diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d114942b6..082dab058 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -69,6 +69,8 @@ jobs: secrets: url_debian_11: ${{ secrets.NEXUS_TEST_REPO_NIGHTLY_URL_DEBIAN_11 }} token_debian_11: ${{ secrets.NEXUS_TEST_REPO_UPLOAD_TOKEN }} + url_debian_12: ${{ secrets.NEXUS_TEST_REPO_URL_DEBIAN_12 }} + token_debian_12: ${{ secrets.NEXUS_TEST_REPO_UPLOAD_TOKEN }} url_centos_7: ${{ secrets.NEXUS_TEST_REPO_NIGHTLY_URL_CENTOS_7 }} token_centos_7: ${{ secrets.NEXUS_TEST_REPO_UPLOAD_TOKEN }} url_rocky_8: ${{ secrets.NEXUS_TEST_REPO_NIGHTLY_URL_ROCKY_8 }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 4aaefd612..a291e1277 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,16 @@ cmake_minimum_required( VERSION 3.12 FATAL_ERROR ) -find_package( ecbuild 3.7 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild) +find_package( ecbuild 3.7 HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild) +if(NOT ecbuild_FOUND) + message(STATUS "Fetching ecbuild...") + include(FetchContent) + FetchContent_Populate(ecbuild + GIT_REPOSITORY https://github.com/ecmwf/ecbuild.git + GIT_TAG 3.8.5 + ) + find_package( ecbuild 3.7 REQUIRED HINTS ${ecbuild_SOURCE_DIR}) +endif() # Initialise project project( eccodes LANGUAGES CXX ) @@ -509,11 +518,8 @@ ecbuild_info(" | PRE-RELEASE CANDIDATE |") ecbuild_info(" +--------------------------+") ecbuild_info("") -ecbuild_info(" +--------------------------------------+") -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 |") -ecbuild_info(" +--------------------------------------+") +ecbuild_info("Please note:") +ecbuild_info(" For Python3 support, you must install the Python bindings.") +ecbuild_info(" See:") +ecbuild_info(" https://confluence.ecmwf.int/display/ECC/ecCodes+installation") ecbuild_info("") diff --git a/definitions/bufr/rdb_key.def b/definitions/bufr/rdb_key.def index eea896d3e..a32343acb 100644 --- a/definitions/bufr/rdb_key.def +++ b/definitions/bufr/rdb_key.def @@ -1,4 +1,5 @@ # RDB stands for REPORT DATA BASE +# See https://confluence.ecmwf.int/pages/viewpage.action?pageId=24316441 unsigned[1] rdbType : dump; unsigned[1] oldSubtype: dump; diff --git a/definitions/bufr/section.3.def b/definitions/bufr/section.3.def index d223bbbb2..56fa58ad1 100644 --- a/definitions/bufr/section.3.def +++ b/definitions/bufr/section.3.def @@ -50,7 +50,7 @@ unsigned[1] reservedSection3 = 0; unsigned[2] numberOfSubsets : dump; alias ls.numberOfSubsets=numberOfSubsets; -if (section2Present && bufrHeaderCentre==98 && section2Length==52) { +if (section2Present && bufrHeaderCentre == 98 && section2Length == 52) { if ( rdbType == 2 || rdbType == 3 || rdbType == 8 || rdbType == 12 || rdbType == 30 ) { transient isSatelliteType=1; } else { @@ -69,10 +69,11 @@ if (section2Present && bufrHeaderCentre==98 && section2Length==52) { meta localLatitude2 bits(keyMore,32,25,-9000000,100000) : dump,no_copy; # This rule is taken from BUFRDC. See bufrdc_wmo/buukey.F - # Also see ECC-686 - if (oldSubtype == 255 || numberOfSubsets>255 || - ( oldSubtype>=121 && oldSubtype <=130 ) || - oldSubtype==31) { + # See ECC-686 + # and https://confluence.ecmwf.int/pages/viewpage.action?pageId=24316441 + if (oldSubtype == 255 || numberOfSubsets > 255 || + ( oldSubtype >= 121 && oldSubtype <= 130 ) || + oldSubtype == 31) { meta ls.localNumberOfObservations bits(keySat,0,16) : dump,long_type,no_copy; meta ls.satelliteID bits(keySat,16,16) : dump,long_type,no_copy; } else { @@ -114,16 +115,16 @@ meta bufrdcExpandedDescriptors bufrdc_expanded_descriptors(expandedCodes) : no_c #smart_table NAME (VALUES,FILE_NAME,MASTER_DIRECTORY,LOCAL_DIRECTORY,WIDTH_OF_CODE_IN_BITS,EXTRA_DIRECTORY,EXTRA_FILE_NAME); #Note: The WIDTH_OF_CODE_IN_BITS has to be big enough so 2^width > the highest BUFR descriptor code smart_table expandedOriginalCodes (expandedCodes,"element.table",tablesMasterDir,tablesLocalDir,18,rootTablesDir,"operators.table") :no_copy; -meta expandedAbbreviations smart_table_column(expandedOriginalCodes,0,1) : string_type,no_copy; -meta expandedTypes smart_table_column(expandedOriginalCodes,1,0) : string_type,no_copy; -meta expandedNames smart_table_column(expandedOriginalCodes,2,0) : string_type,no_copy; -meta expandedUnits smart_table_column(expandedOriginalCodes,3,0) : string_type,no_copy; -meta expandedOriginalScales smart_table_column(expandedOriginalCodes,4,0) : long_type,no_copy; -meta expandedOriginalReferences smart_table_column(expandedOriginalCodes,5,0) : long_type,no_copy; -meta expandedOriginalWidths smart_table_column(expandedOriginalCodes,6,0) : long_type,no_copy; -meta expandedCrex_units smart_table_column(expandedOriginalCodes,7,0) : long_type,no_copy; -meta expandedCrex_scales smart_table_column(expandedOriginalCodes,8,0) : long_type,no_copy; -meta expandedCrex_widths smart_table_column(expandedOriginalCodes,9,0) : long_type,no_copy; +meta expandedAbbreviations smart_table_column(expandedOriginalCodes,0,1) : string_type,no_copy; +meta expandedTypes smart_table_column(expandedOriginalCodes,1,0) : string_type,no_copy; +meta expandedNames smart_table_column(expandedOriginalCodes,2,0) : string_type,no_copy; +meta expandedUnits smart_table_column(expandedOriginalCodes,3,0) : string_type,no_copy; +meta expandedOriginalScales smart_table_column(expandedOriginalCodes,4,0) : long_type,no_copy; +meta expandedOriginalReferences smart_table_column(expandedOriginalCodes,5,0) : long_type,no_copy; +meta expandedOriginalWidths smart_table_column(expandedOriginalCodes,6,0) : long_type,no_copy; +meta expandedCrex_units smart_table_column(expandedOriginalCodes,7,0) : long_type,no_copy; +meta expandedCrex_scales smart_table_column(expandedOriginalCodes,8,0) : long_type,no_copy; +meta expandedCrex_widths smart_table_column(expandedOriginalCodes,9,0) : long_type,no_copy; position endDescriptors; section_padding section3Padding; diff --git a/definitions/grib1/boot.def b/definitions/grib1/boot.def index 4dd9e48e0..f98ef0442 100644 --- a/definitions/grib1/boot.def +++ b/definitions/grib1/boot.def @@ -16,7 +16,7 @@ constant three=1 : hidden; constant eight=8 : hidden; constant eleven=11 : hidden; constant epsPoint=1 : hidden; -constant epsContinous=11 : hidden; +constant epsContinuous=11 : hidden; constant epsStatisticsPoint=2 : hidden; constant epsStatisticsContinous=12 : hidden; diff --git a/definitions/grib1/data.grid_simple_matrix.def b/definitions/grib1/data.grid_simple_matrix.def index ae785ed71..b003be853 100644 --- a/definitions/grib1/data.grid_simple_matrix.def +++ b/definitions/grib1/data.grid_simple_matrix.def @@ -114,7 +114,6 @@ if(matrixOfValues == 0) # From GRIBEX: # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# ! ! # ! This is the WMO definition, but it is entirely ! # ! inadequate when secondary bit maps are present ! # ! eg 3x3 global grid with a matrix of values ! @@ -129,7 +128,6 @@ if(matrixOfValues == 0) # ! missing'). ! # ! This definition will accommodate a 1x1 ! # ! degree global grid. ! -# ! ! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # constant datumSize = NC*NR; diff --git a/definitions/grib1/gds_not_present_bitmap.def b/definitions/grib1/gds_not_present_bitmap.def index c654b3cbc..f4efc0f5c 100644 --- a/definitions/grib1/gds_not_present_bitmap.def +++ b/definitions/grib1/gds_not_present_bitmap.def @@ -10,10 +10,11 @@ transient numberOfUnusedBitsAtEndOfSection3 = 0 : read_only; transient tableReference = 0; #position offsetBeforeBitmap; -meta bitmap gds_not_present_bitmap( missingValue,numberOfValues, - numberOfPoints, - latitudeOfFirstGridPoint, - Ni,numberOfUnusedBitsAtEndOfSection3) : read_only; +meta bitmap gds_not_present_bitmap( + missingValue,numberOfValues, + numberOfPoints, + latitudeOfFirstGridPoint, + Ni,numberOfUnusedBitsAtEndOfSection3) : read_only; #position offsetAfterBitmap; #padtoeven padding_sec3_1(offsetSection3,section3Length); diff --git a/definitions/grib1/grid_definition_192.78.def b/definitions/grib1/grid_definition_192.78.def index c4689a99a..c6c524b70 100644 --- a/definitions/grib1/grid_definition_192.78.def +++ b/definitions/grib1/grid_definition_192.78.def @@ -40,6 +40,6 @@ transient numberOfPoints= nd *(Ni + 1) * (Ni + 1); alias numberOfDataPoints=numberOfPoints; meta numberOfValues -number_of_values(values,bitsPerValue,numberOfDataPoints, - bitmapPresent,bitmap,numberOfCodedValues) : dump; - +number_of_values( + values,bitsPerValue,numberOfDataPoints, + bitmapPresent,bitmap,numberOfCodedValues) : dump; diff --git a/definitions/grib1/grid_definition_193.98.def b/definitions/grib1/grid_definition_193.98.def index 534c51646..9578e4287 100644 --- a/definitions/grib1/grid_definition_193.98.def +++ b/definitions/grib1/grid_definition_193.98.def @@ -79,11 +79,11 @@ if(missing(Ni)){ nearest latlon_reduced(values,radius,Nj,pl); } else { transient iteratorDisableUnrotate = 0 : hidden; # ECC-808 - iterator latlon(numberOfPoints,missingValue,values,longitudeFirstInDegrees,iInc , - Ni,Nj,iScansNegatively , - latitudeFirstInDegrees,DjInDegrees,jScansPositively,jPointsAreConsecutive, - isRotatedGrid, angleOfRotation, - latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees); + iterator latlon(numberOfPoints,missingValue,values,longitudeFirstInDegrees,iInc, + Ni,Nj,iScansNegatively, + latitudeFirstInDegrees,DjInDegrees,jScansPositively,jPointsAreConsecutive, + isRotatedGrid, angleOfRotation, + latitudeOfSouthernPoleInDegrees,longitudeOfSouthernPoleInDegrees); nearest regular(values,radius,Ni,Nj); } meta latLonValues latlonvalues(values); diff --git a/definitions/grib1/local.214.1.def b/definitions/grib1/local.214.1.def index 51e0254aa..82ba4e74d 100644 --- a/definitions/grib1/local.214.1.def +++ b/definitions/grib1/local.214.1.def @@ -32,7 +32,7 @@ if (stepType is "instant" ) { } } else { if (numberOfForecastsInEnsemble!=0) { - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } } diff --git a/definitions/grib1/local.34.1.def b/definitions/grib1/local.34.1.def index 078e15cf8..1a96674b4 100644 --- a/definitions/grib1/local.34.1.def +++ b/definitions/grib1/local.34.1.def @@ -40,7 +40,7 @@ if (stepType is "instant" ) { } else { alias typeOfEnsembleForecast=three; } - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } else { alias productDefinitionTemplateNumber=eight; } diff --git a/definitions/grib1/local.98.1.def b/definitions/grib1/local.98.1.def index d908b43ed..a1a5adddf 100644 --- a/definitions/grib1/local.98.1.def +++ b/definitions/grib1/local.98.1.def @@ -41,7 +41,7 @@ if (stepType is "instant" ) { } else { alias typeOfEnsembleForecast=three; } - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } else { alias productDefinitionTemplateNumber=eight; } diff --git a/definitions/grib1/local.98.18.def b/definitions/grib1/local.98.18.def index 2897af593..f51f19970 100644 --- a/definitions/grib1/local.98.18.def +++ b/definitions/grib1/local.98.18.def @@ -10,7 +10,7 @@ constant grib2LocalSectionNumber=18; if (stepType is "instant" ) { alias productDefinitionTemplateNumber=epsPoint; } else { - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.218.def b/definitions/grib1/local.98.218.def index c6787e258..872a4e734 100644 --- a/definitions/grib1/local.98.218.def +++ b/definitions/grib1/local.98.218.def @@ -10,7 +10,7 @@ constant grib2LocalSectionNumber=18; if (stepType is "instant" ) { alias productDefinitionTemplateNumber=epsPoint; } else { - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } template mars_labeling "grib1/mars_labeling.def"; diff --git a/definitions/grib1/local.98.26.def b/definitions/grib1/local.98.26.def index 4a9ce6c3e..3c1ad63e0 100644 --- a/definitions/grib1/local.98.26.def +++ b/definitions/grib1/local.98.26.def @@ -14,7 +14,7 @@ constant grib2LocalSectionNumber=26; if (stepType is "instant" ) { alias productDefinitionTemplateNumber=epsPoint; } else { - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } constant wrongPadding=1 : hidden; diff --git a/definitions/grib1/local.98.30.def b/definitions/grib1/local.98.30.def index ee7c46a5e..e19efd77f 100644 --- a/definitions/grib1/local.98.30.def +++ b/definitions/grib1/local.98.30.def @@ -23,7 +23,7 @@ if (stepType is "instant" ) { if (type is "em" || type is "es" ) { alias productDefinitionTemplateNumber=epsStatisticsContinous; } else { - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } } diff --git a/definitions/grib1/local.98.36.def b/definitions/grib1/local.98.36.def index c0b6a1baf..32329c92c 100644 --- a/definitions/grib1/local.98.36.def +++ b/definitions/grib1/local.98.36.def @@ -47,7 +47,7 @@ if (stepType is "instant" ) { } else { alias typeOfEnsembleForecast=three; } - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } else { alias productDefinitionTemplateNumber=eight; } diff --git a/definitions/grib1/local/ecmf/3.table b/definitions/grib1/local/ecmf/3.table index 767213f12..8589b462e 100644 --- a/definitions/grib1/local/ecmf/3.table +++ b/definitions/grib1/local/ecmf/3.table @@ -42,10 +42,12 @@ 141 141 Layer between two isobaric surfaces (mixed precision) pressure of top, in kPa 1100hPa minus pressure of bottom, in hPa # 142-159 Reserved 160 dp Depth below sea level meters (2 octets) -# 161-199Reserved +# 161-199 Reserved 200 sfc Entire atmosphere considered as a single layer 0 (2 octets) 201 201 Entire ocean considered as a single layer 0 (2 octets) -# 202-209 Reserved +202 al Abstract Single Level +203 al Abstract Multiple Level +# 204-209 Reserved 210 pl Isobaric surface (Pa) (ECMWF extension) # 211-254 Reserved for local use 211 wv Ocean wave level (ECMWF extension) diff --git a/definitions/grib1/local_no_mars.98.1.def b/definitions/grib1/local_no_mars.98.1.def index bbb31966c..f028eb030 100644 --- a/definitions/grib1/local_no_mars.98.1.def +++ b/definitions/grib1/local_no_mars.98.1.def @@ -48,7 +48,7 @@ if (stepType is "instant" ) { } else { alias typeOfEnsembleForecast=three; } - alias productDefinitionTemplateNumber=epsContinous; + alias productDefinitionTemplateNumber=epsContinuous; } else { alias productDefinitionTemplateNumber=eight; } diff --git a/definitions/grib1/predefined_grid.def b/definitions/grib1/predefined_grid.def index 02a6994ad..e42048a30 100644 --- a/definitions/grib1/predefined_grid.def +++ b/definitions/grib1/predefined_grid.def @@ -24,9 +24,9 @@ constant dataRepresentationType = 0; # (according to data representation type - octet 6 above) # grib 1 -> 2 -constant gridDefinitionTemplateNumber = 0; +constant gridDefinitionTemplateNumber = 0; -# START 1/grid_definition.latitude_longitude_grid ---------------------------------------------------------------------- +# START 1/grid_definition.latitude_longitude_grid # GRID DEFINITION latitude/longitude grid (or equidistant cylindrical) alias numberOfPointsAlongAParallel=Ni; @@ -122,6 +122,6 @@ constant tableReference = 0; #position offsetBeforeBitmap; # meta bitmap gds_not_present_bitmap( missingValue,numberOfValues, -# numberOfPoints, -# latitudeOfFirstGridPoint, -# Ni,numberOfUnusedBitsAtEndOfSection3) : read_only; +# numberOfPoints, +# latitudeOfFirstGridPoint, +# Ni,numberOfUnusedBitsAtEndOfSection3) : read_only; diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index c2dd5c5e0..3e8f936a8 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -105,7 +105,8 @@ if( indicatorOfTypeOfLevel == 109 || indicatorOfTypeOfLevel == 100 || indicatorOfTypeOfLevel == 110 || indicatorOfTypeOfLevel == 113 || - indicatorOfTypeOfLevel == 117) + indicatorOfTypeOfLevel == 117 || + indicatorOfTypeOfLevel == 203) { alias mars.levelist = level; } diff --git a/definitions/grib1/typeOfLevel.def b/definitions/grib1/typeOfLevel.def index ccf74d5be..f5154a706 100644 --- a/definitions/grib1/typeOfLevel.def +++ b/definitions/grib1/typeOfLevel.def @@ -34,3 +34,5 @@ 'depthBelowSea' = {indicatorOfTypeOfLevel=160;} 'entireAtmosphere' = {indicatorOfTypeOfLevel=200;} 'entireOcean' = {indicatorOfTypeOfLevel=201;} +'abstractSingleLevel' = {indicatorOfTypeOfLevel=202; level=missing();} +'abstractMultipleLevels' = {indicatorOfTypeOfLevel=203;} diff --git a/definitions/grib2/marsLevtypeConcept.def b/definitions/grib2/marsLevtypeConcept.def index 4f9c8ae0b..5d1d69d85 100644 --- a/definitions/grib2/marsLevtypeConcept.def +++ b/definitions/grib2/marsLevtypeConcept.def @@ -1,70 +1,70 @@ # Concept marsLevtype -'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=8;} -'o2d' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=9;} -'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=162;} -'sfc' = {typeOfFirstFixedSurface=2; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=7; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=8; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=17; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=18; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=20; scaleFactorOfFirstFixedSurface=-2; - scaledValueOfFirstFixedSurface=29315; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;} -'pl' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=255;} -'pl' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=100;} -'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=100; - scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=80000;} -'sfc' = {typeOfFirstFixedSurface=100; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=80000; - typeOfSecondFixedSurface=100; scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=45000;} -'sfc' = {typeOfFirstFixedSurface=100; scaleFactorOfFirstFixedSurface=0; - scaledValueOfFirstFixedSurface=45000; typeOfSecondFixedSurface=8;} -'sfc' = {typeOfFirstFixedSurface=101; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=102; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=103;} -'ml' = {typeOfFirstFixedSurface=105; typeOfSecondFixedSurface=255;} -'ml' = {typeOfFirstFixedSurface=105; typeOfSecondFixedSurface=105;} -'sfc' = {typeOfFirstFixedSurface=106; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=106;typeOfSecondFixedSurface=106;} -'pt' = {typeOfFirstFixedSurface=107; typeOfSecondFixedSurface=255;} -'pt' = {typeOfFirstFixedSurface=107; typeOfSecondFixedSurface=107;} -'pv' = {typeOfFirstFixedSurface=109; typeOfSecondFixedSurface=255;} -'sol' = {typeOfFirstFixedSurface=114; typeOfSecondFixedSurface=255;} -'sol' = {typeOfFirstFixedSurface=114; typeOfSecondFixedSurface=114;} -'hhl' = {typeOfFirstFixedSurface=118; typeOfSecondFixedSurface=255;} -'hpl' = {typeOfFirstFixedSurface=119; typeOfSecondFixedSurface=255;} -'sol' = {typeOfFirstFixedSurface=151; typeOfSecondFixedSurface=255;} -'sol' = {typeOfFirstFixedSurface=151; typeOfSecondFixedSurface=151;} -'sol' = {typeOfFirstFixedSurface=152; typeOfSecondFixedSurface=255;} -'sol' = {typeOfFirstFixedSurface=152; typeOfSecondFixedSurface=152;} -'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=160; scaleFactorOfFirstFixedSurface=0; - scaledValueOfFirstFixedSurface=0; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=160;} -'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=9;} -'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=20; - scaledValueOfFirstFixedSurface=0; scaleFactorOfFirstFixedSurface=0;} -'sfc' = {typeOfFirstFixedSurface=162; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=166; typeOfSecondFixedSurface=255;} -'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=255;} -'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=168;} -'o2d' = {typeOfFirstFixedSurface=169; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=170; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=171; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=173; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=173; typeOfSecondFixedSurface=175;} -'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255;} -'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255; discipline=1;} -'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=176; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=160; - scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=0;} -'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176;} -'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176; discipline=1;} -'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=176;} -'sfc' = {typeOfFirstFixedSurface=177; typeOfSecondFixedSurface=255;} -'o2d' = {typeOfFirstFixedSurface=188; typeOfSecondFixedSurface=189;} +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=8;} +'o2d' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=9;} +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=162;} +'sfc' = {typeOfFirstFixedSurface=2; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=7; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=8; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=17; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=18; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=19; typeOfSecondFixedSurface=255;} +'o2d' = {discipline=10; typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;} +'pl' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=255;} +'pl' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=100;} +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=100; + scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=80000;} +'sfc' = {typeOfFirstFixedSurface=100; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=80000; + typeOfSecondFixedSurface=100; scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=45000;} +'sfc' = {typeOfFirstFixedSurface=100; scaleFactorOfFirstFixedSurface=0; + scaledValueOfFirstFixedSurface=45000; typeOfSecondFixedSurface=8;} +'sfc' = {typeOfFirstFixedSurface=101; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=102; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=103;} +'ml' = {typeOfFirstFixedSurface=105; typeOfSecondFixedSurface=255;} +'ml' = {typeOfFirstFixedSurface=105; typeOfSecondFixedSurface=105;} +'sfc' = {typeOfFirstFixedSurface=106; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=106;typeOfSecondFixedSurface=106;} +'pt' = {typeOfFirstFixedSurface=107; typeOfSecondFixedSurface=255;} +'pt' = {typeOfFirstFixedSurface=107; typeOfSecondFixedSurface=107;} +'pv' = {typeOfFirstFixedSurface=109; typeOfSecondFixedSurface=255;} +'sol' = {typeOfFirstFixedSurface=114; typeOfSecondFixedSurface=255;} +'sol' = {typeOfFirstFixedSurface=114; typeOfSecondFixedSurface=114;} +'hhl' = {typeOfFirstFixedSurface=118; typeOfSecondFixedSurface=255;} +'hpl' = {typeOfFirstFixedSurface=119; typeOfSecondFixedSurface=255;} +'sol' = {typeOfFirstFixedSurface=151; typeOfSecondFixedSurface=255;} +'sol' = {typeOfFirstFixedSurface=151; typeOfSecondFixedSurface=151;} +'sol' = {typeOfFirstFixedSurface=152; typeOfSecondFixedSurface=255;} +'sol' = {typeOfFirstFixedSurface=152; typeOfSecondFixedSurface=152;} +'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=160; scaleFactorOfFirstFixedSurface=0; + scaledValueOfFirstFixedSurface=0; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=160;} +'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=9;} +'o2d' = {typeOfFirstFixedSurface=160; typeOfSecondFixedSurface=20; + scaledValueOfFirstFixedSurface=0; scaleFactorOfFirstFixedSurface=0;} +'sfc' = {typeOfFirstFixedSurface=162; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=166; typeOfSecondFixedSurface=255;} +'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=255;} +'o3d' = {typeOfFirstFixedSurface=168; typeOfSecondFixedSurface=168;} +'o2d' = {typeOfFirstFixedSurface=169; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=170; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=171; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=173; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=173; typeOfSecondFixedSurface=175;} +'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=255; discipline=1;} +'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=176; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=160; + scaleFactorOfSecondFixedSurface=0; scaledValueOfSecondFixedSurface=0;} +'o2d' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176;} +'sfc' = {typeOfFirstFixedSurface=174; typeOfSecondFixedSurface=176; discipline=1;} +'o2d' = {typeOfFirstFixedSurface=175; typeOfSecondFixedSurface=176;} +'sfc' = {typeOfFirstFixedSurface=177; typeOfSecondFixedSurface=255;} +'o2d' = {typeOfFirstFixedSurface=188; typeOfSecondFixedSurface=189;} 'sfc' = {typeOfFirstFixedSurface=5; typeOfSecondFixedSurface=255;} 'sfc' = {typeOfFirstFixedSurface=14; typeOfSecondFixedSurface=255;} diff --git a/definitions/grib2/mars_labeling.def b/definitions/grib2/mars_labeling.def index 6905210ce..ad51ad962 100644 --- a/definitions/grib2/mars_labeling.def +++ b/definitions/grib2/mars_labeling.def @@ -1,39 +1,42 @@ # (C) Copyright 2005- ECMWF. -codetable[2] marsClass "mars/class.table" = "od" : dump,string_type,lowercase; +codetable[2] marsClass "mars/class.table" = "od" : dump,string_type,lowercase; codetable[2] marsType "mars/type.table" = "an" : dump,string_type,no_fail,lowercase; -codetable[2] marsStream "mars/stream.table" = "oper" : dump,string_type,lowercase ; +codetable[2] marsStream "mars/stream.table" = "oper" : dump,string_type,lowercase; ksec1expver[4] experimentVersionNumber = "0001" : dump; -meta class g2_mars_labeling(0,marsClass, - marsType, - marsStream, - experimentVersionNumber, - typeOfProcessedData, - productDefinitionTemplateNumber, - stepType, - derivedForecast, - typeOfGeneratingProcess); +meta class g2_mars_labeling( + 0,marsClass, + marsType, + marsStream, + experimentVersionNumber, + typeOfProcessedData, + productDefinitionTemplateNumber, + stepType, + derivedForecast, + typeOfGeneratingProcess); -meta type g2_mars_labeling(1,marsClass, - marsType, - marsStream, - experimentVersionNumber, - typeOfProcessedData, - productDefinitionTemplateNumber, - stepType, - derivedForecast, - typeOfGeneratingProcess); +meta type g2_mars_labeling( + 1,marsClass, + marsType, + marsStream, + experimentVersionNumber, + typeOfProcessedData, + productDefinitionTemplateNumber, + stepType, + derivedForecast, + typeOfGeneratingProcess); -meta stream g2_mars_labeling(2,marsClass, - marsType, - marsStream, - experimentVersionNumber, - typeOfProcessedData, - productDefinitionTemplateNumber, - stepType, - derivedForecast, - typeOfGeneratingProcess); +meta stream g2_mars_labeling( + 2,marsClass, + marsType, + marsStream, + experimentVersionNumber, + typeOfProcessedData, + productDefinitionTemplateNumber, + stepType, + derivedForecast, + typeOfGeneratingProcess); alias ls.dataType = marsType; @@ -41,5 +44,4 @@ alias mars.class = class; alias mars.type = type; alias mars.stream = stream; alias mars.expver = experimentVersionNumber; - -alias mars.domain = globalDomain; # For now... +alias mars.domain = globalDomain; # For now... diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index 15831c9a0..f3f8d1b73 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -6135,6 +6135,27 @@ parameterNumber = 148 ; typeOfFirstFixedSurface = 1 ; } +#Radar reflectivity +'Radar reflectivity' = { + discipline = 0 ; + parameterCategory = 16 ; + parameterNumber = 4 ; + } +#Pressure at cloud ceiling +'Pressure at cloud ceiling' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 19 ; + scaledValueOfFirstFixedSurface = 50 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Visibility through precipitation +'Visibility through precipitation' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + } #Burned area 'Burned area' = { discipline = 2 ; @@ -8569,6 +8590,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean visibility through precipitation +'Time-mean visibility through precipitation' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 0 ; + } #Time-maximum temperature tendency due to short-wave radiation 'Time-maximum temperature tendency due to short-wave radiation' = { discipline = 0 ; @@ -10324,6 +10352,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 2 ; } +#Time-maximum visibility through precipitation +'Time-maximum visibility through precipitation' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 2 ; + } #Time-minimum temperature tendency due to short-wave radiation 'Time-minimum temperature tendency due to short-wave radiation' = { discipline = 0 ; @@ -12107,6 +12142,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 3 ; } +#Time-minimum visibility through precipitation +'Time-minimum visibility through precipitation' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 3 ; + } #Time-standard-deviation temperature tendency due to short-wave radiation 'Time-standard-deviation temperature tendency due to short-wave radiation' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index 9a14233b3..26d0517fa 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -6135,6 +6135,27 @@ parameterNumber = 148 ; typeOfFirstFixedSurface = 1 ; } +#Radar reflectivity +'231066' = { + discipline = 0 ; + parameterCategory = 16 ; + parameterNumber = 4 ; + } +#Pressure at cloud ceiling +'231067' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 19 ; + scaledValueOfFirstFixedSurface = 50 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Visibility through precipitation +'231068' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + } #Burned area '232000' = { discipline = 2 ; @@ -8569,6 +8590,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean visibility through precipitation +'235382' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 0 ; + } #Time-maximum temperature tendency due to short-wave radiation '237001' = { discipline = 0 ; @@ -10324,6 +10352,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 2 ; } +#Time-maximum visibility through precipitation +'237382' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 2 ; + } #Time-minimum temperature tendency due to short-wave radiation '238001' = { discipline = 0 ; @@ -12107,6 +12142,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 3 ; } +#Time-minimum visibility through precipitation +'238382' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 3 ; + } #Time-standard-deviation temperature tendency due to short-wave radiation '239001' = { discipline = 0 ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index bc80dd971..69af4a21b 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -6135,6 +6135,27 @@ parameterNumber = 148 ; typeOfFirstFixedSurface = 1 ; } +#Radar reflectivity +'rare' = { + discipline = 0 ; + parameterCategory = 16 ; + parameterNumber = 4 ; + } +#Pressure at cloud ceiling +'pcdc' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 19 ; + scaledValueOfFirstFixedSurface = 50 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Visibility through precipitation +'visp' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + } #Burned area 'fba' = { discipline = 2 ; @@ -8569,6 +8590,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean visibility through precipitation +'avg_visp' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 0 ; + } #Time-maximum temperature tendency due to short-wave radiation 'max_ttswr' = { discipline = 0 ; @@ -10324,6 +10352,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 2 ; } +#Time-maximum visibility through precipitation +'max_visp' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 2 ; + } #Time-minimum temperature tendency due to short-wave radiation 'min_ttswr' = { discipline = 0 ; @@ -12107,6 +12142,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 3 ; } +#Time-minimum visibility through precipitation +'min_visp' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 3 ; + } #Time-standard-deviation temperature tendency due to short-wave radiation 'std_ttswr' = { discipline = 0 ; diff --git a/definitions/grib2/templates/template.4.generalised_tile.def b/definitions/grib2/templates/template.4.generalised_tile.def index e10f491c2..5eb4be333 100644 --- a/definitions/grib2/templates/template.4.generalised_tile.def +++ b/definitions/grib2/templates/template.4.generalised_tile.def @@ -40,6 +40,7 @@ alias nTileAtt=numberOfUsedTileAttributesForTileAttributeCombination; alias tile.nTileAtt=nTileAtt; alias mars.tile=typeOfTile; -alias mars.tileAttribute=tileAttribute; -transient paramtype = "tile"; -alias mars.paramType=paramtype; +alias mars.tileattribute=tileAttribute; +constant paramTypeTile = "tile"; +unalias mars.paramtype; +alias mars.paramtype=paramTypeTile; diff --git a/definitions/grib2/templates/template.4.reforecast.def b/definitions/grib2/templates/template.4.reforecast.def index a8a431936..15e7c6ec4 100644 --- a/definitions/grib2/templates/template.4.reforecast.def +++ b/definitions/grib2/templates/template.4.reforecast.def @@ -12,5 +12,7 @@ unsigned[1] SecondOfModelVersion = 0: edition_specific; meta modelVersionDate g2date(YearOfModelVersion,MonthOfModelVersion,DayOfModelVersion) : dump; meta modelVersionTime time(HourOfModelVersion, MinuteOfModelVersion, SecondOfModelVersion) : dump; +alias referenceDate = modelVersionDate ; + remove isHindcast; constant isHindcast = 1; diff --git a/definitions/grib2/templates/template.4.statistical.def b/definitions/grib2/templates/template.4.statistical.def index a98b8f212..fde76eba3 100644 --- a/definitions/grib2/templates/template.4.statistical.def +++ b/definitions/grib2/templates/template.4.statistical.def @@ -54,12 +54,9 @@ statisticalProcessesList list(numberOfTimeRanges) if (numberOfTimeRanges == 1 || numberOfTimeRanges == 2) { concept stepTypeInternal { "instant" = {typeOfStatisticalProcessing=255;} - "avg" = {typeOfStatisticalProcessing=0;typeOfTimeIncrement=255;} - "avg" = {typeOfStatisticalProcessing=0;typeOfTimeIncrement=2;} - "avg" = {typeOfStatisticalProcessing=0;typeOfTimeIncrement=3;} + "avg" = {typeOfStatisticalProcessing=0;} "avgd" = {typeOfStatisticalProcessing=0;typeOfTimeIncrement=1;} - "accum" = {typeOfStatisticalProcessing=1;typeOfTimeIncrement=255;} - "accum" = {typeOfStatisticalProcessing=1;typeOfTimeIncrement=2;} + "accum" = {typeOfStatisticalProcessing=1;} "max" = {typeOfStatisticalProcessing=2;} "min" = {typeOfStatisticalProcessing=3;} "diff" = {typeOfStatisticalProcessing=4;} # end-start diff --git a/definitions/grib2/typeOfLevelConcept.def b/definitions/grib2/typeOfLevelConcept.def index 2f350d663..946b0722d 100644 --- a/definitions/grib2/typeOfLevelConcept.def +++ b/definitions/grib2/typeOfLevelConcept.def @@ -20,6 +20,7 @@ 'neutralBuoyancy' = {typeOfFirstFixedSurface=16; typeOfSecondFixedSurface=255;} 'mostUnstableParcel' = {typeOfFirstFixedSurface=17; typeOfSecondFixedSurface=255;} 'mixedLayerParcel' = {typeOfFirstFixedSurface=18; typeOfSecondFixedSurface=255;} +'lowestLevelOfCloudCoverExceedance' = {typeOfFirstFixedSurface=19; typeOfSecondFixedSurface=255;} 'isothermal' = {typeOfFirstFixedSurface=20; typeOfSecondFixedSurface=255;} 'isobaricInPa' = {typeOfFirstFixedSurface=100; typeOfSecondFixedSurface=255; pressureUnits='Pa';} 'isobaricInhPa' = {typeOfFirstFixedSurface=100; pressureUnits='hPa'; typeOfSecondFixedSurface=255;} diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 230844a76..350c35c31 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -6135,6 +6135,27 @@ parameterNumber = 148 ; typeOfFirstFixedSurface = 1 ; } +#Radar reflectivity +'dB' = { + discipline = 0 ; + parameterCategory = 16 ; + parameterNumber = 4 ; + } +#Pressure at cloud ceiling +'Pa' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfFirstFixedSurface = 19 ; + scaledValueOfFirstFixedSurface = 50 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Visibility through precipitation +'m' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + } #Burned area '%' = { discipline = 2 ; @@ -8569,6 +8590,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 0 ; } +#Time-mean visibility through precipitation +'m' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 0 ; + } #Time-maximum temperature tendency due to short-wave radiation 'K s**-1' = { discipline = 0 ; @@ -10324,6 +10352,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 2 ; } +#Time-maximum visibility through precipitation +'m' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 2 ; + } #Time-minimum temperature tendency due to short-wave radiation 'K s**-1' = { discipline = 0 ; @@ -12107,6 +12142,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 3 ; } +#Time-minimum visibility through precipitation +'m' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 51 ; + typeOfStatisticalProcessing = 3 ; + } #Time-standard-deviation temperature tendency due to short-wave radiation 'K s**-1' = { discipline = 0 ; diff --git a/definitions/mars/grib.mmam.fcmean.def b/definitions/mars/grib.mmam.fcmean.def index a2ece7923..84c4cce2f 100644 --- a/definitions/mars/grib.mmam.fcmean.def +++ b/definitions/mars/grib.mmam.fcmean.def @@ -4,5 +4,6 @@ alias mars.fcmonth = marsForecastMonth; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.mmsa.em.def b/definitions/mars/grib.mmsa.em.def index 6d152901b..36ac9adc5 100644 --- a/definitions/mars/grib.mmsa.em.def +++ b/definitions/mars/grib.mmsa.em.def @@ -6,7 +6,10 @@ if (class is "od") { alias mars.system = systemNumber; } if (class is "c3") { alias mars.system = systemNumber; } # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } + +if (class is "ci") { unalias mars.method; } + diff --git a/definitions/mars/grib.mmsa.fcmean.def b/definitions/mars/grib.mmsa.fcmean.def index f828d5a8c..3b7f185b3 100644 --- a/definitions/mars/grib.mmsa.fcmean.def +++ b/definitions/mars/grib.mmsa.fcmean.def @@ -8,7 +8,10 @@ if (class is "od") { alias mars.system = systemNumber; } if (class is "c3") { alias mars.system = systemNumber; } # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } + +if (class is "ci") { unalias mars.method; } + diff --git a/definitions/mars/grib.mmsf.an.def b/definitions/mars/grib.mmsf.an.def index 86ccb55b5..20e418ce5 100644 --- a/definitions/mars/grib.mmsf.an.def +++ b/definitions/mars/grib.mmsf.an.def @@ -15,7 +15,7 @@ if (class isnot "gw") { # ECC-1448 } # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } diff --git a/definitions/mars/grib.mmsf.fc.def b/definitions/mars/grib.mmsf.fc.def index 30b2f7394..6fe01e2a6 100644 --- a/definitions/mars/grib.mmsf.fc.def +++ b/definitions/mars/grib.mmsf.fc.def @@ -18,7 +18,7 @@ if (class isnot "gw") { # ECC-1448 } # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } diff --git a/definitions/mars/grib.msmm.em.def b/definitions/mars/grib.msmm.em.def index 3131d45a7..cce87213b 100644 --- a/definitions/mars/grib.msmm.em.def +++ b/definitions/mars/grib.msmm.em.def @@ -5,13 +5,15 @@ unalias mars.step; alias mars.origin = centre; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } + +if (class is "ci") { unalias mars.method; } + diff --git a/definitions/mars/grib.msmm.fcmax.def b/definitions/mars/grib.msmm.fcmax.def index 573343213..52eecab7d 100644 --- a/definitions/mars/grib.msmm.fcmax.def +++ b/definitions/mars/grib.msmm.fcmax.def @@ -6,13 +6,15 @@ alias mars.number = perturbationNumber; alias mars.origin = centre; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } + +if (class is "ci") { unalias mars.method; } + diff --git a/definitions/mars/grib.msmm.fcmean.def b/definitions/mars/grib.msmm.fcmean.def index a13ca9918..7a7ff8e66 100644 --- a/definitions/mars/grib.msmm.fcmean.def +++ b/definitions/mars/grib.msmm.fcmean.def @@ -6,14 +6,12 @@ alias mars.method = methodNumber; unalias mars.step; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } -if (class is "ci") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3" || class is "ci") { + alias mars.system = systemNumber; +} # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } diff --git a/definitions/mars/grib.msmm.fcmin.def b/definitions/mars/grib.msmm.fcmin.def index 59f10189a..0c3d347d0 100644 --- a/definitions/mars/grib.msmm.fcmin.def +++ b/definitions/mars/grib.msmm.fcmin.def @@ -5,14 +5,14 @@ alias mars.number = perturbationNumber; alias mars.origin = centre; alias mars.method = methodNumber; - -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } + +if (class is "ci") { unalias mars.method; } diff --git a/definitions/mars/grib.msmm.fcstdev.def b/definitions/mars/grib.msmm.fcstdev.def index f4b8c2414..86ac736a4 100644 --- a/definitions/mars/grib.msmm.fcstdev.def +++ b/definitions/mars/grib.msmm.fcstdev.def @@ -7,13 +7,14 @@ unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } -if (class is "c3") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} # See ECC-624 -if (centre == 80 && subCentre == 98 && class is "c3") { +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { constant cnmc_cmcc = 'cmcc'; alias mars.origin = cnmc_cmcc; } + +if (class is "ci") { unalias mars.method; } diff --git a/definitions/mars/grib.msmm.hcmean.def b/definitions/mars/grib.msmm.hcmean.def deleted file mode 120000 index 0b5cb2f13..000000000 --- a/definitions/mars/grib.msmm.hcmean.def +++ /dev/null @@ -1 +0,0 @@ -grib.msmm.em.def \ No newline at end of file diff --git a/definitions/mars/grib.msmm.hcmean.def b/definitions/mars/grib.msmm.hcmean.def new file mode 100644 index 000000000..9fd3f4b70 --- /dev/null +++ b/definitions/mars/grib.msmm.hcmean.def @@ -0,0 +1,18 @@ +# assert(16); +alias mars.fcmonth = marsForecastMonth; +unalias mars.step; + +alias mars.origin = centre; +alias mars.method = methodNumber; + +if (class is "od" || class is "me" || class is "en" || class is "c3") { + alias mars.system = systemNumber; +} + +# See ECC-624 +if (centre == 80 && subCentre == 98 && (class is "c3" || class is "ci")) { + constant cnmc_cmcc = 'cmcc'; + alias mars.origin = cnmc_cmcc; +} + +if (class is "ci") { unalias mars.method; } diff --git a/definitions/mars/grib.ocea.an.def b/definitions/mars/grib.ocea.an.def index d682c50bd..13ff8360e 100644 --- a/definitions/mars/grib.ocea.an.def +++ b/definitions/mars/grib.ocea.an.def @@ -1,5 +1,6 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } + +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.ocea.ff.def b/definitions/mars/grib.ocea.ff.def index d682c50bd..5a03a2e58 100644 --- a/definitions/mars/grib.ocea.ff.def +++ b/definitions/mars/grib.ocea.ff.def @@ -1,5 +1,5 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.ocea.fx.def b/definitions/mars/grib.ocea.fx.def index d682c50bd..5a03a2e58 100644 --- a/definitions/mars/grib.ocea.fx.def +++ b/definitions/mars/grib.ocea.fx.def @@ -1,5 +1,5 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.ocea.of.def b/definitions/mars/grib.ocea.of.def index d682c50bd..5a03a2e58 100644 --- a/definitions/mars/grib.ocea.of.def +++ b/definitions/mars/grib.ocea.of.def @@ -1,5 +1,5 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.ocea.or.def b/definitions/mars/grib.ocea.or.def index d682c50bd..5a03a2e58 100644 --- a/definitions/mars/grib.ocea.or.def +++ b/definitions/mars/grib.ocea.or.def @@ -1,5 +1,5 @@ alias mars.number = perturbationNumber; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.swmm.fcmax.def b/definitions/mars/grib.swmm.fcmax.def index a628fb1a2..864aed20f 100644 --- a/definitions/mars/grib.swmm.fcmax.def +++ b/definitions/mars/grib.swmm.fcmax.def @@ -4,6 +4,6 @@ alias mars.number = perturbationNumber; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.swmm.fcmean.def b/definitions/mars/grib.swmm.fcmean.def index a628fb1a2..864aed20f 100644 --- a/definitions/mars/grib.swmm.fcmean.def +++ b/definitions/mars/grib.swmm.fcmean.def @@ -4,6 +4,6 @@ alias mars.number = perturbationNumber; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.swmm.fcmin.def b/definitions/mars/grib.swmm.fcmin.def index a628fb1a2..864aed20f 100644 --- a/definitions/mars/grib.swmm.fcmin.def +++ b/definitions/mars/grib.swmm.fcmin.def @@ -4,6 +4,6 @@ alias mars.number = perturbationNumber; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/definitions/mars/grib.swmm.fcstdev.def b/definitions/mars/grib.swmm.fcstdev.def index a628fb1a2..864aed20f 100644 --- a/definitions/mars/grib.swmm.fcstdev.def +++ b/definitions/mars/grib.swmm.fcstdev.def @@ -4,6 +4,6 @@ alias mars.number = perturbationNumber; unalias mars.step; alias mars.method = methodNumber; -if (class is "od") { alias mars.system = systemNumber; } -if (class is "me") { alias mars.system = systemNumber; } -if (class is "en") { alias mars.system = systemNumber; } +if (class is "od" || class is "me" || class is "en") { + alias mars.system = systemNumber; +} diff --git a/eccodes_config.h.in b/eccodes_config.h.in index 4432f9a10..29877a3d9 100644 --- a/eccodes_config.h.in +++ b/eccodes_config.h.in @@ -115,6 +115,7 @@ #cmakedefine HAVE_GEOGRAPHY #cmakedefine HAVE_MEMFS +#cmakedefine HAVE_FORTRAN #ifdef HAVE_MEMFS #undef ECCODES_DEFINITION_PATH diff --git a/examples/C/CMakeLists.txt b/examples/C/CMakeLists.txt index 5e3795ef8..d25014ed0 100644 --- a/examples/C/CMakeLists.txt +++ b/examples/C/CMakeLists.txt @@ -26,7 +26,6 @@ list( APPEND test_bins grib_get_data grib_sections_copy grib_copy_keys - grib_iterator_bitmap grib_clone grib_copy_message grib_ensemble_index diff --git a/examples/C/bufr_clone.c b/examples/C/bufr_clone.c index 3cda29678..6a617eb50 100644 --- a/examples/C/bufr_clone.c +++ b/examples/C/bufr_clone.c @@ -18,11 +18,6 @@ #include #include "eccodes.h" -static void usage(const char* app) -{ - fprintf(stderr, "Usage is: %s input_file ouput_file\n", app); -} - int main(int argc, char* argv[]) { FILE* in = NULL; @@ -36,7 +31,6 @@ int main(int argc, char* argv[]) int i, err = 0; if (argc != 3) { - usage(argv[0]); return 1; } diff --git a/examples/C/grib_clone.c b/examples/C/grib_clone.c index c2964b54a..dce6c909d 100644 --- a/examples/C/grib_clone.c +++ b/examples/C/grib_clone.c @@ -18,11 +18,6 @@ #include #include "eccodes.h" -static void usage(const char* app) -{ - fprintf(stderr, "Usage is: %s input_file ouput_file\n", app); -} - int main(int argc, char* argv[]) { FILE* in = NULL; @@ -33,7 +28,6 @@ int main(int argc, char* argv[]) int err = 0; if (argc != 3) { - usage(argv[0]); return 1; } diff --git a/examples/C/grib_copy_message.c b/examples/C/grib_copy_message.c index 461bf4ea6..7757fd94a 100644 --- a/examples/C/grib_copy_message.c +++ b/examples/C/grib_copy_message.c @@ -18,11 +18,6 @@ #include "eccodes.h" #include -static void usage(const char* prog) -{ - fprintf(stderr, "Usage is: %s input_file ouput_file\n", prog); -} - int main(int argc, char* argv[]) { FILE* in = NULL; @@ -30,7 +25,6 @@ int main(int argc, char* argv[]) int err = 0; if (argc != 3) { - usage(argv[0]); return 1; } diff --git a/examples/C/grib_set_pv.c b/examples/C/grib_set_pv.c index e279aec8b..7352f6f84 100644 --- a/examples/C/grib_set_pv.c +++ b/examples/C/grib_set_pv.c @@ -19,12 +19,6 @@ #include #include "eccodes.h" -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; @@ -40,7 +34,7 @@ int main(int argc, char** argv) codes_handle* h = NULL; const void* buffer = NULL; - if (argc != 3) usage(argv[0]); + if (argc != 3) return 1; infile = argv[1]; outfile = argv[2]; diff --git a/examples/C/mars_param.c b/examples/C/mars_param.c index aff84d385..ee56cad31 100644 --- a/examples/C/mars_param.c +++ b/examples/C/mars_param.c @@ -20,14 +20,11 @@ int main(int argc, char** argv) { - codes_string_list* list; - codes_string_list* list2; - - list = codes_grib_util_get_param_id("11.2"); + const codes_string_list* list = codes_grib_util_get_param_id("11.2"); printf("mars.param=11.2 -> paramId= "); while (list) { + const codes_string_list* 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); diff --git a/examples/C/nc.c b/examples/C/nc.c index 35b844f1e..6858a6ac5 100644 --- a/examples/C/nc.c +++ b/examples/C/nc.c @@ -9,7 +9,7 @@ */ #include "eccodes.h" -void usage(char* prog) +void usage(const char* prog) { printf("usage: %s in.nc\n", prog); exit(1); diff --git a/examples/F90/codes_dump.f90 b/examples/F90/codes_dump.f90 index 84f04f668..97f8bed95 100644 --- a/examples/F90/codes_dump.f90 +++ b/examples/F90/codes_dump.f90 @@ -31,8 +31,10 @@ program codes_dump_test if (iret == CODES_END_OF_FILE) exit call codes_set_debug(0) + call codes_set_data_quality_checks(1) call codes_dump(msgid) call codes_set_debug(1) + call codes_set_data_quality_checks(0) call codes_release(msgid) diff --git a/examples/F90/grib_keys_iterator_skip.f90 b/examples/F90/grib_keys_iterator_skip.f90 index 7c97d85d7..c64df2447 100644 --- a/examples/F90/grib_keys_iterator_skip.f90 +++ b/examples/F90/grib_keys_iterator_skip.f90 @@ -36,6 +36,8 @@ program keys_iterator_skip call codes_skip_coded(kiter) call codes_skip_duplicates(kiter) call codes_skip_read_only(kiter) + call codes_skip_function(kiter) + call codes_skip_edition_specific(kiter) do call codes_keys_iterator_next(kiter, iret) diff --git a/examples/extra/f_clone.f90 b/examples/extra/f_clone.f90 index 7eedd1dfe..f9552d0c1 100755 --- a/examples/extra/f_clone.f90 +++ b/examples/extra/f_clone.f90 @@ -6,10 +6,9 @@ ! 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. ! -! Description: how to create a new GRIB message by cloning +! Description: how to create a new GRIB message by cloning ! an existing message. ! -! ! Author: Cristian D. Codorean ! ! diff --git a/fortran/eccodes_f90_tail.f90 b/fortran/eccodes_f90_tail.f90 index 4ecf52d03..14dad7118 100644 --- a/fortran/eccodes_f90_tail.f90 +++ b/fortran/eccodes_f90_tail.f90 @@ -2765,12 +2765,35 @@ call grib_skip_read_only(iterid, status) end subroutine codes_skip_read_only + subroutine codes_skip_function(iterid, status) + integer(kind=kindOfInt), intent(in) :: iterid + integer(kind=kindOfInt), optional, intent(out) :: status + + call grib_skip_function(iterid, status) + end subroutine codes_skip_function + + subroutine codes_skip_edition_specific(iterid, status) + integer(kind=kindOfInt), intent(in) :: iterid + integer(kind=kindOfInt), optional, intent(out) :: status + + call grib_skip_edition_specific(iterid, status) + end subroutine codes_skip_edition_specific + + !> Set debug mode subroutine codes_set_debug(dmode) integer(kind=kindOfInt), intent(in) :: dmode call grib_set_debug(dmode) end subroutine codes_set_debug + !> Set data quality check value (0, 1 or 2) + subroutine codes_set_data_quality_checks(val) + integer(kind=kindOfInt), intent(in) :: val + call grib_set_data_quality_checks(val) + end subroutine codes_set_data_quality_checks + + + !> Set the definition path !> !> In case of error, if the status parameter (optional) is not given, the program will diff --git a/fortran/eccodes_visibility.h b/fortran/eccodes_visibility.h index 0c26a53f7..9e720f1cd 100644 --- a/fortran/eccodes_visibility.h +++ b/fortran/eccodes_visibility.h @@ -7,6 +7,8 @@ public :: codes_keys_iterator_new, & public :: codes_skip_computed, & codes_skip_coded, & codes_skip_duplicates, & + codes_skip_function, & + codes_skip_edition_specific, & codes_skip_read_only public :: codes_keys_iterator_get_name, & codes_keys_iterator_rewind diff --git a/fortran/grib_api_externals.h b/fortran/grib_api_externals.h index fd3d6c10a..496143c1b 100644 --- a/fortran/grib_api_externals.h +++ b/fortran/grib_api_externals.h @@ -79,7 +79,7 @@ integer, external :: grib_f_set_int, grib_f_set_int_array, & integer, external :: grib_f_get_message_size, grib_f_copy_message, grib_f_count_in_file integer, external :: grib_f_write, grib_f_multi_write, grib_f_multi_append integer, external :: grib_f_clone, grib_f_copy_namespace -external :: grib_f_check , grib_f_set_debug +external :: grib_f_check , grib_f_set_debug, grib_f_set_data_quality_checks integer, external :: grib_f_util_sections_copy integer, external :: grib_f_set_definitions_path, grib_f_set_samples_path integer, external :: grib_f_julian_to_datetime, grib_f_datetime_to_julian, grib_f_copy_key diff --git a/fortran/grib_f90_tail.f90 b/fortran/grib_f90_tail.f90 index 790ae3ace..385c93b9e 100644 --- a/fortran/grib_f90_tail.f90 +++ b/fortran/grib_f90_tail.f90 @@ -3177,12 +3177,46 @@ end if end subroutine grib_skip_read_only + + subroutine grib_skip_function(iterid, status) + integer(kind=kindOfInt), intent(in) :: iterid + integer(kind=kindOfInt), optional, intent(out) :: status + integer(kind=kindOfInt) :: iret + + iret = grib_f_skip_function(iterid) + if (present(status)) then + status = iret + else + call grib_check(iret, 'skip_function', '') + end if + end subroutine grib_skip_function + + !!! + subroutine grib_skip_edition_specific(iterid, status) + integer(kind=kindOfInt), intent(in) :: iterid + integer(kind=kindOfInt), optional, intent(out) :: status + integer(kind=kindOfInt) :: iret + + iret = grib_f_skip_edition_specific(iterid) + if (present(status)) then + status = iret + else + call grib_check(iret, 'skip_edition_specific', '') + end if + end subroutine grib_skip_edition_specific + !> Set debug mode subroutine grib_set_debug(dmode) integer(kind=kindOfInt), intent(in) :: dmode call grib_f_set_debug(dmode) end subroutine grib_set_debug + !> Set data quality check value (0, 1 or 2) + subroutine grib_set_data_quality_checks(val) + integer(kind=kindOfInt), intent(in) :: val + call grib_f_set_data_quality_checks(val) + end subroutine grib_set_data_quality_checks + !> Set the definition path !> diff --git a/fortran/grib_fortran.cc b/fortran/grib_fortran.cc index fd0a0e726..48807eea6 100644 --- a/fortran/grib_fortran.cc +++ b/fortran/grib_fortran.cc @@ -2875,6 +2875,13 @@ void grib_f_set_debug_(int* dmode) grib_context* c = grib_context_get_default(); grib_context_set_debug(c, *dmode); } +/*****************************************************************************/ +void grib_f_set_data_quality_checks_(int* val) +{ + Assert(val); + grib_context* c = grib_context_get_default(); + grib_context_set_data_quality_checks(c, *val); +} /*****************************************************************************/ int grib_f_set_definitions_path_(char* path, int len) diff --git a/fortran/grib_fortran_prototypes.h b/fortran/grib_fortran_prototypes.h index 499ed6237..8fb2f240f 100644 --- a/fortran/grib_fortran_prototypes.h +++ b/fortran/grib_fortran_prototypes.h @@ -310,6 +310,7 @@ int codes_f_bufr_keys_iterator_new_(int* gid,int* iterid); int grib_f_read_file_(int* fid, void* buffer, size_t* nbytes); int codes_f_bufr_keys_iterator_delete_(int* iterid); void grib_f_set_debug_(int* mode); +void grib_f_set_data_quality_checks_(int* val); int grib_f_set_definitions_path_(char* path, int len); int grib_f_read_any_from_file_(int* fid, void* buffer, size_t* nbytes); int any_f_new_from_file_(int* fid, int* gid); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f6a232fb..a6bf02848 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -357,7 +357,6 @@ list( APPEND eccodes_src_files eccodes_prototypes.h grib_dumper_class.h grib_dumper_factory.h - grib_emoslib.h grib_iterator_class.h grib_iterator_factory.h grib_nearest_class.h diff --git a/src/accessor/grib_accessor.h b/src/accessor/grib_accessor.h index 7fe8aad19..b305bc045 100644 --- a/src/accessor/grib_accessor.h +++ b/src/accessor/grib_accessor.h @@ -16,7 +16,7 @@ class grib_accessor { public: - grib_accessor() : + grib_accessor() : name(nullptr), name_space(nullptr), context(nullptr), h(nullptr), creator(nullptr), length(0), offset(0), parent(nullptr), next_(nullptr), previous_(nullptr), cclass(nullptr), flags(0), sub_section(nullptr), dirty(0), same(nullptr), loop(0), vvalue(nullptr), diff --git a/src/accessor/grib_accessor_class_bufr_data_array.cc b/src/accessor/grib_accessor_class_bufr_data_array.cc index b0b0dc50a..dcc41c41c 100644 --- a/src/accessor/grib_accessor_class_bufr_data_array.cc +++ b/src/accessor/grib_accessor_class_bufr_data_array.cc @@ -835,8 +835,7 @@ static int encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bu return err; } -static int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, - grib_accessor_bufr_data_array_t* self, char* sval) +static int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, char* sval) { int err = 0; int len; @@ -845,7 +844,7 @@ static int encode_string_value(grib_context* c, grib_buffer* buff, long* pos, bu grib_buffer_set_ulength_bits(c, buff, buff->ulength_bits + bd->width); err = grib_encode_string(buff->data, pos, len, sval); if (err) { - grib_context_log(c, GRIB_LOG_ERROR, "encode_string_value: %s. Failed to encode '%s'", bd->shortName, sval); + grib_context_log(c, GRIB_LOG_ERROR, "%s: %s. Failed to encode '%s'", __func__, bd->shortName, sval); } return err; @@ -1151,7 +1150,7 @@ static int encode_new_element(grib_context* c, grib_accessor_bufr_data_array_t* grib_sarray_delete(c, stringValues); } else { - err = encode_string_value(c, buff, pos, bd, self, csval); + err = encode_string_value(c, buff, pos, bd, csval); grib_context_free(c, csval); } } @@ -1273,7 +1272,7 @@ static int encode_element(grib_context* c, grib_accessor_bufr_data_array_t* self 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->stringValues->v[idx]->v[0]); } } else { diff --git a/src/accessor/grib_accessor_class_g1bitmap.cc b/src/accessor/grib_accessor_class_g1bitmap.cc index 331b800c5..afb713b30 100644 --- a/src/accessor/grib_accessor_class_g1bitmap.cc +++ b/src/accessor/grib_accessor_class_g1bitmap.cc @@ -77,7 +77,7 @@ int grib_accessor_class_g1bitmap_t::value_count(grib_accessor* a, long* count) int grib_accessor_class_g1bitmap_t::unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) { - unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; + const unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; grib_accessor_g1bitmap_t* self = (grib_accessor_g1bitmap_t*)a; long tlen; int err; diff --git a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc index 3bf953598..b8b02853a 100644 --- a/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc +++ b/src/accessor/grib_accessor_class_g1end_of_interval_monthly.cc @@ -18,7 +18,7 @@ void grib_accessor_class_g1end_of_interval_monthly_t::init(grib_accessor* a, con { grib_accessor_class_abstract_vector_t::init(a, l, c); grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)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; @@ -26,7 +26,7 @@ void grib_accessor_class_g1end_of_interval_monthly_t::init(grib_accessor* a, con 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->v = (double*)grib_context_malloc(a->context, sizeof(double) * self->number_of_elements); a->length = 0; a->dirty = 1; @@ -90,8 +90,8 @@ int grib_accessor_class_g1end_of_interval_monthly_t::unpack_double(grib_accessor int grib_accessor_class_g1end_of_interval_monthly_t::value_count(grib_accessor* a, long* count) { - grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)a; - *count = self->number_of_elements; + const grib_accessor_g1end_of_interval_monthly_t* self = (grib_accessor_g1end_of_interval_monthly_t*)a; + *count = self->number_of_elements; return 0; } @@ -111,9 +111,8 @@ int grib_accessor_class_g1end_of_interval_monthly_t::compare(grib_accessor* a, g long count = 0; size_t alen = 0; size_t blen = 0; - int err = 0; - err = a->value_count(&count); + int err = a->value_count(&count); if (err) return err; alen = count; @@ -133,7 +132,10 @@ int grib_accessor_class_g1end_of_interval_monthly_t::compare(grib_accessor* a, g a->dirty = 1; err = a->unpack_double(aval, &alen); + if (err) return err; err = b->unpack_double(bval, &blen); + if (err) return err; + for (size_t i = 0; i < alen && retval == GRIB_SUCCESS; ++i) { if (aval[i] != bval[i]) retval = GRIB_DOUBLE_VALUE_MISMATCH; } diff --git a/src/accessor/grib_accessor_class_gen.cc b/src/accessor/grib_accessor_class_gen.cc index 3a721f196..cfe2707a6 100644 --- a/src/accessor/grib_accessor_class_gen.cc +++ b/src/accessor/grib_accessor_class_gen.cc @@ -310,7 +310,7 @@ long grib_accessor_class_gen_t::byte_offset(grib_accessor* a) int grib_accessor_class_gen_t::unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len) { - unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; + const unsigned char* buf = grib_handle_of_accessor(a)->buffer->data; const long length = a->byte_count(); const long offset = a->byte_offset(); diff --git a/src/accessor/grib_accessor_class_getenv.cc b/src/accessor/grib_accessor_class_getenv.cc index a6d6f9c72..89ec5d90d 100644 --- a/src/accessor/grib_accessor_class_getenv.cc +++ b/src/accessor/grib_accessor_class_getenv.cc @@ -18,10 +18,11 @@ void grib_accessor_class_getenv_t::init(grib_accessor* a, const long l, grib_arg { grib_accessor_class_ascii_t::init(a, l, args); grib_accessor_getenv_t* self = (grib_accessor_getenv_t*)a; - static char undefined[] = "undefined"; + static char undefined[] = "undefined"; + grib_handle* hand = grib_handle_of_accessor(a); - 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); + self->envvar = grib_arguments_get_string(hand, args, 0); + self->default_value = grib_arguments_get_string(hand, args, 1); if (!self->default_value) self->default_value = undefined; self->value = 0; @@ -39,7 +40,7 @@ int grib_accessor_class_getenv_t::unpack_string(grib_accessor* a, char* val, siz size_t l = 0; if (!self->value) { - v = getenv(self->name); + v = getenv(self->envvar); if (!v) v = (char*)self->default_value; self->value = v; diff --git a/src/accessor/grib_accessor_class_getenv.h b/src/accessor/grib_accessor_class_getenv.h index b04c58a4d..ee43f136b 100644 --- a/src/accessor/grib_accessor_class_getenv.h +++ b/src/accessor/grib_accessor_class_getenv.h @@ -15,7 +15,7 @@ class grib_accessor_getenv_t : public grib_accessor_ascii_t { public: - const char* name; + const char* envvar; char* value; const char* default_value; }; @@ -23,7 +23,7 @@ public: class grib_accessor_class_getenv_t : public grib_accessor_class_ascii_t { public: - grib_accessor_class_getenv_t(const char* name) : grib_accessor_class_ascii_t(name) {} + grib_accessor_class_getenv_t(const char* envvar) : grib_accessor_class_ascii_t(envvar) {} grib_accessor* create_empty_accessor() override { return new grib_accessor_getenv_t{}; } int pack_string(grib_accessor*, const char*, size_t* len) override; int unpack_string(grib_accessor*, char*, size_t* len) override; @@ -31,4 +31,3 @@ public: int value_count(grib_accessor*, long*) override; void init(grib_accessor*, const long, grib_arguments*) override; }; - diff --git a/src/accessor/grib_accessor_class_group.cc b/src/accessor/grib_accessor_class_group.cc index 74051d17d..c6e52bb9c 100644 --- a/src/accessor/grib_accessor_class_group.cc +++ b/src/accessor/grib_accessor_class_group.cc @@ -17,7 +17,7 @@ grib_accessor_class* grib_accessor_class_group = &_grib_accessor_class_group; void grib_accessor_class_group_t::init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_class_gen_t::init(a, len, arg); - grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; + const grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; grib_accessor_group_t* self = (grib_accessor_group_t*)a; size_t i = 0; diff --git a/src/accessor/grib_accessor_class_gts_header.cc b/src/accessor/grib_accessor_class_gts_header.cc index 5b158c6d1..d069b1c58 100644 --- a/src/accessor/grib_accessor_class_gts_header.cc +++ b/src/accessor/grib_accessor_class_gts_header.cc @@ -59,6 +59,6 @@ int grib_accessor_class_gts_header_t::value_count(grib_accessor* a, long* count) size_t grib_accessor_class_gts_header_t::string_length(grib_accessor* a) { - grib_handle* h = grib_handle_of_accessor(a); + const grib_handle* h = grib_handle_of_accessor(a); return h->gts_header_len; } diff --git a/src/accessor/grib_accessor_class_md5.cc b/src/accessor/grib_accessor_class_md5.cc index 40cbae672..a148787af 100644 --- a/src/accessor/grib_accessor_class_md5.cc +++ b/src/accessor/grib_accessor_class_md5.cc @@ -25,9 +25,9 @@ void grib_accessor_class_md5_t::init(grib_accessor* a, const long len, grib_argu 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->blocklist = NULL; + self->offset_key = grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++); + self->length_key = grib_arguments_get_expression(grib_handle_of_accessor(a), arg, n++); + self->blocklist = NULL; while ((b = (char*)grib_arguments_get_name(grib_handle_of_accessor(a), arg, n++)) != NULL) { if (!self->blocklist) { self->blocklist = (grib_string_list*)grib_context_malloc_clear(context, sizeof(grib_string_list)); @@ -99,9 +99,9 @@ int grib_accessor_class_md5_t::unpack_string(grib_accessor* a, char* v, size_t* return GRIB_BUFFER_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_key, &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_key, &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); diff --git a/src/accessor/grib_accessor_class_md5.h b/src/accessor/grib_accessor_class_md5.h index ae66f397f..42e58e002 100644 --- a/src/accessor/grib_accessor_class_md5.h +++ b/src/accessor/grib_accessor_class_md5.h @@ -17,8 +17,8 @@ class grib_accessor_md5_t : public grib_accessor_gen_t { public: /* Members defined in md5 */ - const char* offset; - grib_expression* length; + const char* offset_key; + grib_expression* length_key; grib_string_list* blocklist; }; diff --git a/src/accessor/grib_accessor_class_non_alpha.cc b/src/accessor/grib_accessor_class_non_alpha.cc index 7e434dfb6..48d9cef34 100644 --- a/src/accessor/grib_accessor_class_non_alpha.cc +++ b/src/accessor/grib_accessor_class_non_alpha.cc @@ -17,12 +17,10 @@ grib_accessor_class* grib_accessor_class_non_alpha = &_grib_accessor_class_non_a void grib_accessor_class_non_alpha_t::init(grib_accessor* a, const long len, grib_arguments* arg) { grib_accessor_class_gen_t::init(a, len, arg); - grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; - size_t i = 0; - unsigned char* v; - v = buffer->data + a->offset; - i = 0; + const grib_buffer* buffer = grib_handle_of_accessor(a)->buffer; + unsigned char* v = buffer->data + a->offset; + size_t i = 0; while ((*v < 33 || *v > 126) && i <= buffer->ulength) { v++; i++; diff --git a/src/accessor/grib_accessor_class_optimal_step_units.cc b/src/accessor/grib_accessor_class_optimal_step_units.cc index e6ff3fe73..6ce297e30 100644 --- a/src/accessor/grib_accessor_class_optimal_step_units.cc +++ b/src/accessor/grib_accessor_class_optimal_step_units.cc @@ -51,7 +51,7 @@ int grib_accessor_class_optimal_step_units_t::pack_expression(grib_accessor* a, const char* cclass_name = a->cclass->name; if (strcmp(e->cclass->name, "long") == 0) { - grib_expression_evaluate_long(hand, e, &lval); // TODO: check return value + grib_expression_evaluate_long(hand, e, &lval); // TODO(maee): check return value ret = a->pack_long(&lval, &len); } else { diff --git a/src/accessor/grib_accessor_class_signed.cc b/src/accessor/grib_accessor_class_signed.cc index 36c20bd59..d240836ac 100644 --- a/src/accessor/grib_accessor_class_signed.cc +++ b/src/accessor/grib_accessor_class_signed.cc @@ -199,17 +199,16 @@ long grib_accessor_class_signed_t::next_offset(grib_accessor* a) int grib_accessor_class_signed_t::is_missing(grib_accessor* a) { - int i = 0; - unsigned char ff = 0xff; + unsigned char ff = 0xff; unsigned long offset = a->offset; - grib_handle* hand = grib_handle_of_accessor(a); + const grib_handle* hand = grib_handle_of_accessor(a); if (a->length == 0) { Assert(a->vvalue != NULL); return a->vvalue->missing; } - for (i = 0; i < a->length; i++) { + for (long i = 0; i < a->length; i++) { if (hand->buffer->data[offset] != ff) return 0; offset++; diff --git a/src/accessor/grib_accessor_class_uint64.cc b/src/accessor/grib_accessor_class_uint64.cc index a800a4630..78e1a54c0 100644 --- a/src/accessor/grib_accessor_class_uint64.cc +++ b/src/accessor/grib_accessor_class_uint64.cc @@ -16,9 +16,9 @@ grib_accessor_class* grib_accessor_class_uint64 = &_grib_accessor_class_uint64; int grib_accessor_class_uint64_t::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; + const unsigned char* data = grib_handle_of_accessor(a)->buffer->data; unsigned long long result = 0, tmp; int i; diff --git a/src/accessor/grib_accessor_class_uint64_little_endian.cc b/src/accessor/grib_accessor_class_uint64_little_endian.cc index 25e537dbe..b98b7a90f 100644 --- a/src/accessor/grib_accessor_class_uint64_little_endian.cc +++ b/src/accessor/grib_accessor_class_uint64_little_endian.cc @@ -16,17 +16,16 @@ grib_accessor_class* grib_accessor_class_uint64_little_endian = &_grib_accessor_ int grib_accessor_class_uint64_little_endian_t::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; + const unsigned char* data = grib_handle_of_accessor(a)->buffer->data; unsigned long long result = 0, tmp; - int i; if (*len < 1) { return GRIB_ARRAY_TOO_SMALL; } - for (i = 7; i >= 0; i--) { + for (int i = 7; i >= 0; i--) { result <<= 8; result |= data[pos + i]; } diff --git a/src/accessor/grib_accessor_class_uint8.cc b/src/accessor/grib_accessor_class_uint8.cc index 90236aa50..9840353df 100644 --- a/src/accessor/grib_accessor_class_uint8.cc +++ b/src/accessor/grib_accessor_class_uint8.cc @@ -18,7 +18,7 @@ int grib_accessor_class_uint8_t::unpack_long(grib_accessor* a, long* val, size_t { long value = 0; long pos = a->offset; - unsigned char* data = grib_handle_of_accessor(a)->buffer->data; + const unsigned char* data = grib_handle_of_accessor(a)->buffer->data; if (*len < 1) { return GRIB_ARRAY_TOO_SMALL; diff --git a/src/accessor/grib_accessor_class_unsigned.cc b/src/accessor/grib_accessor_class_unsigned.cc index 14ca831a3..d2394072d 100644 --- a/src/accessor/grib_accessor_class_unsigned.cc +++ b/src/accessor/grib_accessor_class_unsigned.cc @@ -162,7 +162,7 @@ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t* len, in int grib_accessor_class_unsigned_t::unpack_long(grib_accessor* a, long* val, size_t* len) { - grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; + const grib_accessor_unsigned_t* self = (grib_accessor_unsigned_t*)a; long rlen = 0; unsigned long i = 0; @@ -245,7 +245,7 @@ int grib_accessor_class_unsigned_t::is_missing(grib_accessor* a) { const unsigned char ff = 0xff; unsigned long offset = a->offset; - grib_handle* hand = grib_handle_of_accessor(a); + const grib_handle* hand = grib_handle_of_accessor(a); if (a->length == 0) { Assert(a->vvalue != NULL); diff --git a/src/action.cc b/src/action.cc index 026bca74e..a5496c32d 100644 --- a/src/action.cc +++ b/src/action.cc @@ -95,7 +95,6 @@ static void grib_dump(grib_action* a, FILE* f, int l) } c = c->super ? *(c->super) : NULL; } - DEBUG_ASSERT(0); } // void grib_xref(grib_action* a, FILE* f, const char* path) @@ -210,7 +209,27 @@ void grib_dump_action_tree(grib_context* ctx, FILE* out) Assert(ctx->grib_reader); Assert(ctx->grib_reader->first); Assert(out); - grib_dump_action_branch(out, ctx->grib_reader->first->root, 0); + + // grib_dump_action_branch(out, ctx->grib_reader->first->root, 0); + // grib_action* next = ctx->grib_reader->first->root; + // while (next) { + // fprintf(out, "Dump %s\n", next->name); + // grib_dump_action_branch(out, next, 0); + // next = next->next; + // } + + grib_action_file* fr = ctx->grib_reader->first; + grib_action_file* fn = fr; + while (fn) { + fr = fn; + fn = fn->next; + grib_action* a = fr->root; + while (a) { + grib_action* na = a->next; + grib_dump_action_branch(out, a, 0); + a = na; + } + } } // void grib_xref_action_branch(FILE* out, grib_action* a, const char* path) diff --git a/src/action.class b/src/action.class index 772c328c6..704079e07 100644 --- a/src/action.class +++ b/src/action.class @@ -17,20 +17,17 @@ MEMBERS extern grib_action_class* SUPER; static grib_action_class _grib_action_class_NAME = { - &SUPER, /* super */ - "action_class_NAME", /* name */ - sizeof(grib_action_NAME), /* size */ - 0, /* inited */ + &SUPER, /* super */ + "action_class_NAME", /* name */ + sizeof(grib_action_NAME), /* size */ + 0, /* inited */ &init_class, /* init_class */ - &init, /* init */ + &init, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - &xref, /* xref */ - - &create_accessor, /* create_accessor*/ - - ¬ify_change, /* notify_change */ + &dump, /* dump */ + &xref, /* xref */ + &create_accessor, /* create_accessor */ + ¬ify_change, /* notify_change */ &reparse, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_alias.cc b/src/action_class_alias.cc index bcc2f799c..1659bc38c 100644 --- a/src/action_class_alias.cc +++ b/src/action_class_alias.cc @@ -49,20 +49,17 @@ typedef struct grib_action_alias { static grib_action_class _grib_action_class_alias = { - 0, /* super */ - "action_class_alias", /* name */ - sizeof(grib_action_alias), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_alias", /* name */ + sizeof(grib_action_alias), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_assert.cc b/src/action_class_assert.cc index b19330505..bc449c7ab 100644 --- a/src/action_class_assert.cc +++ b/src/action_class_assert.cc @@ -49,20 +49,17 @@ typedef struct grib_action_assert { static grib_action_class _grib_action_class_assert = { - 0, /* super */ - "action_class_assert", /* name */ - sizeof(grib_action_assert), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_assert", /* name */ + sizeof(grib_action_assert), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - ¬ify_change, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + ¬ify_change, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_close.cc b/src/action_class_close.cc index dfe635890..8b8db96a0 100644 --- a/src/action_class_close.cc +++ b/src/action_class_close.cc @@ -43,20 +43,17 @@ typedef struct grib_action_close { static grib_action_class _grib_action_class_close = { - 0, /* super */ - "action_class_close", /* name */ - sizeof(grib_action_close), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_close", /* name */ + sizeof(grib_action_close), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - 0, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + 0, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; @@ -68,7 +65,7 @@ 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, const char* filename) { char buf[1024]; grib_action_close* a; diff --git a/src/action_class_concept.cc b/src/action_class_concept.cc index d974e7ab9..d770ee266 100644 --- a/src/action_class_concept.cc +++ b/src/action_class_concept.cc @@ -60,20 +60,17 @@ typedef struct 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 */ + &grib_action_class_gen, /* super */ + "action_class_concept", /* name */ + sizeof(grib_action_concept), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; @@ -187,15 +184,12 @@ grib_action* grib_action_create_concept(grib_context* context, static void dump(grib_action* act, FILE* f, int lvl) { - int i = 0; - - for (i = 0; i < lvl; i++) + for (int i = 0; i < lvl; i++) grib_context_print(act->context, f, " "); - printf("concept(%s) { ", act->name); - printf("\n"); + printf("concept(%s) { \n", act->name); - for (i = 0; i < lvl; i++) + for (int i = 0; i < lvl; i++) grib_context_print(act->context, f, " "); printf("}\n"); } @@ -224,10 +218,9 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept* char master[1024] = {0,}; char local[1024] = {0,}; char masterDir[1024] = {0,}; - size_t lenMasterDir = 1024; + size_t lenMasterDir = sizeof(masterDir); char key[4096] = {0,}; char* full = 0; - int id; const size_t bufLen = sizeof(buf); const size_t keyLen = sizeof(key); @@ -240,7 +233,15 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept* Assert(self->masterDir); grib_get_string(h, self->masterDir, masterDir, &lenMasterDir); - snprintf(buf, bufLen, "%s/%s", masterDir, self->basename); + // See ECC-1920: The basename could be a key or a string + char* basename = self->basename; // default is a string + Assert(basename); + char baseNameValue[1024] = {0,}; // its value if a key + size_t lenBaseName = sizeof(baseNameValue); + if (grib_get_string(h, self->basename, baseNameValue, &lenBaseName) == GRIB_SUCCESS) { + basename = baseNameValue; // self->basename was a key whose value is baseNameValue + } + snprintf(buf, bufLen, "%s/%s", masterDir, basename); grib_recompose_name(h, NULL, buf, master, 1); @@ -248,13 +249,13 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept* char localDir[1024] = {0,}; size_t lenLocalDir = 1024; grib_get_string(h, self->localDir, localDir, &lenLocalDir); - snprintf(buf, bufLen, "%s/%s", localDir, self->basename); + snprintf(buf, bufLen, "%s/%s", localDir, basename); grib_recompose_name(h, NULL, buf, local, 1); } snprintf(key, keyLen, "%s%s", master, local); - id = grib_itrie_get_id(h->context->concepts_index, key); + int id = grib_itrie_get_id(h->context->concepts_index, key); if ((c = h->context->concepts[id]) != NULL) return c; @@ -280,7 +281,7 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept* 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); + basename, master, local, context->grib_definition_files_path); return NULL; } diff --git a/src/action_class_gen.cc b/src/action_class_gen.cc index 722391c7f..d4b7e11a8 100644 --- a/src/action_class_gen.cc +++ b/src/action_class_gen.cc @@ -54,20 +54,17 @@ typedef struct grib_action_gen { static grib_action_class _grib_action_class_gen = { - 0, /* super */ - "action_class_gen", /* name */ - sizeof(grib_action_gen), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_gen", /* name */ + sizeof(grib_action_gen), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - ¬ify_change, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + ¬ify_change, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_hash_array.cc b/src/action_class_hash_array.cc index 9a61f9e56..55e87ddda 100644 --- a/src/action_class_hash_array.cc +++ b/src/action_class_hash_array.cc @@ -61,20 +61,17 @@ typedef struct 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 */ + &grib_action_class_gen, /* super */ + "action_class_hash_array", /* name */ + sizeof(grib_action_hash_array), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_if.cc b/src/action_class_if.cc index 8a07b901b..3fd8b1ec9 100644 --- a/src/action_class_if.cc +++ b/src/action_class_if.cc @@ -61,20 +61,17 @@ typedef struct 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 */ + &grib_action_class_section, /* super */ + "action_class_if", /* name */ + sizeof(grib_action_if), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + 0, /* notify_change */ &reparse, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_list.cc b/src/action_class_list.cc index 163a6da55..1475487ee 100644 --- a/src/action_class_list.cc +++ b/src/action_class_list.cc @@ -56,20 +56,17 @@ typedef struct 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 */ + &grib_action_class_section, /* super */ + "action_class_list", /* name */ + sizeof(grib_action_list), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + 0, /* notify_change */ &reparse, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_meta.cc b/src/action_class_meta.cc index 3b5c375eb..7164593e7 100644 --- a/src/action_class_meta.cc +++ b/src/action_class_meta.cc @@ -51,20 +51,17 @@ typedef struct 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 */ + &grib_action_class_gen, /* super */ + "action_class_meta", /* name */ + sizeof(grib_action_meta), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ 0, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_modify.cc b/src/action_class_modify.cc index cc5795559..28ceed17e 100644 --- a/src/action_class_modify.cc +++ b/src/action_class_modify.cc @@ -49,20 +49,17 @@ typedef struct grib_action_modify { static grib_action_class _grib_action_class_modify = { - 0, /* super */ - "action_class_modify", /* name */ - sizeof(grib_action_modify), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_modify", /* name */ + sizeof(grib_action_modify), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - 0, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ + 0, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_noop.cc b/src/action_class_noop.cc index aa5196a46..2b7c1ab62 100644 --- a/src/action_class_noop.cc +++ b/src/action_class_noop.cc @@ -44,20 +44,17 @@ typedef struct grib_action_noop { static grib_action_class _grib_action_class_noop = { - 0, /* super */ - "action_class_noop", /* name */ - sizeof(grib_action_noop), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_noop", /* name */ + sizeof(grib_action_noop), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - 0, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + 0, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_print.cc b/src/action_class_print.cc index 0286c636f..c96e6e22c 100644 --- a/src/action_class_print.cc +++ b/src/action_class_print.cc @@ -48,20 +48,17 @@ typedef struct grib_action_print { static grib_action_class _grib_action_class_print = { - 0, /* super */ - "action_class_print", /* name */ - sizeof(grib_action_print), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_print", /* name */ + sizeof(grib_action_print), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - 0, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + 0, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_remove.cc b/src/action_class_remove.cc index eff91cdce..c64d8ff50 100644 --- a/src/action_class_remove.cc +++ b/src/action_class_remove.cc @@ -49,20 +49,17 @@ typedef struct grib_action_remove { static grib_action_class _grib_action_class_remove = { - 0, /* super */ - "action_class_remove", /* name */ - sizeof(grib_action_remove), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_remove", /* name */ + sizeof(grib_action_remove), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_rename.cc b/src/action_class_rename.cc index 3fb65a704..631a72181 100644 --- a/src/action_class_rename.cc +++ b/src/action_class_rename.cc @@ -51,20 +51,17 @@ typedef struct grib_action_rename { static grib_action_class _grib_action_class_rename = { - 0, /* super */ - "action_class_rename", /* name */ - sizeof(grib_action_rename), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_rename", /* name */ + sizeof(grib_action_rename), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; @@ -127,12 +124,12 @@ 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_rename* a = (grib_action_rename*)act; - // int i = 0; - // for (i = 0; i < lvl; i++) - // grib_context_print(act->context, f, " "); + grib_action_rename* a = (grib_action_rename*)act; + int i = 0; + 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) diff --git a/src/action_class_section.cc b/src/action_class_section.cc index 9dda3dc30..0602bbfcf 100644 --- a/src/action_class_section.cc +++ b/src/action_class_section.cc @@ -44,20 +44,17 @@ typedef struct grib_action_section { static grib_action_class _grib_action_class_section = { - 0, /* super */ - "action_class_section", /* name */ - sizeof(grib_action_section), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_section", /* name */ + sizeof(grib_action_section), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ 0, /* destroy */ - - 0, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - ¬ify_change, /* notify_change */ + 0, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + ¬ify_change, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_set.cc b/src/action_class_set.cc index fee2ca406..799bd6be1 100644 --- a/src/action_class_set.cc +++ b/src/action_class_set.cc @@ -49,20 +49,17 @@ typedef struct grib_action_set { static grib_action_class _grib_action_class_set = { - 0, /* super */ - "action_class_set", /* name */ - sizeof(grib_action_set), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_set", /* name */ + sizeof(grib_action_set), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_set_darray.cc b/src/action_class_set_darray.cc index bbf36f1d6..33ab219f1 100644 --- a/src/action_class_set_darray.cc +++ b/src/action_class_set_darray.cc @@ -47,20 +47,17 @@ typedef struct 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 */ + 0, /* super */ + "action_class_set_darray", /* name */ + sizeof(grib_action_set_darray), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_set_missing.cc b/src/action_class_set_missing.cc index 03bd4ffc3..0907c3760 100644 --- a/src/action_class_set_missing.cc +++ b/src/action_class_set_missing.cc @@ -45,20 +45,17 @@ typedef struct 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 */ + 0, /* super */ + "action_class_set_missing", /* name */ + sizeof(grib_action_set_missing), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_set_sarray.cc b/src/action_class_set_sarray.cc index bc51c2475..50626a0a9 100644 --- a/src/action_class_set_sarray.cc +++ b/src/action_class_set_sarray.cc @@ -47,20 +47,17 @@ typedef struct 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 */ + 0, /* super */ + "action_class_set_sarray", /* name */ + sizeof(grib_action_set_sarray), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_switch.cc b/src/action_class_switch.cc index fa58071ce..547149987 100644 --- a/src/action_class_switch.cc +++ b/src/action_class_switch.cc @@ -51,20 +51,17 @@ typedef struct 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 */ + &grib_action_class_section, /* super */ + "action_class_switch", /* name */ + sizeof(grib_action_switch), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - 0, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + 0, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_template.cc b/src/action_class_template.cc index 79fd2aeaf..13a13c4fd 100644 --- a/src/action_class_template.cc +++ b/src/action_class_template.cc @@ -57,20 +57,17 @@ typedef struct 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 */ + &grib_action_class_section, /* super */ + "action_class_template", /* name */ + sizeof(grib_action_template), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + 0, /* notify_change */ &reparse, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_transient_darray.cc b/src/action_class_transient_darray.cc index 276dcf3fa..baf15300a 100644 --- a/src/action_class_transient_darray.cc +++ b/src/action_class_transient_darray.cc @@ -52,20 +52,17 @@ typedef struct 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 */ + &grib_action_class_gen, /* super */ + "action_class_transient_darray", /* name */ + sizeof(grib_action_transient_darray), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_variable.cc b/src/action_class_variable.cc index 5b7e636ac..1ad93390c 100644 --- a/src/action_class_variable.cc +++ b/src/action_class_variable.cc @@ -48,20 +48,17 @@ typedef struct 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 */ + &grib_action_class_gen, /* super */ + "action_class_variable", /* name */ + sizeof(grib_action_variable), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ 0, /* destroy */ - - 0, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + 0, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/action_class_when.cc b/src/action_class_when.cc index 359890f73..946a41e57 100644 --- a/src/action_class_when.cc +++ b/src/action_class_when.cc @@ -53,20 +53,17 @@ typedef struct grib_action_when { static grib_action_class _grib_action_class_when = { - 0, /* super */ - "action_class_when", /* name */ - sizeof(grib_action_when), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_when", /* name */ + sizeof(grib_action_when), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - &dump, /* dump */ - 0, /* xref */ - - &create_accessor, /* create_accessor*/ - - ¬ify_change, /* notify_change */ + &dump, /* dump */ + 0, /* xref */ + &create_accessor, /* create_accessor */ + ¬ify_change, /* notify_change */ 0, /* reparse */ 0, /* execute */ }; diff --git a/src/action_class_write.cc b/src/action_class_write.cc index 190264e9c..01d5d8a54 100644 --- a/src/action_class_write.cc +++ b/src/action_class_write.cc @@ -47,20 +47,17 @@ typedef struct grib_action_write { static grib_action_class _grib_action_class_write = { - 0, /* super */ - "action_class_write", /* name */ - sizeof(grib_action_write), /* size */ - 0, /* inited */ + 0, /* super */ + "action_class_write", /* name */ + sizeof(grib_action_write), /* size */ + 0, /* inited */ &init_class, /* init_class */ - 0, /* init */ + 0, /* init */ &destroy, /* destroy */ - - 0, /* dump */ - 0, /* xref */ - - 0, /* create_accessor*/ - - 0, /* notify_change */ + 0, /* dump */ + 0, /* xref */ + 0, /* create_accessor */ + 0, /* notify_change */ 0, /* reparse */ &execute, /* execute */ }; diff --git a/src/codes_util.cc b/src/codes_util.cc index 9e7507c23..bb705b335 100644 --- a/src/codes_util.cc +++ b/src/codes_util.cc @@ -9,6 +9,7 @@ */ #include "grib_api_internal.h" +#include "eccodes.h" // Input lon must be in degrees not radians // Not to be used for latitudes as they can be -ve @@ -279,7 +280,7 @@ long convert_to_minutes(long step, long stepUnits) return (long)result; } -bool is_sorted_ascending(double arr[], size_t n) +bool is_sorted_ascending(const double arr[], size_t n) { for (size_t i = 0; i < n-1; i++) { if (arr[i] > arr[i+1]) { @@ -289,7 +290,7 @@ bool is_sorted_ascending(double arr[], size_t n) return true; } -bool is_sorted_descending(double arr[], size_t n) +bool is_sorted_descending(const double arr[], size_t n) { for (size_t i = 0; i < n-1; i++) { if (arr[i] < arr[i+1]) { @@ -404,3 +405,143 @@ int compute_scaled_value_and_scale_factor( } return err; } + +static const char* known_features[] = { + "AEC", + "MEMFS", + "JPG", + "PNG", + "ECCODES_THREADS", + "ECCODES_OMP_THREADS", + "NETCDF", + "FORTRAN", + "GEOGRAPHY" +}; + +#define NUMBER(x) (sizeof(x) / sizeof(x[0])) +int codes_is_feature_enabled(const char* feature) +{ + int aec_enabled = 0; // or CCSDS + int memfs_enabled = 0; + int jpg_enabled = 0; // JasPer or OpenJPEG or both + int png_enabled = 0; + int posix_threads_enabled = 0; + int omp_threads_enabled = 0; + int netcdf_enabled = 0; + int fortran_enabled = 0; + int geography_enabled = 0; + + int found_feature = 0; + const size_t num = NUMBER(known_features); + for (size_t i = 0; i < num; ++i) { + if (STR_EQUAL(feature, known_features[i])) { + found_feature = 1; + break; + } + } + if (!found_feature) { + const grib_context* c = grib_context_get_default(); + grib_context_log(c, GRIB_LOG_ERROR, "Unknown feature '%s'. Select one of:", feature); + for (size_t i = 0; i < num; ++i) { + grib_context_log(c, GRIB_LOG_ERROR, "\t%s", known_features[i]); + } + return 0; + } + +#if defined(HAVE_LIBAEC) || defined(HAVE_AEC) + aec_enabled = 1; +#endif +#if HAVE_JPEG + #if HAVE_LIBJASPER + jpg_enabled = 1; + #endif + #if HAVE_LIBOPENJPEG + jpg_enabled = 1; + #endif +#endif +#if HAVE_LIBPNG + png_enabled = 1; +#endif +#if defined(HAVE_MEMFS) + memfs_enabled = 1; +#endif +#if GRIB_PTHREADS + posix_threads_enabled = 1; +#endif +#if GRIB_OMP_THREADS + omp_threads_enabled = 1; +#endif +#if defined(HAVE_NETCDF) + netcdf_enabled = 1; +#endif +#if defined(HAVE_FORTRAN) + fortran_enabled = 1; +#endif +#if defined(HAVE_GEOGRAPHY) + geography_enabled = 1; +#endif + + if (STR_EQUAL(feature, "AEC") || STR_EQUAL(feature, "CCSDS")) { + return aec_enabled; + } + if (STR_EQUAL(feature, "JPG") || STR_EQUAL(feature, "JPEG")) { + return jpg_enabled; + } + if (STR_EQUAL(feature, "PNG")) { + return png_enabled; + } + if (STR_EQUAL(feature, "MEMFS")) { + return memfs_enabled; + } + if (STR_EQUAL(feature, "ECCODES_THREADS")) { + return posix_threads_enabled; + } + if (STR_EQUAL(feature, "ECCODES_OMP_THREADS")) { + return omp_threads_enabled; + } + if (STR_EQUAL(feature, "NETCDF")) { + return netcdf_enabled; + } + if (STR_EQUAL(feature, "FORTRAN")) { + return fortran_enabled; + } + if (STR_EQUAL(feature, "GEOGRAPHY")) { + return geography_enabled; + } + + return 0; +} + +int codes_get_features(char* result, size_t* length, int select) +{ + Assert(select == CODES_FEATURES_ALL || select == CODES_FEATURES_ENABLED || select == CODES_FEATURES_DISABLED); + + const size_t num = NUMBER(known_features); + result[0] = '\0'; + for (size_t i = 0; i < num; ++i) { + if (select == CODES_FEATURES_ALL) { + strcat(result, known_features[i]); + strcat(result, " "); + } + else if (select == CODES_FEATURES_ENABLED) { + if (codes_is_feature_enabled(known_features[i])) { + strcat(result, known_features[i]); + strcat(result, " "); + } + } + else if (select == CODES_FEATURES_DISABLED) { + if (!codes_is_feature_enabled(known_features[i])) { + strcat(result, known_features[i]); + strcat(result, " "); + } + } + } + + const size_t actual_length = strlen(result); + if (result[actual_length - 1] == ' ') + result[actual_length - 1] = '\0'; + + Assert(*length >= actual_length); + *length = actual_length; + return GRIB_SUCCESS; +} diff --git a/src/eccodes.cc b/src/eccodes.cc index 4dc7868b9..01cec1142 100644 --- a/src/eccodes.cc +++ b/src/eccodes.cc @@ -12,11 +12,11 @@ /* Generic functions */ /******************************************************************************/ -char* codes_samples_path(const grib_context* c) +char* codes_samples_path(const codes_context* c) { return grib_samples_path(c); } -char* codes_definition_path(const grib_context* c) +char* codes_definition_path(const codes_context* c) { return grib_definition_path(c); } @@ -41,16 +41,16 @@ 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(codes_context* c, FILE* f, int* n) { return grib_count_in_file(c, f, n); } -int codes_count_in_filename(grib_context* c, const char* filename, int* n) +int codes_count_in_filename(codes_context* c, const char* filename, int* n) { return grib_count_in_filename(c, filename, n); } -grib_context* codes_context_get_default(void) +codes_context* codes_context_get_default(void) { return grib_context_get_default(); } @@ -74,7 +74,7 @@ void codes_check(const char* call, const char* file, int line, int e, const char /* Fieldsets */ /******************************************************************************/ -grib_fieldset* codes_fieldset_new_from_files(grib_context* c, const char* filenames[], int nfiles, const char** keys, int nkeys, const char* where_string, const char* order_by_string, int* err) +grib_fieldset* codes_fieldset_new_from_files(codes_context* c, const char* filenames[], int nfiles, const 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); } @@ -101,11 +101,11 @@ int codes_fieldset_count(const grib_fieldset* set) /* Indexing */ /******************************************************************************/ -grib_index* codes_index_new_from_file(grib_context* c, const char* filename, const char* keys, int* err) +grib_index* codes_index_new_from_file(codes_context* c, const char* filename, const char* keys, int* 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(codes_context* c, const char* keys, int* err) { return grib_index_new(c, keys, err); } @@ -117,7 +117,7 @@ int codes_index_write(grib_index* index, const char* 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(codes_context* c, const char* filename, int* err) { return grib_index_read(c, filename, err); } @@ -164,15 +164,15 @@ int codes_write_message(const grib_handle* h, const char* file, const char* 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) +grib_handle* codes_handle_new_from_message(codes_context* c, const void* data, size_t 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) +grib_handle* codes_handle_new_from_message_copy(codes_context* c, const void* data, size_t 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) +grib_handle* codes_grib_handle_new_from_samples(codes_context* c, const char* sample_name) { return grib_handle_new_from_samples(c, sample_name); } @@ -189,11 +189,11 @@ int codes_handle_delete(grib_handle* h) { return grib_handle_delete(h); } -grib_handle* codes_handle_new_from_partial_message_copy(grib_context* c, const void* data, size_t size) +grib_handle* codes_handle_new_from_partial_message_copy(codes_context* c, const void* data, size_t 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) +grib_handle* codes_handle_new_from_partial_message(codes_context* c, const void* data, size_t buflen) { return grib_handle_new_from_partial_message(c, data, buflen); } @@ -230,23 +230,23 @@ grib_string_list* codes_grib_util_get_mars_param(const char* param_id) { return grib_util_get_mars_param(param_id); } -void codes_grib_multi_support_on(grib_context* c) +void codes_grib_multi_support_on(codes_context* c) { grib_multi_support_on(c); } -void codes_grib_multi_support_off(grib_context* c) +void codes_grib_multi_support_off(codes_context* c) { grib_multi_support_off(c); } -void codes_grib_multi_support_reset_file(grib_context* c, FILE* f) +void codes_grib_multi_support_reset_file(codes_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(codes_context* c, void** data, size_t* data_len, int* error) { return grib_handle_new_from_multi_message(c, data, data_len, error); } -grib_multi_handle* codes_grib_multi_handle_new(grib_context* c) +grib_multi_handle* codes_grib_multi_handle_new(codes_context* c) { return grib_multi_handle_new(c); } @@ -467,24 +467,24 @@ void codes_dump_action_tree(codes_context* c, FILE* f) } /* GTS, GRIBEX */ /******************************************************************************/ -void codes_gts_header_off(grib_context* c) +void codes_gts_header_off(codes_context* c) { grib_gts_header_off(c); } -void codes_gts_header_on(grib_context* c) +void codes_gts_header_on(codes_context* c) { grib_gts_header_on(c); } -void codes_gribex_mode_on(grib_context* c) +void codes_gribex_mode_on(codes_context* c) { grib_gribex_mode_on(c); } -int codes_get_gribex_mode(grib_context* c) +int codes_get_gribex_mode(const codes_context* c) { return grib_get_gribex_mode(c); } -void codes_gribex_mode_off(grib_context* c) +void codes_gribex_mode_off(codes_context* c) { grib_gribex_mode_off(c); } @@ -577,41 +577,45 @@ void codes_get_reduced_row_p(long pl, double lon_first, double lon_last, long* n grib_get_reduced_row_p(pl, lon_first, lon_last, npoints, olon_first, olon_last); } -void codes_context_delete(grib_context* c) +void codes_context_delete(codes_context* c) { grib_context_delete(c); } -void codes_context_set_definitions_path(grib_context* c, const char* path) +void codes_context_set_definitions_path(codes_context* c, const char* path) { grib_context_set_definitions_path(c, path); } -void codes_context_set_samples_path(grib_context* c, const char* path) +void codes_context_set_samples_path(codes_context* c, const char* path) { grib_context_set_samples_path(c, path); } -void codes_context_set_debug(grib_context* c, int mode) +void codes_context_set_debug(codes_context* c, int mode) { grib_context_set_debug(c, mode); } +void codes_context_set_data_quality_checks(codes_context* c, int val) +{ + grib_context_set_data_quality_checks(c, val); +} -void codes_context_set_memory_proc(grib_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free, grib_realloc_proc p_realloc) +void codes_context_set_memory_proc(codes_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free, grib_realloc_proc p_realloc) { grib_context_set_memory_proc(c, p_malloc, p_free, p_realloc); } -void codes_context_set_persistent_memory_proc(grib_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free) +void codes_context_set_persistent_memory_proc(codes_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free) { grib_context_set_persistent_memory_proc(c, p_malloc, p_free); } -void codes_context_set_buffer_memory_proc(grib_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free, grib_realloc_proc p_realloc) +void codes_context_set_buffer_memory_proc(codes_context* c, grib_malloc_proc p_malloc, grib_free_proc p_free, grib_realloc_proc p_realloc) { grib_context_set_buffer_memory_proc(c, p_malloc, p_free, p_realloc); } -void codes_context_set_print_proc(grib_context* c, grib_print_proc p_print) +void codes_context_set_print_proc(codes_context* c, grib_print_proc p_print) { grib_context_set_print_proc(c, p_print); } -void codes_context_set_logging_proc(grib_context* c, grib_log_proc p_log) +void codes_context_set_logging_proc(codes_context* c, grib_log_proc p_log) { grib_context_set_logging_proc(c, p_log); } diff --git a/src/eccodes.h b/src/eccodes.h index 2c5aff7e2..782542a24 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -809,12 +809,12 @@ int codes_get_float_elements(const codes_handle* h, const char* key, const int* * * @param h : the handle to get the data from * @param key : the key to be searched - * @param mesg : the address of a string where the data will be retrieved + * @param value : the address of a string where the data will be retrieved * @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* value, size_t* length); /** * Get string array values from a key. If several keys of the same name are present, the last one is returned @@ -910,12 +910,12 @@ int codes_set_double(codes_handle* h, const char* key, double val); * * @param h : the handle to set the data to * @param key : the key to be searched - * @param mesg : the address of a string where the data will be read + * @param value : the address of a string where the data will be read * @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* value, size_t* length); /** * Set a bytes array from a key. If several keys of the same name are present, the last one is set @@ -1143,7 +1143,7 @@ void codes_gribex_mode_on(codes_context* c); * * @param c : the context */ -int codes_get_gribex_mode(codes_context* c); +int codes_get_gribex_mode(const codes_context* c); /** * Set the GRIBEX mode off. @@ -1174,7 +1174,8 @@ void codes_context_set_definitions_path(codes_context* c, const char* path); */ void codes_context_set_samples_path(codes_context* c, const char* path); -void codes_context_set_debug(grib_context* c, int mode); +void codes_context_set_debug(codes_context* c, int mode); +void codes_context_set_data_quality_checks(codes_context* c, int val); /** * Sets memory procedures of the context @@ -1400,6 +1401,14 @@ int codes_get_product_kind(const codes_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); +/* Features */ +#define CODES_FEATURES_ALL 0 +#define CODES_FEATURES_ENABLED 1 +#define CODES_FEATURES_DISABLED 2 +int codes_is_feature_enabled(const char* feature); +/* result is a space-separated list of features and + must be allocated by the caller (its length must be large enough) */ +int codes_get_features(char* result, size_t* length, int select); /* --------------------------------------- */ #define CODES_UTIL_GRID_SPEC_REGULAR_LL GRIB_UTIL_GRID_SPEC_REGULAR_LL diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 80d383526..bde1fc807 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -86,7 +86,7 @@ grib_action* grib_action_create_write(grib_context* context, const char* name, i grib_action* grib_action_create_print(grib_context* context, const char* name, char* outname); /* action_class_close.cc */ -grib_action* grib_action_create_close(grib_context* context, char* filename); +grib_action* grib_action_create_close(grib_context* context, const char* filename); /* action_class_variable.cc */ 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); @@ -402,8 +402,8 @@ void codes_dump_bufr_flat(grib_accessors_list* al, grib_handle* h, FILE* f, cons 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); +// 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); @@ -450,7 +450,7 @@ 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); void codes_set_codes_assertion_failed_proc(codes_assertion_failed_proc proc); void codes_assertion_failed(const char* message, const char* file, int line); -int grib_get_gribex_mode(grib_context* c); +int grib_get_gribex_mode(const grib_context* c); void grib_gribex_mode_on(grib_context* c); void grib_gribex_mode_off(grib_context* c); void grib_gts_header_on(grib_context* c); @@ -466,7 +466,6 @@ long grib_julian_to_date(long jdate); long grib_date_to_julian(long ddate); /* grib_fieldset.cc */ -int grib_fieldset_new_column(grib_fieldset* set, int id, char* key, int type); grib_fieldset* grib_fieldset_new_from_files(grib_context* c, const char* filenames[], int nfiles, const 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); @@ -855,9 +854,12 @@ int codes_flush_sync_close_file(FILE* f); int is_date_valid(long year, long month, long day, long hour, long minute, double second); int is_time_valid(long number); // number is HHMM long convert_to_minutes(long step, long stepUnits); -bool is_sorted_ascending(double arr[], size_t n); -bool is_sorted_descending(double arr[], size_t n); +bool is_sorted_ascending(const double arr[], size_t n); +bool is_sorted_descending(const double arr[], size_t n); int compute_scaled_value_and_scale_factor(double input, int64_t scaled_value_max, int64_t scale_factor_max, int64_t* ret_value, int64_t* ret_factor); +int codes_is_feature_enabled(const char* feature); +int codes_get_features(char* result, size_t* length, int select); + /* grib_util.cc */ grib_handle* grib_util_sections_copy(grib_handle* hfrom, grib_handle* hto, int what, int* err); diff --git a/src/expression.class b/src/expression.class index 64c9a2e70..0db380e7c 100644 --- a/src/expression.class +++ b/src/expression.class @@ -2,7 +2,7 @@ typedef const char* string; /* to keep make_class.pl happy */ static void init(grib_expression* e); static void destroy(grib_context*,grib_expression* e); -static void print(grib_context*,grib_expression*,grib_handle*); +static void print(grib_context*, grib_expression*, grib_handle*, FILE*); 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*); @@ -18,12 +18,12 @@ typedef struct grib_expression_NAME{ extern grib_expression_class* SUPER; static grib_expression_class _grib_expression_class_NAME = { - &SUPER, /* super */ - "NAME", /* name */ - sizeof(grib_expression_NAME),/* size of instance */ + &SUPER, /* super */ + "NAME", /* name */ + sizeof(grib_expression_NAME),/* size of instance */ 0, /* inited */ - &init, /* constructor */ - &destroy, /* destructor */ + &init, /* constructor */ + &destroy, /* destructor */ &print, &add_dependency, &native_type, diff --git a/src/grib_accessor_class.cc b/src/grib_accessor_class.cc index de7f8dc47..8beb025a8 100644 --- a/src/grib_accessor_class.cc +++ b/src/grib_accessor_class.cc @@ -74,7 +74,7 @@ static struct table_entry table[] = { grib_section* grib_create_root_section(const grib_context* context, grib_handle* h) { - char* fpath = 0; + const char* fpath = 0; grib_section* s = (grib_section*)grib_context_malloc_clear(context, sizeof(grib_section)); GRIB_MUTEX_INIT_ONCE(&once, &init_mutex); diff --git a/src/grib_api.h b/src/grib_api.h index cd035ea9b..1770032c0 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -815,13 +815,14 @@ int grib_get_float_elements(const grib_handle* h, const char* key, const int* in * Get a string value from a key, if several keys of the same name are present, the last one is returned * @see grib_set_string * - * @param h : the handle to get the data from - * @param key : the key to be searched - * @param mesg : the address of a string where the data will be retrieved - * @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 + * @param h : the handle to get the data from + * @param key : the key to be searched + * @param value : the address of a string where the data will be retrieved + * @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* value, size_t* length); /** * Get string array values from a key. If several keys of the same name are present, the last one is returned @@ -912,11 +913,12 @@ int grib_set_double(grib_handle* h, const char* key, double val); * * @param h : the handle to set the data to * @param key : the key to be searched - * @param mesg : the address of a string where the data will be read - * @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 + * @param value : the address of a string where the data will be read + * @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* value, size_t* length); /** * Set a bytes array from a key. If several keys of the same name are present, the last one is set @@ -1143,7 +1145,7 @@ void grib_gribex_mode_on(grib_context* c); * * @param c : the context */ -int grib_get_gribex_mode(grib_context* c); +int grib_get_gribex_mode(const grib_context* c); /** * Set the GRIBEX mode off. @@ -1170,6 +1172,7 @@ 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_set_debug(grib_context* c, int mode); +void grib_context_set_data_quality_checks(grib_context* c, int val); /** * Sets memory procedures of the context diff --git a/src/grib_context.cc b/src/grib_context.cc index 0e1895314..e29748f74 100644 --- a/src/grib_context.cc +++ b/src/grib_context.cc @@ -185,19 +185,19 @@ int grib_context_seek(const grib_context* c, off_t offset, int whence, void* str return c->seek(c, offset, whence, stream); } -int grib_context_eof(const grib_context* c, void* stream) -{ - if (!c) - c = grib_context_get_default(); - return c->eof(c, stream); -} +// int grib_context_eof(const grib_context* c, void* 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) -{ - if (!c) - c = grib_context_get_default(); - return c->write(c, ptr, size, 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); +// } static void default_log(const grib_context* c, int level, const char* mess) { @@ -237,10 +237,21 @@ 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(); - /* Set logging back to the default if p is NULL */ + /* Set printing back to the default if p is NULL */ c->print = (p ? p : &default_print); } +void grib_context_set_data_quality_checks(grib_context* c, int val) +{ + c = c ? c : grib_context_get_default(); + // If val == 0, disable data quality checks + // If val == 1, failure results in an error + // If val == 2, failure results in a warning + Assert(val == 0 || val == 1 || val == 2); + + c->grib_data_quality_checks = val; +} + void grib_context_set_debug(grib_context* c, int mode) { c = c ? c : grib_context_get_default(); @@ -661,20 +672,19 @@ static int init_definition_files_dir(grib_context* c) } else { /* Definitions path contains multiple directories */ - char* dir = NULL; - dir = strtok_r(path, ECC_PATH_DELIMITER_STR, &lasts); + const char* dir = strtok_r(path, ECC_PATH_DELIMITER_STR, &lasts); while (dir != NULL) { if (next) { next->next = (grib_string_list*)grib_context_malloc_clear_persistent(c, sizeof(grib_string_list)); - next = next->next; + 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 = c->grib_definition_files_dir; } next->value = codes_resolve_path(c, dir); - dir = strtok_r(NULL, ECC_PATH_DELIMITER_STR, &lasts); + dir = strtok_r(NULL, ECC_PATH_DELIMITER_STR, &lasts); } } @@ -811,14 +821,14 @@ void grib_context_reset(grib_context* c) if (c->grib_definition_files_dir) { grib_string_list* next = c->grib_definition_files_dir; - grib_string_list* cur = NULL; + grib_string_list* cur = NULL; while (next) { cur = next; next = next->next; grib_context_free(c, cur->value); grib_context_free(c, cur); } - c->grib_definition_files_dir=0; + c->grib_definition_files_dir = 0; } if (c->multi_support_on) @@ -1233,7 +1243,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(); + const 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(); @@ -1246,7 +1256,7 @@ void codes_assertion_failed(const char* message, const char* file, int line) } } -int grib_get_gribex_mode(grib_context* c) +int grib_get_gribex_mode(const grib_context* c) { if (!c) c = grib_context_get_default(); diff --git a/src/grib_dumper.cc b/src/grib_dumper.cc index bfebdc2d3..6f9f48e67 100644 --- a/src/grib_dumper.cc +++ b/src/grib_dumper.cc @@ -84,7 +84,6 @@ void grib_dump_long(grib_dumper* d, grib_accessor* a, const char* comment) } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_double(grib_dumper* d, grib_accessor* a, const char* comment) @@ -97,7 +96,6 @@ void grib_dump_double(grib_dumper* d, grib_accessor* a, const char* comment) } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_string(grib_dumper* d, grib_accessor* a, const char* comment) @@ -110,7 +108,6 @@ void grib_dump_string(grib_dumper* d, grib_accessor* a, const char* comment) } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) @@ -123,7 +120,6 @@ void grib_dump_string_array(grib_dumper* d, grib_accessor* a, const char* commen } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_label(grib_dumper* d, grib_accessor* a, const char* comment) @@ -136,7 +132,6 @@ void grib_dump_label(grib_dumper* d, grib_accessor* a, const char* comment) } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) @@ -149,7 +144,6 @@ void grib_dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) @@ -162,7 +156,6 @@ void grib_dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) @@ -175,7 +168,6 @@ void grib_dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_values(grib_dumper* d, grib_accessor* a) @@ -188,7 +180,6 @@ void grib_dump_values(grib_dumper* d, grib_accessor* a) } c = c->super ? *(c->super) : NULL; } - Assert(0); } void grib_dump_header(grib_dumper* d, const grib_handle* ch) diff --git a/src/grib_dumper_class_debug.cc b/src/grib_dumper_class_debug.cc index d740e4523..ed416d019 100644 --- a/src/grib_dumper_class_debug.cc +++ b/src/grib_dumper_class_debug.cc @@ -16,7 +16,7 @@ START_CLASS_DEF CLASS = dumper IMPLEMENTS = dump_long;dump_bits - IMPLEMENTS = dump_double;dump_string + IMPLEMENTS = dump_double;dump_string;dump_string_array IMPLEMENTS = dump_bytes;dump_values IMPLEMENTS = dump_label;dump_section IMPLEMENTS = init;destroy @@ -45,6 +45,7 @@ static void dump_long (grib_dumper* d, grib_accessor* a,const char* commen 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); @@ -70,7 +71,7 @@ static grib_dumper_class _grib_dumper_class_debug = { &dump_long, /* dump long */ &dump_double, /* dump double */ &dump_string, /* dump string */ - 0, /* dump string array */ + &dump_string_array, /* dump string array */ &dump_label, /* dump labels */ &dump_bytes, /* dump bytes */ &dump_bits, /* dump bits */ @@ -381,6 +382,76 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) grib_context_free(a->context, value); } +static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comment) +{ + grib_dumper_debug* self = (grib_dumper_debug*)d; + + char** values; + size_t size = 0, i = 0; + grib_context* c = NULL; + int err = 0; + int tab = 0; + long count = 0; + + if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0) + return; + + c = a->context; + a->value_count(&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*)); + if (!values) { + grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %zu bytes", size); + return; + } + + err = a->unpack_string_array(values, &size); + + // print_offset(self->dumper.out,d,a); + //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 (str) \n", a->creator->op); + } + + 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, " "); + + tab++; + 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, " }"); + + if (err) { + fprintf(self->dumper.out, " "); + fprintf(self->dumper.out, "# *** ERR=%d (%s)", err, grib_get_error_message(err)); + } + + fprintf(self->dumper.out, "\n"); + for (i=0; icontext; - for (i = 0; i < set->columns_size; i++) { + const grib_context* c = set->context; + + for (size_t i = 0; i < set->columns_size; i++) { int j = 0; switch (set->columns[i].type) { case GRIB_TYPE_LONG: @@ -146,22 +144,19 @@ static void grib_fieldset_delete_columns(grib_fieldset* set) static int grib_fieldset_columns_resize(grib_fieldset* set, size_t newsize) { - double* newdoubles; - long* newlongs; - char** newstrings; - int* newerrors; - int i = 0; - grib_context* c; - if (!set || !set->columns) return GRIB_INVALID_ARGUMENT; - c = set->context; + double* newdoubles = NULL; + long* newlongs = NULL; + char** newstrings = NULL; + int* newerrors = NULL; + const grib_context* c = set->context; if (newsize <= set->columns[0].values_array_size) return 0; - for (i = 0; i < set->columns_size; i++) { + for (size_t 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, @@ -818,12 +813,9 @@ 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) { - grib_context* c = NULL; - - if (!f) - return; - c = f->context; + if (!f) return; + const grib_context* c = f->context; grib_context_free(c, f->el); grib_context_free(c, f); } diff --git a/src/grib_filepool.cc b/src/grib_filepool.cc index 21f0a5b22..f651c590d 100644 --- a/src/grib_filepool.cc +++ b/src/grib_filepool.cc @@ -287,8 +287,8 @@ void grib_file_pool_delete_file(grib_file* file) void grib_file_close(const char* filename, int force, int* err) { - grib_file* file = NULL; - grib_context* context = grib_context_get_default(); + grib_file* file = NULL; + const 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. */ diff --git a/src/grib_geography.cc b/src/grib_geography.cc index 844a38abb..c864fec9e 100644 --- a/src/grib_geography.cc +++ b/src/grib_geography.cc @@ -143,8 +143,8 @@ static int compute_gaussian_latitudes(long trunc, double* lats) lats[nlat - 1 - jlat] = -lats[jlat]; } - if (nlat != (trunc * 2)) - lats[trunc + 1] = 0.0; + //if (nlat != (trunc * 2)) + // lats[trunc + 1] = 0.0; return GRIB_SUCCESS; } diff --git a/src/grib_iterator_class_gen.cc b/src/grib_iterator_class_gen.cc index 7124e8cf9..7a8ad1f7b 100644 --- a/src/grib_iterator_class_gen.cc +++ b/src/grib_iterator_class_gen.cc @@ -108,7 +108,7 @@ int transform_iterator_data(grib_context* context, double* data, { double* data2; double *pData0, *pData1, *pData2; - unsigned long ix, iy; + long ix, iy; if (!iScansNegatively && jScansPositively && !jPointsAreConsecutive && !alternativeRowScanning) { /* Already +i and +j. No need to change */ diff --git a/src/grib_iterator_class_healpix.cc b/src/grib_iterator_class_healpix.cc index 6a545b6c5..37757eb76 100644 --- a/src/grib_iterator_class_healpix.cc +++ b/src/grib_iterator_class_healpix.cc @@ -211,7 +211,7 @@ static std::vector HEALPix_longitudes(size_t N, size_t i) return longitudes; } -static int iterate_healpix(grib_iterator_healpix* self, long N) +static int iterate_healpix(grib_iterator_healpix* self, long N, bool nested) { size_t Ny = 4 * static_cast(N) - 1; auto Nd = static_cast(N); @@ -241,7 +241,7 @@ static int iterate_healpix(grib_iterator_healpix* self, long N) // Equator latitudes[2 * N - 1] = 0.0; - if (self->nested) { + if (nested) { if (!is_power_of_2(N)) { grib_context* c = grib_context_get_default(); grib_context_log(c, GRIB_LOG_ERROR, "%s: For nested ordering, Nside must be a power of 2", ITER); @@ -389,7 +389,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) } try { - err = iterate_healpix(self, N); + err = iterate_healpix(self, N, self->nested); } catch (...) { return GRIB_INTERNAL_ERROR; diff --git a/src/grib_iterator_class_lambert_conformal.cc b/src/grib_iterator_class_lambert_conformal.cc index fe261b5be..fa002c18b 100644 --- a/src/grib_iterator_class_lambert_conformal.cc +++ b/src/grib_iterator_class_lambert_conformal.cc @@ -295,7 +295,7 @@ static int init_oblate(const grib_handle* h, double ns; // ratio of angle between meridian double F; // flattening of ellipsoid - double rh; // height above ellipsoid + double rh; // height above ellipsoid double sin_po; // sin value double cos_po; // cos value double con; // temporary variable diff --git a/src/grib_trie.cc b/src/grib_trie.cc index c4e1d29e5..85f246e2d 100644 --- a/src/grib_trie.cc +++ b/src/grib_trie.cc @@ -437,11 +437,7 @@ 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; - } + Assert(t); while (*k && t) { last = t; diff --git a/src/grib_util.cc b/src/grib_util.cc index 8e08b3a2d..a3998926b 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -875,6 +875,20 @@ static int write_out_error_data_file(const double* data_values, size_t data_valu return GRIB_SUCCESS; } +static long get_bitsPerValue_for_packingType(const int specPackingType, const long specBitsPerValue) +{ + if (specPackingType == GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE) { + if (specBitsPerValue > 60) return 60; + } + else if (specPackingType == GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER) { + if (specBitsPerValue > 60) return 32; + } + else if (specPackingType == GRIB_UTIL_PACKING_TYPE_CCSDS) { + if (specBitsPerValue > 32) return 32; + } + return specBitsPerValue; //original +} + static int get_grib_sample_name(grib_handle* h, long editionNumber, const grib_util_grid_spec* spec, const char* grid_type, char* sample_name) { @@ -1341,17 +1355,26 @@ grib_handle* grib_util_set_spec(grib_handle* h, Assert(grib_get_long(h, "bitsPerValue", &bitsPerValue) == 0); SET_LONG_VALUE("bitsPerValue", bitsPerValue); } - } break; + } + 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: { + // See ECC-1921 + const long bitsPerValue = get_bitsPerValue_for_packingType(packing_spec->packing_type, packing_spec->bitsPerValue); + if (bitsPerValue != packing_spec->bitsPerValue) { + fprintf(stderr, "ECCODES WARNING : Cannot pack with requested bitsPerValue (%ld). Using %ld\n", + packing_spec->bitsPerValue, bitsPerValue); + } + SET_LONG_VALUE("bitsPerValue", 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; + } + break; case GRIB_UTIL_ACCURACY_USE_PROVIDED_DECIMAL_SCALE_FACTOR: SET_LONG_VALUE("decimalScaleFactor", packing_spec->decimalScaleFactor); diff --git a/src/grib_yacc.cc b/src/grib_yacc.cc index e374bc009..500ae175a 100644 --- a/src/grib_yacc.cc +++ b/src/grib_yacc.cc @@ -961,16 +961,16 @@ union grib_yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 214 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1946 +#define YYLAST 1833 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 145 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 50 /* YYNRULES -- Number of rules. */ -#define YYNRULES 268 +#define YYNRULES 270 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 905 +#define YYNSTATES 919 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 382 @@ -1050,15 +1050,16 @@ static const grib_yytype_int16 grib_yyrline[] = 662, 663, 667, 668, 671, 672, 675, 676, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 695, 698, 701, 704, 705, 706, 707, 708, - 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 724, 725, 728, 729, 732, 733, 736, 737, - 740, 744, 745, 746, 749, 751, 753, 755, 759, 760, - 763, 764, 768, 770, 774, 775, 776, 777, 780, 781, - 782, 784, 785, 786, 787, 788, 789, 793, 794, 797, - 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, - 808, 811, 812, 813, 816, 818, 819, 820, 821, 822, - 823, 824, 829, 830, 833, 834, 837, 838, 841, 847, - 848, 851, 852, 855, 856, 859, 863, 866, 867 + 709, 711, 712, 713, 714, 715, 717, 718, 719, 720, + 721, 722, 723, 724, 728, 729, 732, 733, 736, 737, + 740, 741, 744, 748, 749, 750, 753, 755, 757, 759, + 763, 764, 767, 768, 772, 774, 778, 779, 780, 781, + 784, 785, 786, 788, 789, 790, 791, 792, 793, 797, + 798, 801, 802, 803, 804, 805, 806, 807, 808, 809, + 810, 811, 812, 815, 816, 817, 820, 822, 823, 824, + 825, 826, 827, 828, 833, 834, 837, 838, 841, 842, + 845, 851, 852, 855, 856, 859, 860, 863, 867, 870, + 871 }; #endif @@ -1116,7 +1117,7 @@ grib_yysymbol_name (grib_yysymbol_kind_t grib_yysymbol) } #endif -#define YYPACT_NINF (-658) +#define YYPACT_NINF (-656) #define grib_yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) @@ -1130,97 +1131,98 @@ grib_yysymbol_name (grib_yysymbol_kind_t grib_yysymbol) STATE-NUM. */ static const grib_yytype_int16 grib_yypact[] = { - 1507, -658, -37, -14, 51, 142, -53, -40, 58, 32, - 72, 98, 85, 25, 99, 139, 177, 162, 168, 176, - 197, 205, 208, 212, 228, 270, 272, 277, 310, 313, - 314, 315, 126, 311, 316, 317, 318, 319, 320, 321, - 322, 325, 328, 329, 330, 331, 333, 334, 291, 356, - 357, -12, 14, 15, 364, 755, 360, 366, 365, 374, - 369, 376, 378, 379, 385, 386, 381, 383, 384, 387, - 394, 397, 398, 400, 393, 401, -11, 407, 409, -81, - 535, -658, -658, 1610, 415, -658, -658, -658, -658, -658, - -658, 201, 82, -658, -658, -658, -658, 18, -658, -658, - -658, -658, 755, 755, 421, 422, 423, 425, 426, 755, - 427, 183, 418, 430, -658, -658, 755, -38, 431, 432, - 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 429, 434, 235, 433, 435, 437, - 233, 436, -78, -658, 438, 439, 443, 89, -94, 132, - 428, 755, 444, 450, -658, 451, -658, 459, -658, 256, - 456, 457, 458, 460, -658, -658, 461, 463, 755, 465, - -658, -658, -658, 755, -45, -658, -658, -658, 441, 264, - 424, -658, -52, -71, 259, 472, 478, -658, 446, -658, - 467, 428, 474, 428, 469, 470, 471, -658, 479, 480, - 481, 482, 477, 483, 485, 755, 755, 755, 487, 230, - -80, 468, 22, 475, -658, 488, 7, 486, 1819, -658, - -658, 490, 493, 495, -658, 496, 497, -658, 489, 498, - -658, 500, 501, 502, 491, 503, -658, -658, 504, 508, - 755, 755, -658, 428, 428, 510, 509, 755, 524, 428, - 525, 522, 428, 428, 428, 428, 428, 428, 428, 428, - 428, 428, 428, 428, 428, 428, 755, 526, 528, 529, - 755, 530, 531, 539, 540, 541, 534, 543, 755, 134, - 755, 544, 545, 201, 546, 82, 547, 548, 201, 419, - -658, -658, 542, 84, 755, 549, 550, 551, 552, 755, - 553, 554, 555, 556, 268, 259, 303, 558, -658, -658, - 755, -76, -76, -45, -45, -45, -45, -45, -45, 258, - 258, 258, 258, 258, 258, 258, 258, 755, 755, 484, - 755, -658, 561, -658, 755, 755, 755, 564, 565, 566, - 569, 755, 755, 755, -658, 570, 571, 755, 573, 575, - 576, 591, 592, 560, 557, 596, 560, 557, 557, 755, - 578, 428, 557, 755, 17, -658, 537, 538, 597, 598, - 755, 755, 590, 593, -658, 606, 607, 599, 293, 600, - -658, -658, -658, 608, 602, 603, 418, -658, 612, 615, - -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, - -658, -658, -658, -658, 609, 617, 618, 619, 611, 621, - 622, 428, 613, -658, 755, 624, 428, 262, 428, 616, - -9, 57, -90, 623, -73, 30, 133, -25, -658, -658, - -658, -658, -658, -658, -658, -658, -658, -658, -658, -658, - -658, -658, 625, -658, -48, -658, 251, -658, -658, 627, - 629, 630, 632, 626, 634, 639, 64, 636, 642, 643, - -658, 640, -658, -658, -658, -658, -658, -658, -658, -658, - -658, -658, -658, -52, -52, -71, -71, -71, -71, -71, - -71, 259, 472, 648, 644, 654, 646, 647, 649, 657, - 659, 660, 661, 653, 664, 665, -658, 658, 666, 755, - 755, 755, 755, 755, -658, 33, 668, 476, 557, -658, - 203, 667, 670, 672, 418, -658, 671, 676, 677, 1716, - 1819, 154, 169, 1819, 418, 418, 418, 418, 1819, 418, - 428, 172, 180, 418, 186, 755, 869, 418, 1035, 628, - -658, 687, 679, 681, -658, -658, -658, -67, -658, 418, - 633, 678, 696, 201, 428, 697, 428, 700, 685, 702, - 201, 428, 419, 703, 704, 340, 701, -658, -61, -59, - -658, -658, -658, -658, -658, 707, 712, 713, -658, -658, - 714, 716, -658, 715, -658, 428, -658, -658, -658, 717, - 719, 418, 755, -658, -658, -658, 506, 711, 720, 723, - 724, 727, 728, 737, -658, 745, -658, -658, -658, -658, - -658, 418, 428, -658, 729, 731, 9, 736, -65, 741, - 746, 755, 428, 755, 428, 748, 428, 428, 428, 428, - 749, 428, -658, 755, 428, 755, 428, 428, 755, 428, - 418, 755, 418, 428, 755, 418, 755, 428, 418, 755, - 299, 428, 428, 740, 201, 71, -16, -658, 763, -658, - 764, 201, 86, 61, -658, -658, 730, 761, 701, -62, - -658, 767, -658, 775, -658, 768, 769, 104, 776, 778, - -658, -658, 755, 755, -658, 418, 755, -82, -658, 1819, - 428, 428, 428, 418, 418, -658, 560, 774, 428, -658, - 1819, -65, 455, 868, -658, -658, 901, 777, -658, 779, - -658, -658, -658, -658, -658, -658, -658, -658, 780, -658, - 781, -658, -658, 782, -658, 428, 783, 558, -66, -658, - 784, 428, 785, -658, 428, 786, -658, -658, -658, -658, - 790, 76, 795, 773, 428, 791, 797, 103, 798, 788, - 428, 755, 755, 767, 916, 701, -658, -658, -658, -658, - 799, -658, 802, 805, 800, 801, 428, 804, 806, -658, - -658, 803, -658, -658, -658, 428, 428, 222, -658, -658, - 807, 809, 418, 418, 418, 418, 418, -658, 418, 814, - -658, 418, -658, 428, -658, 418, 105, 428, 808, 201, - -658, 811, 111, 428, 819, 201, -658, -658, -658, 812, - 767, 816, 817, 820, -658, -658, -658, 1819, 1377, -658, - -658, -658, 825, 1819, 1819, 428, 428, 428, 428, 428, - 428, 813, 428, -658, 428, 831, 428, -658, 834, 156, - 835, 836, 428, -658, 837, 171, 340, -658, -658, -658, - -658, -658, 826, -658, 827, 828, -658, -658, -658, -658, - -658, -658, 829, -658, -658, 114, -658, 115, 428, 838, - 839, -658, 129, 428, -60, -658, -658, -658, 428, 843, - 428, 844, 428, -658, 428, 428, 846, 428, -658, -658, - -658, 841, -658, 845, -658, -658, -658, 847, -658, 428, - 428, 428, -658, -658, -658 + 1394, -656, -114, -44, -11, 190, -24, 24, 100, 32, + 160, 182, 134, 84, 189, 239, 236, 271, 274, 286, + 294, 300, 302, 303, 308, 309, 311, 313, 314, 317, + 318, 320, 208, 315, 322, 319, 321, 323, 324, 326, + 335, 340, 341, 356, 357, 358, 359, 360, 353, 362, + 363, -67, -62, -21, 364, 903, 361, 277, 365, 366, + 367, 368, 370, 371, 372, 374, 369, 373, 379, 380, + 376, 388, 389, 390, 383, 384, 6, 387, 391, -73, + 491, -656, -656, 1497, 393, -656, -656, -656, -656, -656, + -656, 205, 148, -656, -656, -656, -656, 15, -656, -656, + -656, -656, 903, 903, 394, 398, 407, 392, 410, 903, + 417, 88, 411, 418, -656, -656, 903, 53, 423, 425, + 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, + 411, 411, 411, 411, 422, 427, 270, 424, 429, 431, + 224, 426, -76, -656, 430, 435, 428, 23, -54, 94, + 420, 903, 436, 437, -656, 433, -656, 452, -656, 251, + 449, 450, 451, 453, -656, -656, 455, 457, 903, 458, + -656, -656, -656, 903, -33, -656, -656, -656, 456, 265, + 460, -656, -74, 2, 90, 444, 472, -656, 469, -656, + 463, 420, 475, 420, 466, 471, 473, -656, 478, 480, + 481, 482, 479, 483, 485, 903, 903, 903, 486, 304, + -17, 474, 56, 476, -656, 487, 8, 489, 1706, -656, + -656, 488, 490, 493, -656, 495, 497, -656, 501, 500, + -656, 502, 506, 508, 492, 509, -656, -656, 511, 517, + 903, 903, -656, 420, 420, 521, 522, 903, 496, 420, + 525, 528, 420, 420, 420, 420, 420, 420, 420, 420, + 420, 420, 420, 420, 420, 420, 903, 532, 548, 549, + 903, 550, 551, 559, 560, 561, 554, 563, 903, 441, + 903, 568, 569, 205, 570, 148, 571, 572, 205, 306, + -656, -656, 564, 89, 903, 565, 573, 574, 575, 903, + 577, 578, 579, 580, 276, 90, 794, 576, -656, -656, + 903, -78, -78, -33, -33, -33, -33, -33, -33, 124, + 124, 124, 124, 124, 124, 124, 124, 903, 903, 582, + 903, -656, 581, -656, 903, 903, 903, 583, 584, 585, + 586, 903, 903, 903, -656, 587, 588, 903, 590, 591, + 592, 593, 594, 601, 589, 599, 601, 589, 589, 903, + 595, 420, 589, 903, 18, -656, 596, 597, 484, 600, + 903, 903, 598, 602, -656, 605, 607, 603, 278, 604, + -656, -656, -656, 611, 606, 609, 411, -656, 612, 617, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -656, 614, 619, 622, 623, 615, 625, + 626, 420, 618, -656, 903, 627, 420, 282, 420, 620, + -10, -12, -71, 628, -88, 28, 75, -40, -656, -656, + -656, -656, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, 630, -656, -46, -656, 113, -656, -656, 629, + 634, 636, 637, 631, 635, 639, 64, 632, 641, 643, + -656, 640, -656, -656, -656, -656, -656, -656, -656, -656, + -656, -656, -656, -74, -74, 2, 2, 2, 2, 2, + 2, 90, 444, 648, 644, 650, 645, 646, 647, 652, + 657, 664, 670, 663, 667, 668, -656, 661, 671, 903, + 903, 903, 903, 903, -656, -30, 621, 666, 589, -656, + 67, 669, 673, 674, 411, -656, 675, 678, 683, 1603, + 1706, 140, 173, 1706, 411, 411, 411, 411, 1706, 411, + 420, 252, 255, 411, 263, 903, 1037, 411, 1094, 676, + -656, 693, 685, 687, -656, -656, -656, -57, -656, 411, + 288, 689, 705, 205, 420, 682, 420, 706, 694, 708, + 205, 420, 306, 709, 710, 334, 715, -656, -56, -32, + -656, -656, -656, -656, -656, 712, 714, 720, -656, -656, + 721, 723, -656, 702, -656, 420, -656, -656, -656, 724, + 726, 411, 903, -656, -656, -656, 513, 716, 727, 729, + 731, 738, 739, 733, -656, 848, -656, -656, -656, -656, + -656, 411, 420, -656, 737, 740, 13, 741, -72, 742, + 743, 903, 420, 903, 420, 744, 420, 420, 420, 420, + 745, 420, -656, 903, 420, 903, 420, 420, 903, 420, + 411, 903, 411, 420, 903, 411, 903, 420, 411, 903, + 290, 420, 420, 746, 747, 205, 127, 27, -656, 749, + -656, 755, 205, 129, 110, -656, -656, 751, 752, 715, + -48, -656, 762, -656, 767, -656, 760, 764, 158, 768, + 770, -656, -656, 903, 903, -656, 411, 903, -87, -656, + 1706, 420, 420, 420, 411, 411, -656, 601, 771, 420, + -656, 1706, -72, 763, 699, -656, -656, 893, 772, -656, + 773, -656, -656, -656, -656, -656, -656, -656, -656, 779, + -656, 780, -656, -656, 781, -656, 420, 783, 576, -65, + -656, 784, 420, 792, -656, 420, 795, -656, -656, -656, + -656, 790, 805, 117, 296, 796, 420, 806, 810, 141, + 811, 799, 420, 903, 903, 762, 931, 715, -656, -656, + -656, -656, 812, -656, 813, 815, 809, 814, 420, 807, + 816, -656, -656, 819, -656, -656, -656, 420, 420, 130, + -656, -656, 808, 817, 411, 411, 411, 411, 411, -656, + 411, 818, -656, 411, -656, 420, -656, 411, 823, 165, + 420, 824, 829, 205, -656, 830, 177, 420, 831, 205, + -656, -656, -656, 825, 762, 832, 834, 835, -656, -656, + -656, 1706, 1264, -656, -656, -656, 833, 1706, 1706, 420, + 420, 420, 420, 420, 420, 846, 420, -656, 420, 847, + 852, 420, -656, 853, 855, 155, 857, 859, 420, -656, + 860, 175, 334, -656, -656, -656, -656, -656, 849, -656, + 851, 856, -656, -656, -656, -656, -656, -656, 861, -656, + -656, 862, 180, -656, 868, 216, 420, 864, 865, -656, + 229, 420, -42, -656, -656, -656, 420, 420, 866, 420, + 875, 876, 420, -656, 420, 420, 877, 420, -656, -656, + -656, -656, 869, -656, 871, 872, -656, -656, -656, 873, + -656, 420, 420, 420, 420, -656, -656, -656, -656 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1237,28 +1239,28 @@ static const grib_yytype_int16 grib_yydefact[] = 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, 267, 265, 259, - 260, 6, 0, 0, 0, 0, 0, 0, 0, 8, + 26, 3, 4, 27, 29, 194, 196, 269, 267, 261, + 262, 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, 253, 255, 257, 258, 36, 0, 262, + 0, 0, 0, 0, 223, 224, 0, 0, 0, 217, + 219, 221, 222, 0, 0, 32, 119, 33, 34, 220, + 230, 236, 245, 255, 257, 259, 260, 36, 0, 264, 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, - 268, 0, 0, 0, 0, 0, 107, 108, 0, 0, + 21, 0, 0, 0, 195, 0, 0, 197, 0, 0, + 270, 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, 252, 0, 0, 218, 224, + 0, 0, 0, 0, 0, 254, 0, 0, 220, 226, 0, 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, @@ -1274,69 +1276,70 @@ static const grib_yytype_int16 grib_yydefact[] = 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, 251, 227, 232, 233, - 229, 230, 231, 242, 241, 245, 249, 247, 248, 246, - 244, 254, 256, 0, 0, 0, 0, 0, 0, 0, + 227, 0, 225, 35, 217, 252, 253, 229, 234, 235, + 231, 232, 233, 244, 243, 247, 251, 249, 250, 248, + 246, 256, 258, 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, 261, + 8, 8, 8, 8, 15, 0, 0, 0, 210, 263, 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, + 130, 134, 139, 138, 118, 0, 0, 0, 242, 237, + 0, 0, 228, 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, 263, 0, + 0, 0, 0, 0, 215, 0, 207, 211, 214, 206, + 208, 8, 8, 209, 0, 0, 0, 0, 265, 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, 264, 266, 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 + 0, 8, 8, 0, 0, 0, 0, 0, 175, 0, + 198, 0, 0, 0, 0, 186, 157, 0, 0, 0, + 0, 30, 145, 125, 0, 126, 0, 0, 0, 0, + 0, 120, 104, 8, 8, 96, 8, 0, 0, 200, + 0, 8, 8, 8, 8, 8, 16, 0, 0, 8, + 93, 0, 0, 0, 141, 266, 268, 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, 0, 8, 0, 0, 0, + 0, 0, 8, 0, 0, 150, 146, 0, 31, 14, + 238, 239, 0, 240, 0, 0, 0, 0, 8, 0, + 0, 205, 201, 0, 44, 46, 45, 8, 8, 0, + 212, 94, 0, 0, 8, 8, 8, 8, 8, 57, + 8, 0, 56, 8, 63, 8, 113, 8, 0, 0, + 8, 0, 0, 0, 184, 0, 0, 8, 0, 0, + 192, 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, + 0, 8, 176, 0, 0, 0, 0, 0, 8, 187, + 0, 0, 0, 241, 216, 218, 202, 204, 0, 213, + 0, 0, 38, 40, 53, 55, 50, 59, 0, 64, + 114, 0, 0, 180, 0, 0, 8, 0, 0, 189, + 0, 8, 0, 203, 142, 144, 8, 8, 0, 8, + 0, 0, 8, 185, 8, 8, 0, 8, 193, 147, + 58, 178, 0, 177, 0, 0, 183, 199, 188, 0, + 191, 8, 8, 8, 8, 179, 182, 181, 190 }; /* YYPGOTO[NTERM-NUM]. */ static const grib_yytype_int16 grib_yypgoto[] = { - -658, -658, 5, 533, -658, -352, 0, -658, -657, 686, - -307, -193, -658, -658, -658, -443, -170, 589, 207, -658, - 440, -658, -658, -658, -658, -259, 692, -658, -658, 294, - -658, -89, -349, -658, -75, -144, 810, 91, 113, 90, - -162, 663, -658, -58, -658, 10, 368, -658, -658, 890 + -656, -656, 5, 272, -656, -352, 0, -656, -655, -47, + -308, -202, -656, -656, -656, -443, -141, 545, 214, -656, + 445, -656, -656, -656, -656, -263, 700, -656, -656, 301, + -656, -85, -345, -656, -81, -144, 837, 1, 103, 30, + -161, 680, -656, -94, -656, 10, 395, -656, -656, 915 }; /* YYDEFGOTO[NTERM-NUM]. */ static const grib_yytype_int16 grib_yydefgoto[] = { - 0, 80, 290, 547, 569, 505, 617, 83, 671, 176, - 177, 178, 84, 85, 86, 668, 669, 243, 291, 442, - 443, 87, 88, 89, 90, 91, 92, 93, 687, 688, + 0, 80, 290, 547, 569, 505, 617, 83, 672, 176, + 177, 178, 84, 85, 86, 669, 670, 243, 291, 442, + 443, 87, 88, 89, 90, 91, 92, 93, 688, 689, 94, 95, 507, 508, 96, 179, 180, 181, 182, 183, 184, 185, 186, 187, 97, 618, 619, 99, 100, 101 }; @@ -1346,147 +1349,159 @@ static const grib_yytype_int16 grib_yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const grib_yytype_int16 grib_yytable[] = { - 82, 566, 224, 463, 510, 81, 305, 208, 511, 512, - 98, 753, 344, 516, 789, 164, 165, 227, 563, 564, - 563, 564, 228, 57, 422, 208, 686, 208, 768, 427, - 308, 167, 563, 564, 221, 222, 78, 223, 284, 348, - 349, 350, 285, 212, 231, 232, 276, 554, 464, 170, - 356, 225, 226, 213, 385, 769, 357, 277, 246, 229, - 175, 650, 167, 351, 556, 314, 315, 650, 319, 673, - 651, 107, 289, 320, 352, 754, 672, 889, 674, 169, - 170, 171, 172, 219, 108, 416, 418, 173, 565, 316, - 317, 318, 247, 292, 174, 102, 241, 248, 810, 221, - 222, 78, 223, 161, 162, 163, 57, 98, 221, 222, - 78, 223, 561, 154, 175, 307, 242, 242, 103, 550, - 155, 744, 242, 209, 551, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 242, 242, 156, - 158, 364, 229, 702, 164, 165, 157, 159, 345, 114, - 115, 355, 359, 161, 162, 163, 241, 360, 557, 607, - 445, 603, 110, 558, 604, 481, 513, 465, 466, 308, + 82, 566, 463, 344, 510, 81, 224, 305, 231, 232, + 98, 227, 511, 512, 755, 791, 57, 516, 102, 228, + 422, 687, 246, 770, 208, 427, 208, 164, 165, 167, + 308, 208, 563, 564, 563, 564, 225, 226, 563, 564, + 348, 349, 350, 314, 315, 385, 464, 170, 276, 556, + 771, 212, 229, 221, 222, 78, 223, 292, 154, 277, + 175, 213, 238, 156, 351, 155, 554, 316, 317, 318, + 157, 650, 650, 289, 167, 352, 416, 418, 284, 307, + 651, 673, 285, 219, 221, 222, 78, 223, 103, 756, + 565, 169, 170, 171, 172, 899, 674, 561, 603, 173, + 107, 604, 814, 57, 158, 675, 174, 98, 161, 162, + 163, 159, 345, 356, 175, 355, 242, 242, 550, 357, + 552, 104, 242, 551, 553, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 229, + 209, 319, 364, 161, 162, 163, 320, 703, 108, 164, + 165, 221, 222, 78, 223, 281, 557, 513, 282, 283, + 346, 558, 110, 607, 746, 445, 481, 465, 466, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 104, 166, 221, 222, 78, 223, 552, - 109, 167, 577, 553, 164, 165, 111, 578, 750, 742, - 221, 222, 78, 223, 743, 168, 225, 226, 169, 170, - 171, 172, 175, 797, 748, 113, 173, 242, 365, 749, - 446, 281, 112, 174, 282, 283, 755, 221, 222, 78, - 223, 116, 760, 835, 166, 447, 448, 761, 836, 841, - 803, 167, 879, 881, 842, 175, 175, 880, 882, 161, - 162, 163, 348, 349, 350, 168, 135, 886, 169, 170, - 171, 172, 887, 117, 286, 559, 173, 287, 288, 560, - 417, 175, 105, 174, 106, 175, 351, 161, 162, 163, - 221, 222, 78, 223, 621, 175, 120, 352, 241, 498, - 164, 165, 121, 868, 656, 221, 222, 78, 223, 623, - 122, 663, 633, 241, 175, 517, 241, 118, 873, 119, - 635, 175, 518, 355, 241, 240, 638, 241, 164, 165, - 241, 123, 161, 162, 163, 221, 222, 78, 223, 124, - 166, 603, 125, 224, 608, 175, 126, 167, 224, 175, - 175, 175, 640, 642, 777, 645, 175, 175, 175, 227, - 603, 168, 127, 822, 169, 170, 171, 172, 166, 268, - 353, 269, 173, 164, 165, 167, 354, 273, 274, 174, - 321, 322, 323, 324, 325, 326, 567, 545, 546, 767, - 297, 298, 169, 170, 171, 172, 311, 312, 545, 546, - 173, 242, 458, 459, 128, 741, 129, 174, 331, 685, - 333, 130, 747, 166, 467, 468, 469, 470, 471, 472, - 167, 475, 476, 477, 478, 479, 480, 524, 525, 175, - 563, 564, 428, 151, 168, 736, 737, 169, 170, 171, - 172, 755, 473, 474, 131, 173, 460, 132, 133, 134, - 137, 136, 174, 140, 141, 142, 143, 138, 139, 144, - 381, 382, 145, 146, 147, 148, 387, 149, 150, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 429, 161, 162, 163, 348, 349, 350, - 152, 153, 430, 431, 432, 433, 434, 435, 160, 190, - 436, 437, 188, 438, 439, 189, 440, 441, 191, 192, - 193, 351, 194, 195, 175, 175, 175, 175, 175, 196, - 197, 198, 352, 199, 200, 164, 165, 201, 202, 242, - 620, 203, 204, 625, 205, 206, 242, 242, 630, 242, - 242, 242, 242, 207, 242, 214, 242, 242, 242, 242, - 839, 210, 242, 211, 220, 233, 845, 697, 234, 235, - 236, 237, 241, 239, 242, 166, 245, 250, 251, 266, - 267, 271, 167, 272, 313, 270, 289, 224, 515, 310, - 329, 275, 278, 279, 224, 280, 168, 295, 293, 169, - 170, 171, 172, 727, 294, 296, 727, 173, 299, 300, - 301, 327, 302, 303, 174, 304, 242, 306, 328, 330, - 332, 334, 335, 336, 358, 337, 338, 339, 340, 341, - 212, 362, 483, 606, 686, 342, 242, 343, 540, 347, - 363, 370, 375, 544, 366, 548, 175, 367, 175, 213, - 368, 369, 371, 372, 373, 374, 376, 377, 175, 378, - 175, 383, 384, 175, 355, 242, 175, 242, 386, 175, - 242, 175, 224, 242, 175, 389, 388, 405, 224, 406, - 407, 409, 410, 411, 412, 413, 414, 415, 420, 421, - 423, 425, 426, 354, 357, 444, 874, 454, 455, 456, - 457, 506, 449, 450, 451, 452, 504, 175, 175, 771, - 242, 462, 485, 807, 808, 489, 490, 491, 242, 242, - 492, 244, 514, 496, 497, 499, 249, 500, 501, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 502, 503, 509, 519, 353, 356, 520, - 521, 522, 527, 526, 529, 523, 531, 632, 528, 532, - 533, 534, 535, 536, 537, 538, 539, 541, 543, 549, - 224, 555, 570, 562, 571, 572, 224, 573, 653, 574, - 646, 657, 575, 659, 161, 162, 163, 576, 664, 579, - 580, 581, 583, 582, 161, 162, 163, 584, 585, 586, - 587, 589, 588, 590, 591, 592, 593, 242, 242, 242, - 242, 242, 681, 242, 596, 238, 242, 594, 595, 597, - 242, 361, 605, 611, 609, 164, 165, 610, 613, 614, - 615, 647, 648, 649, 654, 164, 165, 850, 852, 699, - 655, 661, 658, 854, 855, 660, 662, 666, 667, 708, - 670, 710, 675, 712, 713, 714, 715, 676, 717, 677, - 678, 719, 679, 721, 722, 166, 724, 689, 680, 682, - 729, 683, 167, 690, 733, 166, 691, 692, 738, 739, - 693, 694, 167, 695, 751, 700, 168, 701, 740, 169, - 170, 171, 172, 703, 780, 696, 168, 173, 705, 169, - 170, 171, 172, 706, 174, 711, 716, 173, 161, 162, - 163, 745, 746, 346, 174, 752, 756, 772, 773, 774, - 757, 758, 759, 778, 762, 779, 763, 781, 782, 799, - 783, 784, 785, 786, 796, 801, 788, 791, 793, 795, - 798, 802, 809, 804, 805, 811, 379, 380, 812, 164, - 165, 813, 787, 814, 815, 790, 838, 862, 792, 840, - 819, 794, 817, 823, 818, 824, 831, 844, 846, 847, - 848, 800, 404, 849, 853, 865, 408, 806, 867, 869, - 870, 872, 878, 875, 876, 877, 419, 891, 893, 166, - 897, 884, 885, 816, 899, 530, 167, 424, 900, 568, - 901, 770, 820, 821, 309, 453, 704, 230, 0, 0, - 168, 482, 461, 169, 170, 171, 172, 0, 0, 0, - 833, 641, 665, 0, 837, 0, 0, 0, 174, 0, - 843, 0, 0, 0, 0, 0, 484, 0, 0, 0, - 486, 487, 488, 0, 0, 0, 0, 493, 494, 495, - 0, 0, 856, 857, 858, 859, 860, 861, 0, 863, - 0, 864, 0, 866, 0, 0, 0, 0, 0, 871, - 0, 0, 0, 0, 161, 162, 163, 0, 0, 0, + 308, 308, 308, 247, 164, 165, 359, 241, 248, 166, + 241, 360, 577, 379, 380, 603, 167, 578, 608, 447, + 448, 321, 322, 323, 324, 325, 326, 559, 114, 115, + 168, 560, 175, 169, 170, 171, 172, 242, 365, 404, + 240, 173, 241, 408, 166, 446, 286, 757, 174, 287, + 288, 167, 109, 419, 221, 222, 78, 223, 567, 545, + 546, 221, 222, 78, 223, 175, 175, 752, 169, 170, + 171, 172, 453, 498, 800, 744, 173, 750, 603, 461, + 745, 826, 751, 174, 113, 221, 222, 78, 223, 517, + 621, 175, 225, 226, 241, 175, 518, 355, 807, 221, + 222, 78, 223, 484, 111, 175, 762, 486, 487, 488, + 657, 763, 876, 840, 493, 494, 495, 664, 841, 221, + 222, 78, 223, 623, 175, 847, 112, 241, 888, 428, + 848, 175, 881, 889, 467, 468, 469, 470, 471, 472, + 105, 116, 106, 161, 162, 163, 348, 349, 350, 221, + 222, 78, 223, 640, 642, 175, 645, 224, 135, 175, + 175, 175, 224, 227, 891, 779, 175, 175, 175, 892, + 351, 475, 476, 477, 478, 479, 480, 896, 273, 274, + 429, 352, 897, 117, 164, 165, 118, 542, 119, 430, + 431, 432, 433, 434, 435, 297, 298, 436, 437, 769, + 438, 439, 633, 440, 441, 635, 241, 311, 312, 241, + 686, 242, 743, 638, 268, 120, 269, 241, 121, 749, + 458, 459, 524, 525, 166, 331, 189, 333, 545, 546, + 122, 167, 653, 654, 563, 564, 737, 738, 123, 175, + 801, 802, 473, 474, 124, 168, 125, 126, 169, 170, + 171, 172, 127, 128, 353, 129, 173, 130, 131, 757, + 354, 132, 133, 174, 134, 136, 137, 140, 141, 138, + 142, 139, 598, 599, 600, 601, 602, 381, 382, 143, + 161, 162, 163, 387, 144, 145, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 146, 147, 148, 149, 150, 151, 152, 153, 160, 190, + 191, 214, 193, 188, 194, 195, 196, 192, 197, 198, + 202, 164, 165, 199, 175, 175, 175, 175, 175, 200, + 201, 698, 203, 204, 205, 206, 207, 236, 233, 242, + 620, 210, 220, 625, 234, 211, 242, 242, 630, 242, + 242, 242, 242, 235, 242, 237, 242, 242, 242, 242, + 845, 166, 242, 239, 245, 241, 851, 728, 167, 250, + 728, 251, 266, 267, 242, 271, 270, 272, 289, 295, + 280, 275, 168, 327, 278, 169, 170, 171, 172, 279, + 293, 294, 224, 173, 708, 515, 710, 417, 296, 224, + 174, 299, 300, 301, 310, 302, 719, 303, 721, 304, + 306, 724, 328, 329, 727, 330, 242, 731, 334, 733, + 313, 332, 736, 335, 337, 336, 338, 339, 340, 355, + 358, 341, 362, 212, 353, 342, 242, 343, 347, 363, + 386, 687, 366, 375, 367, 540, 175, 213, 175, 368, + 544, 369, 548, 370, 371, 372, 766, 767, 175, 373, + 175, 374, 376, 175, 377, 242, 175, 242, 378, 175, + 242, 175, 383, 242, 175, 384, 388, 244, 224, 811, + 812, 389, 249, 405, 224, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 406, + 407, 409, 410, 411, 412, 413, 414, 415, 175, 175, + 773, 242, 420, 421, 423, 425, 426, 444, 449, 242, + 242, 454, 455, 456, 457, 782, 450, 451, 452, 462, + 483, 882, 485, 506, 489, 490, 491, 492, 568, 514, + 496, 497, 499, 500, 501, 502, 503, 504, 509, 521, + 356, 522, 354, 357, 519, 527, 531, 526, 520, 523, + 529, 532, 528, 534, 632, 533, 535, 536, 537, 538, + 539, 543, 541, 549, 570, 605, 555, 361, 562, 571, + 224, 572, 573, 575, 574, 579, 224, 576, 658, 580, + 660, 581, 583, 582, 585, 665, 589, 584, 586, 587, + 588, 590, 161, 162, 163, 348, 349, 350, 591, 242, + 242, 242, 242, 242, 592, 242, 593, 596, 242, 682, + 594, 595, 242, 606, 597, 611, 609, 659, 646, 351, + 610, 614, 613, 161, 162, 163, 615, 647, 648, 649, + 352, 856, 858, 164, 165, 655, 700, 860, 861, 656, + 662, 661, 663, 667, 668, 681, 709, 676, 711, 677, + 713, 714, 715, 716, 671, 718, 678, 679, 720, 680, + 722, 723, 690, 725, 164, 165, 683, 730, 684, 696, + 691, 734, 692, 166, 693, 739, 740, 161, 162, 163, + 167, 694, 695, 701, 741, 742, 702, 747, 704, 706, + 707, 712, 717, 748, 168, 753, 754, 169, 170, 171, + 172, 758, 759, 760, 166, 173, 764, 761, 765, 783, + 780, 167, 174, 784, 785, 774, 775, 776, 164, 165, + 786, 787, 788, 781, 798, 168, 790, 793, 169, 170, + 171, 172, 161, 162, 163, 795, 173, 460, 797, 799, + 805, 530, 803, 174, 806, 809, 808, 813, 815, 816, + 789, 817, 818, 792, 827, 821, 794, 819, 166, 796, + 835, 839, 843, 828, 822, 167, 823, 844, 846, 850, + 804, 852, 859, 164, 165, 853, 810, 854, 855, 168, + 868, 871, 169, 170, 171, 172, 872, 874, 697, 875, + 173, 877, 820, 878, 880, 424, 883, 174, 884, 772, + 902, 824, 825, 885, 886, 887, 890, 894, 895, 904, + 905, 909, 911, 166, 912, 913, 914, 666, 482, 837, + 167, 309, 230, 705, 842, 0, 0, 0, 0, 0, + 0, 849, 0, 0, 168, 0, 0, 169, 170, 171, + 172, 0, 0, 0, 0, 173, 0, 0, 0, 0, + 0, 0, 174, 862, 863, 864, 865, 866, 867, 0, + 869, 0, 870, 0, 0, 873, 161, 162, 163, 612, + 0, 0, 879, 0, 0, 0, 622, 624, 0, 626, + 627, 628, 629, 0, 631, 0, 634, 636, 637, 639, + 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, + 893, 0, 0, 0, 652, 898, 0, 164, 165, 0, + 900, 901, 0, 903, 0, 0, 906, 0, 907, 908, + 0, 910, 0, 161, 162, 163, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 915, 916, 917, 918, 0, + 0, 0, 0, 0, 0, 0, 685, 166, 0, 0, + 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 164, 165, 699, 0, 168, 0, + 0, 169, 170, 171, 172, 0, 0, 0, 0, 641, + 0, 0, 0, 0, 0, 0, 174, 0, 0, 0, + 0, 0, 0, 0, 0, 726, 0, 729, 0, 0, + 732, 0, 0, 735, 166, 0, 0, 0, 0, 0, + 0, 167, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 168, 0, 0, 169, 170, + 171, 172, 0, 0, 0, 0, 644, 0, 0, 0, + 0, 768, 0, 174, 0, 0, 0, 0, 0, 777, + 778, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 883, 0, 0, 0, 0, - 888, 0, 0, 0, 0, 890, 0, 892, 0, 894, - 0, 895, 896, 0, 898, 164, 165, 0, 0, 0, - 542, 0, 0, 612, 0, 0, 902, 903, 904, 0, - 622, 624, 0, 626, 627, 628, 629, 0, 631, 0, - 634, 636, 637, 639, 0, 0, 643, 0, 0, 0, - 0, 0, 0, 0, 0, 166, 0, 0, 652, 0, - 0, 0, 167, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 168, 0, 0, 169, - 170, 171, 172, 0, 0, 0, 0, 644, 0, 0, - 0, 0, 0, 0, 174, 0, 0, 0, 0, 0, - 684, 0, 0, 0, 0, 598, 599, 600, 601, 602, + 0, 0, 0, 0, 0, 0, 0, 0, 215, 3, + 0, 0, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 0, 0, 0, 0, 0, 0, 0, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 0, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 0, 45, 46, 0, 0, 47, 0, 0, 829, + 830, 831, 832, 833, 0, 834, 0, 0, 836, 0, + 0, 0, 838, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 0, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 0, 69, 70, 71, 72, 73, + 74, 0, 0, 75, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 216, 0, + 0, 217, 0, 0, -8, 1, 0, 0, 2, 3, + 0, 857, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 0, 0, 0, 0, 0, 0, 0, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 0, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 0, 45, 46, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 698, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 725, - 0, 728, 0, 0, 731, 0, 0, 734, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 766, 0, 0, 0, 0, 0, - 0, 0, 775, 776, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 707, 0, 709, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 718, - 0, 720, 0, 0, 723, 0, 0, 726, 0, 0, - 730, 0, 732, 0, 0, 735, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 764, 765, - 0, 825, 826, 827, 828, 829, 0, 830, 0, 0, - 832, 215, 3, 0, 834, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 0, 0, 0, 0, 0, - 0, 0, 14, 15, 16, 17, 18, 19, 20, 21, + 0, 0, 0, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 0, 69, 70, 71, 72, 73, + 74, 215, 3, 75, 0, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 0, 0, 0, 76, 77, + 78, 79, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 0, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, 45, 46, 0, 0, 47, @@ -1494,198 +1509,187 @@ static const grib_yytype_int16 grib_yytable[] = 0, 0, 0, 0, 0, 0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, 70, - 71, 72, 73, 74, 0, 0, 75, 0, 0, 0, + 71, 72, 73, 74, 0, 0, 75, 215, 3, 0, + 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 216, 0, 0, 217, 0, 218, 0, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 0, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 0, 45, 46, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 216, 0, 0, 217, 0, 0, -8, 1, 0, - 0, 2, 3, 0, 851, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 0, 0, 0, 0, 0, - 0, 0, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 0, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 0, 45, 46, 0, 0, 47, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 0, 69, 70, - 71, 72, 73, 74, 215, 3, 75, 0, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 0, 0, - 0, 76, 77, 78, 79, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 0, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 0, 45, 46, - 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 0, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 0, 69, 70, 71, 72, 73, 74, 0, 0, 75, - 215, 3, 0, 0, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 216, 0, 0, 217, 0, 218, - 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 0, 0, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 0, 69, 70, 71, 72, 73, 74, + 215, 3, 75, 0, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 0, 0, 0, 616, 0, 0, + 217, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 0, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, 45, 46, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 53, 54, 55, 56, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, 70, 71, - 72, 73, 74, 215, 3, 75, 0, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 0, 0, 0, - 616, 0, 0, 217, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 0, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 0, 45, 46, 0, - 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 0, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 0, - 69, 70, 71, 72, 73, 74, 0, 0, 75, 0, + 72, 73, 74, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 216, 0, 0, 217 + 216, 0, 0, 217 }; static const grib_yytype_int16 grib_yycheck[] = { - 0, 444, 91, 310, 356, 0, 168, 18, 357, 358, - 0, 668, 205, 362, 80, 60, 61, 92, 80, 81, - 80, 81, 4, 88, 283, 18, 108, 18, 110, 288, - 174, 107, 80, 81, 124, 125, 126, 127, 132, 22, - 23, 24, 136, 124, 102, 103, 124, 137, 124, 125, - 130, 124, 125, 134, 247, 137, 136, 135, 116, 124, - 55, 128, 107, 46, 137, 117, 118, 128, 139, 128, - 137, 124, 138, 144, 57, 137, 137, 137, 137, 124, - 125, 126, 127, 83, 124, 278, 279, 132, 136, 141, - 142, 143, 130, 151, 139, 132, 134, 135, 755, 124, - 125, 126, 127, 19, 20, 21, 88, 97, 124, 125, - 126, 127, 137, 125, 109, 173, 111, 112, 132, 128, - 132, 137, 117, 134, 133, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 125, - 125, 134, 124, 134, 60, 61, 132, 132, 206, 124, - 125, 209, 130, 19, 20, 21, 134, 135, 128, 508, - 76, 128, 130, 133, 131, 327, 359, 311, 312, 313, + 0, 444, 310, 205, 356, 0, 91, 168, 102, 103, + 0, 92, 357, 358, 669, 80, 88, 362, 132, 4, + 283, 108, 116, 110, 18, 288, 18, 60, 61, 107, + 174, 18, 80, 81, 80, 81, 124, 125, 80, 81, + 22, 23, 24, 117, 118, 247, 124, 125, 124, 137, + 137, 124, 124, 124, 125, 126, 127, 151, 125, 135, + 55, 134, 109, 125, 46, 132, 137, 141, 142, 143, + 132, 128, 128, 138, 107, 57, 278, 279, 132, 173, + 137, 137, 136, 83, 124, 125, 126, 127, 132, 137, + 136, 124, 125, 126, 127, 137, 128, 137, 128, 132, + 124, 131, 757, 88, 125, 137, 139, 97, 19, 20, + 21, 132, 206, 130, 109, 209, 111, 112, 128, 136, + 132, 132, 117, 133, 136, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 124, + 134, 139, 134, 19, 20, 21, 144, 134, 124, 60, + 61, 124, 125, 126, 127, 132, 128, 359, 135, 136, + 207, 133, 130, 508, 137, 76, 327, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 132, 100, 124, 125, 126, 127, 132, - 132, 107, 128, 136, 60, 61, 124, 133, 137, 128, - 124, 125, 126, 127, 133, 121, 124, 125, 124, 125, - 126, 127, 207, 137, 128, 130, 132, 212, 218, 133, - 136, 132, 124, 139, 135, 136, 669, 124, 125, 126, - 127, 132, 128, 128, 100, 293, 294, 133, 133, 128, - 137, 107, 128, 128, 133, 240, 241, 133, 133, 19, - 20, 21, 22, 23, 24, 121, 130, 128, 124, 125, - 126, 127, 133, 124, 132, 132, 132, 135, 136, 136, - 136, 266, 130, 139, 132, 270, 46, 19, 20, 21, - 124, 125, 126, 127, 130, 280, 124, 57, 134, 347, - 60, 61, 124, 137, 553, 124, 125, 126, 127, 130, - 124, 560, 130, 134, 299, 363, 134, 130, 137, 132, - 130, 306, 370, 371, 134, 132, 130, 134, 60, 61, - 134, 124, 19, 20, 21, 124, 125, 126, 127, 124, - 100, 128, 124, 422, 131, 330, 124, 107, 427, 334, - 335, 336, 535, 536, 696, 538, 341, 342, 343, 424, - 128, 121, 124, 131, 124, 125, 126, 127, 100, 124, - 130, 126, 132, 60, 61, 107, 136, 134, 135, 139, - 111, 112, 113, 114, 115, 116, 125, 126, 127, 686, - 124, 125, 124, 125, 126, 127, 122, 123, 126, 127, - 132, 386, 124, 125, 124, 654, 124, 139, 191, 592, - 193, 124, 661, 100, 313, 314, 315, 316, 317, 318, - 107, 321, 322, 323, 324, 325, 326, 124, 125, 414, - 80, 81, 3, 132, 121, 126, 127, 124, 125, 126, - 127, 874, 319, 320, 124, 132, 133, 124, 124, 124, - 124, 130, 139, 124, 124, 124, 124, 130, 130, 124, - 243, 244, 124, 124, 124, 124, 249, 124, 124, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 54, 19, 20, 21, 22, 23, 24, - 124, 124, 63, 64, 65, 66, 67, 68, 124, 124, - 71, 72, 132, 74, 75, 129, 77, 78, 124, 130, - 124, 46, 124, 124, 499, 500, 501, 502, 503, 124, - 124, 130, 57, 130, 130, 60, 61, 130, 124, 514, - 520, 124, 124, 523, 124, 132, 521, 522, 528, 524, - 525, 526, 527, 132, 529, 0, 531, 532, 533, 534, - 799, 134, 537, 134, 129, 124, 805, 605, 126, 126, - 125, 125, 134, 126, 549, 100, 126, 126, 126, 130, - 126, 126, 107, 126, 140, 132, 138, 656, 361, 128, - 124, 135, 134, 134, 663, 132, 121, 126, 134, 124, - 125, 126, 127, 641, 134, 126, 644, 132, 132, 132, - 132, 119, 132, 132, 139, 132, 591, 132, 120, 132, - 126, 132, 132, 132, 136, 126, 126, 126, 126, 132, - 124, 136, 128, 137, 108, 132, 611, 132, 411, 132, - 132, 132, 131, 416, 134, 418, 621, 134, 623, 134, - 134, 134, 134, 133, 133, 133, 133, 133, 633, 131, - 635, 131, 133, 638, 702, 640, 641, 642, 124, 644, - 645, 646, 741, 648, 649, 133, 131, 131, 747, 131, - 131, 131, 131, 124, 124, 124, 132, 124, 124, 124, - 124, 124, 124, 136, 136, 133, 846, 124, 124, 124, - 124, 124, 133, 133, 133, 133, 126, 682, 683, 689, - 685, 133, 131, 751, 752, 131, 131, 131, 693, 694, - 131, 112, 124, 133, 133, 132, 117, 132, 132, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 132, 132, 129, 136, 130, 130, 136, - 124, 124, 124, 133, 131, 136, 124, 530, 136, 124, - 131, 124, 124, 124, 133, 124, 124, 134, 124, 133, - 839, 128, 125, 128, 125, 125, 845, 125, 125, 133, - 132, 554, 128, 556, 19, 20, 21, 128, 561, 133, - 128, 128, 124, 133, 19, 20, 21, 133, 124, 133, - 133, 124, 133, 124, 124, 124, 133, 782, 783, 784, - 785, 786, 585, 788, 136, 109, 791, 133, 133, 133, - 795, 212, 134, 131, 137, 60, 61, 137, 137, 133, - 133, 124, 133, 132, 136, 60, 61, 817, 818, 612, - 124, 136, 125, 823, 824, 125, 124, 124, 124, 622, - 129, 624, 125, 626, 627, 628, 629, 125, 631, 126, - 126, 634, 126, 636, 637, 100, 639, 136, 133, 132, - 643, 132, 107, 133, 647, 100, 133, 133, 651, 652, - 133, 133, 107, 126, 134, 136, 121, 136, 128, 124, - 125, 126, 127, 137, 6, 130, 121, 132, 137, 124, - 125, 126, 127, 137, 139, 137, 137, 132, 19, 20, - 21, 128, 128, 207, 139, 134, 129, 690, 691, 692, - 125, 133, 133, 129, 128, 698, 128, 6, 131, 136, - 131, 131, 131, 131, 124, 124, 133, 133, 133, 133, - 125, 124, 6, 125, 136, 126, 240, 241, 126, 60, - 61, 126, 725, 133, 133, 728, 128, 124, 731, 128, - 137, 734, 138, 136, 138, 136, 132, 128, 136, 133, - 133, 744, 266, 133, 129, 124, 270, 750, 124, 124, - 124, 124, 133, 137, 137, 137, 280, 124, 124, 100, - 124, 133, 133, 766, 133, 386, 107, 285, 133, 446, - 133, 687, 775, 776, 174, 299, 618, 97, -1, -1, - 121, 328, 306, 124, 125, 126, 127, -1, -1, -1, - 793, 132, 562, -1, 797, -1, -1, -1, 139, -1, - 803, -1, -1, -1, -1, -1, 330, -1, -1, -1, - 334, 335, 336, -1, -1, -1, -1, 341, 342, 343, - -1, -1, 825, 826, 827, 828, 829, 830, -1, 832, - -1, 834, -1, 836, -1, -1, -1, -1, -1, 842, - -1, -1, -1, -1, 19, 20, 21, -1, -1, -1, + 324, 325, 326, 130, 60, 61, 130, 134, 135, 100, + 134, 135, 128, 240, 241, 128, 107, 133, 131, 293, + 294, 111, 112, 113, 114, 115, 116, 132, 124, 125, + 121, 136, 207, 124, 125, 126, 127, 212, 218, 266, + 132, 132, 134, 270, 100, 136, 132, 670, 139, 135, + 136, 107, 132, 280, 124, 125, 126, 127, 125, 126, + 127, 124, 125, 126, 127, 240, 241, 137, 124, 125, + 126, 127, 299, 347, 137, 128, 132, 128, 128, 306, + 133, 131, 133, 139, 130, 124, 125, 126, 127, 363, + 130, 266, 124, 125, 134, 270, 370, 371, 137, 124, + 125, 126, 127, 330, 124, 280, 128, 334, 335, 336, + 553, 133, 137, 128, 341, 342, 343, 560, 133, 124, + 125, 126, 127, 130, 299, 128, 124, 134, 128, 3, + 133, 306, 137, 133, 313, 314, 315, 316, 317, 318, + 130, 132, 132, 19, 20, 21, 22, 23, 24, 124, + 125, 126, 127, 535, 536, 330, 538, 422, 130, 334, + 335, 336, 427, 424, 128, 697, 341, 342, 343, 133, + 46, 321, 322, 323, 324, 325, 326, 128, 134, 135, + 54, 57, 133, 124, 60, 61, 130, 414, 132, 63, + 64, 65, 66, 67, 68, 124, 125, 71, 72, 687, + 74, 75, 130, 77, 78, 130, 134, 122, 123, 134, + 592, 386, 655, 130, 124, 124, 126, 134, 124, 662, + 124, 125, 124, 125, 100, 191, 129, 193, 126, 127, + 124, 107, 124, 125, 80, 81, 126, 127, 124, 414, + 124, 125, 319, 320, 124, 121, 124, 124, 124, 125, + 126, 127, 124, 124, 130, 124, 132, 124, 124, 882, + 136, 124, 124, 139, 124, 130, 124, 124, 124, 130, + 124, 130, 499, 500, 501, 502, 503, 243, 244, 124, + 19, 20, 21, 249, 124, 124, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 124, 124, 124, 124, 124, 132, 124, 124, 124, 124, + 124, 0, 124, 132, 124, 124, 124, 130, 124, 130, + 124, 60, 61, 130, 499, 500, 501, 502, 503, 130, + 130, 605, 124, 124, 124, 132, 132, 125, 124, 514, + 520, 134, 129, 523, 126, 134, 521, 522, 528, 524, + 525, 526, 527, 126, 529, 125, 531, 532, 533, 534, + 803, 100, 537, 126, 126, 134, 809, 641, 107, 126, + 644, 126, 130, 126, 549, 126, 132, 126, 138, 126, + 132, 135, 121, 119, 134, 124, 125, 126, 127, 134, + 134, 134, 657, 132, 621, 361, 623, 136, 126, 664, + 139, 132, 132, 132, 128, 132, 633, 132, 635, 132, + 132, 638, 120, 124, 641, 132, 591, 644, 132, 646, + 140, 126, 649, 132, 126, 132, 126, 126, 126, 703, + 136, 132, 136, 124, 130, 132, 611, 132, 132, 132, + 124, 108, 134, 131, 134, 411, 621, 134, 623, 134, + 416, 134, 418, 132, 134, 133, 683, 684, 633, 133, + 635, 133, 133, 638, 133, 640, 641, 642, 131, 644, + 645, 646, 131, 648, 649, 133, 131, 112, 743, 753, + 754, 133, 117, 131, 749, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 131, + 131, 131, 131, 124, 124, 124, 132, 124, 683, 684, + 690, 686, 124, 124, 124, 124, 124, 133, 133, 694, + 695, 124, 124, 124, 124, 6, 133, 133, 133, 133, + 128, 852, 131, 124, 131, 131, 131, 131, 446, 124, + 133, 133, 132, 132, 132, 132, 132, 126, 129, 124, + 130, 124, 136, 136, 136, 124, 124, 133, 136, 136, + 131, 124, 136, 124, 530, 131, 124, 124, 133, 124, + 124, 124, 134, 133, 125, 134, 128, 212, 128, 125, + 845, 125, 125, 128, 133, 133, 851, 128, 554, 128, + 556, 128, 124, 133, 124, 561, 124, 133, 133, 133, + 133, 124, 19, 20, 21, 22, 23, 24, 124, 784, + 785, 786, 787, 788, 124, 790, 133, 136, 793, 585, + 133, 133, 797, 137, 133, 131, 137, 125, 132, 46, + 137, 133, 137, 19, 20, 21, 133, 124, 133, 132, + 57, 821, 822, 60, 61, 136, 612, 827, 828, 124, + 136, 125, 124, 124, 124, 133, 622, 125, 624, 125, + 626, 627, 628, 629, 129, 631, 126, 126, 634, 126, + 636, 637, 136, 639, 60, 61, 132, 643, 132, 126, + 133, 647, 133, 100, 133, 651, 652, 19, 20, 21, + 107, 133, 133, 136, 128, 128, 136, 128, 137, 137, + 137, 137, 137, 128, 121, 134, 134, 124, 125, 126, + 127, 129, 125, 133, 100, 132, 128, 133, 128, 6, + 129, 107, 139, 131, 131, 691, 692, 693, 60, 61, + 131, 131, 131, 699, 124, 121, 133, 133, 124, 125, + 126, 127, 19, 20, 21, 133, 132, 133, 133, 124, + 124, 386, 136, 139, 124, 136, 125, 6, 126, 126, + 726, 126, 133, 729, 136, 138, 732, 133, 100, 735, + 132, 128, 128, 136, 138, 107, 137, 128, 128, 128, + 746, 136, 129, 60, 61, 133, 752, 133, 133, 121, + 124, 124, 124, 125, 126, 127, 124, 124, 130, 124, + 132, 124, 768, 124, 124, 285, 137, 139, 137, 688, + 124, 777, 778, 137, 133, 133, 128, 133, 133, 124, + 124, 124, 133, 100, 133, 133, 133, 562, 328, 795, + 107, 174, 97, 618, 800, -1, -1, -1, -1, -1, + -1, 807, -1, -1, 121, -1, -1, 124, 125, 126, + 127, -1, -1, -1, -1, 132, -1, -1, -1, -1, + -1, -1, 139, 829, 830, 831, 832, 833, 834, -1, + 836, -1, 838, -1, -1, 841, 19, 20, 21, 514, + -1, -1, 848, -1, -1, -1, 521, 522, -1, 524, + 525, 526, 527, -1, 529, -1, 531, 532, 533, 534, + -1, -1, 537, -1, -1, -1, -1, -1, -1, -1, + 876, -1, -1, -1, 549, 881, -1, 60, 61, -1, + 886, 887, -1, 889, -1, -1, 892, -1, 894, 895, + -1, 897, -1, 19, 20, 21, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 911, 912, 913, 914, -1, + -1, -1, -1, -1, -1, -1, 591, 100, -1, -1, + -1, -1, -1, -1, 107, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 60, 61, 611, -1, 121, -1, + -1, 124, 125, 126, 127, -1, -1, -1, -1, 132, + -1, -1, -1, -1, -1, -1, 139, -1, -1, -1, + -1, -1, -1, -1, -1, 640, -1, 642, -1, -1, + 645, -1, -1, 648, 100, -1, -1, -1, -1, -1, + -1, 107, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 121, -1, -1, 124, 125, + 126, 127, -1, -1, -1, -1, 132, -1, -1, -1, + -1, 686, -1, 139, -1, -1, -1, -1, -1, 694, + 695, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 868, -1, -1, -1, -1, - 873, -1, -1, -1, -1, 878, -1, 880, -1, 882, - -1, 884, 885, -1, 887, 60, 61, -1, -1, -1, - 414, -1, -1, 514, -1, -1, 899, 900, 901, -1, - 521, 522, -1, 524, 525, 526, 527, -1, 529, -1, - 531, 532, 533, 534, -1, -1, 537, -1, -1, -1, - -1, -1, -1, -1, -1, 100, -1, -1, 549, -1, - -1, -1, 107, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 121, -1, -1, 124, - 125, 126, 127, -1, -1, -1, -1, 132, -1, -1, - -1, -1, -1, -1, 139, -1, -1, -1, -1, -1, - 591, -1, -1, -1, -1, 499, 500, 501, 502, 503, + -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, + -1, -1, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, -1, -1, -1, -1, -1, -1, -1, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + -1, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, -1, 58, 59, -1, -1, 62, -1, -1, 784, + 785, 786, 787, 788, -1, 790, -1, -1, 793, -1, + -1, -1, 797, 79, 80, 81, 82, 83, 84, 85, + 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, + 106, -1, -1, 109, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, + -1, 127, -1, -1, 0, 1, -1, -1, 4, 5, + -1, 137, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, -1, -1, -1, -1, -1, -1, -1, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + -1, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, -1, 58, 59, -1, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 611, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 640, - -1, 642, -1, -1, 645, -1, -1, 648, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 685, -1, -1, -1, -1, -1, - -1, -1, 693, 694, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 621, -1, 623, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 633, - -1, 635, -1, -1, 638, -1, -1, 641, -1, -1, - 644, -1, 646, -1, -1, 649, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 682, 683, - -1, 782, 783, 784, 785, 786, -1, 788, -1, -1, - 791, 4, 5, -1, 795, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, -1, -1, -1, -1, -1, - -1, -1, 25, 26, 27, 28, 29, 30, 31, 32, + -1, -1, -1, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, -1, 101, 102, 103, 104, 105, + 106, 4, 5, 109, -1, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, -1, -1, -1, 124, 125, + 126, 127, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, -1, -1, 62, @@ -1693,53 +1697,30 @@ static const grib_yytype_int16 grib_yycheck[] = -1, -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, - 103, 104, 105, 106, -1, -1, 109, -1, -1, -1, + 103, 104, 105, 106, -1, -1, 109, 4, 5, -1, + -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 124, -1, -1, 127, -1, 129, -1, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + -1, 58, 59, -1, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 124, -1, -1, 127, -1, -1, 0, 1, -1, - -1, 4, 5, -1, 137, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, -1, -1, -1, -1, -1, - -1, -1, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, -1, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, -1, 58, 59, -1, -1, 62, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, - 103, 104, 105, 106, 4, 5, 109, -1, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, -1, -1, - -1, 124, 125, 126, 127, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, -1, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, - -1, -1, 62, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, - 80, 81, 82, 83, 84, 85, 86, 87, -1, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - -1, 101, 102, 103, 104, 105, 106, -1, -1, 109, - 4, 5, -1, -1, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 124, -1, -1, 127, -1, 129, - -1, 25, 26, 27, 28, 29, 30, 31, 32, 33, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, -1, 101, 102, 103, 104, 105, 106, + 4, 5, 109, -1, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, -1, -1, -1, 124, -1, -1, + 127, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, 58, 59, -1, -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 84, 85, 86, 87, -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, -1, 101, 102, 103, - 104, 105, 106, 4, 5, 109, -1, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, -1, -1, -1, - 124, -1, -1, 127, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, -1, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, -1, 58, 59, -1, - -1, 62, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 79, 80, - 81, 82, 83, 84, 85, 86, 87, -1, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, -1, - 101, 102, 103, 104, 105, 106, -1, -1, 109, -1, + 104, 105, 106, -1, -1, 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 124, -1, -1, 127 + 124, -1, -1, 127 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1811,32 +1792,33 @@ static const grib_yytype_uint8 grib_yystos[] = 151, 130, 162, 130, 162, 151, 162, 162, 162, 162, 151, 162, 163, 130, 162, 130, 162, 162, 130, 162, 156, 132, 156, 162, 132, 156, 132, 124, 133, 132, - 128, 137, 162, 125, 136, 124, 170, 163, 125, 163, - 125, 136, 124, 170, 163, 165, 124, 124, 160, 161, - 129, 153, 137, 128, 137, 125, 125, 126, 126, 126, - 133, 163, 132, 132, 162, 156, 108, 173, 174, 136, - 133, 133, 133, 133, 133, 126, 130, 188, 162, 163, - 136, 136, 134, 137, 191, 137, 137, 154, 163, 154, - 163, 137, 163, 163, 163, 163, 137, 163, 154, 163, - 154, 163, 163, 154, 163, 162, 154, 188, 162, 163, - 154, 162, 154, 163, 162, 154, 126, 127, 163, 163, - 128, 170, 128, 133, 137, 128, 128, 170, 128, 133, - 137, 134, 134, 153, 137, 160, 129, 125, 133, 133, - 128, 133, 128, 128, 154, 154, 162, 155, 110, 137, - 174, 151, 163, 163, 163, 162, 162, 150, 129, 163, - 6, 6, 131, 131, 131, 131, 131, 163, 133, 80, - 163, 133, 163, 133, 163, 133, 124, 137, 125, 136, - 163, 124, 124, 137, 125, 136, 163, 188, 188, 6, - 153, 126, 126, 126, 133, 133, 163, 138, 138, 137, - 163, 163, 131, 136, 136, 162, 162, 162, 162, 162, - 162, 132, 162, 163, 162, 128, 133, 163, 128, 170, - 128, 128, 133, 163, 128, 170, 136, 133, 133, 133, - 151, 137, 151, 129, 151, 151, 163, 163, 163, 163, - 163, 163, 124, 163, 163, 124, 163, 124, 137, 124, - 124, 163, 124, 137, 161, 137, 137, 137, 133, 128, - 133, 128, 133, 163, 133, 133, 128, 133, 163, 137, - 163, 124, 163, 124, 163, 163, 163, 124, 163, 133, - 133, 133, 163, 163, 163 + 128, 137, 162, 124, 125, 136, 124, 170, 163, 125, + 163, 125, 136, 124, 170, 163, 165, 124, 124, 160, + 161, 129, 153, 137, 128, 137, 125, 125, 126, 126, + 126, 133, 163, 132, 132, 162, 156, 108, 173, 174, + 136, 133, 133, 133, 133, 133, 126, 130, 188, 162, + 163, 136, 136, 134, 137, 191, 137, 137, 154, 163, + 154, 163, 137, 163, 163, 163, 163, 137, 163, 154, + 163, 154, 163, 163, 154, 163, 162, 154, 188, 162, + 163, 154, 162, 154, 163, 162, 154, 126, 127, 163, + 163, 128, 128, 170, 128, 133, 137, 128, 128, 170, + 128, 133, 137, 134, 134, 153, 137, 160, 129, 125, + 133, 133, 128, 133, 128, 128, 154, 154, 162, 155, + 110, 137, 174, 151, 163, 163, 163, 162, 162, 150, + 129, 163, 6, 6, 131, 131, 131, 131, 131, 163, + 133, 80, 163, 133, 163, 133, 163, 133, 124, 124, + 137, 124, 125, 136, 163, 124, 124, 137, 125, 136, + 163, 188, 188, 6, 153, 126, 126, 126, 133, 133, + 163, 138, 138, 137, 163, 163, 131, 136, 136, 162, + 162, 162, 162, 162, 162, 132, 162, 163, 162, 128, + 128, 133, 163, 128, 128, 170, 128, 128, 133, 163, + 128, 170, 136, 133, 133, 133, 151, 137, 151, 129, + 151, 151, 163, 163, 163, 163, 163, 163, 124, 163, + 163, 124, 124, 163, 124, 124, 137, 124, 124, 163, + 124, 137, 161, 137, 137, 137, 133, 133, 128, 133, + 128, 128, 133, 163, 133, 133, 128, 133, 163, 137, + 163, 163, 124, 163, 124, 124, 163, 163, 163, 124, + 163, 133, 133, 133, 133, 163, 163, 163, 163 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1861,14 +1843,15 @@ static const grib_yytype_uint8 grib_yyr1[] = 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 166, 167, 168, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 170, 170, 171, 171, 172, 172, 173, 173, - 174, 175, 175, 175, 176, 176, 176, 176, 177, 177, - 178, 178, 179, 179, 180, 180, 180, 180, 181, 181, - 181, 181, 181, 181, 181, 181, 181, 182, 182, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 184, 184, 184, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 186, 186, 187, 187, 188, 189, - 189, 190, 190, 191, 191, 192, 193, 194, 194 + 169, 169, 169, 169, 170, 170, 171, 171, 172, 172, + 173, 173, 174, 175, 175, 175, 176, 176, 176, 176, + 177, 177, 178, 178, 179, 179, 180, 180, 180, 180, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 182, + 182, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 184, 184, 184, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 186, 186, 187, 187, + 188, 189, 189, 190, 190, 191, 191, 192, 193, 194, + 194 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1891,16 +1874,17 @@ static const grib_yytype_int8 grib_yyr2[] = 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, 3, 2, 1, 3, 1, 3, 1, 1, 1, - 1, 4, 2, 1, 2, 1, 7, 1, 2 + 1, 1, 8, 7, 7, 6, 9, 12, 12, 14, + 10, 14, 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, 3, 2, 1, 3, 1, 3, 1, + 1, 1, 1, 4, 2, 1, 2, 1, 7, 1, + 2 }; @@ -2367,242 +2351,242 @@ grib_yyreduce: #line 263 "griby.y" { grib_parser_all_actions = 0;grib_parser_concept=0; grib_parser_hash_array=0;grib_parser_rules=0; } -#line 2371 "y.tab.c" +#line 2355 "y.tab.c" break; case 3: /* all: concept_list */ #line 265 "griby.y" { grib_parser_concept = reverse_concept((grib_yyvsp[0].concept_value)); } -#line 2377 "y.tab.c" +#line 2361 "y.tab.c" break; case 4: /* all: hash_array_list */ #line 266 "griby.y" { grib_parser_hash_array = reverse_hash_array((grib_yyvsp[0].hash_array_value)); } -#line 2383 "y.tab.c" +#line 2367 "y.tab.c" break; case 5: /* all: instructions */ #line 267 "griby.y" { grib_parser_all_actions = (grib_yyvsp[0].act); } -#line 2389 "y.tab.c" +#line 2373 "y.tab.c" break; case 6: /* all: rules */ #line 268 "griby.y" { grib_parser_rules = (grib_yyvsp[0].rules); } -#line 2395 "y.tab.c" +#line 2379 "y.tab.c" break; case 7: /* all: error */ #line 270 "griby.y" { grib_parser_all_actions = 0; grib_parser_concept=0; grib_parser_hash_array=0; grib_parser_rules=0; } -#line 2402 "y.tab.c" +#line 2386 "y.tab.c" break; case 9: /* dvalues: FLOAT */ #line 277 "griby.y" { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,0,(grib_yyvsp[0].dval));} -#line 2408 "y.tab.c" +#line 2392 "y.tab.c" break; case 10: /* dvalues: dvalues ',' FLOAT */ #line 278 "griby.y" { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,(grib_yyvsp[-2].dvalue),(grib_yyvsp[0].dval));} -#line 2414 "y.tab.c" +#line 2398 "y.tab.c" break; case 11: /* dvalues: INTEGER */ #line 279 "griby.y" { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,0,(grib_yyvsp[0].lval));} -#line 2420 "y.tab.c" +#line 2404 "y.tab.c" break; case 12: /* dvalues: dvalues ',' INTEGER */ #line 280 "griby.y" { (grib_yyval.dvalue)=grib_darray_push(grib_parser_context,(grib_yyvsp[-2].dvalue),(grib_yyvsp[0].lval));} -#line 2426 "y.tab.c" +#line 2410 "y.tab.c" break; case 13: /* svalues: STRING */ #line 283 "griby.y" { (grib_yyval.svalue)=grib_sarray_push(grib_parser_context,0,(grib_yyvsp[0].str));} -#line 2432 "y.tab.c" +#line 2416 "y.tab.c" break; case 14: /* svalues: svalues ',' STRING */ #line 284 "griby.y" { (grib_yyval.svalue)=grib_sarray_push(grib_parser_context,(grib_yyvsp[-2].svalue),(grib_yyvsp[0].str));} -#line 2438 "y.tab.c" +#line 2422 "y.tab.c" break; case 15: /* integer_array: INTEGER */ #line 288 "griby.y" { (grib_yyval.ivalue)=grib_iarray_push(0,(grib_yyvsp[0].lval));} -#line 2444 "y.tab.c" +#line 2428 "y.tab.c" break; case 16: /* integer_array: integer_array ',' INTEGER */ #line 289 "griby.y" { (grib_yyval.ivalue)=grib_iarray_push((grib_yyvsp[-2].ivalue),(grib_yyvsp[0].lval));} -#line 2450 "y.tab.c" +#line 2434 "y.tab.c" break; case 18: /* instructions: instruction instructions */ #line 293 "griby.y" { (grib_yyvsp[-1].act)->next = (grib_yyvsp[0].act); (grib_yyval.act) = (grib_yyvsp[-1].act); } -#line 2456 "y.tab.c" +#line 2440 "y.tab.c" break; case 19: /* instructions: instruction ';' instructions */ #line 294 "griby.y" { (grib_yyvsp[-2].act)->next = (grib_yyvsp[0].act); (grib_yyval.act) = (grib_yyvsp[-2].act); } -#line 2462 "y.tab.c" +#line 2446 "y.tab.c" break; case 20: /* instructions: instruction ';' */ #line 295 "griby.y" { (grib_yyval.act) = (grib_yyvsp[-1].act);} -#line 2468 "y.tab.c" +#line 2452 "y.tab.c" break; case 32: /* argument_list: empty */ #line 314 "griby.y" { (grib_yyval.explist) = 0; } -#line 2474 "y.tab.c" +#line 2458 "y.tab.c" break; case 35: /* arguments: argument ',' arguments */ #line 319 "griby.y" { (grib_yyvsp[-2].explist)->next = (grib_yyvsp[0].explist); (grib_yyval.explist) = (grib_yyvsp[-2].explist); } -#line 2480 "y.tab.c" +#line 2464 "y.tab.c" break; case 36: /* argument: expression */ #line 322 "griby.y" { (grib_yyval.explist) = grib_arguments_new(grib_parser_context,(grib_yyvsp[0].exp),NULL); } -#line 2486 "y.tab.c" +#line 2470 "y.tab.c" break; case 37: /* simple: UNSIGNED '[' INTEGER ']' IDENT default flags */ #line 327 "griby.y" { (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 2492 "y.tab.c" +#line 2476 "y.tab.c" break; case 38: /* simple: UNSIGNED '[' INTEGER ']' IDENT '[' argument_list ']' default flags */ #line 330 "griby.y" { (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 2498 "y.tab.c" +#line 2482 "y.tab.c" break; case 39: /* simple: UNSIGNED '(' INTEGER ')' IDENT default flags */ #line 333 "griby.y" { (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 2504 "y.tab.c" +#line 2488 "y.tab.c" break; case 40: /* simple: UNSIGNED '(' INTEGER ')' IDENT '[' argument_list ']' default flags */ #line 336 "griby.y" { (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 2510 "y.tab.c" +#line 2494 "y.tab.c" break; case 41: /* simple: ASCII '[' INTEGER ']' IDENT default flags */ #line 339 "griby.y" { (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 2516 "y.tab.c" +#line 2500 "y.tab.c" break; case 42: /* simple: GROUP IDENT default flags */ #line 342 "griby.y" { (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 2522 "y.tab.c" +#line 2506 "y.tab.c" break; case 43: /* simple: GROUP IDENT '(' argument_list ')' default flags */ #line 345 "griby.y" { (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 2528 "y.tab.c" +#line 2512 "y.tab.c" break; case 44: /* simple: IDENT '=' TO_INTEGER '(' argument_list ')' flags */ #line 348 "griby.y" { (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 2534 "y.tab.c" +#line 2518 "y.tab.c" break; case 45: /* simple: IDENT '=' SEX2DEC '(' argument_list ')' flags */ #line 351 "griby.y" { (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 2540 "y.tab.c" +#line 2524 "y.tab.c" break; case 46: /* simple: IDENT '=' TO_STRING '(' argument_list ')' flags */ #line 354 "griby.y" { (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 2546 "y.tab.c" +#line 2530 "y.tab.c" break; case 47: /* simple: NON_ALPHA IDENT default flags */ #line 357 "griby.y" { (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 2552 "y.tab.c" +#line 2536 "y.tab.c" break; case 48: /* simple: ASCII '[' INTEGER ']' STRING default flags */ #line 361 "griby.y" { (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 2558 "y.tab.c" +#line 2542 "y.tab.c" break; case 49: /* simple: BYTE '[' INTEGER ']' IDENT default flags */ #line 364 "griby.y" { (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 2564 "y.tab.c" +#line 2548 "y.tab.c" break; case 50: /* simple: BYTE '[' INTEGER ']' IDENT '[' argument_list ']' default flags */ #line 367 "griby.y" { (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 2570 "y.tab.c" +#line 2554 "y.tab.c" break; case 51: /* simple: KSEC1EXPVER '[' INTEGER ']' IDENT default flags */ #line 370 "griby.y" { (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 2576 "y.tab.c" +#line 2560 "y.tab.c" break; case 52: /* simple: SIGNED '[' INTEGER ']' IDENT default flags */ #line 373 "griby.y" { (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 2582 "y.tab.c" +#line 2566 "y.tab.c" break; case 53: /* simple: SIGNED '[' INTEGER ']' IDENT '[' argument_list ']' default flags */ #line 376 "griby.y" { (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 2588 "y.tab.c" +#line 2572 "y.tab.c" break; case 54: /* simple: SIGNED '(' INTEGER ')' IDENT default flags */ #line 379 "griby.y" { (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 2594 "y.tab.c" +#line 2578 "y.tab.c" break; case 55: /* simple: SIGNED '(' INTEGER ')' IDENT '[' argument_list ']' default flags */ #line 382 "griby.y" { (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 2600 "y.tab.c" +#line 2584 "y.tab.c" break; case 56: /* simple: CODETABLE '[' INTEGER ']' IDENT argument default flags */ #line 385 "griby.y" { (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 2606 "y.tab.c" +#line 2590 "y.tab.c" break; case 57: /* simple: CODETABLE '[' IDENT ']' IDENT argument default flags */ @@ -2616,326 +2600,326 @@ grib_yyreduce: (grib_yyvsp[-1].explist), (grib_yyvsp[0].lval), NULL, NULL); free((grib_yyvsp[-3].str)); } -#line 2620 "y.tab.c" +#line 2604 "y.tab.c" break; case 58: /* simple: CODETABLE '[' INTEGER ']' IDENT argument default SET '(' IDENT ')' flags */ #line 399 "griby.y" { (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 2627 "y.tab.c" +#line 2611 "y.tab.c" break; case 59: /* simple: CODETABLE '[' INTEGER ']' IDENT '(' argument_list ')' default flags */ #line 403 "griby.y" { (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 2633 "y.tab.c" +#line 2617 "y.tab.c" break; case 60: /* simple: SMART_TABLE IDENT '(' argument_list ')' default flags */ #line 406 "griby.y" { (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 2639 "y.tab.c" +#line 2623 "y.tab.c" break; case 61: /* simple: IDENT '=' DICTIONARY '(' argument_list ')' default flags */ #line 409 "griby.y" { (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 2645 "y.tab.c" +#line 2629 "y.tab.c" break; case 62: /* simple: IDENT '=' GETENV '(' argument_list ')' default flags */ #line 412 "griby.y" { (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 2651 "y.tab.c" +#line 2635 "y.tab.c" break; case 63: /* simple: COMPLEX_CODETABLE '[' INTEGER ']' IDENT argument default flags */ #line 415 "griby.y" { (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 2657 "y.tab.c" +#line 2641 "y.tab.c" break; case 64: /* simple: COMPLEX_CODETABLE '[' INTEGER ']' IDENT '(' argument_list ')' default flags */ #line 418 "griby.y" { (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 2663 "y.tab.c" +#line 2647 "y.tab.c" break; case 65: /* simple: FLAG '[' INTEGER ']' IDENT argument default flags */ #line 421 "griby.y" { (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 2669 "y.tab.c" +#line 2653 "y.tab.c" break; case 66: /* simple: LOOKUP '[' INTEGER ']' IDENT '(' argument_list ')' flags */ #line 424 "griby.y" { (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 2675 "y.tab.c" +#line 2659 "y.tab.c" break; case 67: /* simple: FLAGBIT IDENT '(' argument_list ')' default flags */ #line 427 "griby.y" { (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 2681 "y.tab.c" +#line 2665 "y.tab.c" break; case 68: /* simple: LABEL IDENT */ #line 430 "griby.y" { (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 2687 "y.tab.c" +#line 2671 "y.tab.c" break; case 69: /* simple: LABEL STRING */ #line 433 "griby.y" { (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 2693 "y.tab.c" +#line 2677 "y.tab.c" break; case 70: /* simple: IBMFLOAT IDENT default flags */ #line 436 "griby.y" { (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 2699 "y.tab.c" +#line 2683 "y.tab.c" break; case 71: /* simple: INT8 IDENT default flags */ #line 440 "griby.y" { (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 2705 "y.tab.c" +#line 2689 "y.tab.c" break; case 72: /* simple: UINT8 IDENT default flags */ #line 443 "griby.y" { (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 2711 "y.tab.c" +#line 2695 "y.tab.c" break; case 73: /* simple: INT16 IDENT default flags */ #line 446 "griby.y" { (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 2717 "y.tab.c" +#line 2701 "y.tab.c" break; case 74: /* simple: UINT16 IDENT default flags */ #line 449 "griby.y" { (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 2723 "y.tab.c" +#line 2707 "y.tab.c" break; case 75: /* simple: INT16_LITTLE_ENDIAN IDENT default flags */ #line 452 "griby.y" { (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 2729 "y.tab.c" +#line 2713 "y.tab.c" break; case 76: /* simple: UINT16_LITTLE_ENDIAN IDENT default flags */ #line 455 "griby.y" { (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 2735 "y.tab.c" +#line 2719 "y.tab.c" break; case 77: /* simple: INT32 IDENT default flags */ #line 458 "griby.y" { (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 2741 "y.tab.c" +#line 2725 "y.tab.c" break; case 78: /* simple: UINT32 IDENT default flags */ #line 461 "griby.y" { (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 2747 "y.tab.c" +#line 2731 "y.tab.c" break; case 79: /* simple: INT32_LITTLE_ENDIAN IDENT default flags */ #line 464 "griby.y" { (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 2753 "y.tab.c" +#line 2737 "y.tab.c" break; case 80: /* simple: UINT32_LITTLE_ENDIAN IDENT default flags */ #line 467 "griby.y" { (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 2759 "y.tab.c" +#line 2743 "y.tab.c" break; case 81: /* simple: INT64 IDENT default flags */ #line 470 "griby.y" { (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 2765 "y.tab.c" +#line 2749 "y.tab.c" break; case 82: /* simple: UINT64 IDENT default flags */ #line 473 "griby.y" { (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 2771 "y.tab.c" +#line 2755 "y.tab.c" break; case 83: /* simple: INT64_LITTLE_ENDIAN IDENT default flags */ #line 476 "griby.y" { (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 2777 "y.tab.c" +#line 2761 "y.tab.c" break; case 84: /* simple: UINT64_LITTLE_ENDIAN IDENT default flags */ #line 479 "griby.y" { (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 2783 "y.tab.c" +#line 2767 "y.tab.c" break; case 85: /* simple: BLOB IDENT '[' argument_list ']' default flags */ #line 482 "griby.y" { (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 2789 "y.tab.c" +#line 2773 "y.tab.c" break; case 86: /* simple: IBMFLOAT IDENT '.' IDENT default flags */ #line 486 "griby.y" { (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 2795 "y.tab.c" +#line 2779 "y.tab.c" break; case 87: /* simple: IBMFLOAT IDENT '[' argument ']' default flags */ #line 489 "griby.y" { (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 2801 "y.tab.c" +#line 2785 "y.tab.c" break; case 88: /* simple: POS IDENT */ #line 492 "griby.y" { (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 2807 "y.tab.c" +#line 2791 "y.tab.c" break; case 89: /* simple: INTCONST IDENT '=' argument flags */ #line 495 "griby.y" { (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 2813 "y.tab.c" +#line 2797 "y.tab.c" break; case 90: /* simple: TRANS IDENT '=' argument flags */ #line 498 "griby.y" { (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 2819 "y.tab.c" +#line 2803 "y.tab.c" break; case 91: /* simple: TRANS IDENT '=' '{' dvalues '}' flags */ #line 500 "griby.y" { (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 2825 "y.tab.c" +#line 2809 "y.tab.c" break; case 92: /* simple: FLOAT IDENT default flags */ #line 503 "griby.y" { (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 2831 "y.tab.c" +#line 2815 "y.tab.c" break; case 93: /* simple: FLOAT IDENT '.' IDENT default flags */ #line 506 "griby.y" { (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 2837 "y.tab.c" +#line 2821 "y.tab.c" break; case 94: /* simple: FLOAT IDENT '[' argument ']' default flags */ #line 509 "griby.y" { (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 2843 "y.tab.c" +#line 2827 "y.tab.c" break; case 95: /* simple: G1_HALF_BYTE IDENT */ #line 512 "griby.y" { (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 2849 "y.tab.c" +#line 2833 "y.tab.c" break; case 96: /* simple: SECTION_LENGTH '[' INTEGER ']' IDENT default */ #line 515 "griby.y" { (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 2855 "y.tab.c" +#line 2839 "y.tab.c" break; case 97: /* simple: G1_MESSAGE_LENGTH '[' INTEGER ']' IDENT '(' argument_list ')' */ #line 518 "griby.y" { (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 2861 "y.tab.c" +#line 2845 "y.tab.c" break; case 98: /* simple: G1_SECTION4_LENGTH '[' INTEGER ']' IDENT '(' argument_list ')' */ #line 521 "griby.y" { (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 2867 "y.tab.c" +#line 2851 "y.tab.c" break; case 99: /* simple: KSEC IDENT argument */ #line 524 "griby.y" { (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 2873 "y.tab.c" +#line 2857 "y.tab.c" break; case 100: /* simple: PAD IDENT '(' argument_list ')' */ #line 527 "griby.y" { (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 2879 "y.tab.c" +#line 2863 "y.tab.c" break; case 101: /* simple: PADTO IDENT '(' argument_list ')' */ #line 530 "griby.y" { (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 2885 "y.tab.c" +#line 2869 "y.tab.c" break; case 102: /* simple: PADTOEVEN IDENT '(' argument_list ')' */ #line 533 "griby.y" { (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 2891 "y.tab.c" +#line 2875 "y.tab.c" break; case 103: /* simple: PADTOMULTIPLE IDENT '(' argument_list ')' */ #line 536 "griby.y" { (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 2897 "y.tab.c" +#line 2881 "y.tab.c" break; case 104: /* simple: MESSAGE '[' INTEGER ']' IDENT flags */ #line 539 "griby.y" { (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 2903 "y.tab.c" +#line 2887 "y.tab.c" break; case 105: /* simple: MESSAGE_COPY IDENT flags */ #line 542 "griby.y" { (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 2909 "y.tab.c" +#line 2893 "y.tab.c" break; case 106: /* simple: SECTION_PADDING IDENT flags */ #line 545 "griby.y" { (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 2915 "y.tab.c" +#line 2899 "y.tab.c" break; case 107: /* simple: TEMPLATE IDENT STRING */ #line 547 "griby.y" { (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 2921 "y.tab.c" +#line 2905 "y.tab.c" break; case 108: /* simple: TEMPLATE_NOFAIL IDENT STRING */ #line 549 "griby.y" { (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 2927 "y.tab.c" +#line 2911 "y.tab.c" break; case 109: /* simple: ALIAS IDENT '=' IDENT flags */ #line 552 "griby.y" { (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 2933 "y.tab.c" +#line 2917 "y.tab.c" break; case 110: /* simple: UNALIAS IDENT */ #line 555 "griby.y" { (grib_yyval.act) = grib_action_create_alias(grib_parser_context,(grib_yyvsp[0].str),NULL,NULL,0); free((grib_yyvsp[0].str)); } -#line 2939 "y.tab.c" +#line 2923 "y.tab.c" break; case 111: /* simple: ALIAS IDENT '.' IDENT '=' IDENT flags */ @@ -2943,7 +2927,7 @@ grib_yyreduce: { (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 2947 "y.tab.c" +#line 2931 "y.tab.c" break; case 112: /* simple: UNALIAS IDENT '.' IDENT */ @@ -2951,19 +2935,19 @@ grib_yyreduce: { (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 2955 "y.tab.c" +#line 2939 "y.tab.c" break; case 113: /* simple: META IDENT IDENT '(' argument_list ')' default flags */ #line 566 "griby.y" { (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 2961 "y.tab.c" +#line 2945 "y.tab.c" break; case 114: /* simple: META IDENT '.' IDENT IDENT '(' argument_list ')' default flags */ #line 569 "griby.y" { (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 2967 "y.tab.c" +#line 2951 "y.tab.c" break; case 115: /* simple: ITERATOR IDENT '(' argument_list ')' */ @@ -2979,7 +2963,7 @@ grib_yyreduce: "ITERATOR","iterator",a,NULL, GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } -#line 2983 "y.tab.c" +#line 2967 "y.tab.c" break; case 116: /* simple: NEAREST IDENT '(' argument_list ')' */ @@ -2995,7 +2979,7 @@ grib_yyreduce: "NEAREST","nearest",a,NULL, GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } -#line 2999 "y.tab.c" +#line 2983 "y.tab.c" break; case 117: /* simple: BOX IDENT '(' argument_list ')' */ @@ -3011,815 +2995,827 @@ grib_yyreduce: "BOX","box",a,NULL, GRIB_ACCESSOR_FLAG_HIDDEN|GRIB_ACCESSOR_FLAG_READ_ONLY,NULL); free((grib_yyvsp[-3].str)); } -#line 3015 "y.tab.c" +#line 2999 "y.tab.c" break; case 118: /* simple: EXPORT IDENT '(' argument_list ')' */ #line 608 "griby.y" { (grib_yyval.act) = grib_action_create_put(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].explist));free((grib_yyvsp[-3].str));} -#line 3021 "y.tab.c" +#line 3005 "y.tab.c" break; case 119: /* simple: REMOVE argument_list */ #line 611 "griby.y" { (grib_yyval.act) = grib_action_create_remove(grib_parser_context,(grib_yyvsp[0].explist));} -#line 3027 "y.tab.c" +#line 3011 "y.tab.c" break; case 120: /* simple: RENAME '(' IDENT ',' IDENT ')' */ #line 613 "griby.y" { (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 3033 "y.tab.c" +#line 3017 "y.tab.c" break; case 121: /* simple: ASSERT '(' expression ')' */ #line 616 "griby.y" { (grib_yyval.act) = grib_action_create_assert(grib_parser_context,(grib_yyvsp[-1].exp));} -#line 3039 "y.tab.c" +#line 3023 "y.tab.c" break; case 122: /* simple: MODIFY IDENT flags */ #line 619 "griby.y" { (grib_yyval.act) = grib_action_create_modify(grib_parser_context,(grib_yyvsp[-1].str),(grib_yyvsp[0].lval)); free((grib_yyvsp[-1].str));} -#line 3045 "y.tab.c" +#line 3029 "y.tab.c" break; case 123: /* simple: SET IDENT '=' MISSING */ #line 621 "griby.y" { (grib_yyval.act) = grib_action_create_set_missing(grib_parser_context,(grib_yyvsp[-2].str)); free((grib_yyvsp[-2].str)); } -#line 3051 "y.tab.c" +#line 3035 "y.tab.c" break; case 124: /* simple: SET IDENT '=' expression */ #line 622 "griby.y" { (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 3057 "y.tab.c" +#line 3041 "y.tab.c" break; case 125: /* simple: SET IDENT '=' '{' dvalues '}' */ #line 623 "griby.y" { (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 3063 "y.tab.c" +#line 3047 "y.tab.c" break; case 126: /* simple: SET IDENT '=' '{' svalues '}' */ #line 624 "griby.y" { (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 3069 "y.tab.c" +#line 3053 "y.tab.c" break; case 127: /* simple: SET_NOFAIL IDENT '=' expression */ #line 626 "griby.y" { (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 3075 "y.tab.c" +#line 3059 "y.tab.c" break; case 128: /* simple: WRITE STRING */ #line 629 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),0,0); free((grib_yyvsp[0].str));} -#line 3081 "y.tab.c" +#line 3065 "y.tab.c" break; case 129: /* simple: WRITE */ #line 630 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",0,0); } -#line 3087 "y.tab.c" +#line 3071 "y.tab.c" break; case 130: /* simple: WRITE '(' INTEGER ')' STRING */ #line 631 "griby.y" { (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 3093 "y.tab.c" +#line 3077 "y.tab.c" break; case 131: /* simple: WRITE '(' INTEGER ')' */ #line 632 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",0,(grib_yyvsp[-1].lval)); } -#line 3099 "y.tab.c" +#line 3083 "y.tab.c" break; case 132: /* simple: APPEND STRING */ #line 633 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,(grib_yyvsp[0].str),1,0); free((grib_yyvsp[0].str));} -#line 3105 "y.tab.c" +#line 3089 "y.tab.c" break; case 133: /* simple: APPEND */ #line 634 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",1,0); } -#line 3111 "y.tab.c" +#line 3095 "y.tab.c" break; case 134: /* simple: APPEND '(' INTEGER ')' STRING */ #line 635 "griby.y" { (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 3117 "y.tab.c" +#line 3101 "y.tab.c" break; case 135: /* simple: APPEND '(' INTEGER ')' */ #line 636 "griby.y" { (grib_yyval.act) = grib_action_create_write(grib_parser_context,"",1,(grib_yyvsp[-1].lval)); } -#line 3123 "y.tab.c" +#line 3107 "y.tab.c" break; case 136: /* simple: CLOSE '(' IDENT ')' */ #line 638 "griby.y" { (grib_yyval.act) = grib_action_create_close(grib_parser_context,(grib_yyvsp[-1].str)); free((grib_yyvsp[-1].str));} -#line 3129 "y.tab.c" +#line 3113 "y.tab.c" break; case 137: /* simple: PRINT STRING */ #line 639 "griby.y" { (grib_yyval.act) = grib_action_create_print(grib_parser_context,(grib_yyvsp[0].str),0); free((grib_yyvsp[0].str)); } -#line 3135 "y.tab.c" +#line 3119 "y.tab.c" break; case 138: /* simple: PRINT '(' STRING ')' STRING */ #line 640 "griby.y" { (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 3141 "y.tab.c" +#line 3125 "y.tab.c" break; case 139: /* simple: PRINT '(' IDENT ')' STRING */ #line 641 "griby.y" { (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 3147 "y.tab.c" +#line 3131 "y.tab.c" break; case 140: /* simple: PRINT */ #line 642 "griby.y" { (grib_yyval.act) = grib_action_create_print(grib_parser_context,"",0); } -#line 3153 "y.tab.c" +#line 3137 "y.tab.c" break; case 141: /* if_block: IF '(' expression ')' '{' instructions '}' */ #line 646 "griby.y" { (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 3159 "y.tab.c" +#line 3143 "y.tab.c" break; case 142: /* if_block: IF '(' expression ')' '{' instructions '}' ELSE '{' instructions '}' */ #line 647 "griby.y" { (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 3165 "y.tab.c" +#line 3149 "y.tab.c" break; case 143: /* if_block: IF_TRANSIENT '(' expression ')' '{' instructions '}' */ #line 648 "griby.y" { (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 3171 "y.tab.c" +#line 3155 "y.tab.c" break; case 144: /* if_block: IF_TRANSIENT '(' expression ')' '{' instructions '}' ELSE '{' instructions '}' */ #line 649 "griby.y" { (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 3177 "y.tab.c" +#line 3161 "y.tab.c" break; case 145: /* when_block: WHEN '(' expression ')' set semi */ #line 653 "griby.y" { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-3].exp),(grib_yyvsp[-1].act),NULL); } -#line 3183 "y.tab.c" +#line 3167 "y.tab.c" break; case 146: /* when_block: WHEN '(' expression ')' '{' set_list '}' */ #line 654 "griby.y" { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act),NULL); } -#line 3189 "y.tab.c" +#line 3173 "y.tab.c" break; case 147: /* when_block: WHEN '(' expression ')' '{' set_list '}' ELSE '{' set_list '}' */ #line 655 "griby.y" { (grib_yyval.act) = grib_action_create_when(grib_parser_context,(grib_yyvsp[-8].exp),(grib_yyvsp[-5].act),(grib_yyvsp[-1].act)); } -#line 3195 "y.tab.c" +#line 3179 "y.tab.c" break; case 148: /* set: SET IDENT '=' expression */ #line 658 "griby.y" { (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 3201 "y.tab.c" +#line 3185 "y.tab.c" break; case 149: /* set: SET_NOFAIL IDENT '=' expression */ #line 659 "griby.y" { (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 3207 "y.tab.c" +#line 3191 "y.tab.c" break; case 151: /* set_list: set_list set semi */ #line 663 "griby.y" { (grib_yyvsp[-2].act)->next = (grib_yyvsp[-1].act); (grib_yyval.act) = (grib_yyvsp[-2].act); } -#line 3213 "y.tab.c" +#line 3197 "y.tab.c" break; case 152: /* default: empty */ #line 667 "griby.y" { (grib_yyval.explist) = NULL ;} -#line 3219 "y.tab.c" +#line 3203 "y.tab.c" break; case 153: /* default: '=' argument_list */ #line 668 "griby.y" { (grib_yyval.explist) = (grib_yyvsp[0].explist) ;} -#line 3225 "y.tab.c" +#line 3209 "y.tab.c" break; case 154: /* flags: empty */ #line 671 "griby.y" { (grib_yyval.lval) = 0 ; } -#line 3231 "y.tab.c" +#line 3215 "y.tab.c" break; case 155: /* flags: ':' flag_list */ #line 672 "griby.y" { (grib_yyval.lval) = (grib_yyvsp[0].lval); } -#line 3237 "y.tab.c" +#line 3221 "y.tab.c" break; case 157: /* flag_list: flag_list ',' flag */ #line 676 "griby.y" { (grib_yyval.lval) = (grib_yyvsp[-2].lval) | (grib_yyvsp[0].lval); } -#line 3243 "y.tab.c" +#line 3227 "y.tab.c" break; case 158: /* flag: READ_ONLY */ #line 679 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_READ_ONLY; } -#line 3249 "y.tab.c" +#line 3233 "y.tab.c" break; case 159: /* flag: LOWERCASE */ #line 680 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_LOWERCASE; } -#line 3255 "y.tab.c" +#line 3239 "y.tab.c" break; case 160: /* flag: DUMP */ #line 681 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_DUMP; } -#line 3261 "y.tab.c" +#line 3245 "y.tab.c" break; case 161: /* flag: NO_COPY */ #line 682 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_NO_COPY; } -#line 3267 "y.tab.c" +#line 3251 "y.tab.c" break; case 162: /* flag: NO_FAIL */ #line 683 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_NO_FAIL; } -#line 3273 "y.tab.c" +#line 3257 "y.tab.c" break; case 163: /* flag: HIDDEN */ #line 684 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_HIDDEN; } -#line 3279 "y.tab.c" +#line 3263 "y.tab.c" break; case 164: /* flag: EDITION_SPECIFIC */ #line 685 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_EDITION_SPECIFIC; } -#line 3285 "y.tab.c" +#line 3269 "y.tab.c" break; case 165: /* flag: CAN_BE_MISSING */ #line 686 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_CAN_BE_MISSING; } -#line 3291 "y.tab.c" +#line 3275 "y.tab.c" break; case 166: /* flag: CONSTRAINT */ #line 687 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_CONSTRAINT; } -#line 3297 "y.tab.c" +#line 3281 "y.tab.c" break; case 167: /* flag: COPY_OK */ #line 688 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_COPY_OK; } -#line 3303 "y.tab.c" +#line 3287 "y.tab.c" break; case 168: /* flag: TRANS */ #line 689 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_TRANSIENT; } -#line 3309 "y.tab.c" +#line 3293 "y.tab.c" break; case 169: /* flag: STRING_TYPE */ #line 690 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_STRING_TYPE; } -#line 3315 "y.tab.c" +#line 3299 "y.tab.c" break; case 170: /* flag: LONG_TYPE */ #line 691 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_LONG_TYPE; } -#line 3321 "y.tab.c" +#line 3305 "y.tab.c" break; case 171: /* flag: DOUBLE_TYPE */ #line 692 "griby.y" { (grib_yyval.lval) = GRIB_ACCESSOR_FLAG_DOUBLE_TYPE; } -#line 3327 "y.tab.c" +#line 3311 "y.tab.c" break; case 172: /* list_block: IDENT LIST '(' expression ')' '{' instructions '}' */ #line 695 "griby.y" { (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 3333 "y.tab.c" +#line 3317 "y.tab.c" break; case 173: /* while_block: WHILE '(' expression ')' '{' instructions '}' */ #line 698 "griby.y" { (grib_yyval.act) = grib_action_create_while(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].act)); } -#line 3339 "y.tab.c" +#line 3323 "y.tab.c" break; case 174: /* trigger_block: TRIGGER '(' argument_list ')' '{' instructions '}' */ #line 701 "griby.y" { (grib_yyval.act) = grib_action_create_trigger(grib_parser_context,(grib_yyvsp[-4].explist),(grib_yyvsp[-1].act)); } -#line 3345 "y.tab.c" +#line 3329 "y.tab.c" break; case 175: /* concept_block: CONCEPT IDENT '{' concept_list '}' flags */ #line 704 "griby.y" { (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 3351 "y.tab.c" +#line 3335 "y.tab.c" break; case 176: /* concept_block: CONCEPT IDENT '(' IDENT ')' '{' concept_list '}' flags */ #line 705 "griby.y" { (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 3357 "y.tab.c" +#line 3341 "y.tab.c" break; case 177: /* concept_block: CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 706 "griby.y" - { (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 3363 "y.tab.c" + { (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 3347 "y.tab.c" break; - case 178: /* concept_block: CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ',' IDENT ')' flags */ + case 178: /* concept_block: CONCEPT IDENT '(' IDENT ',' IDENT ',' IDENT ',' IDENT ')' flags */ #line 707 "griby.y" - { (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 3369 "y.tab.c" + { (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 3353 "y.tab.c" break; - case 179: /* concept_block: CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ + case 179: /* concept_block: CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ',' IDENT ')' flags */ #line 708 "griby.y" - { (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 3375 "y.tab.c" + { (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 3359 "y.tab.c" break; - case 180: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ + case 180: /* concept_block: CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ #line 709 "griby.y" - { (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 3381 "y.tab.c" + { (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 3365 "y.tab.c" break; - case 181: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ -#line 710 "griby.y" - { (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 3387 "y.tab.c" - break; - - case 182: /* concept_block: CONCEPT IDENT '.' IDENT '{' concept_list '}' flags */ + case 181: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 711 "griby.y" - { (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 3393 "y.tab.c" + { (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 3371 "y.tab.c" break; - case 183: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ')' '{' concept_list '}' flags */ + case 182: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ',' IDENT ',' IDENT ',' IDENT ')' flags */ #line 712 "griby.y" - { (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 3399 "y.tab.c" + { (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 3377 "y.tab.c" break; - case 184: /* concept_block: CONCEPT_NOFAIL IDENT '{' concept_list '}' flags */ + case 183: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ #line 713 "griby.y" - { (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 3405 "y.tab.c" + { (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 3383 "y.tab.c" break; - case 185: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ')' '{' concept_list '}' flags */ + case 184: /* concept_block: CONCEPT IDENT '.' IDENT '{' concept_list '}' flags */ #line 714 "griby.y" - { (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 3411 "y.tab.c" + { (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 3389 "y.tab.c" break; - case 186: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ + case 185: /* concept_block: CONCEPT IDENT '.' IDENT '(' IDENT ')' '{' concept_list '}' flags */ #line 715 "griby.y" - { (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 3417 "y.tab.c" + { (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 3395 "y.tab.c" break; - case 187: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ -#line 716 "griby.y" - { (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 3423 "y.tab.c" - break; - - case 188: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ + case 186: /* concept_block: CONCEPT_NOFAIL IDENT '{' concept_list '}' flags */ #line 717 "griby.y" - { (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 3429 "y.tab.c" + { (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 3401 "y.tab.c" break; - case 189: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ + case 187: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ')' '{' concept_list '}' flags */ #line 718 "griby.y" - { (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 3435 "y.tab.c" + { (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 3407 "y.tab.c" break; - case 190: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '{' concept_list '}' flags */ + case 188: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 719 "griby.y" - { (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 3441 "y.tab.c" + { (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 3413 "y.tab.c" break; - case 191: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ')' '{' concept_list '}' flags */ + case 189: /* concept_block: CONCEPT_NOFAIL IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ #line 720 "griby.y" + { (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 3419 "y.tab.c" + break; + + case 190: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ +#line 721 "griby.y" + { (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 3425 "y.tab.c" + break; + + case 191: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ')' flags */ +#line 722 "griby.y" + { (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 3431 "y.tab.c" + break; + + case 192: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '{' concept_list '}' flags */ +#line 723 "griby.y" + { (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 3437 "y.tab.c" + break; + + case 193: /* concept_block: CONCEPT_NOFAIL IDENT '.' IDENT '(' IDENT ')' '{' concept_list '}' flags */ +#line 724 "griby.y" { (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 3447 "y.tab.c" +#line 3443 "y.tab.c" break; - case 193: /* concept_list: concept_list concept_value */ -#line 725 "griby.y" - { (grib_yyval.concept_value) = (grib_yyvsp[0].concept_value); (grib_yyvsp[0].concept_value)->next = (grib_yyvsp[-1].concept_value); } -#line 3453 "y.tab.c" - break; - - case 195: /* hash_array_list: hash_array_list hash_array_value */ + case 195: /* concept_list: concept_list concept_value */ #line 729 "griby.y" - { (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 3459 "y.tab.c" + { (grib_yyval.concept_value) = (grib_yyvsp[0].concept_value); (grib_yyvsp[0].concept_value)->next = (grib_yyvsp[-1].concept_value); } +#line 3449 "y.tab.c" break; - case 196: /* hash_array_block: HASH_ARRAY IDENT '{' hash_array_list '}' flags */ -#line 732 "griby.y" - { (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 3465 "y.tab.c" - break; - - case 197: /* hash_array_block: HASH_ARRAY IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ + case 197: /* hash_array_list: hash_array_list hash_array_value */ #line 733 "griby.y" - { (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 3471 "y.tab.c" + { (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 3455 "y.tab.c" break; - case 199: /* case_list: case_list case_value */ + case 198: /* hash_array_block: HASH_ARRAY IDENT '{' hash_array_list '}' flags */ +#line 736 "griby.y" + { (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 3461 "y.tab.c" + break; + + case 199: /* hash_array_block: HASH_ARRAY IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags */ #line 737 "griby.y" + { (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 3467 "y.tab.c" + break; + + case 201: /* case_list: case_list case_value */ +#line 741 "griby.y" { (grib_yyval.case_value) = (grib_yyvsp[0].case_value); (grib_yyvsp[0].case_value)->next = (grib_yyvsp[-1].case_value); } -#line 3477 "y.tab.c" +#line 3473 "y.tab.c" break; - case 200: /* case_value: CASE arguments ':' instructions */ -#line 740 "griby.y" - { (grib_yyval.case_value) = grib_case_new(grib_parser_context,(grib_yyvsp[-2].explist),(grib_yyvsp[0].act)); } -#line 3483 "y.tab.c" - break; - - case 201: /* switch_block: SWITCH '(' argument_list ')' '{' case_list DEFAULT ':' instructions '}' */ + case 202: /* case_value: CASE arguments ':' instructions */ #line 744 "griby.y" + { (grib_yyval.case_value) = grib_case_new(grib_parser_context,(grib_yyvsp[-2].explist),(grib_yyvsp[0].act)); } +#line 3479 "y.tab.c" + break; + + case 203: /* switch_block: SWITCH '(' argument_list ')' '{' case_list DEFAULT ':' instructions '}' */ +#line 748 "griby.y" { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-7].explist),(grib_yyvsp[-4].case_value),(grib_yyvsp[-1].act)); } -#line 3489 "y.tab.c" +#line 3485 "y.tab.c" break; - case 202: /* switch_block: SWITCH '(' argument_list ')' '{' case_list DEFAULT ':' '}' */ -#line 745 "griby.y" - { (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 3495 "y.tab.c" - break; - - case 203: /* switch_block: SWITCH '(' argument_list ')' '{' case_list '}' */ -#line 746 "griby.y" - { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-4].explist),(grib_yyvsp[-1].case_value),0); } -#line 3501 "y.tab.c" - break; - - case 204: /* concept_value: STRING '=' '{' concept_conditions '}' */ + case 204: /* switch_block: SWITCH '(' argument_list ')' '{' case_list DEFAULT ':' '}' */ #line 749 "griby.y" + { (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 3491 "y.tab.c" + break; + + case 205: /* switch_block: SWITCH '(' argument_list ')' '{' case_list '}' */ +#line 750 "griby.y" + { (grib_yyval.act) = grib_action_create_switch(grib_parser_context,(grib_yyvsp[-4].explist),(grib_yyvsp[-1].case_value),0); } +#line 3497 "y.tab.c" + break; + + case 206: /* concept_value: STRING '=' '{' concept_conditions '}' */ +#line 753 "griby.y" { (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 3508 "y.tab.c" +#line 3504 "y.tab.c" break; - case 205: /* concept_value: IDENT '=' '{' concept_conditions '}' */ -#line 751 "griby.y" - { - (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 3515 "y.tab.c" - break; - - case 206: /* concept_value: INTEGER '=' '{' concept_conditions '}' */ -#line 753 "griby.y" - { - char buf[80]; snprintf(buf, sizeof(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 3522 "y.tab.c" - break; - - case 207: /* concept_value: FLOAT '=' '{' concept_conditions '}' */ + case 207: /* concept_value: IDENT '=' '{' concept_conditions '}' */ #line 755 "griby.y" { + (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 208: /* concept_value: INTEGER '=' '{' concept_conditions '}' */ +#line 757 "griby.y" + { + char buf[80]; snprintf(buf, sizeof(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 3518 "y.tab.c" + break; + + case 209: /* concept_value: FLOAT '=' '{' concept_conditions '}' */ +#line 759 "griby.y" + { char buf[80]; snprintf(buf, sizeof(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 3529 "y.tab.c" +#line 3525 "y.tab.c" break; - case 209: /* concept_conditions: concept_condition concept_conditions */ -#line 760 "griby.y" - { (grib_yyvsp[-1].concept_condition)->next = (grib_yyvsp[0].concept_condition); (grib_yyval.concept_condition) = (grib_yyvsp[-1].concept_condition); } -#line 3535 "y.tab.c" - break; - - case 210: /* concept_condition: IDENT '=' expression ';' */ -#line 763 "griby.y" - { (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 3541 "y.tab.c" - break; - - case 211: /* concept_condition: IDENT '=' '[' integer_array ']' ';' */ + case 211: /* concept_conditions: concept_condition concept_conditions */ #line 764 "griby.y" - { (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 3547 "y.tab.c" + { (grib_yyvsp[-1].concept_condition)->next = (grib_yyvsp[0].concept_condition); (grib_yyval.concept_condition) = (grib_yyvsp[-1].concept_condition); } +#line 3531 "y.tab.c" break; - case 212: /* hash_array_value: STRING '=' '[' integer_array ']' */ + case 212: /* concept_condition: IDENT '=' expression ';' */ +#line 767 "griby.y" + { (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 3537 "y.tab.c" + break; + + case 213: /* concept_condition: IDENT '=' '[' integer_array ']' ';' */ #line 768 "griby.y" + { (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 3543 "y.tab.c" + break; + + case 214: /* hash_array_value: STRING '=' '[' integer_array ']' */ +#line 772 "griby.y" { (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 3554 "y.tab.c" +#line 3550 "y.tab.c" break; - case 213: /* hash_array_value: IDENT '=' '[' integer_array ']' */ -#line 770 "griby.y" + case 215: /* hash_array_value: IDENT '=' '[' integer_array ']' */ +#line 774 "griby.y" { (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 3561 "y.tab.c" +#line 3557 "y.tab.c" break; - case 214: /* string_or_ident: SUBSTR '(' IDENT ',' INTEGER ',' INTEGER ')' */ -#line 774 "griby.y" + case 216: /* string_or_ident: SUBSTR '(' IDENT ',' INTEGER ',' INTEGER ')' */ +#line 778 "griby.y" { (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 3567 "y.tab.c" +#line 3563 "y.tab.c" break; - case 215: /* string_or_ident: IDENT */ -#line 775 "griby.y" + case 217: /* string_or_ident: IDENT */ +#line 779 "griby.y" { (grib_yyval.exp) = new_accessor_expression(grib_parser_context,(grib_yyvsp[0].str),0,0); free((grib_yyvsp[0].str)); } -#line 3573 "y.tab.c" +#line 3569 "y.tab.c" break; - case 216: /* string_or_ident: SUBSTR '(' STRING ',' INTEGER ',' INTEGER ')' */ -#line 776 "griby.y" + case 218: /* string_or_ident: SUBSTR '(' STRING ',' INTEGER ',' INTEGER ')' */ +#line 780 "griby.y" { (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 3579 "y.tab.c" +#line 3575 "y.tab.c" break; - case 217: /* string_or_ident: STRING */ -#line 777 "griby.y" - { (grib_yyval.exp) = new_string_expression(grib_parser_context,(grib_yyvsp[0].str)); free((grib_yyvsp[0].str)); } -#line 3585 "y.tab.c" - break; - - case 219: /* atom: INTEGER */ + case 219: /* string_or_ident: STRING */ #line 781 "griby.y" - { (grib_yyval.exp) = new_long_expression(grib_parser_context,(grib_yyvsp[0].lval)); } -#line 3591 "y.tab.c" + { (grib_yyval.exp) = new_string_expression(grib_parser_context,(grib_yyvsp[0].str)); free((grib_yyvsp[0].str)); } +#line 3581 "y.tab.c" break; - case 220: /* atom: FLOAT */ -#line 782 "griby.y" - { (grib_yyval.exp) = new_double_expression(grib_parser_context,(grib_yyvsp[0].dval)); /* TODO: change to new_float_expression*/} -#line 3597 "y.tab.c" - break; - - case 221: /* atom: NIL */ -#line 784 "griby.y" - { (grib_yyval.exp) = NULL; } -#line 3603 "y.tab.c" - break; - - case 222: /* atom: DUMMY */ + case 221: /* atom: INTEGER */ #line 785 "griby.y" - { (grib_yyval.exp) = new_true_expression(grib_parser_context); } -#line 3609 "y.tab.c" + { (grib_yyval.exp) = new_long_expression(grib_parser_context,(grib_yyvsp[0].lval)); } +#line 3587 "y.tab.c" break; - case 223: /* atom: '(' expression ')' */ + case 222: /* atom: FLOAT */ #line 786 "griby.y" - { (grib_yyval.exp) = (grib_yyvsp[-1].exp); } -#line 3615 "y.tab.c" + { (grib_yyval.exp) = new_double_expression(grib_parser_context,(grib_yyvsp[0].dval)); /* TODO: change to new_float_expression*/} +#line 3593 "y.tab.c" break; - case 224: /* atom: '-' atom */ -#line 787 "griby.y" - { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_neg,&grib_op_neg_d,(grib_yyvsp[0].exp)); } -#line 3621 "y.tab.c" - break; - - case 225: /* atom: IDENT '(' ')' */ + case 223: /* atom: NIL */ #line 788 "griby.y" - { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[-2].str),NULL); free((grib_yyvsp[-2].str));} -#line 3627 "y.tab.c" + { (grib_yyval.exp) = NULL; } +#line 3599 "y.tab.c" break; - case 226: /* atom: IDENT '(' argument_list ')' */ + case 224: /* atom: DUMMY */ #line 789 "griby.y" - { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].explist)); free((grib_yyvsp[-3].str));} -#line 3633 "y.tab.c" + { (grib_yyval.exp) = new_true_expression(grib_parser_context); } +#line 3605 "y.tab.c" break; - case 227: /* power: atom '^' power */ + case 225: /* atom: '(' expression ')' */ +#line 790 "griby.y" + { (grib_yyval.exp) = (grib_yyvsp[-1].exp); } +#line 3611 "y.tab.c" + break; + + case 226: /* atom: '-' atom */ +#line 791 "griby.y" + { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_neg,&grib_op_neg_d,(grib_yyvsp[0].exp)); } +#line 3617 "y.tab.c" + break; + + case 227: /* atom: IDENT '(' ')' */ +#line 792 "griby.y" + { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[-2].str),NULL); free((grib_yyvsp[-2].str));} +#line 3623 "y.tab.c" + break; + + case 228: /* atom: IDENT '(' argument_list ')' */ #line 793 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_pow,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3639 "y.tab.c" + { (grib_yyval.exp) = new_func_expression(grib_parser_context,(grib_yyvsp[-3].str),(grib_yyvsp[-1].explist)); free((grib_yyvsp[-3].str));} +#line 3629 "y.tab.c" break; - case 229: /* factor: factor '*' power */ + case 229: /* power: atom '^' power */ #line 797 "griby.y" - { (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 3645 "y.tab.c" + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_pow,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3635 "y.tab.c" break; - case 230: /* factor: factor '/' power */ -#line 798 "griby.y" - { (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 3651 "y.tab.c" - break; - - case 231: /* factor: factor '%' power */ -#line 799 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_modulo,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3657 "y.tab.c" - break; - - case 232: /* factor: factor BIT power */ -#line 800 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bit,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3663 "y.tab.c" - break; - - case 233: /* factor: factor BITOFF power */ + case 231: /* factor: factor '*' power */ #line 801 "griby.y" - { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bitoff,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3669 "y.tab.c" + { (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 3641 "y.tab.c" break; - case 235: /* factor: LENGTH '(' IDENT ')' */ + case 232: /* factor: factor '/' power */ +#line 802 "griby.y" + { (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 3647 "y.tab.c" + break; + + case 233: /* factor: factor '%' power */ #line 803 "griby.y" - { (grib_yyval.exp) = new_length_expression(grib_parser_context,(grib_yyvsp[-1].str)); free((grib_yyvsp[-1].str));} -#line 3675 "y.tab.c" + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_modulo,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3653 "y.tab.c" break; - case 236: /* factor: IS_IN_LIST '(' IDENT ',' STRING ')' */ + case 234: /* factor: factor BIT power */ #line 804 "griby.y" - { (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 3681 "y.tab.c" + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bit,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3659 "y.tab.c" break; - case 237: /* factor: IS_IN_DICT '(' IDENT ',' STRING ')' */ + case 235: /* factor: factor BITOFF power */ #line 805 "griby.y" - { (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 3687 "y.tab.c" + { (grib_yyval.exp) = new_binop_expression(grib_parser_context,&grib_op_bitoff,NULL,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3665 "y.tab.c" break; - case 238: /* factor: IS_INTEGER '(' IDENT ',' INTEGER ')' */ -#line 806 "griby.y" - { (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 3693 "y.tab.c" - break; - - case 239: /* factor: IS_INTEGER '(' IDENT ',' INTEGER ',' INTEGER ')' */ + case 237: /* factor: LENGTH '(' IDENT ')' */ #line 807 "griby.y" - { (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 3699 "y.tab.c" + { (grib_yyval.exp) = new_length_expression(grib_parser_context,(grib_yyvsp[-1].str)); free((grib_yyvsp[-1].str));} +#line 3671 "y.tab.c" break; - case 240: /* factor: IS_INTEGER '(' IDENT ')' */ + case 238: /* factor: IS_IN_LIST '(' IDENT ',' STRING ')' */ #line 808 "griby.y" - { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[-1].str),0,0); free((grib_yyvsp[-1].str));} -#line 3705 "y.tab.c" + { (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 3677 "y.tab.c" break; - case 241: /* term: term '+' factor */ + case 239: /* factor: IS_IN_DICT '(' IDENT ',' STRING ')' */ +#line 809 "griby.y" + { (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 3683 "y.tab.c" + break; + + case 240: /* factor: IS_INTEGER '(' IDENT ',' INTEGER ')' */ +#line 810 "griby.y" + { (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 3689 "y.tab.c" + break; + + case 241: /* factor: IS_INTEGER '(' IDENT ',' INTEGER ',' INTEGER ')' */ #line 811 "griby.y" - { (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 3711 "y.tab.c" + { (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 3695 "y.tab.c" break; - case 242: /* term: term '-' factor */ + case 242: /* factor: IS_INTEGER '(' IDENT ')' */ #line 812 "griby.y" - { (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 3717 "y.tab.c" + { (grib_yyval.exp) = new_is_integer_expression(grib_parser_context,(grib_yyvsp[-1].str),0,0); free((grib_yyvsp[-1].str));} +#line 3701 "y.tab.c" break; - case 244: /* condition: condition GT term */ + case 243: /* term: term '+' factor */ +#line 815 "griby.y" + { (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 3707 "y.tab.c" + break; + + case 244: /* term: term '-' factor */ #line 816 "griby.y" - { (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 3723 "y.tab.c" + { (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 3713 "y.tab.c" break; - case 245: /* condition: condition EQ term */ -#line 818 "griby.y" - { (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 3729 "y.tab.c" - break; - - case 246: /* condition: condition LT term */ -#line 819 "griby.y" - { (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 3735 "y.tab.c" - break; - - case 247: /* condition: condition GE term */ + case 246: /* condition: condition GT term */ #line 820 "griby.y" - { (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 3741 "y.tab.c" + { (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 3719 "y.tab.c" break; - case 248: /* condition: condition LE term */ -#line 821 "griby.y" - { (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 3747 "y.tab.c" - break; - - case 249: /* condition: condition NE term */ + case 247: /* condition: condition EQ term */ #line 822 "griby.y" - { (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 3753 "y.tab.c" + { (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 3725 "y.tab.c" break; - case 250: /* condition: string_or_ident IS string_or_ident */ + case 248: /* condition: condition LT term */ #line 823 "griby.y" - { (grib_yyval.exp) = new_string_compare_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp),1); } -#line 3759 "y.tab.c" + { (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 3731 "y.tab.c" break; - case 251: /* condition: string_or_ident ISNOT string_or_ident */ + case 249: /* condition: condition GE term */ #line 824 "griby.y" + { (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 3737 "y.tab.c" + break; + + case 250: /* condition: condition LE term */ +#line 825 "griby.y" + { (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 3743 "y.tab.c" + break; + + case 251: /* condition: condition NE term */ +#line 826 "griby.y" + { (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 3749 "y.tab.c" + break; + + case 252: /* condition: string_or_ident IS string_or_ident */ +#line 827 "griby.y" + { (grib_yyval.exp) = new_string_compare_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp),1); } +#line 3755 "y.tab.c" + break; + + case 253: /* condition: string_or_ident ISNOT string_or_ident */ +#line 828 "griby.y" { (grib_yyval.exp) = new_string_compare_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp),0); } -#line 3765 "y.tab.c" +#line 3761 "y.tab.c" break; - case 252: /* condition: NOT condition */ -#line 829 "griby.y" - { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_not,NULL,(grib_yyvsp[0].exp)); } -#line 3771 "y.tab.c" - break; - - case 254: /* conjunction: conjunction AND condition */ + case 254: /* condition: NOT condition */ #line 833 "griby.y" - { (grib_yyval.exp) = new_logical_and_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } -#line 3777 "y.tab.c" + { (grib_yyval.exp) = new_unop_expression(grib_parser_context,&grib_op_not,NULL,(grib_yyvsp[0].exp)); } +#line 3767 "y.tab.c" break; - case 256: /* disjunction: disjunction OR conjunction */ + case 256: /* conjunction: conjunction AND condition */ #line 837 "griby.y" + { (grib_yyval.exp) = new_logical_and_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp)); } +#line 3773 "y.tab.c" + break; + + case 258: /* disjunction: disjunction OR conjunction */ +#line 841 "griby.y" { (grib_yyval.exp) = new_logical_or_expression(grib_parser_context,(grib_yyvsp[-2].exp),(grib_yyvsp[0].exp));} -#line 3783 "y.tab.c" +#line 3779 "y.tab.c" break; - case 261: /* rule_entry: IDENT '=' expression ';' */ -#line 851 "griby.y" + case 263: /* rule_entry: IDENT '=' expression ';' */ +#line 855 "griby.y" { (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 3789 "y.tab.c" +#line 3785 "y.tab.c" break; - case 262: /* rule_entry: SKIP ';' */ -#line 852 "griby.y" - { (grib_yyval.rule_entry) = grib_new_rule_entry(grib_parser_context,"skip",0);} -#line 3795 "y.tab.c" - break; - - case 264: /* rule_entries: rule_entry rule_entries */ + case 264: /* rule_entry: SKIP ';' */ #line 856 "griby.y" + { (grib_yyval.rule_entry) = grib_new_rule_entry(grib_parser_context,"skip",0);} +#line 3791 "y.tab.c" + break; + + case 266: /* rule_entries: rule_entry rule_entries */ +#line 860 "griby.y" { (grib_yyvsp[-1].rule_entry)->next = (grib_yyvsp[0].rule_entry); (grib_yyval.rule_entry) = (grib_yyvsp[-1].rule_entry); } -#line 3801 "y.tab.c" +#line 3797 "y.tab.c" break; - case 265: /* fact: rule_entry */ -#line 859 "griby.y" - { (grib_yyval.rules) = grib_new_rule(grib_parser_context,NULL,(grib_yyvsp[0].rule_entry)); } -#line 3807 "y.tab.c" - break; - - case 266: /* conditional_rule: IF '(' expression ')' '{' rule_entries '}' */ + case 267: /* fact: rule_entry */ #line 863 "griby.y" - { (grib_yyval.rules) = grib_new_rule(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].rule_entry)); } -#line 3813 "y.tab.c" + { (grib_yyval.rules) = grib_new_rule(grib_parser_context,NULL,(grib_yyvsp[0].rule_entry)); } +#line 3803 "y.tab.c" break; - case 268: /* rules: rule rules */ + case 268: /* conditional_rule: IF '(' expression ')' '{' rule_entries '}' */ #line 867 "griby.y" + { (grib_yyval.rules) = grib_new_rule(grib_parser_context,(grib_yyvsp[-4].exp),(grib_yyvsp[-1].rule_entry)); } +#line 3809 "y.tab.c" + break; + + case 270: /* rules: rule rules */ +#line 871 "griby.y" { (grib_yyvsp[-1].rules)->next = (grib_yyvsp[0].rules); (grib_yyval.rules) = (grib_yyvsp[-1].rules); } -#line 3819 "y.tab.c" +#line 3815 "y.tab.c" break; -#line 3823 "y.tab.c" +#line 3819 "y.tab.c" default: break; } @@ -4012,7 +4008,7 @@ grib_yyreturnlab: return grib_yyresult; } -#line 871 "griby.y" +#line 875 "griby.y" static grib_concept_value *_reverse_concept(grib_concept_value *r,grib_concept_value *s) diff --git a/src/griby.y b/src/griby.y index 213843240..c1bcff69d 100644 --- a/src/griby.y +++ b/src/griby.y @@ -703,13 +703,17 @@ trigger_block: TRIGGER '(' argument_list ')' '{' instructions '}' { $$ = grib_ac concept_block: CONCEPT IDENT '{' concept_list '}' flags { $$ = grib_action_create_concept(grib_parser_context,$2,$4,0,0,0,0,0,0,$6,0); free($2); } | CONCEPT IDENT '(' IDENT ')' '{' concept_list '}' flags { $$ = grib_action_create_concept(grib_parser_context,$2,$7,0,0,$4,0,0,0,$9,0); free($2);free($4); } - | CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,0,$12,0); free($2);free($6);free($4);free($8);free($10); } + | CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,0,$12,0); free($2);free($6);free($4);free($8);free($10); } + | CONCEPT IDENT '(' IDENT ',' IDENT ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,0,$12,0); free($2);free($6);free($4);free($8);free($10); } | CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,$12,$14,0); free($2);free($6);free($4);free($8);free($10);free($12); } | CONCEPT IDENT '(' IDENT ',' STRING ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,0,0,$10,0); free($2);free($6);free($4);free($8); } + | CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$4,0,$8,$2,$6,$10,$12,0,$14,0); free($4);free($8);free($6);free($10); free($12); free($2);} + | CONCEPT IDENT '.' IDENT '(' IDENT ',' IDENT ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$4,0,$8,$2,$6,$10,$12,0,$14,0); free($4);free($8);free($6);free($10); free($12); free($2);} | CONCEPT IDENT '.' IDENT '(' IDENT ',' STRING ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$4,0,$8,$2,$6,$10,0,0,$12,0); free($4);free($8);free($6);free($10); free($2);} | CONCEPT IDENT '.' IDENT '{' concept_list '}' flags { $$ = grib_action_create_concept(grib_parser_context,$4,$6,0,$2,0,0,0,0,$8,0); free($2);free($4); } | CONCEPT IDENT '.' IDENT '(' IDENT ')' '{' concept_list '}' flags { $$ = grib_action_create_concept(grib_parser_context,$4,$9,0,$2,$6,0,0,0,$11,0); free($2);free($4);free($6); } + | CONCEPT_NOFAIL IDENT '{' concept_list '}' flags { $$ = grib_action_create_concept(grib_parser_context,$2,$4,0,0,0,0,0,0,$6,1); free($2); } | CONCEPT_NOFAIL IDENT '(' IDENT ')' '{' concept_list '}' flags { $$ = grib_action_create_concept(grib_parser_context,$2,$7,0,0,$4,0,0,0,$9,1); free($2);free($4); } | CONCEPT_NOFAIL IDENT '(' IDENT ',' STRING ',' IDENT ',' IDENT ')' flags { $$ = grib_action_create_concept(grib_parser_context,$2,0,$6,0,$4,$8,$10,0,$12,1); free($2);free($6);free($4);free($8);free($10); } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1ed68cfc6..40c1b2f2b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -99,7 +99,6 @@ if( HAVE_BUILD_TOOLS ) grib_calendar grib_md5 grib_cfNames - grib_ifsParam grib_packing_order filter_substr filter_contains @@ -107,7 +106,6 @@ if( HAVE_BUILD_TOOLS ) filter_is_one_of filter_is_in_list filter_transient_darray - grib_uerra grib_ecpoint grib_s2s grib_fire @@ -190,9 +188,11 @@ if( HAVE_BUILD_TOOLS ) grib_partial_message grib_true_imagery grib_headers_only + grib_uerra grib_unpack_subarray grib_count grib_clone_headers_only + grib_ifsParam wmo_read_bufr_from_file wmo_read_gts_from_file wmo_read_any_from_file diff --git a/tests/codes_dump_action_tree.cc b/tests/codes_dump_action_tree.cc index fa895ea97..724b957e2 100644 --- a/tests/codes_dump_action_tree.cc +++ b/tests/codes_dump_action_tree.cc @@ -12,17 +12,29 @@ #include #include "eccodes.h" +static ProductKind get_product_kind(const char* p) +{ + if (strcmp(p, "GRIB") == 0) return PRODUCT_GRIB; + if (strcmp(p, "BUFR") == 0) return PRODUCT_BUFR; + if (strcmp(p, "METAR") == 0) return PRODUCT_METAR; + if (strcmp(p, "GTS") == 0) return PRODUCT_GTS; + return PRODUCT_ANY; +} + int main(int argc, char** argv) { int err = 0; codes_context* c = codes_context_get_default(); - assert(argc == 2); + assert(argc == 3); + + const ProductKind mode = get_product_kind( argv[1] ); + const char* filename = argv[2]; - char* filename = argv[1]; FILE* fp = fopen(filename, "rb"); assert(fp); - codes_handle* h = codes_handle_new_from_file(c, fp, PRODUCT_ANY, &err); + + codes_handle* h = codes_handle_new_from_file(c, fp, mode, &err); assert(h); assert(!err); diff --git a/tests/codes_dump_action_tree.sh b/tests/codes_dump_action_tree.sh index ad562c9e5..fbc2bbf24 100755 --- a/tests/codes_dump_action_tree.sh +++ b/tests/codes_dump_action_tree.sh @@ -10,5 +10,16 @@ . ./include.ctest.sh -input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl -$EXEC ${test_dir}/codes_dump_action_tree "$input" +for f in GRIB1.tmpl GRIB2.tmpl sh_sfc_grib1.tmpl sh_sfc_grib2.tmpl; do + input=$ECCODES_SAMPLES_PATH/$f + $EXEC ${test_dir}/codes_dump_action_tree GRIB "$input" > /dev/null +done + +input=$ECCODES_SAMPLES_PATH/BUFR4.tmpl +$EXEC ${test_dir}/codes_dump_action_tree BUFR "$input" > /dev/null + +input=$data_dir/metar/metar.txt +$EXEC ${test_dir}/codes_dump_action_tree METAR "$input" > /dev/null + +input=$data_dir/gts/EGRR20150317121020_00493212.DAT +$EXEC ${test_dir}/codes_dump_action_tree GTS "$input" > /dev/null diff --git a/tests/definitions.sh b/tests/definitions.sh index 3842fa973..f090c1265 100755 --- a/tests/definitions.sh +++ b/tests/definitions.sh @@ -16,7 +16,9 @@ tempOut=temp.$label.txt [ -z "$ECCODES_DEFINITION_PATH" ] || ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d` -for file in `find ${ECCODES_DEFINITION_PATH}/ -name '*.def' -print | grep -v grib3/ | grep -v metar/ | grep -v taf/` +# Ignore symbolic links +# Ignore unsupported formats e.g., TAF, METAR +for file in `find ${ECCODES_DEFINITION_PATH}/ -name '*.def' -type f -print | grep -v grib3/ | grep -v metar/ | grep -v taf/` do ${bin_dir}/codes_parser $file > $REDIRECT done @@ -29,4 +31,5 @@ set -e [ $status -ne 0 ] grep -q "Parser: syntax error" $tempOut +# Clean up rm -f $tempOut diff --git a/tests/grib1to2.sh b/tests/grib1to2.sh index d050c32ff..46a73ecd6 100755 --- a/tests/grib1to2.sh +++ b/tests/grib1to2.sh @@ -116,6 +116,10 @@ sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl output=temp.grib1to2.grib ECCODES_DEBUG=-1 ${tools_dir}/grib_set -s edition=2 $sample_g1 $output +# -G option +sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +${tools_dir}/grib_set -G -s edition=2 $sample_g1 $temp2 + # Clean up rm -f $output diff --git a/tests/grib_check_param_concepts.sh b/tests/grib_check_param_concepts.sh index cc1bd6a01..ed5c64eca 100755 --- a/tests/grib_check_param_concepts.sh +++ b/tests/grib_check_param_concepts.sh @@ -18,6 +18,15 @@ if [ $ECCODES_ON_WINDOWS -eq 1 ]; then exit 0 fi +check_grib_defs() +{ + CHECK_DEFS=$proj_dir/definitions/check_grib_defs.pl + if [ -x "$CHECK_DEFS" ]; then + # Now check the name.def, paramId.def, shortName.def... files + # in the current directory + $CHECK_DEFS + fi +} # # Do various checks on the concepts files @@ -55,8 +64,6 @@ if [ $status -ne 0 ]; then exit 0 fi -CHECK_DEFS=$ECCODES_DEFINITION_PATH/check_grib_defs.pl - defs_dirs=" $ECCODES_DEFINITION_PATH/grib1 $ECCODES_DEFINITION_PATH/grib2 @@ -86,7 +93,7 @@ defs_dirs=" for dir in $defs_dirs; do cd $dir - $CHECK_DEFS + check_grib_defs done cd $test_dir @@ -108,7 +115,7 @@ cp $ECMF_DIR/name.legacy.def name.def cp $ECMF_DIR/paramId.legacy.def paramId.def cp $ECMF_DIR/shortName.legacy.def shortName.def cp $ECMF_DIR/units.legacy.def units.def -$CHECK_DEFS +check_grib_defs cd $test_dir rm -fr $tempDir @@ -127,7 +134,7 @@ cp $ECMF_DIR/name.legacy.def name.def cp $ECMF_DIR/paramId.legacy.def paramId.def cp $ECMF_DIR/shortName.legacy.def shortName.def cp $ECMF_DIR/units.legacy.def units.def -$CHECK_DEFS +check_grib_defs cd $test_dir rm -fr $tempDir diff --git a/tests/grib_compare.sh b/tests/grib_compare.sh index 1ac1f1462..4c1f457ff 100755 --- a/tests/grib_compare.sh +++ b/tests/grib_compare.sh @@ -306,20 +306,35 @@ status=$? set -e [ $status -ne 0 ] +# Key unpackedValues +#------------------- +${tools_dir}/grib_set -s scaleValuesBy=1.01 $ECCODES_SAMPLES_PATH/sh_ml_grib2.tmpl $temp1 +${tools_dir}/grib_compare -c unpackedValues -A 1.86 $ECCODES_SAMPLES_PATH/sh_ml_grib2.tmpl $temp1 + +# ----------------- # Failing cases # ----------------- set +e -${tools_dir}/grib_compare -H -c data:n $temp1 $temp2 +${tools_dir}/grib_compare -Rxxxx $temp1 $temp2 > $outfile 2>&1 status=$? set -e [ $status -eq 1 ] +grep "Invalid argument" $outfile set +e -${tools_dir}/grib_compare -a $temp1 $temp2 +${tools_dir}/grib_compare -H -c data:n $temp1 $temp2 > $outfile 2>&1 status=$? set -e [ $status -eq 1 ] +grep -q "options are incompatible" $outfile + +set +e +${tools_dir}/grib_compare -a $temp1 $temp2 > $outfile 2>&1 +status=$? +set -e +[ $status -eq 1 ] +grep -q "a option requires -c option" $outfile echo GRIB > $temp1 diff --git a/tests/grib_dump_debug.sh b/tests/grib_dump_debug.sh index 56ceb40d0..f220cea10 100755 --- a/tests/grib_dump_debug.sh +++ b/tests/grib_dump_debug.sh @@ -106,5 +106,11 @@ grep -q "unsigned iDirectionIncrement = 2000000 (can be missing)" $temp grep -q "constant zero = 0 (read-only)" $temp grep -q "unsigned reserved = MISSING (can be missing) (read-only)" $temp +# Debug dump a BUFR using -TB switch +infile=${data_dir}/bufr/pgps_110.bufr +${tools_dir}/grib_dump -Da -TB $infile > $temp +# ${tools_dir}/grib_dump -Da -TB -s unpack=1 $infile > $temp + + # Clean up rm -f $temp diff --git a/tests/grib_grid_lambert_conformal.sh b/tests/grib_grid_lambert_conformal.sh index 11d273d23..df4a3f9ec 100755 --- a/tests/grib_grid_lambert_conformal.sh +++ b/tests/grib_grid_lambert_conformal.sh @@ -86,5 +86,24 @@ ${tools_dir}/grib_get_data $tempGrib > $tempOut ${tools_dir}/grib_ls -l 40.44,353.56 $tempGrib +# Error conditions +# ---------------- +set +e +${tools_dir}/grib_get_data -s Latin1=5000,Latin2=-5000 $tempGrib > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Cannot have equal latitudes for standard parallels on opposite sides of equator" $tempOut + + +set +e +${tools_dir}/grib_get_data -s Ni=8 $tempGrib > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Wrong number of points" $tempOut + + + # Clean up rm -f $tempFilt $tempGrib $tempOut diff --git a/tests/grib_grid_mercator.sh b/tests/grib_grid_mercator.sh index 825262b29..2be01a3fb 100755 --- a/tests/grib_grid_mercator.sh +++ b/tests/grib_grid_mercator.sh @@ -32,11 +32,30 @@ cat > $tempFilt < $tempOut # Nearest function ${tools_dir}/grib_ls -l 19,-97,1 $input > $tempOut grep -q "Point chosen #1 index=618" $tempOut +# Error conditions +# ---------------- +input=${data_dir}/mercator.grib2 +set +e +${tools_dir}/grib_get_data -s latitudeOfFirstGridPointInDegrees=90 $input > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Transformation cannot be computed at the poles" $tempOut + +input=${data_dir}/mercator.grib2 +set +e +${tools_dir}/grib_get_data -s Ni=1 $input > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Wrong number of points" $tempOut + + # Clean up rm -f $tempFilt $tempOut diff --git a/tests/grib_grid_polar_stereographic.sh b/tests/grib_grid_polar_stereographic.sh index b426b34fe..e0f27cbdb 100755 --- a/tests/grib_grid_polar_stereographic.sh +++ b/tests/grib_grid_polar_stereographic.sh @@ -29,6 +29,24 @@ ${tools_dir}/grib_ls -l 60,0 $input # Scanning mode ${tools_dir}/grib_get_data -s iScansNegatively=1 $input > $tempOut +# Failing case +# ------------- +${tools_dir}/grib_set -s shapeOfTheEarth=2 $input $tempGrib # oblate earth +set +e +${tools_dir}/grib_get_data $tempGrib > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Only supported for spherical earth" $tempOut + +# Bad geography +set +e +${tools_dir}/grib_get_data -s Nx=1 $input > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Wrong number of points" $tempOut + # Clean up rm -f $tempFilt $tempGrib $tempOut diff --git a/tests/grib_grid_space_view.sh b/tests/grib_grid_space_view.sh index 03407053d..ff00db519 100755 --- a/tests/grib_grid_space_view.sh +++ b/tests/grib_grid_space_view.sh @@ -50,6 +50,14 @@ ${tools_dir}/grib_get_data $tempGrib2 > $tempOut ${tools_dir}/grib_ls -l 50,0 $tempGrib2 # Invalid cases +# -------------- +set +e +${tools_dir}/grib_get_data -s Nx=1 $tempGrib2 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Wrong number of points" $tempOut + set +e ${tools_dir}/grib_get_data -sNr=missing $tempGrib2 > $tempOut 2>&1 status=$? @@ -64,6 +72,22 @@ set -e [ $status -ne 0 ] grep -q "must be greater than zero" $tempOut + +set +e +${tools_dir}/grib_get_data -s latitudeOfSubSatellitePoint=66 $tempGrib2 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "satellite must be located in the equator plane" $tempOut + + +set +e +${tools_dir}/grib_get_data -s dx=0 $tempGrib2 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Keys dx and dy must be greater than zero" $tempOut + rm -f $tempGrib2 $tempOut # ----------- diff --git a/tests/grib_iterator.sh b/tests/grib_iterator.sh index 240107ee7..2601838ff 100755 --- a/tests/grib_iterator.sh +++ b/tests/grib_iterator.sh @@ -153,6 +153,22 @@ input=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl ECCODES_DEBUG=1 ${tools_dir}/grib_get_data $input > $tempText 2>&1 grep "global num points=6114" $tempText +# Bad -s +set +e +${tools_dir}/grib_get_data -s blah=999 $data_dir/sample.grib2 > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Key/value not found" $tempText + +# Bad -p +set +e +${tools_dir}/grib_get_data -f -p values $data_dir/sample.grib2 > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Passed array is too small" $tempText + # Clean up rm -f $tempText $tempGrib diff --git a/tests/grib_lam_bf.cc b/tests/grib_lam_bf.cc index c7170a192..7a575e68c 100644 --- a/tests/grib_lam_bf.cc +++ b/tests/grib_lam_bf.cc @@ -860,7 +860,7 @@ 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])) { - printf("Geometry is incorrect\n"); + fprintf(stderr, "Geometry is incorrect\n"); return 1; } diff --git a/tests/grib_step.sh b/tests/grib_step.sh index 0e0ddebda..9fc7f9abe 100755 --- a/tests/grib_step.sh +++ b/tests/grib_step.sh @@ -128,7 +128,7 @@ grib_check_key_equals $temp typeOfTimeIncrement 2 ${tools_dir}/grib_set -s stepType=avg,typeOfTimeIncrement=255 $grib2_sample $temp grib_check_key_equals $temp stepType avg ${tools_dir}/grib_set -s stepType=avg $grib2_sample $temp -grib_check_key_equals $temp typeOfTimeIncrement 3 +grib_check_key_equals $temp typeOfTimeIncrement 2 # default is 2 # Decode/Encode stepRange as an int and double ${tools_dir}/grib_set -s stepType=accum,stepRange=23-28 $grib2_sample $temp diff --git a/tests/grib_threads_ecc-604-encode.cc b/tests/grib_threads_ecc-604-encode.cc index 0f2e37560..33a767206 100644 --- a/tests/grib_threads_ecc-604-encode.cc +++ b/tests/grib_threads_ecc-604-encode.cc @@ -26,19 +26,24 @@ 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* values = NULL; + long numberOfDataPoints = 0; + GRIB_CHECK(grib_get_long(h, "numberOfDataPoints", &numberOfDataPoints), 0); + size_t size = numberOfDataPoints; + + values = (double*)malloc(size * sizeof(double)); + for (size_t i = 0; i < size; ++i) { double v = i; - if (i % DIM == 0) v = 0; + if (i % size == 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); + if (opt_dump) { + FILE* devnull = fopen("/dev/null", "w"); + grib_dump_content(h, devnull, "wmo", 0, NULL); + } return GRIB_SUCCESS; } @@ -62,6 +67,7 @@ int main(int argc, char** argv) 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); + fprintf(stderr, "Options:\n\t-d: do a dump\n\t-c: clone\n"); return 1; } @@ -144,7 +150,12 @@ void do_encode(void* ptr) hs = grib_handle_new_from_samples(0, INPUT_FILE); for (i = 0; i < FILES_PER_ITERATION; i++) { - grib_handle* h = grib_handle_clone(hs); + grib_handle* h = NULL; + if (opt_clone) { + h = grib_handle_clone(hs); + } else { + h = hs; + } if (opt_write) { snprintf(output_file, 50, "output/output_file_%zu-%zu.grib", data->number, i); encode_values(h, output_file); @@ -152,7 +163,8 @@ void do_encode(void* ptr) else { encode_values(h, NULL); } - grib_handle_delete(h); + if (opt_clone) + grib_handle_delete(h); } ltime = time(NULL); diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index e1fb6553a..2baf0b352 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -132,7 +132,8 @@ ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib ECCODES_DEBUG=-1 ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib -# The -u option +echo "Test -u option ..." +# ---------------------- input=${data_dir}/sample.grib2 ${tools_dir}/grib_to_netcdf -u time -o $tempNetcdf $input @@ -170,6 +171,17 @@ grib_check_key_equals $tempGrib 'dataDate:s' 'mar-20' ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib +echo "Test -S option..." +# ------------------------------------ +input=${data_dir}/high_level_api.grib2 +${tools_dir}/grib_to_netcdf -o $tempNetcdf -S param $input + +echo "Test -I option..." +# ------------------------------------ +input=${data_dir}/high_level_api.grib2 +${tools_dir}/grib_to_netcdf -o $tempNetcdf -S method $input + + echo "Enable/Disable Checks ..." # --------------------------------- rm -f $tempNetcdf @@ -234,6 +246,24 @@ set -e [ $status -ne 0 ] grep -q "Invalid reference date" $tempText +# Bad -k option +input=$data_dir/sample.grib2 +set +e +${tools_dir}/grib_to_netcdf -k hallo -o $tempNetcdf $input > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Invalid value" $tempText + +# Bad -d option +input=$data_dir/sample.grib2 +set +e +${tools_dir}/grib_to_netcdf -d 999 -o $tempNetcdf $input > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Invalid deflate option" $tempText + # Validity time check export GRIB_TO_NETCDF_CHECKVALIDTIME=0 diff --git a/tests/grib_util_set_spec.cc b/tests/grib_util_set_spec.cc index e47672868..095eb7135 100644 --- a/tests/grib_util_set_spec.cc +++ b/tests/grib_util_set_spec.cc @@ -357,25 +357,24 @@ static void test_grid_complex_spatial_differencing(int remove_local_def, int edi } #endif -static void usage(const char* prog) -{ - fprintf(stderr, "%s: [-p packingType] [-r] [-e edition] in.grib out.grib\n", prog); - fprintf(stderr, "-p packingType: one of grid_jpeg, grid_ccsds, grid_second_order or grid_simple\n"); - fprintf(stderr, "-r remove local definition\n"); - fprintf(stderr, "-e edition: 1 or 2\n"); - exit(1); -} +// static void usage(const char* prog) +// { +// fprintf(stderr, "%s: [-p packingType] [-r] [-e edition] in.grib out.grib\n", prog); +// fprintf(stderr, "-p packingType: one of grid_jpeg, grid_ccsds, grid_second_order or grid_simple\n"); +// fprintf(stderr, "-r remove local definition\n"); +// fprintf(stderr, "-e edition: 1 or 2\n"); +// exit(1); +// } int main(int argc, char* argv[]) { int i = 0, remove_local_def = 0; int edition = 0; char* packingType = NULL; - const char* prog = argv[0]; char* infile_name = NULL; char* outfile_name = NULL; - if (argc == 1 || argc > 8) usage(prog); + if (argc == 1 || argc > 8) return 1;// see usage for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-p") == 0) { diff --git a/tests/gts_compare.sh b/tests/gts_compare.sh index 678d8b571..c4c217b8d 100755 --- a/tests/gts_compare.sh +++ b/tests/gts_compare.sh @@ -31,6 +31,8 @@ echo "Test: comparing the same files" >> $fLog echo "file: $gts_file" >> $fLog ${tools_dir}/gts_compare $gts_file $gts_file +${tools_dir}/gts_compare -v -c totalLength $gts_file $gts_file > /dev/null + #---------------------------------------------------- # Test: comparing with skip #---------------------------------------------------- @@ -69,6 +71,7 @@ set -e [ $status -eq 1 ] # Add correct blocklist ${tools_dir}/gts_compare -b GG $gts_file $fGtsTmp +${tools_dir}/gts_compare -b CCCC,GG $gts_file $fGtsTmp #---------------------------------------------------- # Compare using -c @@ -82,13 +85,13 @@ ${tools_dir}/gts_compare -c theMessage $temp1 $temp2 ${tools_dir}/gts_compare -c theMessage -a $temp1 $temp2 set +e -${tools_dir}/gts_compare -c ls:n $temp1 $temp2 +${tools_dir}/gts_compare -c ls:n $temp1 $temp2 > /dev/null status=$? set -e [ $status -eq 1 ] set +e -${tools_dir}/gts_compare -c ls:n -a $temp1 $temp2 +${tools_dir}/gts_compare -c ls:n -a $temp1 $temp2 > /dev/null status=$? set -e [ $status -eq 1 ] diff --git a/tests/read_any.sh b/tests/read_any.sh index f8d1a0ba1..c8972cc03 100755 --- a/tests/read_any.sh +++ b/tests/read_any.sh @@ -13,12 +13,6 @@ infile=${data_dir}/mixed.grib outfile=${data_dir}/read_any.out -#if [ ! -f ${infile} ] -#then -# echo no data to test -# exit 0 -#fi - $EXEC $test_dir/read_any $infile > ${outfile} diff ${outfile} ${data_dir}/read_any.ok @@ -26,10 +20,13 @@ diff ${outfile} ${data_dir}/read_any.ok rm -f ${outfile} count=`${tools_dir}/grib_count ${data_dir}/pad.grib` - if [ $count != 6 ]; then - echo grib_io problem + echo "Error: grib_io problem" exit 1 fi ${tools_dir}/grib_count -v ${data_dir}/pad.grib >/dev/null + +## +$EXEC $test_dir/read_any $ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib1.tmpl +$EXEC $test_dir/read_any $ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl diff --git a/tests/unit_tests.cc b/tests/unit_tests.cc index 85505d2a6..faabd91c8 100644 --- a/tests/unit_tests.cc +++ b/tests/unit_tests.cc @@ -224,8 +224,7 @@ static void test_assertion_catching() printf("Running %s ...\n", __func__); char empty[] = ""; - char** list = 0; - int i = 0; + char** list = NULL; Assert(assertion_caught == 0); codes_set_codes_assertion_failed_proc(&my_assertion_proc); @@ -233,13 +232,14 @@ static void test_assertion_catching() list = string_split(empty, " "); Assert(assertion_caught == 1); + Assert( list == NULL ); /* Restore everything */ codes_set_codes_assertion_failed_proc(NULL); assertion_caught = 0; - for (i = 0; list[i] != NULL; ++i) - free(list[i]); + // for (i = 0; list[i] != NULL; ++i) + // free(list[i]); free(list); } @@ -264,6 +264,16 @@ static void test_logging_proc() Assert(logging_caught == 0); } +static void my_print_proc(const grib_context* c, void* descriptor, const char* mesg) +{ +} +static void test_print_proc() +{ + grib_context* context = grib_context_get_default(); + grib_context_set_print_proc(context, my_print_proc); + grib_context_set_print_proc(context, NULL); +} + static void test_concept_condition_strings() { printf("Running %s ...\n", __func__); @@ -272,6 +282,7 @@ static void test_concept_condition_strings() char result[1024] = {0,}; grib_context* context = NULL; grib_handle* h = grib_handle_new_from_samples(context, "GRIB2"); + if (!h) return; err = get_concept_condition_string(h, "typeOfLevel", NULL, result); Assert(!err); @@ -411,6 +422,16 @@ static void test_gts_header_mode() Assert(c->gts_header_on == 0); } +static void test_data_quality_checks() +{ + grib_context* c = grib_context_get_default(); + printf("Running %s ...\n", __func__); + + grib_context_set_data_quality_checks(c, 1);//warning + grib_context_set_data_quality_checks(c, 2);//error + grib_context_set_data_quality_checks(c, 0);//no checks +} + static void test_bufr_multi_element_constant_arrays() { grib_context* c = grib_context_get_default(); @@ -501,6 +522,13 @@ static void test_parse_keyval_string() free( (void*)values3[0].name ); } +static void test_time_conversions() +{ + printf("Running %s ...\n", __func__); + long result = convert_to_minutes(120, 13); // 120s = 2mins + Assert(result == 2); +} + static void test_dates() { printf("Running %s ...\n", __func__); @@ -752,6 +780,7 @@ void test_codes_context_set_debug() grib_context_set_debug(context, -1); grib_handle* h = grib_handle_new_from_samples(context, "GRIB2"); + if (!h) return; err = grib_set_long(h, "paramId", 167); Assert(!err); @@ -767,6 +796,48 @@ void test_codes_context_set_debug() grib_context_set_debug(context, 0); } +void test_codes_is_feature_enabled() +{ + printf("Running %s ...\n", __func__); + const char* features[] = { + "AEC", + "MEMFS", + "JPG", + "PNG", + "ECCODES_THREADS", + "ECCODES_OMP_THREADS", + "NETCDF", + "FORTRAN", + "GEOGRAPHY", + NULL}; + for (int i = 0; features[i]; ++i) { + const char* f = features[i]; + printf("\tFeature %s enabled?\t%d\n", f, codes_is_feature_enabled(f)); + } + Assert( 0 == codes_is_feature_enabled("total rubbish") ); +} + +void test_codes_get_features() +{ + printf("Running %s ...\n", __func__); + + size_t len = 512; + char* features = (char*)calloc(len, sizeof(char)); + int err = codes_get_features(features, &len, CODES_FEATURES_ALL); + Assert(!err); + printf("\tFeatures are: '%s'\n", features); + + len = 512; + err = codes_get_features(features, &len, CODES_FEATURES_ENABLED); + printf("\tEnabled features are: '%s'\n", features); + + len = 512; + err = codes_get_features(features, &len, CODES_FEATURES_DISABLED); + printf("\tDisabled features are: '%s'\n", features); + + free(features); +} + int main(int argc, char** argv) { printf("Doing unit tests. ecCodes version = %ld\n", grib_get_api_version()); @@ -786,7 +857,9 @@ int main(int argc, char** argv) test_scale_factor_scaled_values(); test_dates(); + test_time_conversions(); test_logging_proc(); + test_print_proc(); test_grib_binary_search(); test_parse_keyval_string(); @@ -796,6 +869,7 @@ int main(int argc, char** argv) test_gribex_mode(); test_gts_header_mode(); test_bufr_multi_element_constant_arrays(); + test_data_quality_checks(); test_concept_condition_strings(); @@ -830,6 +904,8 @@ int main(int argc, char** argv) test_grib2_select_PDTN(); test_grib2_choose_PDTN(); + test_codes_is_feature_enabled(); + test_codes_get_features(); return 0; } diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index d4b256770..e2016a726 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -96,6 +96,19 @@ else() endif() ######################################## +configure_file( codes_config.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/codes_config @ONLY ) +file(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/codes_config + DESTINATION ${CMAKE_BINARY_DIR}/bin + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ + GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + +install( FILES ${CMAKE_BINARY_DIR}/bin/codes_config + DESTINATION ${INSTALL_BIN_DIR} + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ ) + + # BUFR compare script install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/bufr_compare_dir DESTINATION ${INSTALL_BIN_DIR} diff --git a/tools/bufr_compare.cc b/tools/bufr_compare.cc index 325c67cd3..327020a9d 100644 --- a/tools/bufr_compare.cc +++ b/tools/bufr_compare.cc @@ -49,17 +49,6 @@ const char* tool_name = "bufr_compare"; const char* tool_online_doc = "https://confluence.ecmwf.int/display/ECC/bufr_compare"; const char* tool_usage = "[options] bufr_file1 bufr_file2"; -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; -} - typedef double (*compare_double_proc)(const double*, const double*, const double*); typedef struct grib_error grib_error; @@ -657,7 +646,7 @@ static int strings_are_different(grib_handle* h1, grib_handle* h2, const char* k const char* s1, const char* s2, size_t slen1, size_t slen2) { - if (grib_inline_strcmp(s1, s2) == 0) { + if (strcmp(s1, s2) == 0) { return 0; } /* Strings are different. Now check if strings are 'missing'. diff --git a/tools/codes_config.in b/tools/codes_config.in new file mode 100755 index 000000000..fa15d0115 --- /dev/null +++ b/tools/codes_config.in @@ -0,0 +1,139 @@ +#!/usr/bin/env bash + +ECCODES_VERSION_STR="@eccodes_VERSION_STR@" +ECCODES_MAJOR_VERSION=@eccodes_VERSION_MAJOR@ +ECCODES_MINOR_VERSION=@eccodes_VERSION_MINOR@ +ECCODES_PATCH_VERSION=@eccodes_VERSION_PATCH@ +# ECCODES_VERSION="$ECCODES_MAJOR_VERSION.$ECCODES_MINOR_VERSION.$ECCODES_PATCH_VERSION" + +ECCODES_GIT_SHA1="@eccodes_GIT_SHA1@" + +################################################################# +# Commands +################################################################# +usage() +{ + echo "Usage: $0 [--version] [--info] [--git]" + exit $1 +} + +version() +{ + echo "${ECCODES_VERSION_STR}" +} + +print_feature() +{ + if [ -z "$1" ]; then + echo "OFF" + elif [[ $1 =~ (true|TRUE|ON|1) ]]; then + echo "ON" + else + echo "OFF" + fi +} + +build_type="@CMAKE_BUILD_TYPE@" +info() +{ + echo "ecCodes version ${ECCODES_VERSION_STR}, git-sha1 ${ECCODES_GIT_SHA1}" + echo "" + echo "Build:" + echo " build type : @CMAKE_BUILD_TYPE@" + echo " timestamp : @EC_BUILD_TIMESTAMP@" + echo " op. system : @CMAKE_SYSTEM@ (@EC_OS_NAME@.@EC_OS_BITS@)" + echo " processor : @CMAKE_SYSTEM_PROCESSOR@" + echo " sources : @PROJECT_SOURCE_DIR@" + echo " c++ compiler : @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@" + # Add the most common build type + if [ $build_type = "RelWithDebInfo" ]; then + echo " flags : @CMAKE_CXX_FLAGS_RELWITHDEBINFO@" + else + echo " flags : @CMAKE_CXX_FLAGS@" + fi +# echo " fortran compiler: @CMAKE_Fortran_COMPILER_ID@ @CMAKE_Fortran_COMPILER_VERSION@" +# echo " flags : @ECCODES_Fortran_FLAGS@" + echo "" + echo "Features:" + echo " FORTRAN : $(print_feature @HAVE_FORTRAN@)" + echo " AEC : $(print_feature @HAVE_AEC@)" + echo " MEMFS : $(print_feature @HAVE_MEMFS@)" + echo " ECCODES_THREADS : $(print_feature @GRIB_PTHREADS@)" + echo " ECCODES_OMP_THREADS : $(print_feature @GRIB_OMP_THREADS@)" + echo " JPG : $(print_feature @HAVE_JPEG@)" + echo " PNG : $(print_feature @HAVE_PNG@)" + echo " NETCDF : $(print_feature @HAVE_NETCDF@)" + echo "" + # echo "Dependencies: " + # if [ -n "@ECCODES_HAVE_ECKIT@" ]; then + # echo " eckit version (@eckit_VERSION@), git-sha1 $(short_gitsha1 @eckit_GIT_SHA1@)" + # else + # echo " None" + # fi +} + +gitsha1() +{ + echo "${ECCODES_GIT_SHA1}" +} + +short_gitsha1() +{ + if [ -z "$1" ]; then + echo "unknown" + else + echo $1 | head -c 13 + fi +} + +################################################################# +# Parse command-line +################################################################# + +if test $# -eq 0; then + info + # usage 1 +fi + +while test $# -gt 0; do + + # Split --option=value in $opt="--option" and $val="value" + + opt="" + val="" + + case "$1" in + --*=*) + opt=`echo "$1" | sed 's/=.*//'` + val=`echo "$1" | sed 's/--[_a-zA-Z0-9]*=//'` + ;; + --*) + opt=$1 + ;; + *) + break + ;; + esac + + # Parse options + case "$opt" in + --version) + version + ;; + --git) + gitsha1 + ;; + --info) + info + ;; + --) + shift + break + ;; + *) + echo "unknown option: $opt" + usage 1 + ;; + esac + shift +done diff --git a/tools/grib_compare.cc b/tools/grib_compare.cc index 330f218e0..911b1b0a5 100644 --- a/tools/grib_compare.cc +++ b/tools/grib_compare.cc @@ -367,8 +367,8 @@ int grib_tool_init(grib_runtime_options* options) options->tolerance_count = MAX_KEYS; ret = parse_keyval_string(tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count)); if (ret == GRIB_INVALID_ARGUMENT) { + fprintf(stderr, "%s: Invalid argument for -R\n",tool_name); usage(); - exit(1); } } diff --git a/tools/grib_ls.cc b/tools/grib_ls.cc index c5d06df01..08578502f 100644 --- a/tools/grib_ls.cc +++ b/tools/grib_ls.cc @@ -371,10 +371,6 @@ 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"); } @@ -383,6 +379,12 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) first_handle = 0; } } + + if (options->current_infile && options->current_infile->name) { + size = strlen(options->current_infile->name); + grib_set_string(h, "file", options->current_infile->name, &size); + } + new_handle = "\n,"; return 0; } diff --git a/tools/grib_to_netcdf.cc b/tools/grib_to_netcdf.cc index 713ffcfaf..ffe0b50de 100644 --- a/tools/grib_to_netcdf.cc +++ b/tools/grib_to_netcdf.cc @@ -83,6 +83,11 @@ typedef struct parameter parameter; static const char* get_value(const request*, const char* name, int n); static bool parsedate(const char* name, long* julian, long* second, bool* isjul); +void usage_and_exit(void) +{ + usage(); // this calls exit(1) +} + static bool eq_string(const char* l, const char* r) { if (l && r) @@ -3957,7 +3962,6 @@ struct KindValue /* 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 }, @@ -4073,9 +4077,13 @@ int grib_tool_init(grib_runtime_options* options) } } if (kvalue->name == NULL) { - fprintf(stderr, "Invalid format: %s", kind_name); - usage(); - exit(1); + fprintf(stderr, "Invalid value for -k option: %s\n", kind_name); + fprintf(stderr, "Please use one of:\n"); + for (kvalue = legalkinds; kvalue->name; kvalue++) { + if (is_number(kvalue->name)) + fprintf(stderr, "\t%s\n", kvalue->name); + } + usage_and_exit(); } } @@ -4084,16 +4092,14 @@ int grib_tool_init(grib_runtime_options* options) char* theArg = grib_options_get_option("d:"); 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); + usage_and_exit(); } set_value(user_r, "deflate", theArg); deflate_option = 1; } else { fprintf(stderr, "Invalid deflate option for non netCDF-4 output formats\n"); - usage(); - exit(1); + usage_and_exit(); } } else { @@ -4105,8 +4111,7 @@ int grib_tool_init(grib_runtime_options* options) set_value(user_r, "shuffle", "true"); else { fprintf(stderr, "Invalid shuffle option. Deflate option needed.\n"); - usage(); - exit(1); + usage_and_exit(); } } else @@ -4116,8 +4121,7 @@ int grib_tool_init(grib_runtime_options* options) char* theArg = grib_options_get_option("R:"); if (!is_number(theArg)) { fprintf(stderr, "Invalid reference date: %s\n", theArg); - usage(); - exit(1); + usage_and_exit(); } set_value(user_r, "referencedate", theArg); } @@ -4295,8 +4299,7 @@ int grib_tool_finalise_action(grib_runtime_options* options) if (options->outfile == NULL || options->outfile->name == NULL) { grib_context_log(ctx, GRIB_LOG_ERROR, "No output file. Exiting!"); - usage(); - exit(1); + usage_and_exit(); } if (fs->count == 0) { diff --git a/tools/gts_compare.cc b/tools/gts_compare.cc index 3a084893d..dad70feac 100644 --- a/tools/gts_compare.cc +++ b/tools/gts_compare.cc @@ -17,8 +17,6 @@ grib_option grib_options[] = { { "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 }, /*{"R:",0,0,0,1,0},*/ /*{"A:",0,0,0,1,0},*/ @@ -87,9 +85,6 @@ static int write_count = 0; grib_handle* global_handle = NULL; int counter = 0; -int start = -1; -int end = -1; - static void write_message(grib_handle* h, const char* str) { @@ -155,11 +150,6 @@ int grib_tool_init(grib_runtime_options* options) grib_context* context = grib_context_get_default(); options->strict = 1; - if (grib_options_on("S:")) - start = atoi(grib_options_get_option("S:")); - - if (grib_options_on("E:")) - end = atoi(grib_options_get_option("E:")); if (grib_options_on("f")) force = 1; @@ -537,10 +527,6 @@ static int compare_values(const grib_runtime_options* options, grib_handle* h1, return err2; break; - case GRIB_TYPE_DOUBLE: - Assert(!"GTS cannot contain keys of type DOUBLE"); - break; - case GRIB_TYPE_BYTES: // We do not want to compare the message itself return 0;