diff --git a/.appveyor.yml b/.appveyor.yml index 4b0a3eaaa..096e0e4c8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -9,7 +9,7 @@ branches: - develop - master -image: Visual Studio 2015 +image: Visual Studio 2022 environment: CONDA: c:\Miniconda37-x64 @@ -62,8 +62,7 @@ platform: - x64 before_build: - - cmd: call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 - - cmd: call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64 + - cmd: call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 build_script: - cmd: cd %ECCODES_SRC% diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ef99a2174..2717a74f7 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -3,7 +3,7 @@ name: cd on: push: tags: - - '**' + - '[0-9]+.[0-9]+.[0-9]+' jobs: deploy: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf2d99939..f11896b00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,7 +91,7 @@ jobs: - downstream-ci-hpc - private-downstream-ci-hpc - codecov - if: always() + if: always() && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} steps: - name: Trigger Teams notification uses: ecmwf-actions/notify-teams@v1 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a5906565f..e7bd39400 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -5,20 +5,75 @@ on: # Run at 20:00 UTC every day (on default branch) schedule: - - cron: "0 20 * * *" + - cron: '0 20 * * *' jobs: - test: + test-hpc: uses: ./.github/workflows/reusable-ci-hpc.yml with: eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }} nightly_test: true secrets: inherit + test-macos: + strategy: + matrix: + name: + - clang@macos-13-arm + - clang@macos-13-x86 + include: + - name: clang@macos-13-arm + labels: [self-hosted, platform-builder-macosx-13.4.1-arm64] + os: macos-13-arm + compiler: clang + compiler_cc: clang + compiler_cxx: clang++ + compiler_fc: gfortran + - name: clang@macos-13-x86 + labels: [self-hosted, platform-builder-macosx-13.4.1-x86_64] + os: macos-13-x86 + compiler: clang + compiler_cc: clang + compiler_cxx: clang++ + compiler_fc: gfortran + runs-on: ${{ matrix.labels }} + env: + DEP_TREE: | + ecbuild: ~ + libaec: + deps: + - ecbuild + eccodes: + deps: + - libaec + - ecbuild + steps: + - uses: ecmwf-actions/reusable-workflows/build-package-with-config@v2 + with: + repository: ecmwf/eccodes@${{ github.sha }} + build_config: .github/ci-config.yml + + deploy: + needs: [test-hpc, test-macos] + uses: ecmwf-actions/reusable-workflows/.github/workflows/create-package.yml@v2 + with: + skip_checks: true + cpack_options_rpm: -D CPACK_PACKAGE_FILE_NAME=eccodes-nightly-Linux-x86_64 + cpack_options_deb: -D CPACK_PACKAGE_VERSION=nightly + secrets: + url_debian_11: ${{ secrets.NEXUS_TEST_REPO_NIGHTLY_URL_DEBIAN_11 }} + token_debian_11: ${{ 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 }} + token_rocky_8: ${{ secrets.NEXUS_TEST_REPO_UPLOAD_TOKEN }} + notify: runs-on: ubuntu-latest needs: - - test + - test-hpc + - test-macos + - deploy if: always() steps: - name: Trigger Teams notification diff --git a/VERSION b/VERSION index 7cca401c7..3afbaeb2b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.32.0 +2.33.0 diff --git a/cmake/FindAEC.cmake b/cmake/FindAEC.cmake index bfbe813e3..7eb5b3339 100644 --- a/cmake/FindAEC.cmake +++ b/cmake/FindAEC.cmake @@ -22,14 +22,15 @@ # libaec_DIR # LIBAEC_PATH # libaec_PATH +# libaec_ROOT find_path( AEC_INCLUDE_DIR libaec.h - PATHS ${AEC_DIR} ${AEC_PATH} ${LIBAEC_DIR} ${libaec_DIR} ${LIBAEC_PATH} ${libaec_PATH} ENV AEC_DIR ENV AEC_PATH ENV LIBAEC_DIR ENV libaec_DIR ENV LIBAEC_PATH ENV libaec_PATH + PATHS ${AEC_DIR} ${AEC_PATH} ${LIBAEC_DIR} ${libaec_DIR} ${LIBAEC_PATH} ${libaec_PATH} ${libaec_ROOT} ENV AEC_DIR ENV AEC_PATH ENV LIBAEC_DIR ENV libaec_DIR ENV LIBAEC_PATH ENV libaec_PATH ENV libaec_ROOT PATH_SUFFIXES include include/aec NO_DEFAULT_PATH ) find_path( AEC_INCLUDE_DIR libaec.h PATH_SUFFIXES include include/aec ) find_library( AEC_LIBRARY NAMES aec - PATHS ${AEC_DIR} ${AEC_PATH} ${LIBAEC_DIR} ${libaec_DIR} ${LIBAEC_PATH} ${libaec_PATH} ENV AEC_DIR ENV AEC_PATH ENV LIBAEC_DIR ENV libaec_DIR ENV LIBAEC_PATH ENV libaec_PATH + PATHS ${AEC_DIR} ${AEC_PATH} ${LIBAEC_DIR} ${libaec_DIR} ${LIBAEC_PATH} ${libaec_PATH} ${libaec_ROOT} ENV AEC_DIR ENV AEC_PATH ENV LIBAEC_DIR ENV libaec_DIR ENV LIBAEC_PATH ENV libaec_PATH ENV libaec_ROOT PATH_SUFFIXES lib lib64 lib/aec lib64/aec NO_DEFAULT_PATH ) find_library( AEC_LIBRARY NAMES aec PATH_SUFFIXES lib lib64 lib/aec lib64/aec ) diff --git a/definitions/boot.def b/definitions/boot.def index 22edf96e1..61a7b7be0 100644 --- a/definitions/boot.def +++ b/definitions/boot.def @@ -52,6 +52,9 @@ transient unitsFactor=1 : hidden; transient unitsBias=0 : hidden; constant globalDomain = "g"; transient timeRangeIndicatorFromStepRange=-1 : hidden; +# Format specifiers for converting a number (float or int) into a string +transient formatForDoubles = "%g" : no_copy,hidden; +transient formatForLongs = "%ld" : no_copy,hidden; # ECC-868 transient produceLargeConstantFields = 0 : hidden; diff --git a/definitions/bufr/boot_edition_1.def b/definitions/bufr/boot_edition_1.def index bbf700062..1949309bd 100644 --- a/definitions/bufr/boot_edition_1.def +++ b/definitions/bufr/boot_edition_1.def @@ -1,6 +1,6 @@ # (C) Copyright 2005- ECMWF. -ascii[4] identifier = "BUFR" : read_only,hidden; +ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; unsigned[3] section1Length; @@ -8,7 +8,7 @@ unsigned[3] section1Length; unsigned[1] edition = 1 : dump; alias editionNumber=edition; -template section_1 "bufr/section.1.1.def"; +template section_1 "bufr/section.1.1.def"; flagbit localSectionPresent(section1Flags,7) = 1; alias section2Present=localSectionPresent; @@ -18,7 +18,7 @@ if(localSectionPresent){ template section_2 "bufr/section.2.def"; } else { - transient section2Length = 0; + transient section2Length = 0; } template section_3 "bufr/section.3.def"; diff --git a/definitions/bufr/boot_edition_2.def b/definitions/bufr/boot_edition_2.def index 88ccefaf1..bfa052117 100644 --- a/definitions/bufr/boot_edition_2.def +++ b/definitions/bufr/boot_edition_2.def @@ -1,24 +1,24 @@ # (C) Copyright 2005- ECMWF. -ascii[4] identifier = "BUFR" : read_only,hidden; +ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; -unsigned[3] totalLength; +unsigned[3] totalLength; unsigned[1] edition = 2 : dump; alias editionNumber=edition; -template section_1 "bufr/section.1.2.def"; +template section_1 "bufr/section.1.2.def"; flagbit localSectionPresent(section1Flags,7) = 1; alias section2Present=localSectionPresent; alias localUsePresent=localSectionPresent; if(localSectionPresent){ - template section_2 "bufr/section.2.def"; + template section_2 "bufr/section.2.def"; } else { - transient section2Length = 0; + transient section2Length = 0; } template section_3 "bufr/section.3.def"; diff --git a/definitions/bufr/boot_edition_3.def b/definitions/bufr/boot_edition_3.def index a05dd8ea9..a34ab4b7f 100644 --- a/definitions/bufr/boot_edition_3.def +++ b/definitions/bufr/boot_edition_3.def @@ -1,9 +1,9 @@ # (C) Copyright 2005- ECMWF. -ascii[4] identifier = "BUFR" : read_only,hidden; +ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; -section_length[3] totalLength ; +section_length[3] totalLength ; unsigned[1] edition = 3 : dump; alias editionNumber=edition; @@ -15,10 +15,10 @@ alias section2Present=localSectionPresent; alias localUsePresent=localSectionPresent; if(localSectionPresent){ - template section_2 "bufr/section.2.def"; + template section_2 "bufr/section.2.def"; } else { - transient section2Length = 0; + transient section2Length = 0; } template section_3 "bufr/section.3.def"; diff --git a/definitions/bufr/boot_edition_4.def b/definitions/bufr/boot_edition_4.def index 0f8fa73ac..63d6f6430 100644 --- a/definitions/bufr/boot_edition_4.def +++ b/definitions/bufr/boot_edition_4.def @@ -1,23 +1,23 @@ # (C) Copyright 2005- ECMWF. -ascii[4] identifier = "BUFR" : read_only,hidden; +ascii[4] identifier = "BUFR" : read_only,hidden; alias identifier=identifier; -section_length[3] totalLength ; +section_length[3] totalLength ; unsigned[1] edition = 4 : dump; alias editionNumber=edition; -template section_1 "bufr/section.1.4.def"; +template section_1 "bufr/section.1.4.def"; flagbit localSectionPresent(section1Flags,7) = 1; alias section2Present=localSectionPresent; alias localUsePresent=localSectionPresent; if(localSectionPresent){ - template section_2 "bufr/section.2.def"; + template section_2 "bufr/section.2.def"; } else { - transient section2Length = 0; + transient section2Length = 0; } template section_3 "bufr/section.3.def"; diff --git a/definitions/grib1/3.82.table b/definitions/grib1/3.82.table index b50e3bfef..29e0e2320 100644 --- a/definitions/grib1/3.82.table +++ b/definitions/grib1/3.82.table @@ -4,7 +4,7 @@ ## created: 6 Oct 2011 ## modified: 13 May 2013 ## -# CODE TABLE 3 Fixed levels or layers for wich the data are included +# CODE TABLE 3 Fixed levels or layers for which the data are included 0 0 Reserved 1 surf Surface (of the Earth, which includes sea surface) 2 bcld Cloud base level diff --git a/definitions/grib1/gds_not_present_bitmap.def b/definitions/grib1/gds_not_present_bitmap.def index 735087dc8..c654b3cbc 100644 --- a/definitions/grib1/gds_not_present_bitmap.def +++ b/definitions/grib1/gds_not_present_bitmap.def @@ -5,10 +5,8 @@ position offsetSection3; transient section3Length=1; meta section3Pointer section_pointer(offsetSection3,section3Length,3); -# Number of unused bits at end of Section 3 transient numberOfUnusedBitsAtEndOfSection3 = 0 : read_only; -# Table reference: transient tableReference = 0; #position offsetBeforeBitmap; @@ -18,6 +16,5 @@ meta bitmap gds_not_present_bitmap( missingValue,numberOfValues, Ni,numberOfUnusedBitsAtEndOfSection3) : read_only; #position offsetAfterBitmap; - #padtoeven padding_sec3_1(offsetSection3,section3Length); #section_padding section3Padding; diff --git a/definitions/grib1/grid_definition_1.def b/definitions/grib1/grid_definition_1.def index 14caa71a8..949da5f59 100644 --- a/definitions/grib1/grid_definition_1.def +++ b/definitions/grib1/grid_definition_1.def @@ -12,7 +12,7 @@ alias numberOfPointsAlongXAxis=Ni; signed[2] Nj : dump; alias numberOfPointsAlongAMeridian=Nj; -alias Nx=Nj; +alias Ny=Nj; alias geography.Nj=Nj; alias numberOfPointsAlongYAxis=Nj; diff --git a/definitions/grib1/grid_definition_5.def b/definitions/grib1/grid_definition_5.def index 43781136e..cca099bf8 100644 --- a/definitions/grib1/grid_definition_5.def +++ b/definitions/grib1/grid_definition_5.def @@ -1,15 +1,15 @@ # GRID DEFINITION Polar stereographic # grib 1 -> 2 -constant gridDefinitionTemplateNumber = 20; +constant gridDefinitionTemplateNumber = 20; unsigned[2] Nx : dump; alias Ni = Nx; -alias numberOfPointsAlongXAxis = Nx; +alias numberOfPointsAlongXAxis = Nx; alias geography.Nx=Nx; unsigned[2] Ny : dump; alias Nj = Ny; -alias numberOfPointsAlongYAxis = Ny; +alias numberOfPointsAlongYAxis = Ny; alias geography.Ny=Ny; signed[3] latitudeOfFirstGridPoint : edition_specific ; @@ -22,19 +22,19 @@ alias Lo1 = longitudeOfFirstGridPoint; include "grib1/resolution_flags.def"; -# LoV - orientation of the grid; i.e. the longitude value of the meridian which is parallel to the Y-axis +# LoV - orientation of the grid; i.e. the longitude value of the meridian which is parallel to the Y-axis signed[3] orientationOfTheGrid : edition_specific, no_copy ; meta geography.orientationOfTheGridInDegrees scale(orientationOfTheGrid,oneConstant,grib1divider,truncateDegrees) : dump; alias LoV = orientationOfTheGrid ; -# Dx - X-direction grid length +# Dx - X-direction grid length unsigned[3] DxInMetres : dump; alias xDirectionGridLengthInMetres=DxInMetres; alias Dx=DxInMetres; alias geography.DxInMetres=DxInMetres; alias Di = DxInMetres; -# Dy - Y-direction grid length +# Dy - Y-direction grid length unsigned[3] DyInMetres : dump; alias yDirectionGridLengthInMetres=DyInMetres; alias Dy = DyInMetres; @@ -45,7 +45,7 @@ constant latitudeWhereDxAndDyAreSpecifiedInDegrees=60; constant LaDInDegrees=60; alias geography.LaDInDegrees=LaDInDegrees; -# Projection centre flag +# Projection centre flag unsigned[1] projectionCentreFlag : dump ; alias projectionCenterFlag=projectionCentreFlag; # Note our flagbit numbers go from 7 to 0, while WMO convention is from 1 to 8 @@ -53,7 +53,6 @@ alias projectionCenterFlag=projectionCentreFlag; # If bit 1 is 1, then the South Pole is on the projection plane flagbit southPoleOnProjectionPlane(projectionCentreFlag,7) : dump; # WMO bit 1 - # for change_scanning_direction alias yFirst=latitudeOfFirstGridPointInDegrees; alias xFirst=longitudeOfFirstGridPointInDegrees; diff --git a/definitions/grib1/grid_definition_gaussian.def b/definitions/grib1/grid_definition_gaussian.def index 377a0822f..26c855900 100644 --- a/definitions/grib1/grid_definition_gaussian.def +++ b/definitions/grib1/grid_definition_gaussian.def @@ -10,12 +10,12 @@ alias Ny=Nj; # Resolution and component flags include "grib1/grid_first_last_resandcomp.def"; -# Di - i direction increment +# Di - i direction increment unsigned[2] iDirectionIncrement : can_be_missing,dump,edition_specific; meta geography.iDirectionIncrementInDegrees scale(iDirectionIncrement,oneConstant,grib1divider,truncateDegrees) : can_be_missing,dump; alias Di = iDirectionIncrement; -# N - number of parallels between a pole and the equator +# N - number of parallels between a pole and the equator unsigned[2] N : dump ; alias numberOfParallelsBetweenAPoleAndTheEquator=N; alias geography.N=N; diff --git a/definitions/grib1/grid_definition_lambert.def b/definitions/grib1/grid_definition_lambert.def index 5556c16ac..45404d420 100644 --- a/definitions/grib1/grid_definition_lambert.def +++ b/definitions/grib1/grid_definition_lambert.def @@ -8,7 +8,7 @@ alias Nj = Ny; alias numberOfPointsAlongYAxis = Ny; alias geography.Ny=Ny; -# La1 - latitude of first grid point +# La1 - latitude of first grid point signed[3] latitudeOfFirstGridPoint : edition_specific; meta geography.latitudeOfFirstGridPointInDegrees scale(latitudeOfFirstGridPoint,oneConstant,grib1divider,truncateDegrees) : dump; @@ -17,7 +17,7 @@ alias La1InDegrees=latitudeOfFirstGridPointInDegrees; #meta latitudeOfFirstGridPointInMicrodegrees times(latitudeOfFirstGridPoint,thousand); -# Lo1 - longitude of first grid point +# Lo1 - longitude of first grid point signed[3] longitudeOfFirstGridPoint : edition_specific; meta geography.longitudeOfFirstGridPointInDegrees scale(longitudeOfFirstGridPoint,oneConstant,grib1divider,truncateDegrees) : dump; @@ -25,24 +25,24 @@ alias Lo1 = longitudeOfFirstGridPoint; alias Lo1InDegrees = longitudeOfFirstGridPointInDegrees; #meta longitudeOfFirstGridPointInMicrodegrees times(longitudeOfFirstGridPoint,thousand); -# Resolution and component flags +# Resolution and component flags include "grib1/resolution_flags.def"; -# LoV - orientation of the grid; i.e. the east longitude value of the meridian which is parallel to the Y-axis +# LoV - orientation of the grid; i.e. the east longitude value of the meridian which is parallel to the Y-axis signed[3] LoV : edition_specific ; meta geography.LoVInDegrees scale(LoV,oneConstant,grib1divider,truncateDegrees) : dump; alias orientationOfTheGrid = LoV; alias orientationOfTheGridInDegrees = LoVInDegrees; -# Dx - X-direction grid length (in units of metres) +# Dx - X-direction grid length (in units of metres) unsigned[3] DxInMetres : dump; alias xDirectionGridLength=DxInMetres; alias geography.DxInMetres=DxInMetres ; alias Dx = DxInMetres; alias Di = DxInMetres; -# Dy - Y-direction grid length (in units of metres) +# Dy - Y-direction grid length (in units of metres) unsigned[3] DyInMetres : dump; alias yDirectionGridLength=DyInMetres; alias geography.DyInMetres=DyInMetres; @@ -59,7 +59,7 @@ alias xFirst=longitudeOfFirstGridPointInDegrees; include "grib1/scanning_mode.def"; -# Latin 1 - first latitude from the pole at which the secant cone cuts the sphere +# Latin 1 - first latitude from the pole at which the secant cone cuts the sphere signed[3] Latin1 : edition_specific, no_copy; meta geography.Latin1InDegrees scale(Latin1,oneConstant,grib1divider,truncateDegrees) : dump; alias firstLatitude=Latin1; @@ -69,7 +69,7 @@ alias firstLatitudeInDegrees=Latin1InDegrees; constant LaDInDegrees = Latin1InDegrees : dump; alias geography.LaDInDegrees=LaDInDegrees; -# Latin 2 - second latitude from the pole at which the secant cone cuts the sphere +# Latin 2 - second latitude from the pole at which the secant cone cuts the sphere signed[3] Latin2 :edition_specific,no_copy; alias secondLatitude=Latin2; meta geography.Latin2InDegrees scale(Latin2,oneConstant,grib1divider,truncateDegrees) : dump; diff --git a/definitions/grib1/grid_definition_latlon.def b/definitions/grib1/grid_definition_latlon.def index 552836fcf..c96c93506 100644 --- a/definitions/grib1/grid_definition_latlon.def +++ b/definitions/grib1/grid_definition_latlon.def @@ -1,9 +1,11 @@ -unsigned[2] Ni : can_be_missing,dump; +unsigned[2] Ni : can_be_missing,dump; alias numberOfPointsAlongAParallel=Ni; +alias numberOfPointsAlongXAxis=Ni; alias Nx = Ni; unsigned[2] Nj : can_be_missing,dump; alias numberOfPointsAlongAMeridian=Nj; +alias numberOfPointsAlongYAxis= Nj; alias Ny = Nj; # Latitudes and Longitudes of the first and the last points diff --git a/definitions/grib1/grid_definition_spherical_harmonics.def b/definitions/grib1/grid_definition_spherical_harmonics.def index f79e45157..f82b5c7f3 100644 --- a/definitions/grib1/grid_definition_spherical_harmonics.def +++ b/definitions/grib1/grid_definition_spherical_harmonics.def @@ -1,17 +1,17 @@ # GRID DEFINITION spherical harmonic coefficients (including rotated, stretched, or stretched and rotated) constant isGridded = zero; -# J - pentagonal resolution parameter +# J - pentagonal resolution parameter unsigned[2] J : dump ; alias pentagonalResolutionParameterJ= J; alias geography.J=J; -# K - pentagonal resolution parameter +# K - pentagonal resolution parameter unsigned[2] K : dump; alias pentagonalResolutionParameterK=K; alias geography.K=K; -# M - pentagonal resolution parameter +# M - pentagonal resolution parameter unsigned[2] M : dump ; alias pentagonalResolutionParameterM=M; alias geography.M=M; @@ -22,14 +22,13 @@ alias numberOfPoints=numberOfValues; alias numberOfDataPoints=numberOfValues; #alias ls.valuesCount=numberOfValues; -# Representation type +# Representation type codetable[1] representationType 'grib1/9.table' = 1 : no_copy; -# Representation mode +# Representation mode codetable[1] representationMode 'grib1/10.table' = 2 : no_copy; -# Set to zero -# (reserved) +# Set to zero (reserved) pad padding_grid50_1(18); # For now, to make section2 happy diff --git a/definitions/grib1/localConcepts/ecmf/cfVarName.def b/definitions/grib1/localConcepts/ecmf/cfVarName.def index 21f25c311..36530b6f3 100644 --- a/definitions/grib1/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib1/localConcepts/ecmf/cfVarName.def @@ -294,7 +294,7 @@ table2Version = 128 ; indicatorOfParameter = 48 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'fg10' = { table2Version = 128 ; indicatorOfParameter = 49 ; @@ -659,7 +659,7 @@ table2Version = 128 ; indicatorOfParameter = 122 ; } -#10 metre wind gust in the last 6 hours +#Maximum 10 metre wind gust in the last 6 hours 'p10fg6' = { table2Version = 128 ; indicatorOfParameter = 123 ; @@ -1169,7 +1169,7 @@ table2Version = 128 ; indicatorOfParameter = 159 ; } -#Standard deviation of orography +#Standard deviation of sub-gridscale orography 'sdor' = { table2Version = 128 ; indicatorOfParameter = 160 ; @@ -9879,7 +9879,7 @@ table2Version = 228 ; indicatorOfParameter = 20 ; } -#Total sky direct solar radiation at surface +#Total sky direct short-wave (solar) radiation at surface 'fdir' = { table2Version = 228 ; indicatorOfParameter = 21 ; @@ -9914,7 +9914,7 @@ table2Version = 228 ; indicatorOfParameter = 27 ; } -#10 metre wind gust in the last 3 hours +#Maximum 10 metre wind gust in the last 3 hours 'fg310' = { table2Version = 228 ; indicatorOfParameter = 28 ; @@ -10089,12 +10089,12 @@ table2Version = 228 ; indicatorOfParameter = 94 ; } -#Surface solar radiation downward clear-sky +#Surface short-wave (solar) radiation downward clear-sky 'ssrdc' = { table2Version = 228 ; indicatorOfParameter = 129 ; } -#Surface thermal radiation downward clear-sky +#Surface long-wave (thermal) radiation downward clear-sky 'strdc' = { table2Version = 228 ; indicatorOfParameter = 130 ; @@ -16314,7 +16314,7 @@ table2Version = 210 ; indicatorOfParameter = 54 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio 'co2' = { table2Version = 210 ; indicatorOfParameter = 61 ; diff --git a/definitions/grib1/localConcepts/ecmf/name.def b/definitions/grib1/localConcepts/ecmf/name.def index fd2b9af79..78ecaecad 100644 --- a/definitions/grib1/localConcepts/ecmf/name.def +++ b/definitions/grib1/localConcepts/ecmf/name.def @@ -294,8 +294,8 @@ table2Version = 128 ; indicatorOfParameter = 48 ; } -#10 metre wind gust since previous post-processing -'10 metre wind gust since previous post-processing' = { +#Maximum 10 metre wind gust since previous post-processing +'Maximum 10 metre wind gust since previous post-processing' = { table2Version = 128 ; indicatorOfParameter = 49 ; } @@ -659,8 +659,8 @@ table2Version = 128 ; indicatorOfParameter = 122 ; } -#10 metre wind gust in the last 6 hours -'10 metre wind gust in the last 6 hours' = { +#Maximum 10 metre wind gust in the last 6 hours +'Maximum 10 metre wind gust in the last 6 hours' = { table2Version = 128 ; indicatorOfParameter = 123 ; } @@ -1169,8 +1169,8 @@ table2Version = 128 ; indicatorOfParameter = 159 ; } -#Standard deviation of orography -'Standard deviation of orography' = { +#Standard deviation of sub-gridscale orography +'Standard deviation of sub-gridscale orography' = { table2Version = 128 ; indicatorOfParameter = 160 ; } @@ -9879,8 +9879,8 @@ table2Version = 228 ; indicatorOfParameter = 20 ; } -#Total sky direct solar radiation at surface -'Total sky direct solar radiation at surface' = { +#Total sky direct short-wave (solar) radiation at surface +'Total sky direct short-wave (solar) radiation at surface' = { table2Version = 228 ; indicatorOfParameter = 21 ; } @@ -9914,8 +9914,8 @@ table2Version = 228 ; indicatorOfParameter = 27 ; } -#10 metre wind gust in the last 3 hours -'10 metre wind gust in the last 3 hours' = { +#Maximum 10 metre wind gust in the last 3 hours +'Maximum 10 metre wind gust in the last 3 hours' = { table2Version = 228 ; indicatorOfParameter = 28 ; } @@ -10089,13 +10089,13 @@ table2Version = 228 ; indicatorOfParameter = 94 ; } -#Surface solar radiation downward clear-sky -'Surface solar radiation downward clear-sky' = { +#Surface short-wave (solar) radiation downward clear-sky +'Surface short-wave (solar) radiation downward clear-sky' = { table2Version = 228 ; indicatorOfParameter = 129 ; } -#Surface thermal radiation downward clear-sky -'Surface thermal radiation downward clear-sky' = { +#Surface long-wave (thermal) radiation downward clear-sky +'Surface long-wave (thermal) radiation downward clear-sky' = { table2Version = 228 ; indicatorOfParameter = 130 ; } @@ -16314,8 +16314,8 @@ table2Version = 210 ; indicatorOfParameter = 54 ; } -#Carbon Dioxide -'Carbon Dioxide' = { +#Carbon dioxide mass mixing ratio +'Carbon dioxide mass mixing ratio' = { table2Version = 210 ; indicatorOfParameter = 61 ; } diff --git a/definitions/grib1/localConcepts/ecmf/paramId.def b/definitions/grib1/localConcepts/ecmf/paramId.def index 46ed99774..572393e2e 100644 --- a/definitions/grib1/localConcepts/ecmf/paramId.def +++ b/definitions/grib1/localConcepts/ecmf/paramId.def @@ -294,7 +294,7 @@ table2Version = 128 ; indicatorOfParameter = 48 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '49' = { table2Version = 128 ; indicatorOfParameter = 49 ; @@ -659,7 +659,7 @@ table2Version = 128 ; indicatorOfParameter = 122 ; } -#10 metre wind gust in the last 6 hours +#Maximum 10 metre wind gust in the last 6 hours '123' = { table2Version = 128 ; indicatorOfParameter = 123 ; @@ -1169,7 +1169,7 @@ table2Version = 128 ; indicatorOfParameter = 159 ; } -#Standard deviation of orography +#Standard deviation of sub-gridscale orography '160' = { table2Version = 128 ; indicatorOfParameter = 160 ; @@ -9879,7 +9879,7 @@ table2Version = 228 ; indicatorOfParameter = 20 ; } -#Total sky direct solar radiation at surface +#Total sky direct short-wave (solar) radiation at surface '228021' = { table2Version = 228 ; indicatorOfParameter = 21 ; @@ -9914,7 +9914,7 @@ table2Version = 228 ; indicatorOfParameter = 27 ; } -#10 metre wind gust in the last 3 hours +#Maximum 10 metre wind gust in the last 3 hours '228028' = { table2Version = 228 ; indicatorOfParameter = 28 ; @@ -10089,12 +10089,12 @@ table2Version = 228 ; indicatorOfParameter = 94 ; } -#Surface solar radiation downward clear-sky +#Surface short-wave (solar) radiation downward clear-sky '228129' = { table2Version = 228 ; indicatorOfParameter = 129 ; } -#Surface thermal radiation downward clear-sky +#Surface long-wave (thermal) radiation downward clear-sky '228130' = { table2Version = 228 ; indicatorOfParameter = 130 ; @@ -16314,7 +16314,7 @@ table2Version = 210 ; indicatorOfParameter = 54 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio '210061' = { table2Version = 210 ; indicatorOfParameter = 61 ; diff --git a/definitions/grib1/localConcepts/ecmf/shortName.def b/definitions/grib1/localConcepts/ecmf/shortName.def index 159ebb628..6fd82758e 100644 --- a/definitions/grib1/localConcepts/ecmf/shortName.def +++ b/definitions/grib1/localConcepts/ecmf/shortName.def @@ -294,7 +294,7 @@ table2Version = 128 ; indicatorOfParameter = 48 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '10fg' = { table2Version = 128 ; indicatorOfParameter = 49 ; @@ -659,7 +659,7 @@ table2Version = 128 ; indicatorOfParameter = 122 ; } -#10 metre wind gust in the last 6 hours +#Maximum 10 metre wind gust in the last 6 hours '10fg6' = { table2Version = 128 ; indicatorOfParameter = 123 ; @@ -1169,7 +1169,7 @@ table2Version = 128 ; indicatorOfParameter = 159 ; } -#Standard deviation of orography +#Standard deviation of sub-gridscale orography 'sdor' = { table2Version = 128 ; indicatorOfParameter = 160 ; @@ -9879,7 +9879,7 @@ table2Version = 228 ; indicatorOfParameter = 20 ; } -#Total sky direct solar radiation at surface +#Total sky direct short-wave (solar) radiation at surface 'fdir' = { table2Version = 228 ; indicatorOfParameter = 21 ; @@ -9914,7 +9914,7 @@ table2Version = 228 ; indicatorOfParameter = 27 ; } -#10 metre wind gust in the last 3 hours +#Maximum 10 metre wind gust in the last 3 hours '10fg3' = { table2Version = 228 ; indicatorOfParameter = 28 ; @@ -10089,12 +10089,12 @@ table2Version = 228 ; indicatorOfParameter = 94 ; } -#Surface solar radiation downward clear-sky +#Surface short-wave (solar) radiation downward clear-sky 'ssrdc' = { table2Version = 228 ; indicatorOfParameter = 129 ; } -#Surface thermal radiation downward clear-sky +#Surface long-wave (thermal) radiation downward clear-sky 'strdc' = { table2Version = 228 ; indicatorOfParameter = 130 ; @@ -16314,7 +16314,7 @@ table2Version = 210 ; indicatorOfParameter = 54 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio 'co2' = { table2Version = 210 ; indicatorOfParameter = 61 ; diff --git a/definitions/grib1/localConcepts/ecmf/units.def b/definitions/grib1/localConcepts/ecmf/units.def index f34142102..027242702 100644 --- a/definitions/grib1/localConcepts/ecmf/units.def +++ b/definitions/grib1/localConcepts/ecmf/units.def @@ -294,7 +294,7 @@ table2Version = 128 ; indicatorOfParameter = 48 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'm s**-1' = { table2Version = 128 ; indicatorOfParameter = 49 ; @@ -659,7 +659,7 @@ table2Version = 128 ; indicatorOfParameter = 122 ; } -#10 metre wind gust in the last 6 hours +#Maximum 10 metre wind gust in the last 6 hours 'm s**-1' = { table2Version = 128 ; indicatorOfParameter = 123 ; @@ -1169,7 +1169,7 @@ table2Version = 128 ; indicatorOfParameter = 159 ; } -#Standard deviation of orography +#Standard deviation of sub-gridscale orography 'm' = { table2Version = 128 ; indicatorOfParameter = 160 ; @@ -9879,7 +9879,7 @@ table2Version = 228 ; indicatorOfParameter = 20 ; } -#Total sky direct solar radiation at surface +#Total sky direct short-wave (solar) radiation at surface 'J m**-2' = { table2Version = 228 ; indicatorOfParameter = 21 ; @@ -9914,7 +9914,7 @@ table2Version = 228 ; indicatorOfParameter = 27 ; } -#10 metre wind gust in the last 3 hours +#Maximum 10 metre wind gust in the last 3 hours 'm s**-1' = { table2Version = 228 ; indicatorOfParameter = 28 ; @@ -10089,12 +10089,12 @@ table2Version = 228 ; indicatorOfParameter = 94 ; } -#Surface solar radiation downward clear-sky +#Surface short-wave (solar) radiation downward clear-sky 'J m**-2' = { table2Version = 228 ; indicatorOfParameter = 129 ; } -#Surface thermal radiation downward clear-sky +#Surface long-wave (thermal) radiation downward clear-sky 'J m**-2' = { table2Version = 228 ; indicatorOfParameter = 130 ; @@ -16314,7 +16314,7 @@ table2Version = 210 ; indicatorOfParameter = 54 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio 'kg kg**-1' = { table2Version = 210 ; indicatorOfParameter = 61 ; diff --git a/definitions/grib1/localConcepts/edzw/name.def b/definitions/grib1/localConcepts/edzw/name.def index 47f2c21a7..6abae509f 100644 --- a/definitions/grib1/localConcepts/edzw/name.def +++ b/definitions/grib1/localConcepts/edzw/name.def @@ -1,4 +1,4 @@ -# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2020-11-05 10:29 +# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2023-07-18 16:26 #paramId: 500000 #Pressure (S) (not reduced) 'Pressure (S) (not reduced)' = { @@ -5441,6 +5441,104 @@ indicatorOfParameter = 128 ; } +#paramId: 500779 +#DUMMY_129 +'DUMMY_129' = { + table2Version = 254 ; + indicatorOfParameter = 129 ; + } + +#paramId: 500780 +#DUMMY_130 +'DUMMY_130' = { + table2Version = 254 ; + indicatorOfParameter = 130 ; + } + +#paramId: 500781 +#DUMMY_131 +'DUMMY_131' = { + table2Version = 254 ; + indicatorOfParameter = 131 ; + } + +#paramId: 500782 +#DUMMY_132 +'DUMMY_132' = { + table2Version = 254 ; + indicatorOfParameter = 132 ; + } + +#paramId: 500783 +#DUMMY_133 +'DUMMY_133' = { + table2Version = 254 ; + indicatorOfParameter = 133 ; + } + +#paramId: 500784 +#DUMMY_134 +'DUMMY_134' = { + table2Version = 254 ; + indicatorOfParameter = 134 ; + } + +#paramId: 500785 +#DUMMY_135 +'DUMMY_135' = { + table2Version = 254 ; + indicatorOfParameter = 135 ; + } + +#paramId: 500786 +#DUMMY_136 +'DUMMY_136' = { + table2Version = 254 ; + indicatorOfParameter = 136 ; + } + +#paramId: 500787 +#DUMMY_137 +'DUMMY_137' = { + table2Version = 254 ; + indicatorOfParameter = 137 ; + } + +#paramId: 500788 +#DUMMY_138 +'DUMMY_138' = { + table2Version = 254 ; + indicatorOfParameter = 138 ; + } + +#paramId: 500789 +#DUMMY_139 +'DUMMY_139' = { + table2Version = 254 ; + indicatorOfParameter = 139 ; + } + +#paramId: 500790 +#DUMMY_140 +'DUMMY_140' = { + table2Version = 254 ; + indicatorOfParameter = 140 ; + } + +#paramId: 500791 +#DUMMY_141 +'DUMMY_141' = { + table2Version = 254 ; + indicatorOfParameter = 141 ; + } + +#paramId: 500792 +#DUMMY_142 +'DUMMY_142' = { + table2Version = 254 ; + indicatorOfParameter = 142 ; + } + #paramId: 500793 #DUMMY_143 'DUMMY_143' = { @@ -7342,13 +7440,6 @@ indicatorOfParameter = 18 ; } -#paramId: 502505 -#Visibility -'Visibility' = { - table2Version = 2 ; - indicatorOfParameter = 20 ; - } - #paramId: 502506 #Radar spectra (2) 'Radar spectra (2)' = { @@ -8657,6 +8748,13 @@ indicatorOfParameter = 71 ; } +#paramId: 502946 +#Visibility +'Visibility' = { + table2Version = 2 ; + indicatorOfParameter = 20 ; + } + #paramId: 503049 #Eddy dissipitation rate of TKE 'Eddy dissipitation rate of TKE' = { diff --git a/definitions/grib1/localConcepts/edzw/paramId.def b/definitions/grib1/localConcepts/edzw/paramId.def index e27013695..c26e8f4b9 100644 --- a/definitions/grib1/localConcepts/edzw/paramId.def +++ b/definitions/grib1/localConcepts/edzw/paramId.def @@ -1,4 +1,4 @@ -# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE,do not edit! 2020-11-05 10:29 +# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE,do not edit! 2023-07-18 16:26 #paramId: 500000 #Pressure (S) (not reduced) '500000' = { @@ -2073,13 +2073,6 @@ indicatorOfParameter = 18 ; } -#paramId: 502505 -#Visibility -'502505' = { - table2Version = 2 ; - indicatorOfParameter = 20 ; - } - #paramId: 502506 #Radar spectra (2) '502506' = { @@ -3381,6 +3374,13 @@ indicatorOfParameter = 35 ; } +#paramId: 502946 +#Visibility +'502946' = { + table2Version = 2 ; + indicatorOfParameter = 20 ; + } + #paramId: 503063 #Momentum Flux, U-Component (m) '503063' = { @@ -7922,6 +7922,104 @@ indicatorOfParameter = 128 ; } +#paramId: 500779 +#DUMMY_129 +'500779' = { + table2Version = 254 ; + indicatorOfParameter = 129 ; + } + +#paramId: 500780 +#DUMMY_130 +'500780' = { + table2Version = 254 ; + indicatorOfParameter = 130 ; + } + +#paramId: 500781 +#DUMMY_131 +'500781' = { + table2Version = 254 ; + indicatorOfParameter = 131 ; + } + +#paramId: 500782 +#DUMMY_132 +'500782' = { + table2Version = 254 ; + indicatorOfParameter = 132 ; + } + +#paramId: 500783 +#DUMMY_133 +'500783' = { + table2Version = 254 ; + indicatorOfParameter = 133 ; + } + +#paramId: 500784 +#DUMMY_134 +'500784' = { + table2Version = 254 ; + indicatorOfParameter = 134 ; + } + +#paramId: 500785 +#DUMMY_135 +'500785' = { + table2Version = 254 ; + indicatorOfParameter = 135 ; + } + +#paramId: 500786 +#DUMMY_136 +'500786' = { + table2Version = 254 ; + indicatorOfParameter = 136 ; + } + +#paramId: 500787 +#DUMMY_137 +'500787' = { + table2Version = 254 ; + indicatorOfParameter = 137 ; + } + +#paramId: 500788 +#DUMMY_138 +'500788' = { + table2Version = 254 ; + indicatorOfParameter = 138 ; + } + +#paramId: 500789 +#DUMMY_139 +'500789' = { + table2Version = 254 ; + indicatorOfParameter = 139 ; + } + +#paramId: 500790 +#DUMMY_140 +'500790' = { + table2Version = 254 ; + indicatorOfParameter = 140 ; + } + +#paramId: 500791 +#DUMMY_141 +'500791' = { + table2Version = 254 ; + indicatorOfParameter = 141 ; + } + +#paramId: 500792 +#DUMMY_142 +'500792' = { + table2Version = 254 ; + indicatorOfParameter = 142 ; + } + #paramId: 500793 #DUMMY_143 '500793' = { diff --git a/definitions/grib1/localConcepts/edzw/shortName.def b/definitions/grib1/localConcepts/edzw/shortName.def index 3ee953db6..e71934309 100644 --- a/definitions/grib1/localConcepts/edzw/shortName.def +++ b/definitions/grib1/localConcepts/edzw/shortName.def @@ -1,4 +1,4 @@ -# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2020-11-05 10:29 +# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2023-07-18 16:26 #paramId: 500000 #Pressure (S) (not reduced) 'PS' = { @@ -5441,6 +5441,104 @@ indicatorOfParameter = 128 ; } +#paramId: 500779 +#DUMMY_129 +'DUMMY_129' = { + table2Version = 254 ; + indicatorOfParameter = 129 ; + } + +#paramId: 500780 +#DUMMY_130 +'DUMMY_130' = { + table2Version = 254 ; + indicatorOfParameter = 130 ; + } + +#paramId: 500781 +#DUMMY_131 +'DUMMY_131' = { + table2Version = 254 ; + indicatorOfParameter = 131 ; + } + +#paramId: 500782 +#DUMMY_132 +'DUMMY_132' = { + table2Version = 254 ; + indicatorOfParameter = 132 ; + } + +#paramId: 500783 +#DUMMY_133 +'DUMMY_133' = { + table2Version = 254 ; + indicatorOfParameter = 133 ; + } + +#paramId: 500784 +#DUMMY_134 +'DUMMY_134' = { + table2Version = 254 ; + indicatorOfParameter = 134 ; + } + +#paramId: 500785 +#DUMMY_135 +'DUMMY_135' = { + table2Version = 254 ; + indicatorOfParameter = 135 ; + } + +#paramId: 500786 +#DUMMY_136 +'DUMMY_136' = { + table2Version = 254 ; + indicatorOfParameter = 136 ; + } + +#paramId: 500787 +#DUMMY_137 +'DUMMY_137' = { + table2Version = 254 ; + indicatorOfParameter = 137 ; + } + +#paramId: 500788 +#DUMMY_138 +'DUMMY_138' = { + table2Version = 254 ; + indicatorOfParameter = 138 ; + } + +#paramId: 500789 +#DUMMY_139 +'DUMMY_139' = { + table2Version = 254 ; + indicatorOfParameter = 139 ; + } + +#paramId: 500790 +#DUMMY_140 +'DUMMY_140' = { + table2Version = 254 ; + indicatorOfParameter = 140 ; + } + +#paramId: 500791 +#DUMMY_141 +'DUMMY_141' = { + table2Version = 254 ; + indicatorOfParameter = 141 ; + } + +#paramId: 500792 +#DUMMY_142 +'DUMMY_142' = { + table2Version = 254 ; + indicatorOfParameter = 142 ; + } + #paramId: 500793 #DUMMY_143 'DUMMY_143' = { @@ -7342,13 +7440,6 @@ indicatorOfParameter = 18 ; } -#paramId: 502505 -#Visibility -'VIS' = { - table2Version = 2 ; - indicatorOfParameter = 20 ; - } - #paramId: 502506 #Radar spectra (2) 'RDSP2' = { @@ -8657,6 +8748,13 @@ indicatorOfParameter = 71 ; } +#paramId: 502946 +#Visibility +'VIS' = { + table2Version = 2 ; + indicatorOfParameter = 20 ; + } + #paramId: 503049 #Eddy dissipitation rate of TKE 'EDR' = { diff --git a/definitions/grib1/localConcepts/edzw/units.def b/definitions/grib1/localConcepts/edzw/units.def index d525620a4..73fe51891 100644 --- a/definitions/grib1/localConcepts/edzw/units.def +++ b/definitions/grib1/localConcepts/edzw/units.def @@ -1,4 +1,4 @@ -# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2020-11-05 10:29 +# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2023-07-18 16:26 #paramId: 500000 #Pressure (S) (not reduced) 'Pa' = { @@ -5441,6 +5441,104 @@ indicatorOfParameter = 128 ; } +#paramId: 500779 +#DUMMY_129 +'' = { + table2Version = 254 ; + indicatorOfParameter = 129 ; + } + +#paramId: 500780 +#DUMMY_130 +'' = { + table2Version = 254 ; + indicatorOfParameter = 130 ; + } + +#paramId: 500781 +#DUMMY_131 +'' = { + table2Version = 254 ; + indicatorOfParameter = 131 ; + } + +#paramId: 500782 +#DUMMY_132 +'' = { + table2Version = 254 ; + indicatorOfParameter = 132 ; + } + +#paramId: 500783 +#DUMMY_133 +'' = { + table2Version = 254 ; + indicatorOfParameter = 133 ; + } + +#paramId: 500784 +#DUMMY_134 +'' = { + table2Version = 254 ; + indicatorOfParameter = 134 ; + } + +#paramId: 500785 +#DUMMY_135 +'' = { + table2Version = 254 ; + indicatorOfParameter = 135 ; + } + +#paramId: 500786 +#DUMMY_136 +'' = { + table2Version = 254 ; + indicatorOfParameter = 136 ; + } + +#paramId: 500787 +#DUMMY_137 +'' = { + table2Version = 254 ; + indicatorOfParameter = 137 ; + } + +#paramId: 500788 +#DUMMY_138 +'' = { + table2Version = 254 ; + indicatorOfParameter = 138 ; + } + +#paramId: 500789 +#DUMMY_139 +'' = { + table2Version = 254 ; + indicatorOfParameter = 139 ; + } + +#paramId: 500790 +#DUMMY_140 +'' = { + table2Version = 254 ; + indicatorOfParameter = 140 ; + } + +#paramId: 500791 +#DUMMY_141 +'' = { + table2Version = 254 ; + indicatorOfParameter = 141 ; + } + +#paramId: 500792 +#DUMMY_142 +'' = { + table2Version = 254 ; + indicatorOfParameter = 142 ; + } + #paramId: 500793 #DUMMY_143 '' = { @@ -7342,13 +7440,6 @@ indicatorOfParameter = 18 ; } -#paramId: 502505 -#Visibility -'m' = { - table2Version = 2 ; - indicatorOfParameter = 20 ; - } - #paramId: 502506 #Radar spectra (2) 'Numeric' = { @@ -8657,6 +8748,13 @@ indicatorOfParameter = 71 ; } +#paramId: 502946 +#Visibility +'m' = { + table2Version = 2 ; + indicatorOfParameter = 20 ; + } + #paramId: 503049 #Eddy dissipitation rate of TKE 'm2 s-3' = { diff --git a/definitions/grib1/resolution_flags.def b/definitions/grib1/resolution_flags.def index 6c56f24b9..eb096e61e 100644 --- a/definitions/grib1/resolution_flags.def +++ b/definitions/grib1/resolution_flags.def @@ -1,4 +1,4 @@ -# Resolution and component flags +# Resolution and component flags flags[1] resolutionAndComponentFlags 'grib1/7.table' : edition_specific,no_copy ; # Note our flagbit numbers run from 7 to 0, while WMO convention uses 1 to 8 @@ -21,7 +21,6 @@ if (earthIsOblate) { alias earthMinorAxisInMetres=earthMinorAxis; } - flagbit resolutionAndComponentFlags3(resolutionAndComponentFlags,5) = 0: read_only; flagbit resolutionAndComponentFlags4(resolutionAndComponentFlags,4) = 0: read_only; diff --git a/definitions/grib1/scanning_mode.def b/definitions/grib1/scanning_mode.def index fadd9509f..477e63562 100644 --- a/definitions/grib1/scanning_mode.def +++ b/definitions/grib1/scanning_mode.def @@ -1,6 +1,6 @@ constant isGridded = one; -# Scanning mode +# Scanning mode flags[1] scanningMode 'grib1/8.table' : edition_specific,no_copy; # Not flagbit numbers 7 to 0, while wmo is 1 to 8 diff --git a/definitions/grib1/section.1.def b/definitions/grib1/section.1.def index fc0c82e86..3d89bd277 100644 --- a/definitions/grib1/section.1.def +++ b/definitions/grib1/section.1.def @@ -23,15 +23,14 @@ section_length[3] section1Length; meta section1Pointer section_pointer(offsetSection1,section1Length,1); constant wrongPadding=0; -# GRIB tables Version No. +# GRIB tables Version No. # (currently 3 for international exchange) -unsigned[1] table2Version : edition_specific,dump; +unsigned[1] table2Version : edition_specific,dump; alias gribTablesVersionNo=table2Version; - #assert(section1Length > 5); -# Identification of originating/generating centre +# Identification of originating/generating centre codetable[1] centre 'common/c-1.table' : dump,string_type; alias identificationOfOriginatingGeneratingCentre=centre; meta centreDescription codetable_title(centre); @@ -40,8 +39,7 @@ alias parameter.centre=centre; alias originatingCentre=centre; alias ls.centre = centre; -# Generating process identification number -# (allocated by originating centre) +# Generating process identification number unsigned[1] generatingProcessIdentifier : dump; alias generatingProcessIdentificationNumber=generatingProcessIdentifier; alias process=generatingProcessIdentifier; @@ -269,7 +267,6 @@ if(((section1Length > 40) or new() or setLocalDefinition> 0) and deleteLocalDefi } template_nofail marsKeywords "mars/grib.[stream:s].[type:s].def"; - #template marsKeywords "mars/grib.[stream:s].[type:s].def"; } else @@ -286,13 +283,12 @@ if(((section1Length > 40) or new() or setLocalDefinition> 0) and deleteLocalDefi else { constant localUsePresent = 0 : edition_specific; - # template defaultMarsLabeling "mars/default_labeling.def"; } section_padding section1Padding : read_only; #if (!wrongPadding) { -# padtoeven evenpadding_sec1(offsetSection1,section1Length); +# padtoeven evenpadding_sec1(offsetSection1,section1Length); #} concept shortNameECMF (defaultShortName,"shortName.def",conceptsMasterDir,conceptsLocalDirECMF) : no_copy; diff --git a/definitions/grib1/section.4.def b/definitions/grib1/section.4.def index ef6428e3f..80f602a7e 100644 --- a/definitions/grib1/section.4.def +++ b/definitions/grib1/section.4.def @@ -179,6 +179,7 @@ alias setDecimalPrecision=changeDecimalPrecision; meta bitsPerValueAndRepack bits_per_value(values,bitsPerValue) : edition_specific; alias setBitsPerValue=bitsPerValueAndRepack; +meta setPackingType packing_type(values,packingType) : edition_specific; meta scaleValuesBy scale_values(values,missingValue) : edition_specific; meta offsetValuesBy offset_values(values,missingValue) : edition_specific; diff --git a/definitions/grib2/cfVarName.def b/definitions/grib2/cfVarName.def index a596af2a0..4234951b7 100644 --- a/definitions/grib2/cfVarName.def +++ b/definitions/grib2/cfVarName.def @@ -206,7 +206,7 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'fg10' = { discipline = 0 ; parameterCategory = 2 ; @@ -326,6 +326,12 @@ parameterCategory = 3 ; parameterNumber = 18 ; } +#Standard deviation of sub-gridscale orography +'sdor' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 20 ; + } #Anisotropy of sub-gridscale orography 'isor' = { discipline = 0 ; @@ -2424,6 +2430,14 @@ scaledValueOfFirstFixedSurface = 26315 ; scaleFactorOfFirstFixedSurface = 2 ; } +#Total sky direct short-wave (solar) radiation at surface +'fdir' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Surface direct short-wave radiation, clear sky 'cdir' = { discipline = 0 ; @@ -2432,6 +2446,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Cloud base height +'cbh' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 2 ; + } #0 degrees C isothermal level (atm) 'deg0l' = { discipline = 0 ; @@ -2441,7 +2462,7 @@ scaledValueOfFirstFixedSurface = 27315 ; scaleFactorOfFirstFixedSurface = 2 ; } -#10 metre wind gust in the last 3 hours +#Maximum 10 metre wind gust in the last 3 hours 'fg310' = { discipline = 0 ; parameterCategory = 2 ; @@ -2523,6 +2544,14 @@ parameterCategory = 3 ; parameterNumber = 23 ; } +#Convective available potential energy shear +'capes' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Tropopause pressure 'trpp' = { discipline = 0 ; @@ -2746,6 +2775,22 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 10 ; } +#Surface short-wave (solar) radiation downward clear-sky +'ssrdc' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Surface long-wave (thermal) radiation downward clear-sky +'strdc' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Convective precipitation 'cp' = { discipline = 0 ; @@ -2984,7 +3029,7 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Runoff water equivalent +#Runoff water equivalent (surface plus subsurface) 'rowe' = { discipline = 2 ; parameterCategory = 0 ; @@ -4086,6 +4131,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total column integrated ozone +'tcioz' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #2 metre relative humidity 'r2' = { discipline = 0 ; @@ -4433,6 +4486,18 @@ parameterCategory = 1 ; parameterNumber = 15 ; } +#Cloudy reflectance +'cdrfl' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 31 ; + } +#Clear reflectance +'crrfl' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 32 ; + } #Scaled radiance 'p260530' = { discipline = 3 ; @@ -4910,8 +4975,8 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } -#Sea ice temperature -'sitemp' = { +#Vertically averaged sea ice temperature +'vasit' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 8 ; @@ -5066,6 +5131,12 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice temperature +'sit' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + } #Sea surface practical salinity 'sos' = { discipline = 10 ; @@ -5973,8 +6044,8 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice temperature -'avg_sitemp' = { +#Time-mean vertically averaged sea ice temperature +'avg_vasit' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 8 ; @@ -6142,6 +6213,13 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice temperature +'avg_sit' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface practical salinity 'avg_sos' = { discipline = 10 ; @@ -7543,12 +7621,54 @@ parameterCategory = 0 ; parameterNumber = 20 ; } +#10 metre wind speed +'wind' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Altimeter wave height +'awh' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } +#Altimeter corrected wave height +'acwh' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 38 ; + } +#Altimeter range relative correction +'arrc' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 39 ; + } +#10 metre wind direction +'dwi' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #2D wave spectra (single) 'd2fd' = { discipline = 10 ; parameterCategory = 0 ; parameterNumber = 86 ; } +#Wave spectral kurtosis +'wsk' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 43 ; + } #Benjamin-Feir index 'bfi' = { discipline = 10 ; @@ -8985,12 +9105,6 @@ parameterCategory = 14 ; parameterNumber = 0 ; } -#Total column integrated ozone -'tcioz' = { - discipline = 0 ; - parameterCategory = 14 ; - parameterNumber = 2 ; - } #Base spectrum width 'bswid' = { discipline = 0 ; diff --git a/definitions/grib2/d b/definitions/grib2/d deleted file mode 100644 index 1747c3626..000000000 --- a/definitions/grib2/d +++ /dev/null @@ -1,98 +0,0 @@ -0.0.table -1.0.table -1.1.table -1.2.table -1.3.table -1.4.table -3.0.table -3.1.table -3.10.table -3.11.table -3.15.table -3.2.table -3.20.table -3.21.table -3.3.table -3.4.table -3.5.table -3.6.table -3.7.table -3.8.table -3.9.table -4.0.table -4.1.0.table -4.1.1.table -4.1.10.table -4.1.2.table -4.1.3.table -4.1.table -4.10.table -4.11.table -4.12.table -4.13.table -4.14.table -4.2.0.0.table -4.2.0.1.table -4.2.0.13.table -4.2.0.14.table -4.2.0.15.table -4.2.0.18.table -4.2.0.19.table -4.2.0.190.table -4.2.0.191.table -4.2.0.2.table -4.2.0.3.table -4.2.0.4.table -4.2.0.5.table -4.2.0.6.table -4.2.0.7.table -4.2.1.0.table -4.2.1.1.table -4.2.10.0.table -4.2.10.1.table -4.2.10.2.table -4.2.10.3.table -4.2.10.4.table -4.2.2.0.table -4.2.2.3.table -4.2.3.0.table -4.2.3.1.table -4.2.table -4.201.table -4.202.table -4.203.table -4.204.table -4.205.table -4.206.table -4.207.table -4.208.table -4.209.table -4.210.table -4.211.table -4.212.table -4.213.table -4.215.table -4.216.table -4.217.table -4.220.table -4.221.table -4.3.table -4.4.table -4.5.table -4.6.table -4.7.table -4.8.table -4.9.table -5.0.table -5.1.table -5.2.table -5.3.table -5.4.table -5.40.table -5.40000.table -5.5.table -5.6.table -5.7.table -5.8.table -5.9.table -6.0.table diff --git a/definitions/grib2/localConcepts/destine/cfName.def b/definitions/grib2/localConcepts/destine/cfName.def new file mode 100644 index 000000000..acde985fd --- /dev/null +++ b/definitions/grib2/localConcepts/destine/cfName.def @@ -0,0 +1,9 @@ +# Automatically generated by ./create_def.pl, do not edit +#Carbon dioxide mass mixing ratio +'mass_fraction_of_carbon_dioxide_in_air' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 3 ; + is_chemical = 1 ; +} diff --git a/definitions/grib2/localConcepts/destine/name.def b/definitions/grib2/localConcepts/destine/name.def new file mode 100644 index 000000000..a00484536 --- /dev/null +++ b/definitions/grib2/localConcepts/destine/name.def @@ -0,0 +1,9 @@ +# Automatically generated by ./create_def.pl, do not edit +#Carbon dioxide mass mixing ratio +'Carbon dioxide mass mixing ratio' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 3 ; + is_chemical = 1 ; +} diff --git a/definitions/grib2/localConcepts/destine/paramId.def b/definitions/grib2/localConcepts/destine/paramId.def new file mode 100644 index 000000000..e9080e6d4 --- /dev/null +++ b/definitions/grib2/localConcepts/destine/paramId.def @@ -0,0 +1,9 @@ +# Automatically generated by ./create_def.pl, do not edit +#Carbon dioxide mass mixing ratio +'210061' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 3 ; + is_chemical = 1 ; +} diff --git a/definitions/grib2/localConcepts/destine/shortName.def b/definitions/grib2/localConcepts/destine/shortName.def new file mode 100644 index 000000000..8c26930a3 --- /dev/null +++ b/definitions/grib2/localConcepts/destine/shortName.def @@ -0,0 +1,9 @@ +# Automatically generated by ./create_def.pl, do not edit +#Carbon dioxide mass mixing ratio +'co2' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 3 ; + is_chemical = 1 ; +} diff --git a/definitions/grib2/localConcepts/destine/units.def b/definitions/grib2/localConcepts/destine/units.def new file mode 100644 index 000000000..b7edf253c --- /dev/null +++ b/definitions/grib2/localConcepts/destine/units.def @@ -0,0 +1,9 @@ +# Automatically generated by ./create_def.pl, do not edit +#Carbon dioxide mass mixing ratio +'kg kg**-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 3 ; + is_chemical = 1 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/cfName.def b/definitions/grib2/localConcepts/ecmf/cfName.def index f60b522c8..f32ddc9a7 100644 --- a/definitions/grib2/localConcepts/ecmf/cfName.def +++ b/definitions/grib2/localConcepts/ecmf/cfName.def @@ -85,9 +85,12 @@ } #Total column ozone 'atmosphere_mass_content_of_ozone' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 206 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 192 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; } #Hydrogen peroxide 'mass_fraction_of_hydrogen_peroxide_in_air' = { @@ -515,7 +518,7 @@ parameterCategory = 151 ; parameterNumber = 154 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio 'mass_fraction_of_carbon_dioxide_in_air' = { discipline = 192 ; parameterCategory = 210 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfName.legacy.def index 102bbbc17..e3b2b9750 100644 --- a/definitions/grib2/localConcepts/ecmf/cfName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/cfName.legacy.def @@ -142,3 +142,9 @@ parameterCategory = 128 ; parameterNumber = 174 ; } +#Total column ozone +'atmosphere_mass_content_of_ozone' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 206 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.def b/definitions/grib2/localConcepts/ecmf/cfVarName.def index 50d38a32b..4f85bb57e 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.def @@ -542,7 +542,7 @@ parameterCategory = 128 ; parameterNumber = 120 ; } -#10 metre wind gust in the last 6 hours +#Maximum 10 metre wind gust in the last 6 hours 'p10fg6' = { discipline = 192 ; parameterCategory = 128 ; @@ -661,12 +661,6 @@ parameterCategory = 128 ; parameterNumber = 158 ; } -#Standard deviation of orography -'sdor' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 160 ; - } #Total cloud cover 'tcc' = { localTablesVersion = 1 ; @@ -803,9 +797,12 @@ } #Total column ozone 'tco3' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 206 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 192 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; } #Diabatic heating by radiation 'dhr' = { @@ -921,15 +918,21 @@ } #Convective snowfall 'csf' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 239 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Large-scale snowfall 'lsf' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 240 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 202 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Accumulated cloud fraction tendency 'acf' = { @@ -13626,18 +13629,6 @@ typeOfStatisticalProcessing = 1 ; is_chemical = 1 ; } -#Total sky direct solar radiation at surface -'fdir' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 21 ; - } -#Cloud base height -'cbh' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 23 ; - } #Horizontal visibility 'hvis' = { discipline = 192 ; @@ -13800,18 +13791,6 @@ scaleFactorOfSecondWavelength = missing() ; is_aerosol_optical = 1 ; } -#Surface solar radiation downward clear-sky -'ssrdc' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 129 ; - } -#Surface thermal radiation downward clear-sky -'strdc' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 130 ; - } #Accumulated freezing rain 'fzra' = { localTablesVersion = 1 ; @@ -16468,48 +16447,12 @@ parameterCategory = 140 ; parameterNumber = 243 ; } -#10 metre wind speed -'wind' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 245 ; - } -#Altimeter wave height -'awh' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 246 ; - } -#Altimeter corrected wave height -'acwh' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 247 ; - } -#Altimeter range relative correction -'arrc' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 248 ; - } -#10 metre wind direction -'dwi' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 249 ; - } #2D wave spectra (multiple) 'd2sp' = { discipline = 192 ; parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral kurtosis -'wsk' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 252 ; - } #Wave spectral peakedness 'wsp' = { discipline = 192 ; @@ -20458,7 +20401,7 @@ parameterCategory = 210 ; parameterNumber = 54 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio 'co2' = { discipline = 192 ; parameterCategory = 210 ; diff --git a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def index f7bcee7d1..d7faa1e1d 100644 --- a/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/cfVarName.legacy.def @@ -1225,3 +1225,87 @@ parameterCategory = 140 ; parameterNumber = 216 ; } +#Total column ozone +'tco3' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 206 ; +} +#Convective snowfall +'csf' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 239 ; +} +#Large-scale snowfall +'lsf' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 240 ; +} +#Altimeter wave height +'awh' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 246 ; +} +#Altimeter corrected wave height +'acwh' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 247 ; +} +#Altimeter range relative correction +'arrc' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 248 ; +} +#Total sky direct solar radiation at surface +'fdir' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 21 ; +} +#Surface solar radiation downward clear-sky +'ssrdc' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 129 ; +} +#Surface thermal radiation downward clear-sky +'strdc' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 130 ; +} +#Standard deviation of orography +'sdor' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 160 ; +} +#Cloud base height +'cbh' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 23 ; +} +#Wave spectral kurtosis +'wsk' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 252 ; +} +#10 metre wind speed +'wind' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 245 ; +} +#10 metre wind direction +'dwi' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 249 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/name.def b/definitions/grib2/localConcepts/ecmf/name.def index 9aaaccc21..1d626bf3d 100644 --- a/definitions/grib2/localConcepts/ecmf/name.def +++ b/definitions/grib2/localConcepts/ecmf/name.def @@ -542,8 +542,8 @@ parameterCategory = 128 ; parameterNumber = 120 ; } -#10 metre wind gust in the last 6 hours -'10 metre wind gust in the last 6 hours' = { +#Maximum 10 metre wind gust in the last 6 hours +'Maximum 10 metre wind gust in the last 6 hours' = { discipline = 192 ; parameterCategory = 128 ; parameterNumber = 123 ; @@ -661,12 +661,6 @@ parameterCategory = 128 ; parameterNumber = 158 ; } -#Standard deviation of orography -'Standard deviation of orography' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 160 ; - } #Total cloud cover 'Total cloud cover' = { localTablesVersion = 1 ; @@ -803,9 +797,12 @@ } #Total column ozone 'Total column ozone' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 206 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 192 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; } #Diabatic heating by radiation 'Diabatic heating by radiation' = { @@ -921,15 +918,21 @@ } #Convective snowfall 'Convective snowfall' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 239 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Large-scale snowfall 'Large-scale snowfall' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 240 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 202 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Accumulated cloud fraction tendency 'Accumulated cloud fraction tendency' = { @@ -13626,18 +13629,6 @@ typeOfStatisticalProcessing = 1 ; is_chemical = 1 ; } -#Total sky direct solar radiation at surface -'Total sky direct solar radiation at surface' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 21 ; - } -#Cloud base height -'Cloud base height' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 23 ; - } #Horizontal visibility 'Horizontal visibility' = { discipline = 192 ; @@ -13800,18 +13791,6 @@ scaleFactorOfSecondWavelength = missing() ; is_aerosol_optical = 1 ; } -#Surface solar radiation downward clear-sky -'Surface solar radiation downward clear-sky' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 129 ; - } -#Surface thermal radiation downward clear-sky -'Surface thermal radiation downward clear-sky' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 130 ; - } #Accumulated freezing rain 'Accumulated freezing rain' = { localTablesVersion = 1 ; @@ -16468,48 +16447,12 @@ parameterCategory = 140 ; parameterNumber = 243 ; } -#10 metre wind speed -'10 metre wind speed' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 245 ; - } -#Altimeter wave height -'Altimeter wave height' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 246 ; - } -#Altimeter corrected wave height -'Altimeter corrected wave height' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 247 ; - } -#Altimeter range relative correction -'Altimeter range relative correction' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 248 ; - } -#10 metre wind direction -'10 metre wind direction' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 249 ; - } #2D wave spectra (multiple) '2D wave spectra (multiple)' = { discipline = 192 ; parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral kurtosis -'Wave spectral kurtosis' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 252 ; - } #Wave spectral peakedness 'Wave spectral peakedness' = { discipline = 192 ; @@ -20458,8 +20401,8 @@ parameterCategory = 210 ; parameterNumber = 54 ; } -#Carbon Dioxide -'Carbon Dioxide' = { +#Carbon dioxide mass mixing ratio +'Carbon dioxide mass mixing ratio' = { discipline = 192 ; parameterCategory = 210 ; parameterNumber = 61 ; diff --git a/definitions/grib2/localConcepts/ecmf/name.legacy.def b/definitions/grib2/localConcepts/ecmf/name.legacy.def index a57bbf939..c7a877462 100644 --- a/definitions/grib2/localConcepts/ecmf/name.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/name.legacy.def @@ -1225,3 +1225,87 @@ parameterCategory = 140 ; parameterNumber = 216 ; } +#Total column ozone +'Total column ozone' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 206 ; +} +#Convective snowfall +'Convective snowfall' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 239 ; +} +#Large-scale snowfall +'Large-scale snowfall' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 240 ; +} +#Altimeter wave height +'Altimeter wave height' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 246 ; +} +#Altimeter corrected wave height +'Altimeter corrected wave height' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 247 ; +} +#Altimeter range relative correction +'Altimeter range relative correction' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 248 ; +} +#Total sky direct solar radiation at surface +'Total sky direct solar radiation at surface' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 21 ; +} +#Surface solar radiation downward clear-sky +'Surface solar radiation downward clear-sky' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 129 ; +} +#Surface thermal radiation downward clear-sky +'Surface thermal radiation downward clear-sky' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 130 ; +} +#Standard deviation of orography +'Standard deviation of orography' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 160 ; +} +#Cloud base height +'Cloud base height' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 23 ; +} +#Wave spectral kurtosis +'Wave spectral kurtosis' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 252 ; +} +#10 metre wind speed +'10 metre wind speed' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 245 ; +} +#10 metre wind direction +'10 metre wind direction' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 249 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/paramId.def b/definitions/grib2/localConcepts/ecmf/paramId.def index b333b780c..9886c1f16 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.def @@ -542,7 +542,7 @@ parameterCategory = 128 ; parameterNumber = 120 ; } -#10 metre wind gust in the last 6 hours +#Maximum 10 metre wind gust in the last 6 hours '123' = { discipline = 192 ; parameterCategory = 128 ; @@ -661,12 +661,6 @@ parameterCategory = 128 ; parameterNumber = 158 ; } -#Standard deviation of orography -'160' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 160 ; - } #Total cloud cover '164' = { localTablesVersion = 1 ; @@ -803,9 +797,12 @@ } #Total column ozone '206' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 206 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 192 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; } #Diabatic heating by radiation '214' = { @@ -921,15 +918,21 @@ } #Convective snowfall '239' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 239 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Large-scale snowfall '240' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 240 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 202 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Accumulated cloud fraction tendency '241' = { @@ -13626,18 +13629,6 @@ typeOfStatisticalProcessing = 1 ; is_chemical = 1 ; } -#Total sky direct solar radiation at surface -'228021' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 21 ; - } -#Cloud base height -'228023' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 23 ; - } #Horizontal visibility '228025' = { discipline = 192 ; @@ -13800,18 +13791,6 @@ scaleFactorOfSecondWavelength = missing() ; is_aerosol_optical = 1 ; } -#Surface solar radiation downward clear-sky -'228129' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 129 ; - } -#Surface thermal radiation downward clear-sky -'228130' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 130 ; - } #Accumulated freezing rain '228216' = { localTablesVersion = 1 ; @@ -16468,48 +16447,12 @@ parameterCategory = 140 ; parameterNumber = 243 ; } -#10 metre wind speed -'140245' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 245 ; - } -#Altimeter wave height -'140246' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 246 ; - } -#Altimeter corrected wave height -'140247' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 247 ; - } -#Altimeter range relative correction -'140248' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 248 ; - } -#10 metre wind direction -'140249' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 249 ; - } #2D wave spectra (multiple) '140250' = { discipline = 192 ; parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral kurtosis -'140252' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 252 ; - } #Wave spectral peakedness '140254' = { discipline = 192 ; @@ -20458,7 +20401,7 @@ parameterCategory = 210 ; parameterNumber = 54 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio '210061' = { discipline = 192 ; parameterCategory = 210 ; diff --git a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def index 598fa6dea..cb5186931 100644 --- a/definitions/grib2/localConcepts/ecmf/paramId.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/paramId.legacy.def @@ -1225,3 +1225,87 @@ parameterCategory = 140 ; parameterNumber = 216 ; } +#Total column ozone +'206' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 206 ; +} +#Convective snowfall +'239' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 239 ; +} +#Large-scale snowfall +'240' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 240 ; +} +#Altimeter wave height +'140246' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 246 ; +} +#Altimeter corrected wave height +'140247' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 247 ; +} +#Altimeter range relative correction +'140248' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 248 ; +} +#Total sky direct solar radiation at surface +'228021' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 21 ; +} +#Surface solar radiation downward clear-sky +'228129' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 129 ; +} +#Surface thermal radiation downward clear-sky +'228130' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 130 ; +} +#Standard deviation of orography +'160' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 160 ; +} +#Cloud base height +'228023' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 23 ; +} +#Wave spectral kurtosis +'140252' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 252 ; +} +#10 metre wind speed +'140245' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 245 ; +} +#10 metre wind direction +'140249' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 249 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/shortName.def b/definitions/grib2/localConcepts/ecmf/shortName.def index 08c773a66..3d30e0aec 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.def @@ -542,7 +542,7 @@ parameterCategory = 128 ; parameterNumber = 120 ; } -#10 metre wind gust in the last 6 hours +#Maximum 10 metre wind gust in the last 6 hours '10fg6' = { discipline = 192 ; parameterCategory = 128 ; @@ -661,12 +661,6 @@ parameterCategory = 128 ; parameterNumber = 158 ; } -#Standard deviation of orography -'sdor' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 160 ; - } #Total cloud cover 'tcc' = { localTablesVersion = 1 ; @@ -803,9 +797,12 @@ } #Total column ozone 'tco3' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 206 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 192 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; } #Diabatic heating by radiation 'dhr' = { @@ -921,15 +918,21 @@ } #Convective snowfall 'csf' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 239 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Large-scale snowfall 'lsf' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 240 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 202 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Accumulated cloud fraction tendency 'acf' = { @@ -13626,18 +13629,6 @@ typeOfStatisticalProcessing = 1 ; is_chemical = 1 ; } -#Total sky direct solar radiation at surface -'fdir' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 21 ; - } -#Cloud base height -'cbh' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 23 ; - } #Horizontal visibility 'hvis' = { discipline = 192 ; @@ -13800,18 +13791,6 @@ scaleFactorOfSecondWavelength = missing() ; is_aerosol_optical = 1 ; } -#Surface solar radiation downward clear-sky -'ssrdc' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 129 ; - } -#Surface thermal radiation downward clear-sky -'strdc' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 130 ; - } #Accumulated freezing rain 'fzra' = { localTablesVersion = 1 ; @@ -16468,48 +16447,12 @@ parameterCategory = 140 ; parameterNumber = 243 ; } -#10 metre wind speed -'wind' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 245 ; - } -#Altimeter wave height -'awh' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 246 ; - } -#Altimeter corrected wave height -'acwh' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 247 ; - } -#Altimeter range relative correction -'arrc' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 248 ; - } -#10 metre wind direction -'dwi' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 249 ; - } #2D wave spectra (multiple) '2dsp' = { discipline = 192 ; parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral kurtosis -'wsk' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 252 ; - } #Wave spectral peakedness 'wsp' = { discipline = 192 ; @@ -20458,7 +20401,7 @@ parameterCategory = 210 ; parameterNumber = 54 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio 'co2' = { discipline = 192 ; parameterCategory = 210 ; diff --git a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def index a043040a0..7e0d60eed 100644 --- a/definitions/grib2/localConcepts/ecmf/shortName.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/shortName.legacy.def @@ -1225,3 +1225,87 @@ parameterCategory = 140 ; parameterNumber = 216 ; } +#Total column ozone +'tco3' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 206 ; +} +#Convective snowfall +'csf' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 239 ; +} +#Large-scale snowfall +'lsf' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 240 ; +} +#Altimeter wave height +'awh' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 246 ; +} +#Altimeter corrected wave height +'acwh' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 247 ; +} +#Altimeter range relative correction +'arrc' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 248 ; +} +#Total sky direct solar radiation at surface +'fdir' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 21 ; +} +#Surface solar radiation downward clear-sky +'ssrdc' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 129 ; +} +#Surface thermal radiation downward clear-sky +'strdc' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 130 ; +} +#Standard deviation of orography +'sdor' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 160 ; +} +#Cloud base height +'cbh' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 23 ; +} +#Wave spectral kurtosis +'wsk' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 252 ; +} +#10 metre wind speed +'wind' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 245 ; +} +#10 metre wind direction +'dwi' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 249 ; +} diff --git a/definitions/grib2/localConcepts/ecmf/units.def b/definitions/grib2/localConcepts/ecmf/units.def index a36fc4dca..26a9c0a22 100644 --- a/definitions/grib2/localConcepts/ecmf/units.def +++ b/definitions/grib2/localConcepts/ecmf/units.def @@ -542,7 +542,7 @@ parameterCategory = 128 ; parameterNumber = 120 ; } -#10 metre wind gust in the last 6 hours +#Maximum 10 metre wind gust in the last 6 hours 'm s**-1' = { discipline = 192 ; parameterCategory = 128 ; @@ -661,12 +661,6 @@ parameterCategory = 128 ; parameterNumber = 158 ; } -#Standard deviation of orography -'m' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 160 ; - } #Total cloud cover '(0 - 1)' = { localTablesVersion = 1 ; @@ -803,9 +797,12 @@ } #Total column ozone 'kg m**-2' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 206 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 192 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; } #Diabatic heating by radiation 'K' = { @@ -921,15 +918,21 @@ } #Convective snowfall 'm of water equivalent' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 239 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Large-scale snowfall 'm of water equivalent' = { - discipline = 192 ; - parameterCategory = 128 ; - parameterNumber = 240 ; + localTablesVersion = 1 ; + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 202 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; } #Accumulated cloud fraction tendency '(-1 to 1)' = { @@ -13626,18 +13629,6 @@ typeOfStatisticalProcessing = 1 ; is_chemical = 1 ; } -#Total sky direct solar radiation at surface -'J m**-2' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 21 ; - } -#Cloud base height -'m' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 23 ; - } #Horizontal visibility 'm' = { discipline = 192 ; @@ -13800,18 +13791,6 @@ scaleFactorOfSecondWavelength = missing() ; is_aerosol_optical = 1 ; } -#Surface solar radiation downward clear-sky -'J m**-2' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 129 ; - } -#Surface thermal radiation downward clear-sky -'J m**-2' = { - discipline = 192 ; - parameterCategory = 228 ; - parameterNumber = 130 ; - } #Accumulated freezing rain 'm' = { localTablesVersion = 1 ; @@ -16468,48 +16447,12 @@ parameterCategory = 140 ; parameterNumber = 243 ; } -#10 metre wind speed -'m s**-1' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 245 ; - } -#Altimeter wave height -'m' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 246 ; - } -#Altimeter corrected wave height -'m' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 247 ; - } -#Altimeter range relative correction -'~' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 248 ; - } -#10 metre wind direction -'degrees' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 249 ; - } #2D wave spectra (multiple) 'm**2 s radian**-1' = { discipline = 192 ; parameterCategory = 140 ; parameterNumber = 250 ; } -#Wave spectral kurtosis -'dimensionless' = { - discipline = 192 ; - parameterCategory = 140 ; - parameterNumber = 252 ; - } #Wave spectral peakedness 'dimensionless' = { discipline = 192 ; @@ -20458,7 +20401,7 @@ parameterCategory = 210 ; parameterNumber = 54 ; } -#Carbon Dioxide +#Carbon dioxide mass mixing ratio 'kg kg**-1' = { discipline = 192 ; parameterCategory = 210 ; diff --git a/definitions/grib2/localConcepts/ecmf/units.legacy.def b/definitions/grib2/localConcepts/ecmf/units.legacy.def index 74e470e08..4b5d36486 100644 --- a/definitions/grib2/localConcepts/ecmf/units.legacy.def +++ b/definitions/grib2/localConcepts/ecmf/units.legacy.def @@ -1225,3 +1225,87 @@ parameterCategory = 140 ; parameterNumber = 216 ; } +#Total column ozone +'kg m**-2' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 206 ; +} +#Convective snowfall +'m of water equivalent' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 239 ; +} +#Large-scale snowfall +'m of water equivalent' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 240 ; +} +#Altimeter wave height +'m' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 246 ; +} +#Altimeter corrected wave height +'m' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 247 ; +} +#Altimeter range relative correction +'~' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 248 ; +} +#Total sky direct solar radiation at surface +'J m**-2' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 21 ; +} +#Surface solar radiation downward clear-sky +'J m**-2' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 129 ; +} +#Surface thermal radiation downward clear-sky +'J m**-2' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 130 ; +} +#Standard deviation of orography +'m' = { + discipline = 192 ; + parameterCategory = 128 ; + parameterNumber = 160 ; +} +#Cloud base height +'m' = { + discipline = 192 ; + parameterCategory = 228 ; + parameterNumber = 23 ; +} +#Wave spectral kurtosis +'dimensionless' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 252 ; +} +#10 metre wind speed +'m s**-1' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 245 ; +} +#10 metre wind direction +'degrees' = { + discipline = 192 ; + parameterCategory = 140 ; + parameterNumber = 249 ; +} diff --git a/definitions/grib2/localConcepts/edzw/name.def b/definitions/grib2/localConcepts/edzw/name.def index e94200cae..08b716bcb 100644 --- a/definitions/grib2/localConcepts/edzw/name.def +++ b/definitions/grib2/localConcepts/edzw/name.def @@ -1,4 +1,4 @@ -# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2020-11-05 10:29 +# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2023-08-17 13:41 #paramId: 500000 #Pressure (S) (not reduced) 'Pressure (S) (not reduced)' = { @@ -3471,118 +3471,6 @@ parameterNumber = 8 ; } -#paramId: 500779 -#Effective radius of cloud water -'Effective radius of cloud water' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 129 ; - } - -#paramId: 500780 -#Effective radius of rain -'Effective radius of rain' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 130 ; - } - -#paramId: 500781 -#Effective radius of cloud ice -'Effective radius of cloud ice' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 131 ; - } - -#paramId: 500782 -#Effective radius of snow -'Effective radius of snow' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 132 ; - } - -#paramId: 500783 -#Effective radius of graupel -'Effective radius of graupel' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 133 ; - } - -#paramId: 500784 -#Effective radius of hail -'Effective radius of hail' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 134 ; - } - -#paramId: 500785 -#Effective radius of subgrid liquid clouds -'Effective radius of subgrid liquid clouds' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 135 ; - } - -#paramId: 500786 -#Effective radius of subgrid ice clouds -'Effective radius of subgrid ice clouds' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 136 ; - } - -#paramId: 500787 -#Effective aspect ratio of rain -'Effective aspect ratio of rain' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 137 ; - } - -#paramId: 500788 -#Effective aspect ratio of cloud ice -'Effective aspect ratio of cloud ice' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 138 ; - } - -#paramId: 500789 -#Effective aspect ratio of snow -'Effective aspect ratio of snow' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 139 ; - } - -#paramId: 500790 -#Effective aspect ratio of graupel -'Effective aspect ratio of graupel' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 140 ; - } - -#paramId: 500791 -#Effective aspect ratio of hail -'Effective aspect ratio of hail' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 141 ; - } - -#paramId: 500792 -#Effective aspect ratio of subgrid ice clouds -'Effective aspect ratio of subgrid ice clouds' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 142 ; - } - #paramId: 500905 #Specific Humidity (S) 'Specific Humidity (S)' = { @@ -8267,6 +8155,815 @@ typeOfFirstFixedSurface = 1 ; } +#paramId: 503563 +#Temperature tendency perturbation due to stochastic model of model error +'Temperature tendency perturbation due to stochastic model of model error' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 26 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503564 +#Zonal wind tendency perturbation due to stochastic model of model error +'Zonal wind tendency perturbation due to stochastic model of model error' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 39 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503565 +#Meridional wind tendency perturbation due to stochastic model of model error +'Meridional wind tendency perturbation due to stochastic model of model error' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 40 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503566 +#Effective radius of cloud water +'Effective radius of cloud water' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 129 ; + } + +#paramId: 503567 +#Effective radius of rain +'Effective radius of rain' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 130 ; + } + +#paramId: 503568 +#Effective radius of cloud ice +'Effective radius of cloud ice' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 131 ; + } + +#paramId: 503569 +#Effective radius of snow +'Effective radius of snow' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 132 ; + } + +#paramId: 503570 +#Effective radius of graupel +'Effective radius of graupel' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 133 ; + } + +#paramId: 503571 +#Effective radius of hail +'Effective radius of hail' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 134 ; + } + +#paramId: 503572 +#Effective radius of subgrid liquid clouds +'Effective radius of subgrid liquid clouds' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 135 ; + } + +#paramId: 503573 +#Effective radius of subgrid ice clouds +'Effective radius of subgrid ice clouds' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 136 ; + } + +#paramId: 503574 +#Effective aspect ratio of rain +'Effective aspect ratio of rain' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 137 ; + } + +#paramId: 503575 +#Effective aspect ratio of cloud ice +'Effective aspect ratio of cloud ice' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 138 ; + } + +#paramId: 503576 +#Effective aspect ratio of snow +'Effective aspect ratio of snow' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 139 ; + } + +#paramId: 503577 +#Effective aspect ratio of graupel +'Effective aspect ratio of graupel' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 140 ; + } + +#paramId: 503578 +#Effective aspect ratio of hail +'Effective aspect ratio of hail' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 141 ; + } + +#paramId: 503579 +#Effective aspect ratio of subgrid ice clouds +'Effective aspect ratio of subgrid ice clouds' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 142 ; + } + +#paramId: 503580 +#Relative Humidity in lowest model layer - time-filtered assimilation increment +'Relative Humidity in lowest model layer - time-filtered assimilation increment' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503581 +#Temperature in lowest model layer - time-filtered assimilation increment +'Temperature in lowest model layer - time-filtered assimilation increment' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503583 +#Wind speed (time average) +'Wind speed (time average)' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } + +#paramId: 503584 +#10m wind speed (time average) +'10m wind speed (time average)' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 10 ; + } + +#paramId: 503587 +#Total cloud cover (time average) +'Total cloud cover (time average)' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } + +#paramId: 503593 +#Clear-sky net solar radiation flux (at the surface) +'Clear-sky net solar radiation flux (at the surface)' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503594 +#Clear-sky net thermal radiation flux (at the surface) +'Clear-sky net thermal radiation flux (at the surface)' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503595 +#Clear-sky net solar radiation flux (on model top) +'Clear-sky net solar radiation flux (on model top)' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503596 +#Clear-sky net thermal radiation flux (on model top) +'Clear-sky net thermal radiation flux (on model top)' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503597 +#Clear-sky net solar radiation flux (at the surface) - time average +'Clear-sky net solar radiation flux (at the surface) - time average' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503598 +#Clear-sky net thermal radiation flux (at the surface) - time average +'Clear-sky net thermal radiation flux (at the surface) - time average' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503599 +#Clear-sky net solar radiation flux (on model top) - time average +'Clear-sky net solar radiation flux (on model top) - time average' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503600 +#Clear-sky net thermal radiation flux (on model top) - time average +'Clear-sky net thermal radiation flux (on model top) - time average' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503601 +#TOA downward solar radiation (time average) +'TOA downward solar radiation (time average)' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503602 +#Volumetric saturation of soil moisture +'Volumetric saturation of soil moisture' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfSecondFixedSurface = 106 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503616 +#Pressure in lowest model layer - time-filtered assimilation increment +'Pressure in lowest model layer - time-filtered assimilation increment' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503617 +#Maximum amplitude of updraft helicity in tropospheric column of low height +'Maximum amplitude of updraft helicity in tropospheric column of low height' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 15 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 102 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 3000 ; + typeOfFirstFixedSurface = 102 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 0 ; + } + +#paramId: 503618 +#Maximum amplitude of updraft helicity in tropospheric column of medium height +'Maximum amplitude of updraft helicity in tropospheric column of medium height' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 15 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 102 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 5000 ; + typeOfFirstFixedSurface = 102 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 2000 ; + } + +#paramId: 503621 +#Large-scale precipitation rate +'Large-scale precipitation rate' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 54 ; + } + +#paramId: 503624 +#Total lightning flash density - maximum +'Total lightning flash density - maximum' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 8 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503628 +#Smoke - high absorption (mass mixing ratio) +'Smoke - high absorption (mass mixing ratio)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62020 ; + } + +#paramId: 503629 +#Smoke - high absorption (mass density) +'Smoke - high absorption (mass density)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62020 ; + } + +#paramId: 503630 +#Smoke - high absorption (specific number concentration) +'Smoke - high absorption (specific number concentration)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62020 ; + } + +#paramId: 503631 +#Smoke - low absorption (mass mixing ratio) +'Smoke - low absorption (mass mixing ratio)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62021 ; + } + +#paramId: 503632 +#Smoke - low absorption (mass density) +'Smoke - low absorption (mass density)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62021 ; + } + +#paramId: 503633 +#Smoke - low absorption (specific number concentration) +'Smoke - low absorption (specific number concentration)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62021 ; + } + +#paramId: 503634 +#Sulphur dioxide (SO2) - volume mixing ratio +'Sulphur dioxide (SO2) - volume mixing ratio' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 52 ; + constituentType = 8 ; + } + +#paramId: 503635 +#Sulphur dioxide (SO2) - mass density +'Sulphur dioxide (SO2) - mass density' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 8 ; + } + +#paramId: 503636 +#Hazel (corylus) pollen concentration +'Hazel (corylus) pollen concentration' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 59 ; + constituentType = 62104 ; + } + +#paramId: 503637 +#Fraction of land occupied by hazel (corylus) +'Fraction of land occupied by hazel (corylus)' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 4 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503643 +#Precipitation reservoir (liquid water on the flowers, preventing them from flowering) of hazel (corylus) +'Precipitation reservoir (liquid water on the flowers, preventing them from flowering) of hazel (corylus)' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 13 ; + constituentType = 62104 ; + } + +#paramId: 503651 +#Hazel (corylus) pollen specific number concentration +'Hazel (corylus) pollen specific number concentration' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62104 ; + } + +#paramId: 503657 +#Temperature in lowest model layer - time-filtered assimilation increment, weighted with cos(2pi loc.time/day) +'Temperature in lowest model layer - time-filtered assimilation increment, weighted with cos(2pi loc.time/day)' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 208 ; + } + +#paramId: 503662 +#Thickness of snow layer - multi level +'Thickness of snow layer - multi level' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503664 +#Snow temperature of layer (defined at layer top) - multi level +'Snow temperature of layer (defined at layer top) - multi level' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 28 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503672 +#Lightning Potential Index from convection scheme +'Lightning Potential Index from convection scheme' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 5 ; + } + +#paramId: 503673 +#Maximum Lightning Potential Index from convection scheme +'Maximum Lightning Potential Index from convection scheme' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 5 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503674 +#Wind speed in lowest model layer - time-filtered assimilation increment +'Wind speed in lowest model layer - time-filtered assimilation increment' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503675 +#Eddy Dissipation Parameter +'Eddy Dissipation Parameter' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 30 ; + } + +#paramId: 503676 +#Icing Severity (0=None, 1=Trace, 2=Light, 3=Moderate, 4=Severe) +'Icing Severity (0=None, 1=Trace, 2=Light, 3=Moderate, 4=Severe)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 37 ; + } + +#paramId: 503677 +#U-component surface Stokes drift +'U-component surface Stokes drift' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 21 ; + } + +#paramId: 503678 +#V-component surface Stokes drift +'V-component surface Stokes drift' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 22 ; + } + +#paramId: 503679 +#Peak wave direction +'Peak wave direction' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 46 ; + } + +#paramId: 503680 +#Significant wave height of first swell partition +'Significant wave height of first swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 47 ; + } + +#paramId: 503681 +#Significant wave height of second swell partition +'Significant wave height of second swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 48 ; + } + +#paramId: 503682 +#Significant wave height of third swell partition +'Significant wave height of third swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 49 ; + } + +#paramId: 503683 +#Mean wave period of first swell partition +'Mean wave period of first swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 50 ; + } + +#paramId: 503684 +#Mean wave period of second swell partition +'Mean wave period of second swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 51 ; + } + +#paramId: 503685 +#Mean wave period of third swell partition +'Mean wave period of third swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 52 ; + } + +#paramId: 503686 +#Mean wave direction of first swell partition +'Mean wave direction of first swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 53 ; + } + +#paramId: 503687 +#Mean wave direction of second swell partition +'Mean wave direction of second swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 54 ; + } + +#paramId: 503688 +#Mean wave direction of third swell partition +'Mean wave direction of third swell partition' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 55 ; + } + +#paramId: 503689 +#Diagnostic total mass concentration of mineral dust aerosol +'Diagnostic total mass concentration of mineral dust aerosol' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62001 ; + } + +#paramId: 503690 +#Diagnostic total mass concentration of sea salt aerosol +'Diagnostic total mass concentration of sea salt aerosol' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62008 ; + } + +#paramId: 503691 +#Diagnostic total mass concentration of black carbon aerosol (soot) +'Diagnostic total mass concentration of black carbon aerosol (soot)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62009 ; + } + +#paramId: 503692 +#Diagnostic black carbon aerosol (soot) optical depth +'Diagnostic black carbon aerosol (soot) optical depth' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + aerosolType = 62009 ; + } + +#paramId: 503693 +#Total atmosphere optical depth due to mineral dust aerosol +'Total atmosphere optical depth due to mineral dust aerosol' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62001 ; + } + +#paramId: 503694 +#Total atmosphere optical depth due to sea salt aerosol +'Total atmosphere optical depth due to sea salt aerosol' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62008 ; + } + +#paramId: 503695 +#Total atmosphere optical depth due to volcanic ash aerosol +'Total atmosphere optical depth due to volcanic ash aerosol' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62025 ; + } + +#paramId: 503696 +#Total atmosphere optical depth due to black carbon aerosol (soot) +'Total atmosphere optical depth due to black carbon aerosol (soot)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62009 ; + } + +#paramId: 503697 +#Modal prognostic mass mixing ratio of mineral dust aerosol (all modes) +'Modal prognostic mass mixing ratio of mineral dust aerosol (all modes)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62001 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503698 +#Modal prognostic mass mixing ratio of sea salt aerosol (all modes) +'Modal prognostic mass mixing ratio of sea salt aerosol (all modes)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62008 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503699 +#Modal prognostic mass mixing ratio of black carbon aerosol (soot) (all modes) +'Modal prognostic mass mixing ratio of black carbon aerosol (soot) (all modes)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62009 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503700 +#Modal prognostic specific number concentration of black carbon aerosol (soot) (all modes) +'Modal prognostic specific number concentration of black carbon aerosol (soot) (all modes)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62009 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503701 +#Modal prognostic mass mixing ratio of volcanic ash aerosol (all modes) +'Modal prognostic mass mixing ratio of volcanic ash aerosol (all modes)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62025 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503702 +#Modal prognostic specific number concentration of total aerosol (all modes) +'Modal prognostic specific number concentration of total aerosol (all modes)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62000 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503703 +#Base reflectivity - low layer maximum +'Base reflectivity - low layer maximum' = { + discipline = 0 ; + parameterCategory = 15 ; + parameterNumber = 4 ; + typeOfSecondFixedSurface = 103 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 500 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 2500 ; + } + +#paramId: 503706 +#Sea water density +'Sea water density' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 16 ; + } + +#paramId: 503707 +#Sea water potential temperature +'Sea water potential temperature' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 18 ; + } + +#paramId: 503708 +#Sea water potential density +'Sea water potential density' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 19 ; + } + +#paramId: 503709 +#Sea water practical salinity +'Sea water practical salinity' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 21 ; + } + #paramId: 500092 #Solar radiation heating rate 'Solar radiation heating rate' = { @@ -11069,6 +11766,118 @@ parameterNumber = 128 ; } +#paramId: 500779 +#DUMMY_129 +'DUMMY_129' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 129 ; + } + +#paramId: 500780 +#DUMMY_130 +'DUMMY_130' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 130 ; + } + +#paramId: 500781 +#DUMMY_131 +'DUMMY_131' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 131 ; + } + +#paramId: 500782 +#DUMMY_132 +'DUMMY_132' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 132 ; + } + +#paramId: 500783 +#DUMMY_133 +'DUMMY_133' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 133 ; + } + +#paramId: 500784 +#DUMMY_134 +'DUMMY_134' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 134 ; + } + +#paramId: 500785 +#DUMMY_135 +'DUMMY_135' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 135 ; + } + +#paramId: 500786 +#DUMMY_136 +'DUMMY_136' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 136 ; + } + +#paramId: 500787 +#DUMMY_137 +'DUMMY_137' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 137 ; + } + +#paramId: 500788 +#DUMMY_138 +'DUMMY_138' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 138 ; + } + +#paramId: 500789 +#DUMMY_139 +'DUMMY_139' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 139 ; + } + +#paramId: 500790 +#DUMMY_140 +'DUMMY_140' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 140 ; + } + +#paramId: 500791 +#DUMMY_141 +'DUMMY_141' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 141 ; + } + +#paramId: 500792 +#DUMMY_142 +'DUMMY_142' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 142 ; + } + #paramId: 500793 #DUMMY_143 'DUMMY_143' = { @@ -13807,3 +14616,655 @@ parameterNumber = 211 ; } +#paramId: 503582 +#Frequency of winds in defined wind sector for defined time interval +'Frequency of winds in defined wind sector for defined time interval' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 11 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503585 +#10m wind speed in wind sector (time average) +'10m wind speed in wind sector (time average)' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503586 +#10m wind speed in wind sector (time maximum) +'10m wind speed in wind sector (time maximum)' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503588 +#Downward direct short-wave radiation flux at surface on a plane normal to the sun (time average) +'Downward direct short-wave radiation flux at surface on a plane normal to the sun (time average)' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 198 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 206 ; + } + +#paramId: 503589 +#Downward direct short-wave radiation flux at surface on a plane normal to the sun without orographic shading (time average) +'Downward direct short-wave radiation flux at surface on a plane normal to the sun without orographic shading (time average)' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 198 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 207 ; + } + +#paramId: 503590 +#Solar elevation angle +'Solar elevation angle' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 202 ; + } + +#paramId: 503591 +#Solar azimuth angle +'Solar azimuth angle' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 203 ; + } + +#paramId: 503592 +#Turbulence intensity (time maximum) +'Turbulence intensity (time maximum)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 236 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503603 +#Soil water mass flux at layer interfaces (sum of conductive and diffusive fluxes) +'Soil water mass flux at layer interfaces (sum of conductive and diffusive fluxes)' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503604 +#Ground water runoff rate, aquifer +'Ground water runoff rate, aquifer' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 195 ; + typeOfSecondFixedSurface = 106 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503605 +#Water table depth +'Water table depth' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 193 ; + typeOfFirstFixedSurface = 177 ; + } + +#paramId: 503606 +#Soil moisture saturation level +'Soil moisture saturation level' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 194 ; + typeOfFirstFixedSurface = 177 ; + } + +#paramId: 503607 +#Slope of orography (using average of maximum gradient in different directions) +'Slope of orography (using average of maximum gradient in different directions)' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 198 ; + } + +#paramId: 503608 +#Total column zonal water flux +'Total column zonal water flux ' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 236 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503609 +#Total column meridional water flux +'Total column meridional water flux' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 237 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503610 +#Total column zonal water flux - time average +'Total column zonal water flux - time average' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 236 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503611 +#Total column meridional water flux - time average +'Total column meridional water flux - time average' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 237 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503612 +#Number of active clouds per horizontal unit area +'Number of active clouds per horizontal unit area' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 210 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503613 +#Number of passive clouds per horizontal unit area +'Number of passive clouds per horizontal unit area' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 211 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503614 +#Cloud base mass flux associated with active clouds +'Cloud base mass flux associated with active clouds' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 200 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503615 +#Cloud base mass flux associated with passive clouds +'Cloud base mass flux associated with passive clouds' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 199 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503619 +#Single scan reflectivity - observation +'Single scan reflectivity - observation' = { + discipline = 0 ; + parameterCategory = 15 ; + parameterNumber = 200 ; + typeOfGeneratingProcess = 8 ; + } + +#paramId: 503620 +#Single scan reflectivity - simulation +'Single scan reflectivity - simulation' = { + discipline = 0 ; + parameterCategory = 16 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 198 ; + } + +#paramId: 503622 +#Lightning Potential Index from convection scheme, modified by convection index +'Lightning Potential Index from convection scheme, modified by convection index' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 193 ; + } + +#paramId: 503623 +#Maximum Lightning Potential Index from convection scheme, modified by convection index +'Maximum Lightning Potential Index from convection scheme, modified by convection index' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 193 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503625 +#Mass median diameter of dust for mode 1 +'Mass median diameter of dust for mode 1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 1 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503626 +#Mass median diameter of dust for mode 2 +'Mass median diameter of dust for mode 2' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 2 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503627 +#Mass median diameter of dust for mode 3 +'Mass median diameter of dust for mode 3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 3 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503638 +#Number of hazel (corylus) pollen in the reservoir (previous timestep) +'Number of hazel (corylus) pollen in the reservoir (previous timestep)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 192 ; + constituentType = 62104 ; + } + +#paramId: 503639 +#Number of hazel (corylus) pollen released into the reservoir (new) +'Number of hazel (corylus) pollen released into the reservoir (new)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 193 ; + constituentType = 62104 ; + } + +#paramId: 503640 +#State of the hazel (corylus) season (eq.zero before and after season, the higher, the more plants are flowering) +'State of the hazel (corylus) season (eq.zero before and after season, the higher, the more plants are flowering)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 194 ; + constituentType = 62104 ; + } + +#paramId: 503641 +#Height correction for emission (decreasing emission with height) for hazel (corylus) +'Height correction for emission (decreasing emission with height) for hazel (corylus)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 195 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503642 +#Sum of released hazel (corylus) pollen into the reservoir (daily sum) +'Sum of released hazel (corylus) pollen into the reservoir (daily sum)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 193 ; + typeOfStatisticalProcessing = 11 ; + constituentType = 62104 ; + } + +#paramId: 503644 +#Cumulated weighted 2m temperature sum of daily values for hazel (corylus) pollen +'Cumulated weighted 2m temperature sum of daily values for hazel (corylus) pollen' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 196 ; + constituentType = 62104 ; + } + +#paramId: 503645 +#Cumulated 2m temperature sum threshold for the start of hazel (corylus) pollen season (climatological) +'Cumulated 2m temperature sum threshold for the start of hazel (corylus) pollen season (climatological)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 197 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503646 +#Cumulated 2m temperature sum threshold for the end of hazel (corylus) pollen season (climatological) +'Cumulated 2m temperature sum threshold for the end of hazel (corylus) pollen season (climatological)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 198 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503647 +#Number of days since the start of hazel (corylus) pollen season (if present day is in the season: zero outside season) +'Number of days since the start of hazel (corylus) pollen season (if present day is in the season: zero outside season)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 199 ; + constituentType = 62104 ; + } + +#paramId: 503648 +#Length of hazel (corylus) pollen season +'Length of hazel (corylus) pollen season' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 201 ; + constituentType = 62104 ; + } + +#paramId: 503649 +#Pollen number emission flux for hazel (corylus) +'Pollen number emission flux for hazel (corylus)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 202 ; + constituentType = 62104 ; + } + +#paramId: 503650 +#Number of days since the start of hazel (corylus) pollen season (if present day is outside the season: length of current season) +'Number of days since the start of hazel (corylus) pollen season (if present day is outside the season: length of current season)' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 200 ; + constituentType = 62104 ; + } + +#paramId: 503652 +#Emission tuning factor for birch (betula) pollen +'Emission tuning factor for birch (betula) pollen' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62101 ; + } + +#paramId: 503653 +#Emission tuning factor for alder (alnus) pollen +'Emission tuning factor for alder (alnus) pollen' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62100 ; + } + +#paramId: 503654 +#Emission tuning factor for grasses (poaceae) pollen +'Emission tuning factor for grasses (poaceae) pollen' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62300 ; + } + +#paramId: 503655 +#Emission tuning factor for ragweed (ambrosia) pollen +'Emission tuning factor for ragweed (ambrosia) pollen' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62200 ; + } + +#paramId: 503656 +#Emission tuning factor for hazel (corylus) pollen +'Emission tuning factor for hazel (corylus) pollen' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62104 ; + } + +#paramId: 503658 +#Height of new snow (without settling) +'Height of new snow (without settling)' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 207 ; + } + +#paramId: 503659 +#Volumetric ice content of snow layer - multi level +'Volumetric ice content of snow layer - multi level' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 63000 ; + } + +#paramId: 503660 +#Volumetric water content of snow layer - multi level +'Volumetric water content of snow layer - multi level' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 62002 ; + } + +#paramId: 503661 +#Volumetric air content of snow layer - multi level +'Volumetric air content of snow layer - multi level' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 63001 ; + } + +#paramId: 503663 +#Number of snow layer - multi level +'Number of snow layer - multi level' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 206 ; + } + +#paramId: 503665 +#Building area fraction (proportion: 0=no building, 1=whole urban area) +'Building area fraction (proportion: 0=no building, 1=whole urban area)' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 0 ; + } + +#paramId: 503666 +#Street canyon aspect (height - width) ratio +'Street canyon aspect (height - width) ratio' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 1 ; + } + +#paramId: 503667 +#Height of building +'Height of building' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 2 ; + } + +#paramId: 503668 +#Urban material thermal albedo +'Urban material thermal albedo' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 3 ; + } + +#paramId: 503669 +#Urban material shortwave (solar) albedo +'Urban material shortwave (solar) albedo' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 4 ; + } + +#paramId: 503670 +#Volumetric heat capacity of urban material (capacity x density) +'Volumetric heat capacity of urban material (capacity x density)' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 5 ; + } + +#paramId: 503671 +#Heat conductivity of urban material +'Heat conductivity of urban material' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 6 ; + } + +#paramId: 503704 +#Potential flight distance PFD (gliding) +'Potential flight distance PFD (gliding)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 240 ; + } + +#paramId: 503705 +#Lifting ratio VST (gliding) +'Lifting ratio VST (gliding)' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 241 ; + } + +#paramId: 503710 +#U-component of mean wind (vertical mean over specified layer) +'U-component of mean wind (vertical mean over specified layer)' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 212 ; + } + +#paramId: 503711 +#V-component of mean wind (vertical mean over specified layer) +'V-component of mean wind (vertical mean over specified layer)' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 213 ; + } + +#paramId: 503712 +#Extreme weather index of snow amount, grid-scale plus convective +'Extreme weather index of snow amount, grid-scale plus convective' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 240 ; + typeOfStatisticalProcessing = 1 ; + } + +#paramId: 503713 +#Extreme weather index of maximum Wind 10m +'Extreme weather index of maximum Wind 10m' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 214 ; + typeOfStatisticalProcessing = 2 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 10 ; + } + +#paramId: 503714 +#Extreme weather index of total precipitation (Accumulation) +'Extreme weather index of total precipitation (Accumulation)' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 239 ; + typeOfStatisticalProcessing = 1 ; + } + +#paramId: 503715 +#Cloud cover for use in radiative transfer (modified where large hydrometeors are present) +'Cloud cover for use in radiative transfer (modified where large hydrometeors are present)' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 215 ; + } + +#paramId: 503716 +#Snow temperature at node (i.e. at snow layer interface or boundary) - multi level +'Snow temperature at node (i.e. at snow layer interface or boundary) - multi level' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 208 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503717 +#Volumetric ice content of snow layer (for use in tile approach) - multi level +'Volumetric ice content of snow layer (for use in tile approach) - multi level' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 209 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503718 +#Volumetric water content of snow layer (for use in tile approach) - multi level +'Volumetric water content of snow layer (for use in tile approach) - multi level' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503719 +#Volumetric air content of snow layer (for use in tile approach) - multi level +'Volumetric air content of snow layer (for use in tile approach) - multi level' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 211 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503720 +#Probability for freezing precipitation/wet snow +'Probability for freezing precipitation/wet snow' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 242 ; + } + +#paramId: 503721 +#Probability for freezing precipitation with wind +'Probability for freezing precipitation with wind' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 243 ; + } + diff --git a/definitions/grib2/localConcepts/edzw/paramId.def b/definitions/grib2/localConcepts/edzw/paramId.def index 9b31c68c9..09e15e295 100644 --- a/definitions/grib2/localConcepts/edzw/paramId.def +++ b/definitions/grib2/localConcepts/edzw/paramId.def @@ -1,4 +1,4 @@ -# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2020-11-05 10:29 +# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2023-08-17 13:41 #paramId: 500000 #Pressure (S) (not reduced) '500000' = { @@ -6785,114 +6785,114 @@ } #paramId: 500779 -#Effective radius of cloud water +#DUMMY_129 '500779' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 129 ; } #paramId: 500780 -#Effective radius of rain +#DUMMY_130 '500780' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 130 ; } #paramId: 500781 -#Effective radius of cloud ice +#DUMMY_131 '500781' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 131 ; } #paramId: 500782 -#Effective radius of snow +#DUMMY_132 '500782' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 132 ; } #paramId: 500783 -#Effective radius of graupel +#DUMMY_133 '500783' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 133 ; } #paramId: 500784 -#Effective radius of hail +#DUMMY_134 '500784' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 134 ; } #paramId: 500785 -#Effective radius of subgrid liquid clouds +#DUMMY_135 '500785' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 135 ; } #paramId: 500786 -#Effective radius of subgrid ice clouds +#DUMMY_136 '500786' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 136 ; } #paramId: 500787 -#Effective aspect ratio of rain +#DUMMY_137 '500787' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 137 ; } #paramId: 500788 -#Effective aspect ratio of cloud ice +#DUMMY_138 '500788' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 138 ; } #paramId: 500789 -#Effective aspect ratio of snow +#DUMMY_139 '500789' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 139 ; } #paramId: 500790 -#Effective aspect ratio of graupel +#DUMMY_140 '500790' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 140 ; } #paramId: 500791 -#Effective aspect ratio of hail +#DUMMY_141 '500791' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 141 ; } #paramId: 500792 -#Effective aspect ratio of subgrid ice clouds +#DUMMY_142 '500792' = { discipline = 0 ; - parameterCategory = 1 ; + parameterCategory = 254 ; parameterNumber = 142 ; } @@ -14346,3 +14346,1464 @@ typeOfFirstFixedSurface = 1 ; } +#paramId: 503563 +#Temperature tendency perturbation due to stochastic model of model error +'503563' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 26 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503564 +#Zonal wind tendency perturbation due to stochastic model of model error +'503564' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 39 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503565 +#Meridional wind tendency perturbation due to stochastic model of model error +'503565' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 40 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503566 +#Effective radius of cloud water +'503566' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 129 ; + } + +#paramId: 503567 +#Effective radius of rain +'503567' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 130 ; + } + +#paramId: 503568 +#Effective radius of cloud ice +'503568' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 131 ; + } + +#paramId: 503569 +#Effective radius of snow +'503569' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 132 ; + } + +#paramId: 503570 +#Effective radius of graupel +'503570' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 133 ; + } + +#paramId: 503571 +#Effective radius of hail +'503571' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 134 ; + } + +#paramId: 503572 +#Effective radius of subgrid liquid clouds +'503572' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 135 ; + } + +#paramId: 503573 +#Effective radius of subgrid ice clouds +'503573' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 136 ; + } + +#paramId: 503574 +#Effective aspect ratio of rain +'503574' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 137 ; + } + +#paramId: 503575 +#Effective aspect ratio of cloud ice +'503575' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 138 ; + } + +#paramId: 503576 +#Effective aspect ratio of snow +'503576' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 139 ; + } + +#paramId: 503577 +#Effective aspect ratio of graupel +'503577' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 140 ; + } + +#paramId: 503578 +#Effective aspect ratio of hail +'503578' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 141 ; + } + +#paramId: 503579 +#Effective aspect ratio of subgrid ice clouds +'503579' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 142 ; + } + +#paramId: 503580 +#Relative Humidity in lowest model layer - time-filtered assimilation increment +'503580' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503581 +#Temperature in lowest model layer - time-filtered assimilation increment +'503581' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503582 +#Frequency of winds in defined wind sector for defined time interval +'503582' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 11 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503583 +#Wind speed (time average) +'503583' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } + +#paramId: 503584 +#10m wind speed (time average) +'503584' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 10 ; + } + +#paramId: 503585 +#10m wind speed in wind sector (time average) +'503585' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503586 +#10m wind speed in wind sector (time maximum) +'503586' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503587 +#Total cloud cover (time average) +'503587' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } + +#paramId: 503588 +#Downward direct short-wave radiation flux at surface on a plane normal to the sun (time average) +'503588' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 198 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 206 ; + } + +#paramId: 503589 +#Downward direct short-wave radiation flux at surface on a plane normal to the sun without orographic shading (time average) +'503589' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 198 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 207 ; + } + +#paramId: 503590 +#Solar elevation angle +'503590' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 202 ; + } + +#paramId: 503591 +#Solar azimuth angle +'503591' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 203 ; + } + +#paramId: 503592 +#Turbulence intensity (time maximum) +'503592' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 236 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503593 +#Clear-sky net solar radiation flux (at the surface) +'503593' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503594 +#Clear-sky net thermal radiation flux (at the surface) +'503594' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503595 +#Clear-sky net solar radiation flux (on model top) +'503595' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503596 +#Clear-sky net thermal radiation flux (on model top) +'503596' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503597 +#Clear-sky net solar radiation flux (at the surface) - time average +'503597' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503598 +#Clear-sky net thermal radiation flux (at the surface) - time average +'503598' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503599 +#Clear-sky net solar radiation flux (on model top) - time average +'503599' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503600 +#Clear-sky net thermal radiation flux (on model top) - time average +'503600' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503601 +#TOA downward solar radiation (time average) +'503601' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503602 +#Volumetric saturation of soil moisture +'503602' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfSecondFixedSurface = 106 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503603 +#Soil water mass flux at layer interfaces (sum of conductive and diffusive fluxes) +'503603' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503604 +#Ground water runoff rate, aquifer +'503604' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 195 ; + typeOfSecondFixedSurface = 106 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503605 +#Water table depth +'503605' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 193 ; + typeOfFirstFixedSurface = 177 ; + } + +#paramId: 503606 +#Soil moisture saturation level +'503606' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 194 ; + typeOfFirstFixedSurface = 177 ; + } + +#paramId: 503607 +#Slope of orography (using average of maximum gradient in different directions) +'503607' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 198 ; + } + +#paramId: 503608 +#Total column zonal water flux +'503608' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 236 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503609 +#Total column meridional water flux +'503609' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 237 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503610 +#Total column zonal water flux - time average +'503610' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 236 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503611 +#Total column meridional water flux - time average +'503611' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 237 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503612 +#Number of active clouds per horizontal unit area +'503612' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 210 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503613 +#Number of passive clouds per horizontal unit area +'503613' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 211 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503614 +#Cloud base mass flux associated with active clouds +'503614' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 200 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503615 +#Cloud base mass flux associated with passive clouds +'503615' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 199 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503616 +#Pressure in lowest model layer - time-filtered assimilation increment +'503616' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503617 +#Maximum amplitude of updraft helicity in tropospheric column of low height +'503617' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 15 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 102 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 3000 ; + typeOfFirstFixedSurface = 102 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 0 ; + } + +#paramId: 503618 +#Maximum amplitude of updraft helicity in tropospheric column of medium height +'503618' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 15 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 102 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 5000 ; + typeOfFirstFixedSurface = 102 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 2000 ; + } + +#paramId: 503619 +#Single scan reflectivity - observation +'503619' = { + discipline = 0 ; + parameterCategory = 15 ; + parameterNumber = 200 ; + typeOfGeneratingProcess = 8 ; + } + +#paramId: 503620 +#Single scan reflectivity - simulation +'503620' = { + discipline = 0 ; + parameterCategory = 16 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 198 ; + } + +#paramId: 503621 +#Large-scale precipitation rate +'503621' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 54 ; + } + +#paramId: 503622 +#Lightning Potential Index from convection scheme, modified by convection index +'503622' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 193 ; + } + +#paramId: 503623 +#Maximum Lightning Potential Index from convection scheme, modified by convection index +'503623' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 193 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503624 +#Total lightning flash density - maximum +'503624' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 8 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503625 +#Mass median diameter of dust for mode 1 +'503625' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 1 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503626 +#Mass median diameter of dust for mode 2 +'503626' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 2 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503627 +#Mass median diameter of dust for mode 3 +'503627' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 3 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503628 +#Smoke - high absorption (mass mixing ratio) +'503628' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62020 ; + } + +#paramId: 503629 +#Smoke - high absorption (mass density) +'503629' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62020 ; + } + +#paramId: 503630 +#Smoke - high absorption (specific number concentration) +'503630' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62020 ; + } + +#paramId: 503631 +#Smoke - low absorption (mass mixing ratio) +'503631' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62021 ; + } + +#paramId: 503632 +#Smoke - low absorption (mass density) +'503632' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62021 ; + } + +#paramId: 503633 +#Smoke - low absorption (specific number concentration) +'503633' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62021 ; + } + +#paramId: 503634 +#Sulphur dioxide (SO2) - volume mixing ratio +'503634' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 52 ; + constituentType = 8 ; + } + +#paramId: 503635 +#Sulphur dioxide (SO2) - mass density +'503635' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 8 ; + } + +#paramId: 503636 +#Hazel (corylus) pollen concentration +'503636' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 59 ; + constituentType = 62104 ; + } + +#paramId: 503637 +#Fraction of land occupied by hazel (corylus) +'503637' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 4 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503638 +#Number of hazel (corylus) pollen in the reservoir (previous timestep) +'503638' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 192 ; + constituentType = 62104 ; + } + +#paramId: 503639 +#Number of hazel (corylus) pollen released into the reservoir (new) +'503639' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 193 ; + constituentType = 62104 ; + } + +#paramId: 503640 +#State of the hazel (corylus) season (eq.zero before and after season, the higher, the more plants are flowering) +'503640' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 194 ; + constituentType = 62104 ; + } + +#paramId: 503641 +#Height correction for emission (decreasing emission with height) for hazel (corylus) +'503641' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 195 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503642 +#Sum of released hazel (corylus) pollen into the reservoir (daily sum) +'503642' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 193 ; + typeOfStatisticalProcessing = 11 ; + constituentType = 62104 ; + } + +#paramId: 503643 +#Precipitation reservoir (liquid water on the flowers, preventing them from flowering) of hazel (corylus) +'503643' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 13 ; + constituentType = 62104 ; + } + +#paramId: 503644 +#Cumulated weighted 2m temperature sum of daily values for hazel (corylus) pollen +'503644' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 196 ; + constituentType = 62104 ; + } + +#paramId: 503645 +#Cumulated 2m temperature sum threshold for the start of hazel (corylus) pollen season (climatological) +'503645' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 197 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503646 +#Cumulated 2m temperature sum threshold for the end of hazel (corylus) pollen season (climatological) +'503646' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 198 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503647 +#Number of days since the start of hazel (corylus) pollen season (if present day is in the season: zero outside season) +'503647' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 199 ; + constituentType = 62104 ; + } + +#paramId: 503648 +#Length of hazel (corylus) pollen season +'503648' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 201 ; + constituentType = 62104 ; + } + +#paramId: 503649 +#Pollen number emission flux for hazel (corylus) +'503649' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 202 ; + constituentType = 62104 ; + } + +#paramId: 503650 +#Number of days since the start of hazel (corylus) pollen season (if present day is outside the season: length of current season) +'503650' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 200 ; + constituentType = 62104 ; + } + +#paramId: 503651 +#Hazel (corylus) pollen specific number concentration +'503651' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62104 ; + } + +#paramId: 503652 +#Emission tuning factor for birch (betula) pollen +'503652' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62101 ; + } + +#paramId: 503653 +#Emission tuning factor for alder (alnus) pollen +'503653' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62100 ; + } + +#paramId: 503654 +#Emission tuning factor for grasses (poaceae) pollen +'503654' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62300 ; + } + +#paramId: 503655 +#Emission tuning factor for ragweed (ambrosia) pollen +'503655' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62200 ; + } + +#paramId: 503656 +#Emission tuning factor for hazel (corylus) pollen +'503656' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62104 ; + } + +#paramId: 503657 +#Temperature in lowest model layer - time-filtered assimilation increment, weighted with cos(2pi loc.time/day) +'503657' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 208 ; + } + +#paramId: 503658 +#Height of new snow (without settling) +'503658' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 207 ; + } + +#paramId: 503659 +#Volumetric ice content of snow layer - multi level +'503659' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 63000 ; + } + +#paramId: 503660 +#Volumetric water content of snow layer - multi level +'503660' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 62002 ; + } + +#paramId: 503661 +#Volumetric air content of snow layer - multi level +'503661' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 63001 ; + } + +#paramId: 503662 +#Thickness of snow layer - multi level +'503662' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503663 +#Number of snow layer - multi level +'503663' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 206 ; + } + +#paramId: 503664 +#Snow temperature of layer (defined at layer top) - multi level +'503664' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 28 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503665 +#Building area fraction (proportion: 0=no building, 1=whole urban area) +'503665' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 0 ; + } + +#paramId: 503666 +#Street canyon aspect (height - width) ratio +'503666' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 1 ; + } + +#paramId: 503667 +#Height of building +'503667' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 2 ; + } + +#paramId: 503668 +#Urban material thermal albedo +'503668' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 3 ; + } + +#paramId: 503669 +#Urban material shortwave (solar) albedo +'503669' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 4 ; + } + +#paramId: 503670 +#Volumetric heat capacity of urban material (capacity x density) +'503670' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 5 ; + } + +#paramId: 503671 +#Heat conductivity of urban material +'503671' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 6 ; + } + +#paramId: 503672 +#Lightning Potential Index from convection scheme +'503672' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 5 ; + } + +#paramId: 503673 +#Maximum Lightning Potential Index from convection scheme +'503673' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 5 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503674 +#Wind speed in lowest model layer - time-filtered assimilation increment +'503674' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503675 +#Eddy Dissipation Parameter +'503675' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 30 ; + } + +#paramId: 503676 +#Icing Severity (0=None, 1=Trace, 2=Light, 3=Moderate, 4=Severe) +'503676' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 37 ; + } + +#paramId: 503677 +#U-component surface Stokes drift +'503677' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 21 ; + } + +#paramId: 503678 +#V-component surface Stokes drift +'503678' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 22 ; + } + +#paramId: 503679 +#Peak wave direction +'503679' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 46 ; + } + +#paramId: 503680 +#Significant wave height of first swell partition +'503680' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 47 ; + } + +#paramId: 503681 +#Significant wave height of second swell partition +'503681' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 48 ; + } + +#paramId: 503682 +#Significant wave height of third swell partition +'503682' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 49 ; + } + +#paramId: 503683 +#Mean wave period of first swell partition +'503683' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 50 ; + } + +#paramId: 503684 +#Mean wave period of second swell partition +'503684' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 51 ; + } + +#paramId: 503685 +#Mean wave period of third swell partition +'503685' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 52 ; + } + +#paramId: 503686 +#Mean wave direction of first swell partition +'503686' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 53 ; + } + +#paramId: 503687 +#Mean wave direction of second swell partition +'503687' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 54 ; + } + +#paramId: 503688 +#Mean wave direction of third swell partition +'503688' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 55 ; + } + +#paramId: 503689 +#Diagnostic total mass concentration of mineral dust aerosol +'503689' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62001 ; + } + +#paramId: 503690 +#Diagnostic total mass concentration of sea salt aerosol +'503690' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62008 ; + } + +#paramId: 503691 +#Diagnostic total mass concentration of black carbon aerosol (soot) +'503691' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62009 ; + } + +#paramId: 503692 +#Diagnostic black carbon aerosol (soot) optical depth +'503692' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + aerosolType = 62009 ; + } + +#paramId: 503693 +#Total atmosphere optical depth due to mineral dust aerosol +'503693' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62001 ; + } + +#paramId: 503694 +#Total atmosphere optical depth due to sea salt aerosol +'503694' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62008 ; + } + +#paramId: 503695 +#Total atmosphere optical depth due to volcanic ash aerosol +'503695' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62025 ; + } + +#paramId: 503696 +#Total atmosphere optical depth due to black carbon aerosol (soot) +'503696' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62009 ; + } + +#paramId: 503697 +#Modal prognostic mass mixing ratio of mineral dust aerosol (all modes) +'503697' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62001 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503698 +#Modal prognostic mass mixing ratio of sea salt aerosol (all modes) +'503698' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62008 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503699 +#Modal prognostic mass mixing ratio of black carbon aerosol (soot) (all modes) +'503699' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62009 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503700 +#Modal prognostic specific number concentration of black carbon aerosol (soot) (all modes) +'503700' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62009 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503701 +#Modal prognostic mass mixing ratio of volcanic ash aerosol (all modes) +'503701' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62025 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503702 +#Modal prognostic specific number concentration of total aerosol (all modes) +'503702' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62000 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503703 +#Base reflectivity - low layer maximum +'503703' = { + discipline = 0 ; + parameterCategory = 15 ; + parameterNumber = 4 ; + typeOfSecondFixedSurface = 103 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 500 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 2500 ; + } + +#paramId: 503704 +#Potential flight distance PFD (gliding) +'503704' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 240 ; + } + +#paramId: 503705 +#Lifting ratio VST (gliding) +'503705' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 241 ; + } + +#paramId: 503706 +#Sea water density +'503706' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 16 ; + } + +#paramId: 503707 +#Sea water potential temperature +'503707' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 18 ; + } + +#paramId: 503708 +#Sea water potential density +'503708' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 19 ; + } + +#paramId: 503709 +#Sea water practical salinity +'503709' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 21 ; + } + +#paramId: 503710 +#U-component of mean wind (vertical mean over specified layer) +'503710' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 212 ; + } + +#paramId: 503711 +#V-component of mean wind (vertical mean over specified layer) +'503711' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 213 ; + } + +#paramId: 503712 +#Extreme weather index of snow amount, grid-scale plus convective +'503712' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 240 ; + typeOfStatisticalProcessing = 1 ; + } + +#paramId: 503713 +#Extreme weather index of maximum Wind 10m +'503713' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 214 ; + typeOfStatisticalProcessing = 2 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 10 ; + } + +#paramId: 503714 +#Extreme weather index of total precipitation (Accumulation) +'503714' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 239 ; + typeOfStatisticalProcessing = 1 ; + } + +#paramId: 503715 +#Cloud cover for use in radiative transfer (modified where large hydrometeors are present) +'503715' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 215 ; + } + +#paramId: 503716 +#Snow temperature at node (i.e. at snow layer interface or boundary) - multi level +'503716' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 208 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503717 +#Volumetric ice content of snow layer (for use in tile approach) - multi level +'503717' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 209 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503718 +#Volumetric water content of snow layer (for use in tile approach) - multi level +'503718' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503719 +#Volumetric air content of snow layer (for use in tile approach) - multi level +'503719' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 211 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503720 +#Probability for freezing precipitation/wet snow +'503720' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 242 ; + } + +#paramId: 503721 +#Probability for freezing precipitation with wind +'503721' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 243 ; + } + diff --git a/definitions/grib2/localConcepts/edzw/shortName.def b/definitions/grib2/localConcepts/edzw/shortName.def index a341a3566..37150d10c 100644 --- a/definitions/grib2/localConcepts/edzw/shortName.def +++ b/definitions/grib2/localConcepts/edzw/shortName.def @@ -1,4 +1,4 @@ -# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2020-11-05 10:29 +# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2023-08-17 13:41 #paramId: 500000 #Pressure (S) (not reduced) 'PS' = { @@ -3471,118 +3471,6 @@ parameterNumber = 8 ; } -#paramId: 500779 -#Effective radius of cloud water -'RECLOUD' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 129 ; - } - -#paramId: 500780 -#Effective radius of rain -'RERAIN' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 130 ; - } - -#paramId: 500781 -#Effective radius of cloud ice -'REICE' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 131 ; - } - -#paramId: 500782 -#Effective radius of snow -'RESNOW' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 132 ; - } - -#paramId: 500783 -#Effective radius of graupel -'REGRAUPEL' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 133 ; - } - -#paramId: 500784 -#Effective radius of hail -'REHAIL' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 134 ; - } - -#paramId: 500785 -#Effective radius of subgrid liquid clouds -'RECLOUD_SGS' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 135 ; - } - -#paramId: 500786 -#Effective radius of subgrid ice clouds -'REICE_SGS' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 136 ; - } - -#paramId: 500787 -#Effective aspect ratio of rain -'ARRAIN' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 137 ; - } - -#paramId: 500788 -#Effective aspect ratio of cloud ice -'ARICE' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 138 ; - } - -#paramId: 500789 -#Effective aspect ratio of snow -'ARSNOW' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 139 ; - } - -#paramId: 500790 -#Effective aspect ratio of graupel -'ARGRAUPEL' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 140 ; - } - -#paramId: 500791 -#Effective aspect ratio of hail -'ARHAIL' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 141 ; - } - -#paramId: 500792 -#Effective aspect ratio of subgrid ice clouds -'ARICE_SGS' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 142 ; - } - #paramId: 500905 #Specific Humidity (S) 'QV_S' = { @@ -8267,6 +8155,815 @@ typeOfFirstFixedSurface = 1 ; } +#paramId: 503563 +#Temperature tendency perturbation due to stochastic model of model error +'DT_SMME' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 26 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503564 +#Zonal wind tendency perturbation due to stochastic model of model error +'DU_SMME' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 39 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503565 +#Meridional wind tendency perturbation due to stochastic model of model error +'DV_SMME' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 40 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503566 +#Effective radius of cloud water +'RECLOUD' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 129 ; + } + +#paramId: 503567 +#Effective radius of rain +'RERAIN' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 130 ; + } + +#paramId: 503568 +#Effective radius of cloud ice +'REICE' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 131 ; + } + +#paramId: 503569 +#Effective radius of snow +'RESNOW' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 132 ; + } + +#paramId: 503570 +#Effective radius of graupel +'REGRAUPEL' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 133 ; + } + +#paramId: 503571 +#Effective radius of hail +'REHAIL' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 134 ; + } + +#paramId: 503572 +#Effective radius of subgrid liquid clouds +'RECLOUD_SGS' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 135 ; + } + +#paramId: 503573 +#Effective radius of subgrid ice clouds +'REICE_SGS' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 136 ; + } + +#paramId: 503574 +#Effective aspect ratio of rain +'ARRAIN' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 137 ; + } + +#paramId: 503575 +#Effective aspect ratio of cloud ice +'ARICE' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 138 ; + } + +#paramId: 503576 +#Effective aspect ratio of snow +'ARSNOW' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 139 ; + } + +#paramId: 503577 +#Effective aspect ratio of graupel +'ARGRAUPEL' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 140 ; + } + +#paramId: 503578 +#Effective aspect ratio of hail +'ARHAIL' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 141 ; + } + +#paramId: 503579 +#Effective aspect ratio of subgrid ice clouds +'ARICE_SGS' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 142 ; + } + +#paramId: 503580 +#Relative Humidity in lowest model layer - time-filtered assimilation increment +'RELHUM_LML_FILTINC' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503581 +#Temperature in lowest model layer - time-filtered assimilation increment +'T_LML_FILTINC' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503583 +#Wind speed (time average) +'SP_AV' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } + +#paramId: 503584 +#10m wind speed (time average) +'SP_10M_AV' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 10 ; + } + +#paramId: 503587 +#Total cloud cover (time average) +'CLCT_AV' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } + +#paramId: 503593 +#Clear-sky net solar radiation flux (at the surface) +'SOBS_RAD_CS' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503594 +#Clear-sky net thermal radiation flux (at the surface) +'THBS_RAD_CS' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503595 +#Clear-sky net solar radiation flux (on model top) +'SOBT_RAD_CS' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503596 +#Clear-sky net thermal radiation flux (on model top) +'THBT_RAD_CS' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503597 +#Clear-sky net solar radiation flux (at the surface) - time average +'ASOB_S_CS' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503598 +#Clear-sky net thermal radiation flux (at the surface) - time average +'ATHB_S_CS' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503599 +#Clear-sky net solar radiation flux (on model top) - time average +'ASOB_T_CS' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503600 +#Clear-sky net thermal radiation flux (on model top) - time average +'ATHB_T_CS' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503601 +#TOA downward solar radiation (time average) +'ASOD_T' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503602 +#Volumetric saturation of soil moisture +'W_SO_SAT' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfSecondFixedSurface = 106 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503616 +#Pressure in lowest model layer - time-filtered assimilation increment +'P_LML_FILTINC' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503617 +#Maximum amplitude of updraft helicity in tropospheric column of low height +'UH_MAX_LOW' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 15 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 102 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 3000 ; + typeOfFirstFixedSurface = 102 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 0 ; + } + +#paramId: 503618 +#Maximum amplitude of updraft helicity in tropospheric column of medium height +'UH_MAX_MED' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 15 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 102 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 5000 ; + typeOfFirstFixedSurface = 102 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 2000 ; + } + +#paramId: 503621 +#Large-scale precipitation rate +'PR_GSP' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 54 ; + } + +#paramId: 503624 +#Total lightning flash density - maximum +'LFD_TOT_MX' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 8 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503628 +#Smoke - high absorption (mass mixing ratio) +'SMOKE_HA' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62020 ; + } + +#paramId: 503629 +#Smoke - high absorption (mass density) +'SMOKE_DEN_HA' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62020 ; + } + +#paramId: 503630 +#Smoke - high absorption (specific number concentration) +'SMOKE0_HA' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62020 ; + } + +#paramId: 503631 +#Smoke - low absorption (mass mixing ratio) +'SMOKE_LA' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62021 ; + } + +#paramId: 503632 +#Smoke - low absorption (mass density) +'SMOKE_DEN_LA' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62021 ; + } + +#paramId: 503633 +#Smoke - low absorption (specific number concentration) +'SMOKE0_LA' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62021 ; + } + +#paramId: 503634 +#Sulphur dioxide (SO2) - volume mixing ratio +'SO2' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 52 ; + constituentType = 8 ; + } + +#paramId: 503635 +#Sulphur dioxide (SO2) - mass density +'SO2_DEN' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 8 ; + } + +#paramId: 503636 +#Hazel (corylus) pollen concentration +'CORY' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 59 ; + constituentType = 62104 ; + } + +#paramId: 503637 +#Fraction of land occupied by hazel (corylus) +'CORYfr' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 4 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503643 +#Precipitation reservoir (liquid water on the flowers, preventing them from flowering) of hazel (corylus) +'CORYrprec' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 13 ; + constituentType = 62104 ; + } + +#paramId: 503651 +#Hazel (corylus) pollen specific number concentration +'CORYsnc' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62104 ; + } + +#paramId: 503657 +#Temperature in lowest model layer - time-filtered assimilation increment, weighted with cos(2pi loc.time/day) +'T_LML_COSWGT_FILTINC' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 208 ; + } + +#paramId: 503662 +#Thickness of snow layer - multi level +'DZ_SNOW_M' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503664 +#Snow temperature of layer (defined at layer top) - multi level +'TofSNW_LTOP_M' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 28 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503672 +#Lightning Potential Index from convection scheme +'LPI_CON' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 5 ; + } + +#paramId: 503673 +#Maximum Lightning Potential Index from convection scheme +'LPI_CON_MAX' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 5 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503674 +#Wind speed in lowest model layer - time-filtered assimilation increment +'SP_LML_FILTINC' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503675 +#Eddy Dissipation Parameter +'EDP' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 30 ; + } + +#paramId: 503676 +#Icing Severity (0=None, 1=Trace, 2=Light, 3=Moderate, 4=Severe) +'ICE_SEV' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 37 ; + } + +#paramId: 503677 +#U-component surface Stokes drift +'UST' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 21 ; + } + +#paramId: 503678 +#V-component surface Stokes drift +'VST' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 22 ; + } + +#paramId: 503679 +#Peak wave direction +'PWD' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 46 ; + } + +#paramId: 503680 +#Significant wave height of first swell partition +'SWH1' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 47 ; + } + +#paramId: 503681 +#Significant wave height of second swell partition +'SWH2' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 48 ; + } + +#paramId: 503682 +#Significant wave height of third swell partition +'SWH3' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 49 ; + } + +#paramId: 503683 +#Mean wave period of first swell partition +'MWP1' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 50 ; + } + +#paramId: 503684 +#Mean wave period of second swell partition +'MWP2' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 51 ; + } + +#paramId: 503685 +#Mean wave period of third swell partition +'MWP3' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 52 ; + } + +#paramId: 503686 +#Mean wave direction of first swell partition +'MWD1' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 53 ; + } + +#paramId: 503687 +#Mean wave direction of second swell partition +'MWD2' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 54 ; + } + +#paramId: 503688 +#Mean wave direction of third swell partition +'MWD3' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 55 ; + } + +#paramId: 503689 +#Diagnostic total mass concentration of mineral dust aerosol +'DUST_TOTAL_MC' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62001 ; + } + +#paramId: 503690 +#Diagnostic total mass concentration of sea salt aerosol +'SEAS_TOTAL_MC' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62008 ; + } + +#paramId: 503691 +#Diagnostic total mass concentration of black carbon aerosol (soot) +'BCARB_TOTAL_MC' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62009 ; + } + +#paramId: 503692 +#Diagnostic black carbon aerosol (soot) optical depth +'AOD_BCARB' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + aerosolType = 62009 ; + } + +#paramId: 503693 +#Total atmosphere optical depth due to mineral dust aerosol +'TAOD_DUST' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62001 ; + } + +#paramId: 503694 +#Total atmosphere optical depth due to sea salt aerosol +'TAOD_SEAS' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62008 ; + } + +#paramId: 503695 +#Total atmosphere optical depth due to volcanic ash aerosol +'TAOD_ASH' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62025 ; + } + +#paramId: 503696 +#Total atmosphere optical depth due to black carbon aerosol (soot) +'TAOD_BCARB' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62009 ; + } + +#paramId: 503697 +#Modal prognostic mass mixing ratio of mineral dust aerosol (all modes) +'DUST' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62001 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503698 +#Modal prognostic mass mixing ratio of sea salt aerosol (all modes) +'SEAS' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62008 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503699 +#Modal prognostic mass mixing ratio of black carbon aerosol (soot) (all modes) +'BCARB' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62009 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503700 +#Modal prognostic specific number concentration of black carbon aerosol (soot) (all modes) +'BCARB0' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62009 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503701 +#Modal prognostic mass mixing ratio of volcanic ash aerosol (all modes) +'ASH' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62025 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503702 +#Modal prognostic specific number concentration of total aerosol (all modes) +'SNC_AERO' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62000 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503703 +#Base reflectivity - low layer maximum +'DBZLMX_LOW' = { + discipline = 0 ; + parameterCategory = 15 ; + parameterNumber = 4 ; + typeOfSecondFixedSurface = 103 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 500 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 2500 ; + } + +#paramId: 503706 +#Sea water density +'SWDEN' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 16 ; + } + +#paramId: 503707 +#Sea water potential temperature +'SWPT' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 18 ; + } + +#paramId: 503708 +#Sea water potential density +'SWPDEN' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 19 ; + } + +#paramId: 503709 +#Sea water practical salinity +'SWPSAL' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 21 ; + } + #paramId: 500092 #Solar radiation heating rate 'SOHR_RAD' = { @@ -11069,6 +11766,118 @@ parameterNumber = 128 ; } +#paramId: 500779 +#DUMMY_129 +'DUMMY_129' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 129 ; + } + +#paramId: 500780 +#DUMMY_130 +'DUMMY_130' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 130 ; + } + +#paramId: 500781 +#DUMMY_131 +'DUMMY_131' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 131 ; + } + +#paramId: 500782 +#DUMMY_132 +'DUMMY_132' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 132 ; + } + +#paramId: 500783 +#DUMMY_133 +'DUMMY_133' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 133 ; + } + +#paramId: 500784 +#DUMMY_134 +'DUMMY_134' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 134 ; + } + +#paramId: 500785 +#DUMMY_135 +'DUMMY_135' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 135 ; + } + +#paramId: 500786 +#DUMMY_136 +'DUMMY_136' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 136 ; + } + +#paramId: 500787 +#DUMMY_137 +'DUMMY_137' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 137 ; + } + +#paramId: 500788 +#DUMMY_138 +'DUMMY_138' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 138 ; + } + +#paramId: 500789 +#DUMMY_139 +'DUMMY_139' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 139 ; + } + +#paramId: 500790 +#DUMMY_140 +'DUMMY_140' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 140 ; + } + +#paramId: 500791 +#DUMMY_141 +'DUMMY_141' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 141 ; + } + +#paramId: 500792 +#DUMMY_142 +'DUMMY_142' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 142 ; + } + #paramId: 500793 #DUMMY_143 'DUMMY_143' = { @@ -13807,3 +14616,655 @@ parameterNumber = 211 ; } +#paramId: 503582 +#Frequency of winds in defined wind sector for defined time interval +'DD_10M_SECFREQ' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 11 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503585 +#10m wind speed in wind sector (time average) +'SP_10M_SECAV' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503586 +#10m wind speed in wind sector (time maximum) +'SP_10M_SECMAX' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503588 +#Downward direct short-wave radiation flux at surface on a plane normal to the sun (time average) +'ASWDIR_SN' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 198 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 206 ; + } + +#paramId: 503589 +#Downward direct short-wave radiation flux at surface on a plane normal to the sun without orographic shading (time average) +'ASWDIR_SNO' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 198 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 207 ; + } + +#paramId: 503590 +#Solar elevation angle +'SUN_EL' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 202 ; + } + +#paramId: 503591 +#Solar azimuth angle +'SUN_AZI' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 203 ; + } + +#paramId: 503592 +#Turbulence intensity (time maximum) +'TURB_INTENS_MAX' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 236 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503603 +#Soil water mass flux at layer interfaces (sum of conductive and diffusive fluxes) +'WSOIL_FLX' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503604 +#Ground water runoff rate, aquifer +'Q_ROFF' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 195 ; + typeOfSecondFixedSurface = 106 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503605 +#Water table depth +'WT_DEPTH' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 193 ; + typeOfFirstFixedSurface = 177 ; + } + +#paramId: 503606 +#Soil moisture saturation level +'W_SO_SL' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 194 ; + typeOfFirstFixedSurface = 177 ; + } + +#paramId: 503607 +#Slope of orography (using average of maximum gradient in different directions) +'S_ORO_MAX' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 198 ; + } + +#paramId: 503608 +#Total column zonal water flux +'TWATFLXU' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 236 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503609 +#Total column meridional water flux +'TWATFLXV' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 237 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503610 +#Total column zonal water flux - time average +'ATWATFLXU' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 236 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503611 +#Total column meridional water flux - time average +'ATWATFLXV' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 237 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503612 +#Number of active clouds per horizontal unit area +'NCL_PUA_ACT' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 210 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503613 +#Number of passive clouds per horizontal unit area +'NCL_PUA_PSV' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 211 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503614 +#Cloud base mass flux associated with active clouds +'CBMFLX_ACT' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 200 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503615 +#Cloud base mass flux associated with passive clouds +'CBMFLX_PSV' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 199 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503619 +#Single scan reflectivity - observation +'DBZSCAN_OBS' = { + discipline = 0 ; + parameterCategory = 15 ; + parameterNumber = 200 ; + typeOfGeneratingProcess = 8 ; + } + +#paramId: 503620 +#Single scan reflectivity - simulation +'DBZSCAN_SIM' = { + discipline = 0 ; + parameterCategory = 16 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 198 ; + } + +#paramId: 503622 +#Lightning Potential Index from convection scheme, modified by convection index +'LPI_CON_CI' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 193 ; + } + +#paramId: 503623 +#Maximum Lightning Potential Index from convection scheme, modified by convection index +'LPI_CON_CI_MAX' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 193 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503625 +#Mass median diameter of dust for mode 1 +'MMD_DUSTA' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 1 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503626 +#Mass median diameter of dust for mode 2 +'MMD_DUSTB' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 2 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503627 +#Mass median diameter of dust for mode 3 +'MMD_DUSTC' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 3 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503638 +#Number of hazel (corylus) pollen in the reservoir (previous timestep) +'CORYreso' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 192 ; + constituentType = 62104 ; + } + +#paramId: 503639 +#Number of hazel (corylus) pollen released into the reservoir (new) +'CORYresn' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 193 ; + constituentType = 62104 ; + } + +#paramId: 503640 +#State of the hazel (corylus) season (eq.zero before and after season, the higher, the more plants are flowering) +'CORYsdes' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 194 ; + constituentType = 62104 ; + } + +#paramId: 503641 +#Height correction for emission (decreasing emission with height) for hazel (corylus) +'CORYhcem' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 195 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503642 +#Sum of released hazel (corylus) pollen into the reservoir (daily sum) +'CORYress' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 193 ; + typeOfStatisticalProcessing = 11 ; + constituentType = 62104 ; + } + +#paramId: 503644 +#Cumulated weighted 2m temperature sum of daily values for hazel (corylus) pollen +'CORYctsum' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 196 ; + constituentType = 62104 ; + } + +#paramId: 503645 +#Cumulated 2m temperature sum threshold for the start of hazel (corylus) pollen season (climatological) +'CORYtthrs' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 197 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503646 +#Cumulated 2m temperature sum threshold for the end of hazel (corylus) pollen season (climatological) +'CORYtthre' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 198 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503647 +#Number of days since the start of hazel (corylus) pollen season (if present day is in the season: zero outside season) +'CORYsaisn' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 199 ; + constituentType = 62104 ; + } + +#paramId: 503648 +#Length of hazel (corylus) pollen season +'CORYsaisl' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 201 ; + constituentType = 62104 ; + } + +#paramId: 503649 +#Pollen number emission flux for hazel (corylus) +'CORYfe' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 202 ; + constituentType = 62104 ; + } + +#paramId: 503650 +#Number of days since the start of hazel (corylus) pollen season (if present day is outside the season: length of current season) +'CORYsaisa' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 200 ; + constituentType = 62104 ; + } + +#paramId: 503652 +#Emission tuning factor for birch (betula) pollen +'BETUtune' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62101 ; + } + +#paramId: 503653 +#Emission tuning factor for alder (alnus) pollen +'ALNUtune' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62100 ; + } + +#paramId: 503654 +#Emission tuning factor for grasses (poaceae) pollen +'POACtune' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62300 ; + } + +#paramId: 503655 +#Emission tuning factor for ragweed (ambrosia) pollen +'AMBRtune' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62200 ; + } + +#paramId: 503656 +#Emission tuning factor for hazel (corylus) pollen +'CORYtune' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62104 ; + } + +#paramId: 503658 +#Height of new snow (without settling) +'H_NEWSNOW_M' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 207 ; + } + +#paramId: 503659 +#Volumetric ice content of snow layer - multi level +'ICEinSNW_VC_M' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 63000 ; + } + +#paramId: 503660 +#Volumetric water content of snow layer - multi level +'H2OinSNW_VC_M' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 62002 ; + } + +#paramId: 503661 +#Volumetric air content of snow layer - multi level +'AIRinSNW_VC_M' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 63001 ; + } + +#paramId: 503663 +#Number of snow layer - multi level +'N_SNOW_M' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 206 ; + } + +#paramId: 503665 +#Building area fraction (proportion: 0=no building, 1=whole urban area) +'URB_FR_BLD' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 0 ; + } + +#paramId: 503666 +#Street canyon aspect (height - width) ratio +'URB_H2W' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 1 ; + } + +#paramId: 503667 +#Height of building +'URB_H_BLD' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 2 ; + } + +#paramId: 503668 +#Urban material thermal albedo +'URB_ALB_TH' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 3 ; + } + +#paramId: 503669 +#Urban material shortwave (solar) albedo +'URB_ALB_SO' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 4 ; + } + +#paramId: 503670 +#Volumetric heat capacity of urban material (capacity x density) +'URB_HCAP' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 5 ; + } + +#paramId: 503671 +#Heat conductivity of urban material +'URB_HCON' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 6 ; + } + +#paramId: 503704 +#Potential flight distance PFD (gliding) +'POT_FLT_DIST' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 240 ; + } + +#paramId: 503705 +#Lifting ratio VST (gliding) +'LIFT_RATIO' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 241 ; + } + +#paramId: 503710 +#U-component of mean wind (vertical mean over specified layer) +'U_MEAN' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 212 ; + } + +#paramId: 503711 +#V-component of mean wind (vertical mean over specified layer) +'V_MEAN' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 213 ; + } + +#paramId: 503712 +#Extreme weather index of snow amount, grid-scale plus convective +'TOT_SNOW_EWI' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 240 ; + typeOfStatisticalProcessing = 1 ; + } + +#paramId: 503713 +#Extreme weather index of maximum Wind 10m +'VMAX_10M_EWI' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 214 ; + typeOfStatisticalProcessing = 2 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 10 ; + } + +#paramId: 503714 +#Extreme weather index of total precipitation (Accumulation) +'TOT_PREC_EWI' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 239 ; + typeOfStatisticalProcessing = 1 ; + } + +#paramId: 503715 +#Cloud cover for use in radiative transfer (modified where large hydrometeors are present) +'CLC_RAD' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 215 ; + } + +#paramId: 503716 +#Snow temperature at node (i.e. at snow layer interface or boundary) - multi level +'TofSNW_NODE_M' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 208 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503717 +#Volumetric ice content of snow layer (for use in tile approach) - multi level +'ICEinSNW_VC_T_M' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 209 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503718 +#Volumetric water content of snow layer (for use in tile approach) - multi level +'H2OinSNW_VC_T_M' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503719 +#Volumetric air content of snow layer (for use in tile approach) - multi level +'AIRinSNW_VC_T_M' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 211 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503720 +#Probability for freezing precipitation/wet snow +'FP' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 242 ; + } + +#paramId: 503721 +#Probability for freezing precipitation with wind +'FPW' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 243 ; + } + diff --git a/definitions/grib2/localConcepts/edzw/units.def b/definitions/grib2/localConcepts/edzw/units.def index 54b9c9931..7f652d7df 100644 --- a/definitions/grib2/localConcepts/edzw/units.def +++ b/definitions/grib2/localConcepts/edzw/units.def @@ -1,4 +1,4 @@ -# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2020-11-05 10:29 +# Automatically generated by get_definitionsALL.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2023-08-17 13:41 #paramId: 500000 #Pressure (S) (not reduced) 'Pa' = { @@ -3471,118 +3471,6 @@ parameterNumber = 8 ; } -#paramId: 500779 -#Effective radius of cloud water -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 129 ; - } - -#paramId: 500780 -#Effective radius of rain -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 130 ; - } - -#paramId: 500781 -#Effective radius of cloud ice -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 131 ; - } - -#paramId: 500782 -#Effective radius of snow -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 132 ; - } - -#paramId: 500783 -#Effective radius of graupel -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 133 ; - } - -#paramId: 500784 -#Effective radius of hail -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 134 ; - } - -#paramId: 500785 -#Effective radius of subgrid liquid clouds -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 135 ; - } - -#paramId: 500786 -#Effective radius of subgrid ice clouds -'m' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 136 ; - } - -#paramId: 500787 -#Effective aspect ratio of rain -'' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 137 ; - } - -#paramId: 500788 -#Effective aspect ratio of cloud ice -'' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 138 ; - } - -#paramId: 500789 -#Effective aspect ratio of snow -'' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 139 ; - } - -#paramId: 500790 -#Effective aspect ratio of graupel -'' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 140 ; - } - -#paramId: 500791 -#Effective aspect ratio of hail -'' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 141 ; - } - -#paramId: 500792 -#Effective aspect ratio of subgrid ice clouds -'' = { - discipline = 0 ; - parameterCategory = 1 ; - parameterNumber = 142 ; - } - #paramId: 500905 #Specific Humidity (S) 'kg kg-1' = { @@ -8267,6 +8155,815 @@ typeOfFirstFixedSurface = 1 ; } +#paramId: 503563 +#Temperature tendency perturbation due to stochastic model of model error +'K s-1' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 26 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503564 +#Zonal wind tendency perturbation due to stochastic model of model error +'m s-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 39 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503565 +#Meridional wind tendency perturbation due to stochastic model of model error +'m s-2' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 40 ; + typeOfGeneratingProcess = 221 ; + } + +#paramId: 503566 +#Effective radius of cloud water +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 129 ; + } + +#paramId: 503567 +#Effective radius of rain +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 130 ; + } + +#paramId: 503568 +#Effective radius of cloud ice +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 131 ; + } + +#paramId: 503569 +#Effective radius of snow +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 132 ; + } + +#paramId: 503570 +#Effective radius of graupel +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 133 ; + } + +#paramId: 503571 +#Effective radius of hail +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 134 ; + } + +#paramId: 503572 +#Effective radius of subgrid liquid clouds +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 135 ; + } + +#paramId: 503573 +#Effective radius of subgrid ice clouds +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 136 ; + } + +#paramId: 503574 +#Effective aspect ratio of rain +'' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 137 ; + } + +#paramId: 503575 +#Effective aspect ratio of cloud ice +'' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 138 ; + } + +#paramId: 503576 +#Effective aspect ratio of snow +'' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 139 ; + } + +#paramId: 503577 +#Effective aspect ratio of graupel +'' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 140 ; + } + +#paramId: 503578 +#Effective aspect ratio of hail +'' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 141 ; + } + +#paramId: 503579 +#Effective aspect ratio of subgrid ice clouds +'' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 142 ; + } + +#paramId: 503580 +#Relative Humidity in lowest model layer - time-filtered assimilation increment +'Proportion' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 1 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503581 +#Temperature in lowest model layer - time-filtered assimilation increment +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503583 +#Wind speed (time average) +'m s-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } + +#paramId: 503584 +#10m wind speed (time average) +'m s-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 10 ; + } + +#paramId: 503587 +#Total cloud cover (time average) +'%' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + } + +#paramId: 503593 +#Clear-sky net solar radiation flux (at the surface) +'W m-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503594 +#Clear-sky net thermal radiation flux (at the surface) +'W m-2' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503595 +#Clear-sky net solar radiation flux (on model top) +'W m-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503596 +#Clear-sky net thermal radiation flux (on model top) +'W m-2' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503597 +#Clear-sky net solar radiation flux (at the surface) - time average +'W m-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503598 +#Clear-sky net thermal radiation flux (at the surface) - time average +'W m-2' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503599 +#Clear-sky net solar radiation flux (on model top) - time average +'W m-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 11 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503600 +#Clear-sky net thermal radiation flux (on model top) - time average +'W m-2' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 6 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503601 +#TOA downward solar radiation (time average) +'W m-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 7 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 8 ; + } + +#paramId: 503602 +#Volumetric saturation of soil moisture +'m3 m-3' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 16 ; + typeOfSecondFixedSurface = 106 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503616 +#Pressure in lowest model layer - time-filtered assimilation increment +'Pa' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503617 +#Maximum amplitude of updraft helicity in tropospheric column of low height +'m2 s-2' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 15 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 102 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 3000 ; + typeOfFirstFixedSurface = 102 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 0 ; + } + +#paramId: 503618 +#Maximum amplitude of updraft helicity in tropospheric column of medium height +'m2 s-2' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 15 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 102 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 5000 ; + typeOfFirstFixedSurface = 102 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 2000 ; + } + +#paramId: 503621 +#Large-scale precipitation rate +'kg m-2 s-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 54 ; + } + +#paramId: 503624 +#Total lightning flash density - maximum +'km-2 day-1' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 4 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 8 ; + typeOfFirstFixedSurface = 1 ; + } + +#paramId: 503628 +#Smoke - high absorption (mass mixing ratio) +'kg kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62020 ; + } + +#paramId: 503629 +#Smoke - high absorption (mass density) +'kg m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62020 ; + } + +#paramId: 503630 +#Smoke - high absorption (specific number concentration) +'kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62020 ; + } + +#paramId: 503631 +#Smoke - low absorption (mass mixing ratio) +'kg kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62021 ; + } + +#paramId: 503632 +#Smoke - low absorption (mass density) +'kg m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62021 ; + } + +#paramId: 503633 +#Smoke - low absorption (specific number concentration) +'kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62021 ; + } + +#paramId: 503634 +#Sulphur dioxide (SO2) - volume mixing ratio +'mol mol-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 52 ; + constituentType = 8 ; + } + +#paramId: 503635 +#Sulphur dioxide (SO2) - mass density +'kg m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 8 ; + } + +#paramId: 503636 +#Hazel (corylus) pollen concentration +'m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 59 ; + constituentType = 62104 ; + } + +#paramId: 503637 +#Fraction of land occupied by hazel (corylus) +'%' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 4 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503643 +#Precipitation reservoir (liquid water on the flowers, preventing them from flowering) of hazel (corylus) +'kg m-2' = { + discipline = 2 ; + parameterCategory = 0 ; + parameterNumber = 13 ; + constituentType = 62104 ; + } + +#paramId: 503651 +#Hazel (corylus) pollen specific number concentration +'kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62104 ; + } + +#paramId: 503657 +#Temperature in lowest model layer - time-filtered assimilation increment, weighted with cos(2pi loc.time/day) +'K' = { + discipline = 0 ; + parameterCategory = 0 ; + parameterNumber = 0 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 208 ; + } + +#paramId: 503662 +#Thickness of snow layer - multi level +'m' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 11 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503664 +#Snow temperature of layer (defined at layer top) - multi level +'K' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 28 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503672 +#Lightning Potential Index from convection scheme +'J kg-1' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 5 ; + } + +#paramId: 503673 +#Maximum Lightning Potential Index from convection scheme +'J kg-1' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 5 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503674 +#Wind speed in lowest model layer - time-filtered assimilation increment +'m s-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfSecondFixedSurface = 1 ; + typeOfFirstFixedSurface = 103 ; + typeOfGeneratingProcess = 207 ; + } + +#paramId: 503675 +#Eddy Dissipation Parameter +'m2/3 s-1' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 30 ; + } + +#paramId: 503676 +#Icing Severity (0=None, 1=Trace, 2=Light, 3=Moderate, 4=Severe) +'Code Table 4.228' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 37 ; + } + +#paramId: 503677 +#U-component surface Stokes drift +'m s-1' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 21 ; + } + +#paramId: 503678 +#V-component surface Stokes drift +'m s-1' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 22 ; + } + +#paramId: 503679 +#Peak wave direction +'degree true' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 46 ; + } + +#paramId: 503680 +#Significant wave height of first swell partition +'m' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 47 ; + } + +#paramId: 503681 +#Significant wave height of second swell partition +'m' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 48 ; + } + +#paramId: 503682 +#Significant wave height of third swell partition +'m' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 49 ; + } + +#paramId: 503683 +#Mean wave period of first swell partition +'s ' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 50 ; + } + +#paramId: 503684 +#Mean wave period of second swell partition +'s' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 51 ; + } + +#paramId: 503685 +#Mean wave period of third swell partition +'s' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 52 ; + } + +#paramId: 503686 +#Mean wave direction of first swell partition +'degree true' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 53 ; + } + +#paramId: 503687 +#Mean wave direction of second swell partition +'degree true' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 54 ; + } + +#paramId: 503688 +#Mean wave direction of third swell partition +'degree true' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 55 ; + } + +#paramId: 503689 +#Diagnostic total mass concentration of mineral dust aerosol +'kg m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62001 ; + } + +#paramId: 503690 +#Diagnostic total mass concentration of sea salt aerosol +'kg m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62008 ; + } + +#paramId: 503691 +#Diagnostic total mass concentration of black carbon aerosol (soot) +'kg m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 0 ; + constituentType = 62009 ; + } + +#paramId: 503692 +#Diagnostic black carbon aerosol (soot) optical depth +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + aerosolType = 62009 ; + } + +#paramId: 503693 +#Total atmosphere optical depth due to mineral dust aerosol +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62001 ; + } + +#paramId: 503694 +#Total atmosphere optical depth due to sea salt aerosol +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62008 ; + } + +#paramId: 503695 +#Total atmosphere optical depth due to volcanic ash aerosol +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62025 ; + } + +#paramId: 503696 +#Total atmosphere optical depth due to black carbon aerosol (soot) +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 102 ; + typeOfFirstFixedSurface = 10 ; + aerosolType = 62009 ; + } + +#paramId: 503697 +#Modal prognostic mass mixing ratio of mineral dust aerosol (all modes) +'kg kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62001 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503698 +#Modal prognostic mass mixing ratio of sea salt aerosol (all modes) +'kg kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62008 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503699 +#Modal prognostic mass mixing ratio of black carbon aerosol (soot) (all modes) +'kg kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62009 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503700 +#Modal prognostic specific number concentration of black carbon aerosol (soot) (all modes) +'kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62009 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503701 +#Modal prognostic mass mixing ratio of volcanic ash aerosol (all modes) +'kg kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 2 ; + constituentType = 62025 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503702 +#Modal prognostic specific number concentration of total aerosol (all modes) +'kg-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 60 ; + constituentType = 62000 ; + typeOfDistributionFunction = 7 ; + } + +#paramId: 503703 +#Base reflectivity - low layer maximum +'dBZ' = { + discipline = 0 ; + parameterCategory = 15 ; + parameterNumber = 4 ; + typeOfSecondFixedSurface = 103 ; + scaleFactorOfSecondFixedSurface = 0 ; + scaledValueOfSecondFixedSurface = 500 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 2500 ; + } + +#paramId: 503706 +#Sea water density +'kg m-3' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 16 ; + } + +#paramId: 503707 +#Sea water potential temperature +'K' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 18 ; + } + +#paramId: 503708 +#Sea water potential density +'kg m-3' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 19 ; + } + +#paramId: 503709 +#Sea water practical salinity +'Numeric' = { + discipline = 10 ; + parameterCategory = 4 ; + parameterNumber = 21 ; + } + #paramId: 500092 #Solar radiation heating rate 'K s-1' = { @@ -11069,6 +11766,118 @@ parameterNumber = 128 ; } +#paramId: 500779 +#DUMMY_129 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 129 ; + } + +#paramId: 500780 +#DUMMY_130 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 130 ; + } + +#paramId: 500781 +#DUMMY_131 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 131 ; + } + +#paramId: 500782 +#DUMMY_132 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 132 ; + } + +#paramId: 500783 +#DUMMY_133 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 133 ; + } + +#paramId: 500784 +#DUMMY_134 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 134 ; + } + +#paramId: 500785 +#DUMMY_135 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 135 ; + } + +#paramId: 500786 +#DUMMY_136 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 136 ; + } + +#paramId: 500787 +#DUMMY_137 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 137 ; + } + +#paramId: 500788 +#DUMMY_138 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 138 ; + } + +#paramId: 500789 +#DUMMY_139 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 139 ; + } + +#paramId: 500790 +#DUMMY_140 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 140 ; + } + +#paramId: 500791 +#DUMMY_141 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 141 ; + } + +#paramId: 500792 +#DUMMY_142 +'' = { + discipline = 0 ; + parameterCategory = 254 ; + parameterNumber = 142 ; + } + #paramId: 500793 #DUMMY_143 '' = { @@ -13807,3 +14616,655 @@ parameterNumber = 211 ; } +#paramId: 503582 +#Frequency of winds in defined wind sector for defined time interval +'Numeric' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 0 ; + typeOfStatisticalProcessing = 11 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503585 +#10m wind speed in wind sector (time average) +'m s-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 0 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503586 +#10m wind speed in wind sector (time maximum) +'m s-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 1 ; + typeOfStatisticalProcessing = 2 ; + typeOfSecondFixedSurface = 233 ; + typeOfFirstFixedSurface = 233 ; + } + +#paramId: 503588 +#Downward direct short-wave radiation flux at surface on a plane normal to the sun (time average) +'W m-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 198 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 206 ; + } + +#paramId: 503589 +#Downward direct short-wave radiation flux at surface on a plane normal to the sun without orographic shading (time average) +'W m-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 198 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 207 ; + } + +#paramId: 503590 +#Solar elevation angle +'Degree' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 202 ; + } + +#paramId: 503591 +#Solar azimuth angle +'Degree' = { + discipline = 0 ; + parameterCategory = 191 ; + parameterNumber = 203 ; + } + +#paramId: 503592 +#Turbulence intensity (time maximum) +'Numeric' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 236 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503603 +#Soil water mass flux at layer interfaces (sum of conductive and diffusive fluxes) +'kg m-2 s-1' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 201 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503604 +#Ground water runoff rate, aquifer +'kg m-3 s-1' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 195 ; + typeOfSecondFixedSurface = 106 ; + typeOfFirstFixedSurface = 106 ; + } + +#paramId: 503605 +#Water table depth +'m' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 193 ; + typeOfFirstFixedSurface = 177 ; + } + +#paramId: 503606 +#Soil moisture saturation level +'-' = { + discipline = 1 ; + parameterCategory = 0 ; + parameterNumber = 194 ; + typeOfFirstFixedSurface = 177 ; + } + +#paramId: 503607 +#Slope of orography (using average of maximum gradient in different directions) +'Numeric' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 198 ; + } + +#paramId: 503608 +#Total column zonal water flux +'kg m-1 s-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 236 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503609 +#Total column meridional water flux +'kg m-1 s-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 237 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503610 +#Total column zonal water flux - time average +'kg m-1 s-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 236 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503611 +#Total column meridional water flux - time average +'kg m-1 s-1' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 237 ; + typeOfStatisticalProcessing = 0 ; + typeOfFirstFixedSurface = 10 ; + } + +#paramId: 503612 +#Number of active clouds per horizontal unit area +'m-2' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 210 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503613 +#Number of passive clouds per horizontal unit area +'m-2' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 211 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503614 +#Cloud base mass flux associated with active clouds +'kg m-2 s-1' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 200 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503615 +#Cloud base mass flux associated with passive clouds +'kg m-2 s-1' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 199 ; + typeOfFirstFixedSurface = 2 ; + } + +#paramId: 503619 +#Single scan reflectivity - observation +'dB' = { + discipline = 0 ; + parameterCategory = 15 ; + parameterNumber = 200 ; + typeOfGeneratingProcess = 8 ; + } + +#paramId: 503620 +#Single scan reflectivity - simulation +'dB' = { + discipline = 0 ; + parameterCategory = 16 ; + parameterNumber = 4 ; + typeOfFirstFixedSurface = 198 ; + } + +#paramId: 503622 +#Lightning Potential Index from convection scheme, modified by convection index +'J kg-1' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 193 ; + } + +#paramId: 503623 +#Maximum Lightning Potential Index from convection scheme, modified by convection index +'J kg-1' = { + discipline = 0 ; + parameterCategory = 17 ; + parameterNumber = 193 ; + typeOfStatisticalProcessing = 2 ; + } + +#paramId: 503625 +#Mass median diameter of dust for mode 1 +'m' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 1 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503626 +#Mass median diameter of dust for mode 2 +'m' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 2 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503627 +#Mass median diameter of dust for mode 3 +'m' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 220 ; + constituentType = 62001 ; + modeNumber = 3 ; + typeOfDistributionFunction = 8 ; + } + +#paramId: 503638 +#Number of hazel (corylus) pollen in the reservoir (previous timestep) +'m-2' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 192 ; + constituentType = 62104 ; + } + +#paramId: 503639 +#Number of hazel (corylus) pollen released into the reservoir (new) +'m-2' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 193 ; + constituentType = 62104 ; + } + +#paramId: 503640 +#State of the hazel (corylus) season (eq.zero before and after season, the higher, the more plants are flowering) +'0-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 194 ; + constituentType = 62104 ; + } + +#paramId: 503641 +#Height correction for emission (decreasing emission with height) for hazel (corylus) +'0-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 195 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503642 +#Sum of released hazel (corylus) pollen into the reservoir (daily sum) +'m-2' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 193 ; + typeOfStatisticalProcessing = 11 ; + constituentType = 62104 ; + } + +#paramId: 503644 +#Cumulated weighted 2m temperature sum of daily values for hazel (corylus) pollen +'deg C' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 196 ; + constituentType = 62104 ; + } + +#paramId: 503645 +#Cumulated 2m temperature sum threshold for the start of hazel (corylus) pollen season (climatological) +'deg C' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 197 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503646 +#Cumulated 2m temperature sum threshold for the end of hazel (corylus) pollen season (climatological) +'deg C' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 198 ; + typeOfGeneratingProcess = 9 ; + constituentType = 62104 ; + } + +#paramId: 503647 +#Number of days since the start of hazel (corylus) pollen season (if present day is in the season: zero outside season) +'d' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 199 ; + constituentType = 62104 ; + } + +#paramId: 503648 +#Length of hazel (corylus) pollen season +'d' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 201 ; + constituentType = 62104 ; + } + +#paramId: 503649 +#Pollen number emission flux for hazel (corylus) +'m-2 s-1' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 202 ; + constituentType = 62104 ; + } + +#paramId: 503650 +#Number of days since the start of hazel (corylus) pollen season (if present day is outside the season: length of current season) +'d' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 200 ; + constituentType = 62104 ; + } + +#paramId: 503652 +#Emission tuning factor for birch (betula) pollen +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62101 ; + } + +#paramId: 503653 +#Emission tuning factor for alder (alnus) pollen +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62100 ; + } + +#paramId: 503654 +#Emission tuning factor for grasses (poaceae) pollen +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62300 ; + } + +#paramId: 503655 +#Emission tuning factor for ragweed (ambrosia) pollen +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62200 ; + } + +#paramId: 503656 +#Emission tuning factor for hazel (corylus) pollen +'Numeric' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 211 ; + constituentType = 62104 ; + } + +#paramId: 503658 +#Height of new snow (without settling) +'m' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 207 ; + } + +#paramId: 503659 +#Volumetric ice content of snow layer - multi level +'m3 m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 63000 ; + } + +#paramId: 503660 +#Volumetric water content of snow layer - multi level +'m3 m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 62002 ; + } + +#paramId: 503661 +#Volumetric air content of snow layer - multi level +'m3 m-3' = { + discipline = 0 ; + parameterCategory = 20 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + constituentType = 63001 ; + } + +#paramId: 503663 +#Number of snow layer - multi level +'Numeric' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 206 ; + } + +#paramId: 503665 +#Building area fraction (proportion: 0=no building, 1=whole urban area) +'Proportion' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 0 ; + } + +#paramId: 503666 +#Street canyon aspect (height - width) ratio +'m m-1' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 1 ; + } + +#paramId: 503667 +#Height of building +'m' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 2 ; + } + +#paramId: 503668 +#Urban material thermal albedo +'%' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 3 ; + } + +#paramId: 503669 +#Urban material shortwave (solar) albedo +'%' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 4 ; + } + +#paramId: 503670 +#Volumetric heat capacity of urban material (capacity x density) +'J m-3 K-1' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 5 ; + } + +#paramId: 503671 +#Heat conductivity of urban material +'W m-1 K-1' = { + discipline = 2 ; + parameterCategory = 192 ; + parameterNumber = 6 ; + } + +#paramId: 503704 +#Potential flight distance PFD (gliding) +'m' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 240 ; + } + +#paramId: 503705 +#Lifting ratio VST (gliding) +'m s-1' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 241 ; + } + +#paramId: 503710 +#U-component of mean wind (vertical mean over specified layer) +'m s-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 212 ; + } + +#paramId: 503711 +#V-component of mean wind (vertical mean over specified layer) +'m s-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 213 ; + } + +#paramId: 503712 +#Extreme weather index of snow amount, grid-scale plus convective +'kg m-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 240 ; + typeOfStatisticalProcessing = 1 ; + } + +#paramId: 503713 +#Extreme weather index of maximum Wind 10m +'m s-1' = { + discipline = 0 ; + parameterCategory = 2 ; + parameterNumber = 214 ; + typeOfStatisticalProcessing = 2 ; + typeOfFirstFixedSurface = 103 ; + scaleFactorOfFirstFixedSurface = 0 ; + scaledValueOfFirstFixedSurface = 10 ; + } + +#paramId: 503714 +#Extreme weather index of total precipitation (Accumulation) +'kg m-2' = { + discipline = 0 ; + parameterCategory = 1 ; + parameterNumber = 239 ; + typeOfStatisticalProcessing = 1 ; + } + +#paramId: 503715 +#Cloud cover for use in radiative transfer (modified where large hydrometeors are present) +'%' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 215 ; + } + +#paramId: 503716 +#Snow temperature at node (i.e. at snow layer interface or boundary) - multi level +'K' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 208 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503717 +#Volumetric ice content of snow layer (for use in tile approach) - multi level +'m3 m-3' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 209 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503718 +#Volumetric water content of snow layer (for use in tile approach) - multi level +'m3 m-3' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 210 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503719 +#Volumetric air content of snow layer (for use in tile approach) - multi level +'m3 m-3' = { + discipline = 2 ; + parameterCategory = 3 ; + parameterNumber = 211 ; + typeOfSecondFixedSurface = 114 ; + typeOfFirstFixedSurface = 114 ; + } + +#paramId: 503720 +#Probability for freezing precipitation/wet snow +'%' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 242 ; + } + +#paramId: 503721 +#Probability for freezing precipitation with wind +'%' = { + discipline = 0 ; + parameterCategory = 19 ; + parameterNumber = 243 ; + } + diff --git a/definitions/grib2/localConcepts/era6/marsLevtypeConcept.def b/definitions/grib2/localConcepts/era6/marsLevtypeConcept.def new file mode 100644 index 000000000..cedc39b0d --- /dev/null +++ b/definitions/grib2/localConcepts/era6/marsLevtypeConcept.def @@ -0,0 +1,69 @@ +# Concept marsLevtype +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=8;} +'o2d' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=9;} +'sfc' = {typeOfFirstFixedSurface=1; typeOfSecondFixedSurface=162;} +'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;} +'hl' = {typeOfFirstFixedSurface=103; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=103; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=0; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=103; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=2; typeOfSecondFixedSurface=255;} +'sfc' = {typeOfFirstFixedSurface=103; scaleFactorOfFirstFixedSurface=0; scaledValueOfFirstFixedSurface=10; typeOfSecondFixedSurface=255;} +'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;} + diff --git a/definitions/grib2/localConcepts/uerra/cfVarName.def b/definitions/grib2/localConcepts/uerra/cfVarName.def index 20387cdfc..a77e854d9 100644 --- a/definitions/grib2/localConcepts/uerra/cfVarName.def +++ b/definitions/grib2/localConcepts/uerra/cfVarName.def @@ -17,7 +17,7 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'fg10' = { discipline = 0 ; parameterCategory = 2 ; @@ -29,7 +29,7 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 3 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'fg10' = { discipline = 0 ; parameterCategory = 2 ; @@ -41,7 +41,7 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 1 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'fg10' = { discipline = 0 ; parameterCategory = 2 ; diff --git a/definitions/grib2/localConcepts/uerra/name.def b/definitions/grib2/localConcepts/uerra/name.def index 644409a2c..938e1072a 100644 --- a/definitions/grib2/localConcepts/uerra/name.def +++ b/definitions/grib2/localConcepts/uerra/name.def @@ -17,8 +17,8 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } -#10 metre wind gust since previous post-processing -'10 metre wind gust since previous post-processing' = { +#Maximum 10 metre wind gust since previous post-processing +'Maximum 10 metre wind gust since previous post-processing' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 22 ; @@ -29,8 +29,8 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 3 ; } -#10 metre wind gust since previous post-processing -'10 metre wind gust since previous post-processing' = { +#Maximum 10 metre wind gust since previous post-processing +'Maximum 10 metre wind gust since previous post-processing' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 22 ; @@ -41,8 +41,8 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 1 ; } -#10 metre wind gust since previous post-processing -'10 metre wind gust since previous post-processing' = { +#Maximum 10 metre wind gust since previous post-processing +'Maximum 10 metre wind gust since previous post-processing' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 22 ; diff --git a/definitions/grib2/localConcepts/uerra/paramId.def b/definitions/grib2/localConcepts/uerra/paramId.def index db4f09f5d..3db8ad4fa 100644 --- a/definitions/grib2/localConcepts/uerra/paramId.def +++ b/definitions/grib2/localConcepts/uerra/paramId.def @@ -17,7 +17,7 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '49' = { discipline = 0 ; parameterCategory = 2 ; @@ -29,7 +29,7 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 3 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '49' = { discipline = 0 ; parameterCategory = 2 ; @@ -41,7 +41,7 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 1 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '49' = { discipline = 0 ; parameterCategory = 2 ; diff --git a/definitions/grib2/localConcepts/uerra/shortName.def b/definitions/grib2/localConcepts/uerra/shortName.def index 839d6dc5d..9cbb74cd7 100644 --- a/definitions/grib2/localConcepts/uerra/shortName.def +++ b/definitions/grib2/localConcepts/uerra/shortName.def @@ -17,7 +17,7 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '10fg' = { discipline = 0 ; parameterCategory = 2 ; @@ -29,7 +29,7 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 3 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '10fg' = { discipline = 0 ; parameterCategory = 2 ; @@ -41,7 +41,7 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 1 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '10fg' = { discipline = 0 ; parameterCategory = 2 ; diff --git a/definitions/grib2/localConcepts/uerra/units.def b/definitions/grib2/localConcepts/uerra/units.def index 87cb31619..aa1f30814 100644 --- a/definitions/grib2/localConcepts/uerra/units.def +++ b/definitions/grib2/localConcepts/uerra/units.def @@ -17,7 +17,7 @@ scaledValueOfFirstFixedSurface = 200 ; scaleFactorOfFirstFixedSurface = 0 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'm s**-1' = { discipline = 0 ; parameterCategory = 2 ; @@ -29,7 +29,7 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 3 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'm s**-1' = { discipline = 0 ; parameterCategory = 2 ; @@ -41,7 +41,7 @@ typeOfStatisticalProcessing = 2 ; lengthOfTimeRange = 1 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'm s**-1' = { discipline = 0 ; parameterCategory = 2 ; diff --git a/definitions/grib2/ls.def b/definitions/grib2/ls.def deleted file mode 100644 index 139597f9c..000000000 --- a/definitions/grib2/ls.def +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/definitions/grib2/marsLevtypeConcept.def b/definitions/grib2/marsLevtypeConcept.def index 1bfb06e6d..109473e86 100644 --- a/definitions/grib2/marsLevtypeConcept.def +++ b/definitions/grib2/marsLevtypeConcept.def @@ -3,6 +3,7 @@ '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;} diff --git a/definitions/grib2/mars_labeling.82.def b/definitions/grib2/mars_labeling.82.def index 88328c1a2..7d881ced7 100644 --- a/definitions/grib2/mars_labeling.82.def +++ b/definitions/grib2/mars_labeling.82.def @@ -1,15 +1,11 @@ # author: Sebastien Villaume # created: 14 Feb 2014 -# ######################### - constant conceptsMasterMarsDir="mars" : hidden; constant conceptsLocalMarsDirAll="mars/[centre:s]" : hidden; ########################## -# # # Base MARS keywors # -# # ########################## alias mars.class = marsClass; @@ -20,28 +16,21 @@ alias mars.expver = experimentVersionNumber; alias mars.domain = globalDomain; ######################### -# # # local section 82 # -# # ######################### ### nothing needed here... ######################### -# # # local section 83 # -# # ######################### - if ( localDefinitionNumber == 83 ) { - - alias mars.sort = matchSort; - alias mars.timerepres = matchTimeRepres; - alias mars.landtype = matchLandType; - alias mars.aerosolbinnumber = matchAerosolBinNumber; + alias mars.sort = matchSort; + alias mars.timerepres = matchTimeRepres; + alias mars.landtype = matchLandType; + alias mars.aerosolbinnumber = matchAerosolBinNumber; concept_nofail matchAerosolPacking (unknown,"aerosolPackingConcept.def",conceptsLocalMarsDirAll,conceptsMasterMarsDir); - alias mars.aerosolpacking = matchAerosolPacking; - + alias mars.aerosolpacking = matchAerosolPacking; } diff --git a/definitions/grib2/meta.def b/definitions/grib2/meta.def deleted file mode 100644 index baa49b8f2..000000000 --- a/definitions/grib2/meta.def +++ /dev/null @@ -1,5 +0,0 @@ -# (C) Copyright 2005- ECMWF. - -label "_Empty file"; - -#meta area g1area(latitudeOfFirstGridPoint,longitudeOfFirstGridPoint,latitudeOfLastGridPoint,longitudeOfLastGridPoint,angleMultiplier,angleDivisor); diff --git a/definitions/grib2/name.def b/definitions/grib2/name.def index bf69dd7b6..d852effb4 100644 --- a/definitions/grib2/name.def +++ b/definitions/grib2/name.def @@ -206,8 +206,8 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#10 metre wind gust since previous post-processing -'10 metre wind gust since previous post-processing' = { +#Maximum 10 metre wind gust since previous post-processing +'Maximum 10 metre wind gust since previous post-processing' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 22 ; @@ -326,6 +326,12 @@ parameterCategory = 3 ; parameterNumber = 18 ; } +#Standard deviation of sub-gridscale orography +'Standard deviation of sub-gridscale orography' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 20 ; + } #Anisotropy of sub-gridscale orography 'Anisotropy of sub-gridscale orography' = { discipline = 0 ; @@ -2424,6 +2430,14 @@ scaledValueOfFirstFixedSurface = 26315 ; scaleFactorOfFirstFixedSurface = 2 ; } +#Total sky direct short-wave (solar) radiation at surface +'Total sky direct short-wave (solar) radiation at surface' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Surface direct short-wave radiation, clear sky 'Surface direct short-wave radiation, clear sky' = { discipline = 0 ; @@ -2432,6 +2446,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Cloud base height +'Cloud base height' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 2 ; + } #0 degrees C isothermal level (atm) '0 degrees C isothermal level (atm)' = { discipline = 0 ; @@ -2441,8 +2462,8 @@ scaledValueOfFirstFixedSurface = 27315 ; scaleFactorOfFirstFixedSurface = 2 ; } -#10 metre wind gust in the last 3 hours -'10 metre wind gust in the last 3 hours' = { +#Maximum 10 metre wind gust in the last 3 hours +'Maximum 10 metre wind gust in the last 3 hours' = { discipline = 0 ; parameterCategory = 2 ; parameterNumber = 22 ; @@ -2523,6 +2544,14 @@ parameterCategory = 3 ; parameterNumber = 23 ; } +#Convective available potential energy shear +'Convective available potential energy shear' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Tropopause pressure 'Tropopause pressure' = { discipline = 0 ; @@ -2746,6 +2775,22 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 10 ; } +#Surface short-wave (solar) radiation downward clear-sky +'Surface short-wave (solar) radiation downward clear-sky' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Surface long-wave (thermal) radiation downward clear-sky +'Surface long-wave (thermal) radiation downward clear-sky' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Convective precipitation 'Convective precipitation' = { discipline = 0 ; @@ -2984,8 +3029,8 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Runoff water equivalent -'Runoff water equivalent' = { +#Runoff water equivalent (surface plus subsurface) +'Runoff water equivalent (surface plus subsurface)' = { discipline = 2 ; parameterCategory = 0 ; parameterNumber = 42 ; @@ -4086,6 +4131,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total column integrated ozone +'Total column integrated ozone' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #2 metre relative humidity '2 metre relative humidity' = { discipline = 0 ; @@ -4433,6 +4486,18 @@ parameterCategory = 1 ; parameterNumber = 15 ; } +#Cloudy reflectance +'Cloudy reflectance' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 31 ; + } +#Clear reflectance +'Clear reflectance' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 32 ; + } #Scaled radiance 'Scaled radiance' = { discipline = 3 ; @@ -4910,8 +4975,8 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } -#Sea ice temperature -'Sea ice temperature' = { +#Vertically averaged sea ice temperature +'Vertically averaged sea ice temperature' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 8 ; @@ -5066,6 +5131,12 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice temperature +'Sea ice temperature' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + } #Sea surface practical salinity 'Sea surface practical salinity' = { discipline = 10 ; @@ -5973,8 +6044,8 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice temperature -'Time-mean sea ice temperature' = { +#Time-mean vertically averaged sea ice temperature +'Time-mean vertically averaged sea ice temperature' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 8 ; @@ -6142,6 +6213,13 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice temperature +'Time-mean sea ice temperature' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface practical salinity 'Time-mean sea surface practical salinity' = { discipline = 10 ; @@ -7543,12 +7621,54 @@ parameterCategory = 0 ; parameterNumber = 20 ; } +#10 metre wind speed +'10 metre wind speed' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Altimeter wave height +'Altimeter wave height' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } +#Altimeter corrected wave height +'Altimeter corrected wave height' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 38 ; + } +#Altimeter range relative correction +'Altimeter range relative correction' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 39 ; + } +#10 metre wind direction +'10 metre wind direction' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #2D wave spectra (single) '2D wave spectra (single)' = { discipline = 10 ; parameterCategory = 0 ; parameterNumber = 86 ; } +#Wave spectral kurtosis +'Wave spectral kurtosis' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 43 ; + } #Benjamin-Feir index 'Benjamin-Feir index' = { discipline = 10 ; @@ -8985,12 +9105,6 @@ parameterCategory = 14 ; parameterNumber = 0 ; } -#Total column integrated ozone -'Total column integrated ozone' = { - discipline = 0 ; - parameterCategory = 14 ; - parameterNumber = 2 ; - } #Base spectrum width 'Base spectrum width' = { discipline = 0 ; diff --git a/definitions/grib2/paramId.def b/definitions/grib2/paramId.def index edc5ce043..1d0daf539 100644 --- a/definitions/grib2/paramId.def +++ b/definitions/grib2/paramId.def @@ -206,7 +206,7 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '49' = { discipline = 0 ; parameterCategory = 2 ; @@ -326,6 +326,12 @@ parameterCategory = 3 ; parameterNumber = 18 ; } +#Standard deviation of sub-gridscale orography +'160' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 20 ; + } #Anisotropy of sub-gridscale orography '161' = { discipline = 0 ; @@ -2424,6 +2430,14 @@ scaledValueOfFirstFixedSurface = 26315 ; scaleFactorOfFirstFixedSurface = 2 ; } +#Total sky direct short-wave (solar) radiation at surface +'228021' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Surface direct short-wave radiation, clear sky '228022' = { discipline = 0 ; @@ -2432,6 +2446,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Cloud base height +'228023' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 2 ; + } #0 degrees C isothermal level (atm) '228024' = { discipline = 0 ; @@ -2441,7 +2462,7 @@ scaledValueOfFirstFixedSurface = 27315 ; scaleFactorOfFirstFixedSurface = 2 ; } -#10 metre wind gust in the last 3 hours +#Maximum 10 metre wind gust in the last 3 hours '228028' = { discipline = 0 ; parameterCategory = 2 ; @@ -2523,6 +2544,14 @@ parameterCategory = 3 ; parameterNumber = 23 ; } +#Convective available potential energy shear +'228044' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Tropopause pressure '228045' = { discipline = 0 ; @@ -2746,6 +2775,22 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 10 ; } +#Surface short-wave (solar) radiation downward clear-sky +'228129' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Surface long-wave (thermal) radiation downward clear-sky +'228130' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Convective precipitation '228143' = { discipline = 0 ; @@ -2984,7 +3029,7 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Runoff water equivalent +#Runoff water equivalent (surface plus subsurface) '231002' = { discipline = 2 ; parameterCategory = 0 ; @@ -4086,6 +4131,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total column integrated ozone +'260132' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #2 metre relative humidity '260242' = { discipline = 0 ; @@ -4433,6 +4486,18 @@ parameterCategory = 1 ; parameterNumber = 15 ; } +#Cloudy reflectance +'260512' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 31 ; + } +#Clear reflectance +'260513' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 32 ; + } #Scaled radiance '260530' = { discipline = 3 ; @@ -4910,7 +4975,7 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } -#Sea ice temperature +#Vertically averaged sea ice temperature '262010' = { discipline = 10 ; parameterCategory = 2 ; @@ -5066,6 +5131,12 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice temperature +'262024' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + } #Sea surface practical salinity '262100' = { discipline = 10 ; @@ -5973,7 +6044,7 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice temperature +#Time-mean vertically averaged sea ice temperature '263010' = { discipline = 10 ; parameterCategory = 2 ; @@ -6142,6 +6213,13 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice temperature +'263024' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface practical salinity '263100' = { discipline = 10 ; @@ -7543,12 +7621,54 @@ parameterCategory = 0 ; parameterNumber = 20 ; } +#10 metre wind speed +'140245' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Altimeter wave height +'140246' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } +#Altimeter corrected wave height +'140247' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 38 ; + } +#Altimeter range relative correction +'140248' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 39 ; + } +#10 metre wind direction +'140249' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #2D wave spectra (single) '140251' = { discipline = 10 ; parameterCategory = 0 ; parameterNumber = 86 ; } +#Wave spectral kurtosis +'140252' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 43 ; + } #Benjamin-Feir index '140253' = { discipline = 10 ; @@ -8985,12 +9105,6 @@ parameterCategory = 14 ; parameterNumber = 0 ; } -#Total column integrated ozone -'260132' = { - discipline = 0 ; - parameterCategory = 14 ; - parameterNumber = 2 ; - } #Base spectrum width '260133' = { discipline = 0 ; diff --git a/definitions/grib2/postProcessingConcept.def b/definitions/grib2/postProcessingConcept.def index e61d4b343..cfd5c0031 100644 --- a/definitions/grib2/postProcessingConcept.def +++ b/definitions/grib2/postProcessingConcept.def @@ -16,3 +16,4 @@ "mhm_mrm" = { typeOfPostProcessing = 203; } "pcrg_mrm" = { typeOfPostProcessing = 204; } "meteogrid" = { typeOfPostProcessing = 205; } +"ecPoint" = { typeOfPostProcessing = 206; } diff --git a/definitions/grib2/rules.def b/definitions/grib2/rules.def deleted file mode 100644 index c1f74af5d..000000000 --- a/definitions/grib2/rules.def +++ /dev/null @@ -1,12 +0,0 @@ -# (C) Copyright 2005- ECMWF. - -# Experimental stuff - -transient isAccumulation = 0 ; -transient isEPS = 0 ; - -when(isAccumulation and !isEPS) - set productDefinitionTemplateNumber = 8; - -when(isAccumulation and isEPS) - set productDefinitionTemplateNumber = 11; diff --git a/definitions/grib2/section.3.def b/definitions/grib2/section.3.def index ad06e8a1f..d8ce26e6f 100644 --- a/definitions/grib2/section.3.def +++ b/definitions/grib2/section.3.def @@ -110,6 +110,7 @@ concept gridType { "lambert_bf" = { gridDefinitionTemplateNumber=63; PLPresent=0; } "mercator_bf" = { gridDefinitionTemplateNumber=61; PLPresent=0; } "polar_stereographic_bf" = { gridDefinitionTemplateNumber=62; PLPresent=0; } + "healpix" = { gridDefinitionTemplateNumber=150; PLPresent=0; } "ncep_32769" = { centre=7; gridDefinitionTemplateNumber=32769; PLPresent=0; } diff --git a/definitions/grib2/section.4.def b/definitions/grib2/section.4.def index b62a15329..1f646f221 100644 --- a/definitions/grib2/section.4.def +++ b/definitions/grib2/section.4.def @@ -33,9 +33,11 @@ concept datasetForLocal(unknown) { "hydro" = {marsClass="ul";} # ULYSSES "fire" = {marsClass="gw";} # Global Wildfire awareness system "uerra" = {productionStatusOfProcessedData=8;} # UERRA - "uerra" = {productionStatusOfProcessedData=9;} # UERRA + "uerra" = {productionStatusOfProcessedData=9;} "uerra" = {productionStatusOfProcessedData=10;} # CARRA/CERRA - "uerra" = {productionStatusOfProcessedData=11;} # CARRA/CERRA + "uerra" = {productionStatusOfProcessedData=11;} + "destine" = {productionStatusOfProcessedData=12;} # Destination Earth + "destine" = {productionStatusOfProcessedData=13;} "unknown" = { dummy=1; } } diff --git a/definitions/grib2/section.7.def b/definitions/grib2/section.7.def index 5e4280475..f6d947674 100644 --- a/definitions/grib2/section.7.def +++ b/definitions/grib2/section.7.def @@ -21,6 +21,7 @@ meta decimalPrecision decimal_precision(bitsPerValue,decimalScaleFactor,changing alias setDecimalPrecision=changeDecimalPrecision; meta setBitsPerValue bits_per_value(values,bitsPerValue) : edition_specific; +meta setPackingType packing_type(values, packingType) : edition_specific; meta getNumberOfValues size(values) : edition_specific,dump ; diff --git a/definitions/grib2/shortName.def b/definitions/grib2/shortName.def index cacb09809..5070fb459 100644 --- a/definitions/grib2/shortName.def +++ b/definitions/grib2/shortName.def @@ -206,7 +206,7 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing '10fg' = { discipline = 0 ; parameterCategory = 2 ; @@ -326,6 +326,12 @@ parameterCategory = 3 ; parameterNumber = 18 ; } +#Standard deviation of sub-gridscale orography +'sdor' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 20 ; + } #Anisotropy of sub-gridscale orography 'isor' = { discipline = 0 ; @@ -2424,6 +2430,14 @@ scaledValueOfFirstFixedSurface = 26315 ; scaleFactorOfFirstFixedSurface = 2 ; } +#Total sky direct short-wave (solar) radiation at surface +'fdir' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Surface direct short-wave radiation, clear sky 'cdir' = { discipline = 0 ; @@ -2432,6 +2446,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Cloud base height +'cbh' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 2 ; + } #0 degrees C isothermal level (atm) 'deg0l' = { discipline = 0 ; @@ -2441,7 +2462,7 @@ scaledValueOfFirstFixedSurface = 27315 ; scaleFactorOfFirstFixedSurface = 2 ; } -#10 metre wind gust in the last 3 hours +#Maximum 10 metre wind gust in the last 3 hours '10fg3' = { discipline = 0 ; parameterCategory = 2 ; @@ -2523,6 +2544,14 @@ parameterCategory = 3 ; parameterNumber = 23 ; } +#Convective available potential energy shear +'capes' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Tropopause pressure 'trpp' = { discipline = 0 ; @@ -2746,6 +2775,22 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 10 ; } +#Surface short-wave (solar) radiation downward clear-sky +'ssrdc' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Surface long-wave (thermal) radiation downward clear-sky +'strdc' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Convective precipitation 'cp' = { discipline = 0 ; @@ -2984,7 +3029,7 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Runoff water equivalent +#Runoff water equivalent (surface plus subsurface) 'rowe' = { discipline = 2 ; parameterCategory = 0 ; @@ -4086,6 +4131,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total column integrated ozone +'tcioz' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #2 metre relative humidity '2r' = { discipline = 0 ; @@ -4433,6 +4486,18 @@ parameterCategory = 1 ; parameterNumber = 15 ; } +#Cloudy reflectance +'cdrfl' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 31 ; + } +#Clear reflectance +'crrfl' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 32 ; + } #Scaled radiance '~' = { discipline = 3 ; @@ -4910,8 +4975,8 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } -#Sea ice temperature -'sitemp' = { +#Vertically averaged sea ice temperature +'vasit' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 8 ; @@ -5066,6 +5131,12 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice temperature +'sit' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + } #Sea surface practical salinity 'sos' = { discipline = 10 ; @@ -5973,8 +6044,8 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice temperature -'avg_sitemp' = { +#Time-mean vertically averaged sea ice temperature +'avg_vasit' = { discipline = 10 ; parameterCategory = 2 ; parameterNumber = 8 ; @@ -6142,6 +6213,13 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice temperature +'avg_sit' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface practical salinity 'avg_sos' = { discipline = 10 ; @@ -7543,12 +7621,54 @@ parameterCategory = 0 ; parameterNumber = 20 ; } +#10 metre wind speed +'wind' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Altimeter wave height +'awh' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } +#Altimeter corrected wave height +'acwh' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 38 ; + } +#Altimeter range relative correction +'arrc' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 39 ; + } +#10 metre wind direction +'dwi' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #2D wave spectra (single) '2dfd' = { discipline = 10 ; parameterCategory = 0 ; parameterNumber = 86 ; } +#Wave spectral kurtosis +'wsk' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 43 ; + } #Benjamin-Feir index 'bfi' = { discipline = 10 ; @@ -8985,12 +9105,6 @@ parameterCategory = 14 ; parameterNumber = 0 ; } -#Total column integrated ozone -'tcioz' = { - discipline = 0 ; - parameterCategory = 14 ; - parameterNumber = 2 ; - } #Base spectrum width 'bswid' = { discipline = 0 ; diff --git a/definitions/grib2/tables/local/ecmf/1/4.2.0.1.table b/definitions/grib2/tables/local/ecmf/1/4.2.0.1.table index 2c4961ba0..5e02901a1 100644 --- a/definitions/grib2/tables/local/ecmf/1/4.2.0.1.table +++ b/definitions/grib2/tables/local/ecmf/1/4.2.0.1.table @@ -1,11 +1,13 @@ # Code table 4.2 - discipline=0 category=1 for ECMWF 192 192 Snow evaporation rate (kg m-2 s-1) -193 193 Total precipitation (m) +193 193 Total precipitation rate (m s-1) 194 194 Accumulated freezing rain (m) -195 195 Convective precipitation (m) -196 196 Large-scale precipitation (m) -197 197 Snow evaporation (m of water equivalent) -198 198 Snowfall (m of water equivalent) -199 199 Evaporation (m of water equivalent) -200 200 Potential evaporation (m) +195 195 Convective precipitation rate (m s-1) +196 196 Large-scale precipitation rate (m s-1) +197 197 Snow evaporation rate (m of water equivalent s-1) +198 198 Snowfall rate (m of water equivalent s-1) +199 199 Evaporation rate (m of water equivalent s-1) +200 200 Potential evaporation rate (m s-1) +201 201 Convective snowfall rate (m of water equivalent s-1) +202 202 Large-scale snowfall rate (m of water equivalent s-1) 254 254 Snow depth (m of water equivalent) diff --git a/definitions/grib2/tables/local/ecmf/1/4.2.0.14.table b/definitions/grib2/tables/local/ecmf/1/4.2.0.14.table new file mode 100644 index 000000000..e7573ef3d --- /dev/null +++ b/definitions/grib2/tables/local/ecmf/1/4.2.0.14.table @@ -0,0 +1,2 @@ +# Code table 4.2 - discipline=0 category=14 for ECMWF +192 192 Total column ozone diff --git a/definitions/grib2/tables/local/ecmf/1/4.2.2.0.table b/definitions/grib2/tables/local/ecmf/1/4.2.2.0.table index f68411f32..16c57248b 100644 --- a/definitions/grib2/tables/local/ecmf/1/4.2.2.0.table +++ b/definitions/grib2/tables/local/ecmf/1/4.2.2.0.table @@ -8,9 +8,9 @@ 198 198 GPP coefficient from Biogenic Flux Adjustment System 199 199 Rec coefficient from Biogenic Flux Adjustment System 200 200 Surface roughness length for heat (m) -201 201 Water runoff (m) -202 202 Surface runoff (m) -203 203 Snow melt (m of water equivalent) -204 204 Sub-surface runoff (m) +201 201 Water runoff and drainage rate (m s-1) +202 202 Surface runoff rate (m s-1) +203 203 Snow melt rate (m of water equivalent s-1) +204 204 Sub-surface runoff rate (m s-1) 205 205 Skin reservoir content (m of water equivalent) 255 255 Missing diff --git a/definitions/grib2/tables/local/edzw/1/2.120.table b/definitions/grib2/tables/local/edzw/1/2.120.table new file mode 100644 index 000000000..73eb1a926 --- /dev/null +++ b/definitions/grib2/tables/local/edzw/1/2.120.table @@ -0,0 +1,26 @@ +# This file is automatically generated, don't edit! +# +# Table 2.120 contains (additional) scaled metadata +# for single radar volume scans for local use +# +# IMPORTANT "Meaning" must not contain numbers and parentheses, except in the "(unit)"!!! +# +# 2*(Code figure) Meaning +# +0 0 Undetected value +1 1 Missing value +# 2-5 Reserved (for further indicators of special data points) +6 6 Station height above mean sea level - mod (m) +7 7 Station height above mean sea level - true (m) +8 8 Reflectivity calibration constant (dB) +9 9 Reference reflectivity for echo top (dB) +10 10 Extended Nyquist (s-1) +11 11 High Nyquist (s-1) +12 12 Dual PRF ratio (proportion) +13 13 Range gate length (m) +14 14 Number of ranges averaged over (numeric) +15 15 Number of pulses averaged over (numeric) +16 16 ppiStartAzimuth (degree) +17 17 ppiConstantElevation (degree) +255 255 Missing + diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.1.table b/definitions/grib2/tables/local/edzw/1/4.2.0.1.table index 1005b6373..988d80980 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.1.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.1.table @@ -43,4 +43,8 @@ 233 233 Percentage of precipitation in snow (from total prec.)(%) 234 234 Standard deviation of saturation deficit(Numeric) 235 235 Maximum snow height during contiguous accumulating snow period (coupled with snow age)(m) +236 236 Vertically-integrated zonal water flux (kg m-1 s-1) +237 237 Vertically-integrated meridional water flux (kg m-1 s-1) 238 238 Hail diameter (mm) +239 239 Extreme weather index (EWI) of total precipitation rate (kg m-2 s-1) +240 240 Extreme weather index (EWI) of snow precipitation rate (kg m-2 s-1) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.15.table b/definitions/grib2/tables/local/edzw/1/4.2.0.15.table index a80a93e1f..515f55529 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.15.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.15.table @@ -6,3 +6,4 @@ 196 196 Radar quality information (Proportion) 197 197 Radar blacklist (Numeric) 198 198 Height of radar beam above ground (m) +200 200 Reflectivity (dB) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.17.table b/definitions/grib2/tables/local/edzw/1/4.2.0.17.table index f2b51a037..971ace852 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.17.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.17.table @@ -1,2 +1,3 @@ # This file is automatically generated, don't edit! 192 192 Lightning potential index (J kg-1) +193 193 Lightning Potential Index from convection scheme, modified by convection index (J kg-1) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.19.table b/definitions/grib2/tables/local/edzw/1/4.2.0.19.table index 27dcb9b57..24fb050ad 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.19.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.19.table @@ -30,10 +30,15 @@ 226 226 Eddy Dissipation Rate Total Col-Max. Upper UIR ( 15mm, -3 < T_2M < 1 ?C +243 243 Probability for freezing precipitation with wind, TOT_PREC > 3mm, -3 < T_2M < 1 ?C, VMAX_10M > 10 m/s diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.191.table b/definitions/grib2/tables/local/edzw/1/4.2.0.191.table index 10e26b5ba..06686dd87 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.191.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.191.table @@ -9,3 +9,5 @@ 199 199 Swiss coordinate (west-east) (m) 200 200 Swiss coordinate LV 95 (south-north) (m) 201 201 Swiss coordinate LV 95 (west-east) (m) +202 202 Solar elevation angle (degree) +203 203 Solar azimuth angle (degree) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.191.table_alt b/definitions/grib2/tables/local/edzw/1/4.2.0.191.table_alt new file mode 100644 index 000000000..b329a8234 --- /dev/null +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.191.table_alt @@ -0,0 +1,9 @@ +# This file is automatically generated, dont edit! +192 192 solution of 2-d Helmholtz equations - needed for restart(Numeric) +193 193 Area weights for regular lon-lat grid(Numeric) +194 194 Gauss Boaga Coordinates West to East,East Sector(m) +195 195 Gauss Boaga Coordinates South to North,East Sector(m) +196 196 Gauss Boaga Coordinates West to East, West Sector(m) +197 197 Gauss Boaga Coordinates South to North, West Sector(m) +198 198 Swiss coodinate (south-north)(m) +199 199 Swiss coodinate (west-east)(m) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.2.table b/definitions/grib2/tables/local/edzw/1/4.2.0.2.table index 4fb548fd7..34f308d4d 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.2.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.2.table @@ -19,3 +19,6 @@ 209 209 V-component of (vertical) wind shear vector between two levels (m s-1) 210 210 Updraft duration(s) 211 211 Updraft mask(Numeric) +212 212 U-component of mean wind (vertical mean over specified layer) (m s-1) +213 213 V-component of mean wind (vertical mean over specified layer) (m s-1) +214 214 Extreme weather index (EWI) of wind speed (gust) (m s-1) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.20.table b/definitions/grib2/tables/local/edzw/1/4.2.0.20.table index be9d530d5..293389ec8 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.20.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.20.table @@ -17,3 +17,6 @@ 207 207 Wet deposition of number concentration if rain reaches the surface (m-2 s-1) 208 208 Sedimentation of number concentration (m-2 s-1) 209 209 Aerosol backscatter (not attenuated) for given wavelength (m-1 sr-1) +210 210 Volumetric content of constituent in snow (m3 m-3) +211 211 Emission tuning factor for pollen (Numeric) +220 220 Mass median diameter (m) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.3.table b/definitions/grib2/tables/local/edzw/1/4.2.0.3.table index 7ff056e8c..d489efae9 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.3.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.3.table @@ -5,3 +5,6 @@ 195 195 3 hour pressure change(Pa-3h) 196 196 Height of -10 degree Celsius isotherm(m) 197 197 Pressure difference between two specific levels (Pa) +198 198 Slope of orography (using average of maximum gradient in different directions) (Numeric) +199 199 Updraught mass flux associated with passive clouds (kg m-2 s-1) +200 200 Updraught mass flux associated with active clouds (kg m-2 s-1) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.0.6.table b/definitions/grib2/tables/local/edzw/1/4.2.0.6.table index 7ad7ab5f8..39b0172a1 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.0.6.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.0.6.table @@ -13,3 +13,6 @@ 204 204 Mass density of cloud ice(kg m-3) 205 205 Possible astronomical sunshine duration (s) 206 206 Relative duration of sunshine (DURSUN * 100 / DURSUN_M)(%) +210 210 Number of active clouds per horizontal unit area (m-2) +211 211 Number of passive clouds per horizontal unit area (m-2) +215 215 Cloud cover for use in radiative transfer (modified where large hydrometeors are present) (%) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.1.0.table b/definitions/grib2/tables/local/edzw/1/4.2.1.0.table index a6590ff82..289b20add 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.1.0.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.1.0.table @@ -1,2 +1,5 @@ # This file is automatically generated, don't edit! 192 192 Tidal tendencies (s2 m-2) +193 193 Water table depth (m) +194 194 Soil moisture saturation level (-) +195 195 Ground water runoff rate, aquifer (kg m-3 s-1) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.2.192.table b/definitions/grib2/tables/local/edzw/1/4.2.2.192.table new file mode 100644 index 000000000..9129b5e3b --- /dev/null +++ b/definitions/grib2/tables/local/edzw/1/4.2.2.192.table @@ -0,0 +1,8 @@ +# This file is automatically generated, don't edit! +0 0 Building area fraction (proportion: 0=no building, 1=whole urban area) +1 1 Street canyon aspect (height - width) ratio +2 2 Height of building (m) +3 3 Urban material thermal albedo (%) +4 4 Urban material shortwave (solar) albedo (%) +5 5 Volumetric heat capacity of urban material (capacity x density) (J m-3 K-1) +6 6 Heat conductivity of urban material (W m-1 K-1) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.2.3.table b/definitions/grib2/tables/local/edzw/1/4.2.2.3.table index 2ad91b4db..ffd24e82e 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.2.3.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.2.3.table @@ -8,3 +8,10 @@ 198 198 Covariance of soil moisture content (kg2 m-4) 199 199 Surface emissivity (Numeric) 200 200 Soil moisture index (multilayers) (Numeric) +201 201 Soil water mass flux (sum of conductive and diffusive fluxes) (kg m-2 s-1) +206 206 Number of snow layer (Numeric) +207 207 Height of new snow (without settling) +208 208 Temperature at interface or boundary of snow layers (e.g. in a multi-level/layer snow model) (K) +209 209 Volumetric ice content of snow layer (m3 m-3) +210 210 Volumetric water content of snow layer (m3 m-3) +211 211 Volumetric air content of snow layer (m3 m-3) diff --git a/definitions/grib2/tables/local/edzw/1/4.2.215.5.table b/definitions/grib2/tables/local/edzw/1/4.2.215.5.table index 1cff0f7ce..86d8cd9b3 100644 --- a/definitions/grib2/tables/local/edzw/1/4.2.215.5.table +++ b/definitions/grib2/tables/local/edzw/1/4.2.215.5.table @@ -1,4 +1,4 @@ -# This file is automatically generated, dont edit! +# This file is automatically generated, don't edit! 1 1 Downward long-wave radiation flux at surface based on T_2M(W m-2 ) 2 2 Downward long-wave radiation flux at surface based on T_G(W m-2 ) 3 3 Downward long-wave radiation flux at surface based on T_SO(0)(W m-2 ) diff --git a/definitions/grib2/tables/local/edzw/1/4.230.table b/definitions/grib2/tables/local/edzw/1/4.230.table new file mode 100644 index 000000000..7ebd85ff7 --- /dev/null +++ b/definitions/grib2/tables/local/edzw/1/4.230.table @@ -0,0 +1,4 @@ +# Code table 4.230 - Atmospheric chemical constituent type +63000 63000 Ice in ambient (a composite of different constituents) +63001 63001 Air in ambient (a composite of different constituents) + diff --git a/definitions/grib2/tables/local/edzw/1/4.3.table b/definitions/grib2/tables/local/edzw/1/4.3.table index d845e448f..79637aa98 100644 --- a/definitions/grib2/tables/local/edzw/1/4.3.table +++ b/definitions/grib2/tables/local/edzw/1/4.3.table @@ -1,3 +1,4 @@ +# This file is automatically generated, don't edit! 192 192 bias corrected ensemble forecast 193 193 calibrated forecast 194 194 calibrated ensemble f. @@ -6,12 +7,17 @@ 197 197 smoothed forecast 198 198 smoothed and calibrated forecast 199 199 probability forecast derived by neighbourhood method -201 201 diff. analysis - first guess 200 200 diff. init. analysis - analysis* +201 201 diff. analysis - first guess 202 202 nudging 203 203 nudgecast 204 204 product derived by statistical model 205 205 deterministic forecast on ensemble mean(DOM) 206 206 time filtered bias +207 207 Time-filtered assimilation increment +208 208 Time-filtered assimilation increment, weighted with cos(2pi loc.time/day) 220 220 postprocessing +221 221 Stochastic model of the model error +225 225 EMVORADO +226 226 Dual Pol Doppler Radar 255 255 Missing diff --git a/definitions/grib2/tables/local/edzw/1/4.5.table b/definitions/grib2/tables/local/edzw/1/4.5.table index c545958ed..4cfa7a984 100644 --- a/definitions/grib2/tables/local/edzw/1/4.5.table +++ b/definitions/grib2/tables/local/edzw/1/4.5.table @@ -3,7 +3,8 @@ 192 ML ML start level of mixed layer parcel(CAPE/CIN) 193 MU MU start level of most unstable parcel(CAPE/CIN) 194 LFC Level of free convection -#195-198 reserved +#195-197 reserved +198 radarElev radarElev Radar antenna elevation angle (degree) 199 radarElevComposite radarElevComposite radarElevComposite #200 reserved 201 hor Surface: horizontal plane diff --git a/definitions/grib2/tables/local/edzw/1/generatingProcessIdentifier.table b/definitions/grib2/tables/local/edzw/1/generatingProcessIdentifier.table index 209928e41..2596d361d 100644 --- a/definitions/grib2/tables/local/edzw/1/generatingProcessIdentifier.table +++ b/definitions/grib2/tables/local/edzw/1/generatingProcessIdentifier.table @@ -11,12 +11,12 @@ 011 icXla icXla (ICON LAM) 012 icXln icXln (ICON LAM nest) 013 icXls icXls (ICON LAM sub-nest) -014 dwd dwd (reserved ICON DWD) -015 dwd dwd (reserved ICON DWD) -016 dwd dwd (reserved ICON DWD) -017 dwd dwd (reserved ICON DWD) -018 dwd dwd (reserved ICON DWD) -019 dwd dwd (reserved ICON DWD) +014 icXls2 icXls2 (ICON LAM sub-nest 2) +015 icXls3 icXls3 (ICON LAM sub-nest 3) +016 rucXla rucXla (ICON LAM RUC) +017 rucXln rucXln (ICON LAM RUC nest) +018 rucXls rucXls (ICON LAM RUC sub-nest) +019 rucXls2 rucXls2 (ICON LAM RUC sub-nest 2) 020 icX1b icX1b (ICON Bw 1) 021 bw bw (reserved ICON Bw) 022 bw bw (reserved ICON Bw) diff --git a/definitions/grib2/template.3.10.def b/definitions/grib2/template.3.10.def index 9c1c30bf0..fefc41ba4 100644 --- a/definitions/grib2/template.3.10.def +++ b/definitions/grib2/template.3.10.def @@ -6,13 +6,13 @@ include "grib2/template.3.shape_of_the_earth.def"; constant isGridded = one; unsigned[4] Ni : dump; -alias numberOfPointsAlongAParallel=Ni; +alias numberOfPointsAlongAParallel = Ni; alias Nx = Ni; alias numberOfPointsAlongXAxis = Ni; alias geography.Ni=Ni; unsigned[4] Nj : dump; -alias numberOfPointsAlongAMeridian=Nj; +alias numberOfPointsAlongAMeridian = Nj; alias Ny = Nj; alias numberOfPointsAlongYAxis = Nj; alias geography.Nj=Nj; diff --git a/definitions/grib2/template.3.110.def b/definitions/grib2/template.3.110.def index 8a1f50e8e..dae4a9263 100644 --- a/definitions/grib2/template.3.110.def +++ b/definitions/grib2/template.3.110.def @@ -7,14 +7,17 @@ constant isGridded = one; # Nx - number of points along X-axis unsigned[4] numberOfPointsAlongXAxis : dump; - alias Nx = numberOfPointsAlongXAxis; +alias numberOfPointsAlongAParallel = Nx; +alias Ni = Nx; + # Ny - number of points along Y-axis unsigned[4] numberOfPointsAlongYAxis : dump; - alias Ny = numberOfPointsAlongYAxis; -# La1 - latitude of tangency point -# (centre of grid) +alias numberOfPointsAlongAMeridian = Ny; +alias Nj = Ny; + +# La1 - latitude of tangency point (centre of grid) signed[4] latitudeOfTangencyPoint : dump; alias La1 = latitudeOfTangencyPoint; @@ -22,6 +25,7 @@ alias La1 = latitudeOfTangencyPoint; unsigned[4] longitudeOfTangencyPoint : dump; alias Lo1 = longitudeOfTangencyPoint; + # Resolution and component flag flags[1] resolutionAndComponentFlags 'grib2/tables/[tablesVersion]/3.3.table' : dump; diff --git a/definitions/grib2/template.3.12.def b/definitions/grib2/template.3.12.def index b45a065d4..d317d6ca8 100644 --- a/definitions/grib2/template.3.12.def +++ b/definitions/grib2/template.3.12.def @@ -6,13 +6,15 @@ include "grib2/template.3.shape_of_the_earth.def"; constant isGridded = one; unsigned[4] Ni : dump; -alias numberOfPointsAlongAParallel=Ni; +alias numberOfPointsAlongAParallel = Ni; alias Nx = Ni; +alias numberOfPointsAlongXAxis = Ni; alias geography.Ni=Ni; unsigned[4] Nj : dump; -alias numberOfPointsAlongAMeridian=Nj; -alias Ny = Nj ; +alias numberOfPointsAlongAMeridian = Nj; +alias Ny = Nj; +alias numberOfPointsAlongYAxis = Nj; alias geography.Nj=Nj; # LaR - geographic latitude of reference point diff --git a/definitions/grib2/template.3.140.def b/definitions/grib2/template.3.140.def index 1ec12cadd..83ece859c 100644 --- a/definitions/grib2/template.3.140.def +++ b/definitions/grib2/template.3.140.def @@ -7,24 +7,25 @@ constant isGridded = one; # Nx - number of points along X-axis unsigned[4] numberOfPointsAlongXAxis : dump; -alias Nx = numberOfPointsAlongXAxis; -alias Ni = Nx; +alias Nx = numberOfPointsAlongXAxis; +alias Ni = Nx; # Ny - number of points along Y-axis unsigned[4] numberOfPointsAlongYAxis : dump; -alias Ny = numberOfPointsAlongYAxis; -alias Nj = Ny; +alias Ny = numberOfPointsAlongYAxis; +alias numberOfPointsAlongAMeridian = Ny; +alias Nj = Ny; # La1 - latitude of first grid point signed[4] latitudeOfFirstGridPoint: edition_specific; -alias La1 = latitudeOfFirstGridPoint; +alias La1 = latitudeOfFirstGridPoint; meta geography.latitudeOfFirstGridPointInDegrees scale(latitudeOfFirstGridPoint, one,grib2divider,truncateDegrees) : dump; #meta latitudeOfFirstGridPointInMicrodegrees times(latitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor): no_copy; # Lo1 - longitude of first grid point signed[4] longitudeOfFirstGridPoint: edition_specific ; -alias La1 = longitudeOfFirstGridPoint; +alias La1 = longitudeOfFirstGridPoint; meta geography.longitudeOfFirstGridPointInDegrees scale(longitudeOfFirstGridPoint, one,grib2divider,truncateDegrees) : dump; #meta longitudeOfFirstGridPointInMicrodegrees times(longitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor) : no_copy; diff --git a/definitions/grib2/template.3.150.def b/definitions/grib2/template.3.150.def new file mode 100644 index 000000000..ea9f76811 --- /dev/null +++ b/definitions/grib2/template.3.150.def @@ -0,0 +1,7 @@ +# TEMPLATE 3.150 - The HEALPix grid +# See https://healpix.jpl.nasa.gov/pdf/intro.pdf + +include "grib2/template.3.shape_of_the_earth.def"; +include "grib2/template.3.resolution_flags.def"; +include "grib2/template.3.healpix.def"; + diff --git a/definitions/grib2/template.3.20.def b/definitions/grib2/template.3.20.def index 1e15ab98e..fd1e33b7a 100644 --- a/definitions/grib2/template.3.20.def +++ b/definitions/grib2/template.3.20.def @@ -6,15 +6,16 @@ include "grib2/template.3.shape_of_the_earth.def"; constant isGridded = one; # Nx - number of points along X-axis -unsigned[4] Nx : dump; -alias Ni = Nx; -alias numberOfPointsAlongXAxis = Nx; +unsigned[4] Nx : dump; +alias Ni = Nx; +alias numberOfPointsAlongXAxis = Nx; alias geography.Nx=Nx; # Ny - number of points along Y-axis unsigned[4] Ny : dump; -alias Nj = Ny; -alias numberOfPointsAlongYAxis = Ny; +alias Nj = Ny; +alias numberOfPointsAlongYAxis = Ny; +alias numberOfPointsAlongAMeridian = Nj; alias geography.Ny=Ny; # La1 - latitude of first grid point diff --git a/definitions/grib2/template.3.30.def b/definitions/grib2/template.3.30.def index cdf13a337..6e9466426 100644 --- a/definitions/grib2/template.3.30.def +++ b/definitions/grib2/template.3.30.def @@ -6,13 +6,14 @@ include "grib2/template.3.shape_of_the_earth.def"; constant isGridded = one; unsigned[4] Nx : dump; -alias Ni = Nx; +alias Ni = Nx; alias numberOfPointsAlongXAxis = Nx; alias geography.Nx=Nx; -unsigned[4] Ny : dump; -alias Nj = Ny; -alias numberOfPointsAlongYAxis = Ny; +unsigned[4] Ny : dump; +alias Nj = Ny; +alias numberOfPointsAlongYAxis = Nj; +alias numberOfPointsAlongAMeridian = Nj; alias geography.Ny=Ny; # La1 - latitude of first grid point diff --git a/definitions/grib2/template.3.90.def b/definitions/grib2/template.3.90.def index 4f8813f25..00f359383 100644 --- a/definitions/grib2/template.3.90.def +++ b/definitions/grib2/template.3.90.def @@ -5,14 +5,15 @@ include "grib2/template.3.shape_of_the_earth.def"; constant isGridded = one; -unsigned[4] Nx : dump; -alias Ni = Nx; -alias numberOfPointsAlongXAxis = Nx; +unsigned[4] Nx : dump; +alias Ni = Nx; +alias numberOfPointsAlongXAxis = Nx; alias geography.Nx=Nx; -unsigned[4] Ny : dump; -alias Nj = Ny; -alias numberOfPointsAlongYAxis = Ny; +unsigned[4] Ny : dump; +alias Nj = Ny; +alias numberOfPointsAlongYAxis = Nj; +alias numberOfPointsAlongAMeridian = Nj; alias geography.Ny=Ny; # Lap - latitude of sub-satellite point @@ -27,22 +28,22 @@ meta geography.longitudeOfSubSatellitePointInDegrees scale(longitudeOfSubSatel include "grib2/template.3.resolution_flags.def"; # dx - apparent diameter of Earth in grid lengths, in X-direction -unsigned[4] dx : dump; +unsigned[4] dx : dump; alias geography.dx=dx; # dy - apparent diameter of Earth in grid lengths, in Y-direction -unsigned[4] dy : dump; +unsigned[4] dy : dump; alias geography.dy=dy; # Xp - X-coordinate of sub-satellite point # (in units of 10^-3 grid length expressed as an integer) -unsigned[4] Xp : no_copy; +unsigned[4] Xp : no_copy; meta geography.XpInGridLengths scale(Xp,one,thousand) : dump; alias xCoordinateOfSubSatellitePoint=XpInGridLengths; # Yp - Y-coordinate of sub-satellite point # (in units of 10^-3 grid length expressed as an integer) -unsigned[4] Yp : no_copy; +unsigned[4] Yp : no_copy; meta geography.YpInGridLengths scale(Yp,one,thousand) : dump; alias yCoordinateOfSubSatellitePoint=YpInGridLengths; diff --git a/definitions/grib2/template.3.grid.def b/definitions/grib2/template.3.grid.def index c23cddf52..28070d542 100644 --- a/definitions/grib2/template.3.grid.def +++ b/definitions/grib2/template.3.grid.def @@ -4,16 +4,18 @@ constant isGridded = one; unsigned[4] Ni : can_be_missing,dump; alias numberOfPointsAlongAParallel=Ni; +alias numberOfPointsAlongXAxis=Ni; alias Nx = Ni; unsigned[4] Nj : dump; alias numberOfPointsAlongAMeridian=Nj; +alias numberOfPointsAlongYAxis= Nj; alias Ny = Nj; alias geography.Ni=Ni; alias geography.Nj=Nj; -# Basic angle of the initial production domain +# Basic angle of the initial production domain unsigned[4] basicAngleOfTheInitialProductionDomain = 0; transient mBasicAngle=basicAngleOfTheInitialProductionDomain*oneMillionConstant; transient angleMultiplier = 1; @@ -26,35 +28,31 @@ when (basicAngleOfTheInitialProductionDomain == 0) { set mAngleMultiplier = mBasicAngle; } -# Subdivisions of basic angle used to define extreme longitudes and latitudes, and direction increments +# Subdivisions of basic angle used to define extreme longitudes and latitudes, and direction increments unsigned[4] subdivisionsOfBasicAngle = missing() : can_be_missing; transient angleDivisor = 1000000; when (missing(subdivisionsOfBasicAngle) || subdivisionsOfBasicAngle == 0) { - set angleDivisor = 1000000; + set angleDivisor = 1000000; } else { - set angleDivisor = subdivisionsOfBasicAngle; + set angleDivisor = subdivisionsOfBasicAngle; } # La1 - latitude of first grid point signed[4] latitudeOfFirstGridPoint : edition_specific ; -alias La1 = latitudeOfFirstGridPoint; +alias La1 = latitudeOfFirstGridPoint; #meta latitudeOfFirstGridPointInMicrodegrees times(latitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor) : no_copy; -# Lo1 - longitude of first grid point - +# Lo1 - longitude of first grid point signed[4] longitudeOfFirstGridPoint ; -alias Lo1 = longitudeOfFirstGridPoint; -#meta longitudeOfFirstGridPointInMicrodegrees times(longitudeOfFirstGridPoint,mAngleMultiplier,angleDivisor) : no_copy; +alias Lo1 = longitudeOfFirstGridPoint; include "grib2/template.3.resolution_flags.def" -# La2 - latitude of last grid point -signed[4] latitudeOfLastGridPoint : edition_specific; -alias La2 = latitudeOfLastGridPoint; -#meta latitudeOfLastGridPointInMicrodegrees times(latitudeOfLastGridPoint,mAngleMultiplier,angleDivisor) : no_copy; +# La2 - latitude of last grid point +signed[4] latitudeOfLastGridPoint : edition_specific; +alias La2 = latitudeOfLastGridPoint; -# Lo2 - longitude of last grid point -signed[4] longitudeOfLastGridPoint : edition_specific ; -alias Lo2 = longitudeOfLastGridPoint; -#meta longitudeOfLastGridPointInMicrodegrees times(longitudeOfLastGridPoint,mAngleMultiplier,angleDivisor) : no_copy; +# Lo2 - longitude of last grid point +signed[4] longitudeOfLastGridPoint : edition_specific ; +alias Lo2 = longitudeOfLastGridPoint; diff --git a/definitions/grib2/template.3.healpix.def b/definitions/grib2/template.3.healpix.def new file mode 100644 index 000000000..47e1a63f8 --- /dev/null +++ b/definitions/grib2/template.3.healpix.def @@ -0,0 +1,48 @@ +# (C) Copyright 2005- ECMWF. + +# See https://healpix.jpl.nasa.gov/pdf/intro.pdf + +constant isGridded = one; + +# Number of grid points along one side of one of the 12 base resolution pixels (>=1) +# The number of data points should be = 12 * Nside * Nside +unsigned[4] Nside : edition_specific,dump; +alias N = Nside; +alias numberOfPointsAlongASide = Nside; +alias geography.Nside = Nside; + +# Longitude of the centre line of the first rhomboid +unsigned[4] longitudeOfFirstGridPoint = 45000000 : edition_specific,dump; +alias Lo = longitudeOfFirstGridPoint; +meta geography.longitudeOfFirstGridPointInDegrees + scale(longitudeOfFirstGridPoint,one,grib2divider,truncateDegrees) : dump; + +# Position of the points. Default = Grid points at centres of shape +codetable[1] gridPointPosition ('3.8.table',masterDir,localDir) = 4 : edition_specific,dump; +alias geography.gridPointPosition = gridPointPosition; + +# Ordering convention of points. Default = ring +codetable[1] ordering ('3.12.table',masterDir,localDir) = 0 : edition_specific,dump; +concept orderingConvention(unknown) { + "ring" = { ordering = 0; } + "nested" = { ordering = 1; } +} : dump; +alias geography.pointsOrdering = orderingConvention; + +flags[1] scanningMode 'grib2/tables/[tablesVersion]/3.13.table'; +flagbit iScansNegatively(scanningMode,7) : dump; # WMO bit 1 +flagbit jScansPositively(scanningMode,6) : dump; # WMO bit 2 +transient iScansPositively = !iScansNegatively : constraint; +transient jScansNegatively = !jScansPositively : constraint; + +iterator healpix(numberOfPoints,missingValue,values,Nside,orderingConvention); +nearest healpix(values,radius,Nx,Ny); + +meta latLonValues latlonvalues(values); +alias latitudeLongitudeValues=latLonValues; +meta latitudes latitudes(values,0); +meta longitudes longitudes(values,0); +meta distinctLatitudes latitudes(values,1); +meta distinctLongitudes longitudes(values,1); + +meta gridName sprintf("H%d", N) : no_copy; diff --git a/definitions/grib2/template.3.latlon.def b/definitions/grib2/template.3.latlon.def index cc3b8cc5f..aa2c945d7 100644 --- a/definitions/grib2/template.3.latlon.def +++ b/definitions/grib2/template.3.latlon.def @@ -2,17 +2,15 @@ include "grib2/template.3.grid.def"; -# Di - i direction increment - +# Di - i direction increment unsigned[4] iDirectionIncrement : can_be_missing,edition_specific; -alias Di = iDirectionIncrement; -alias Dx = iDirectionIncrement; - -# Dj - j direction increment +alias Di = iDirectionIncrement; +alias Dx = iDirectionIncrement; +# Dj - j direction increment unsigned[4] jDirectionIncrement : can_be_missing,edition_specific; -alias Dj = jDirectionIncrement; -alias Dy = jDirectionIncrement; +alias Dj = jDirectionIncrement; +alias Dy = jDirectionIncrement; include "grib2/template.3.scanning_mode.def"; diff --git a/definitions/grib2/template.3.rotation.def b/definitions/grib2/template.3.rotation.def index f797170a5..33c319735 100644 --- a/definitions/grib2/template.3.rotation.def +++ b/definitions/grib2/template.3.rotation.def @@ -1,18 +1,18 @@ # (C) Copyright 2005- ECMWF. -# Latitude of the southern pole of projection +# Latitude of the southern pole of projection signed[4] latitudeOfSouthernPole : no_copy; alias latitudeOfTheSouthernPoleOfProjection=latitudeOfSouthernPole; -# Longitude of the southern pole of projection +# Longitude of the southern pole of projection unsigned[4] longitudeOfSouthernPole : no_copy; alias longitudeOfTheSouthernPoleOfProjection=longitudeOfSouthernPole; -meta geography.latitudeOfSouthernPoleInDegrees scale(latitudeOfSouthernPole +meta geography.latitudeOfSouthernPoleInDegrees scale(latitudeOfSouthernPole ,one,grib2divider,truncateDegrees) : dump; -meta geography.longitudeOfSouthernPoleInDegrees g2lon(longitudeOfSouthernPole) : dump; +meta geography.longitudeOfSouthernPoleInDegrees g2lon(longitudeOfSouthernPole) : dump; -# Angle of rotation of projection +# Angle of rotation of projection ieeefloat angleOfRotation : dump,edition_specific ; alias geography.angleOfRotationInDegrees=angleOfRotation; diff --git a/definitions/grib2/template.3.shape_of_the_earth.def b/definitions/grib2/template.3.shape_of_the_earth.def index 2ff2dcdf0..6bd4deceb 100644 --- a/definitions/grib2/template.3.shape_of_the_earth.def +++ b/definitions/grib2/template.3.shape_of_the_earth.def @@ -2,25 +2,25 @@ codetable[1] shapeOfTheEarth ('3.2.table',masterDir,localDir) : dump; -# Scale factor of radius of spherical earth +# Scale factor of radius of spherical earth unsigned[1] scaleFactorOfRadiusOfSphericalEarth = missing() : can_be_missing, edition_specific; -# Scaled value of radius of spherical earth (in metres) +# Scaled value of radius of spherical earth (in metres) unsigned[4] scaledValueOfRadiusOfSphericalEarth = missing(): can_be_missing, edition_specific; -# Scale factor of major axis of oblate spheroid earth +# Scale factor of major axis of oblate spheroid earth unsigned[1] scaleFactorOfEarthMajorAxis = missing(): can_be_missing, edition_specific; alias scaleFactorOfMajorAxisOfOblateSpheroidEarth=scaleFactorOfEarthMajorAxis; -# Scaled value of major axis of oblate spheroid earth +# Scaled value of major axis of oblate spheroid earth unsigned[4] scaledValueOfEarthMajorAxis = missing(): can_be_missing, edition_specific; alias scaledValueOfMajorAxisOfOblateSpheroidEarth=scaledValueOfEarthMajorAxis; -# Scale factor of minor axis of oblate spheroid earth +# Scale factor of minor axis of oblate spheroid earth unsigned[1] scaleFactorOfEarthMinorAxis = missing(): can_be_missing, edition_specific; alias scaleFactorOfMinorAxisOfOblateSpheroidEarth=scaleFactorOfEarthMinorAxis ; -# Scaled value of minor axis of oblate spheroid earth +# Scaled value of minor axis of oblate spheroid earth unsigned[4] scaledValueOfEarthMinorAxis = missing(): can_be_missing, edition_specific; alias scaledValueOfMinorAxisOfOblateSpheroidEarth=scaledValueOfEarthMinorAxis; diff --git a/definitions/grib2/template.3.spherical_harmonics.def b/definitions/grib2/template.3.spherical_harmonics.def index 3e58d278c..2adbe405b 100644 --- a/definitions/grib2/template.3.spherical_harmonics.def +++ b/definitions/grib2/template.3.spherical_harmonics.def @@ -1,29 +1,28 @@ # (C) Copyright 2005- ECMWF. constant sphericalHarmonics=1; - # constant dataRepresentationType = 50; -# J - pentagonal resolution parameter +# J - pentagonal resolution parameter unsigned[4] J : dump; alias pentagonalResolutionParameterJ=J ; alias geography.J=J; -# K - pentagonal resolution parameter +# K - pentagonal resolution parameter unsigned[4] K : dump; alias pentagonalResolutionParameterK=K; alias geography.K=K; -# M - pentagonal resolution parameter +# M - pentagonal resolution parameter unsigned[4] M : dump; alias pentagonalResolutionParameterM = M ; alias geography.M=M; -# Representation type indicating the method used to define the norm +# Representation type indicating the method used to define the norm codetable[1] spectralType ('3.6.table',masterDir,localDir) = 1 : no_copy; alias spectralDataRepresentationType=spectralType; -# Representation mode indicating the order of the coefficients +# Representation mode indicating the order of the coefficients codetable[1] spectralMode ('3.7.table',masterDir,localDir) = 1 : no_copy; alias spectralDataRepresentationMode=spectralMode; diff --git a/definitions/grib2/template.4.20.def b/definitions/grib2/template.4.20.def index 86cc2e8e7..9ba5668eb 100644 --- a/definitions/grib2/template.4.20.def +++ b/definitions/grib2/template.4.20.def @@ -1,64 +1,64 @@ # (C) Copyright 2005- ECMWF. # TEMPLATE 4.20, Radar product -# Parameter category +# Parameter category codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump; -# Parameter number +# Parameter number codetable[1] parameterNumber ('4.2.[discipline:l].[parameterCategory:l].table',masterDir,localDir) : dump; meta parameterUnits codetable_units(parameterNumber) : dump; meta parameterName codetable_title(parameterNumber) : dump; -# Type of generating process +# Type of generating process codetable[1] typeOfGeneratingProcess ('4.3.table',masterDir,localDir) : dump; -# Number of radar sites used +# Number of radar sites used unsigned[1] numberOfRadarSitesUsed : dump; -# Indicator of unit of time range +# Indicator of unit of time range codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; -# Site latitude (in 10-6 degree) +# Site latitude (in 10-6 degree) unsigned[4] siteLatitude : dump; -# Site longitude (in 10-6 degree) +# Site longitude (in 10-6 degree) unsigned[4] siteLongitude : dump; -# Site elevation (meters) +# Site elevation (meters) unsigned[2] siteElevation : dump; -# Site ID (alphanumeric) +# Site ID (alphanumeric) unsigned[4] siteId : dump; -# Site ID (numeric) +# Site ID (numeric) unsigned[2] siteId : dump; -# Operating mode +# Operating mode codetable[1] operatingMode ('4.12.table',masterDir,localDir) : dump; -# Reflectivity calibration constant (tenths of dB) +# Reflectivity calibration constant (tenths of dB) unsigned[1] reflectivityCalibrationConstant : dump; -# Quality control indicator +# Quality control indicator codetable[1] qualityControlIndicator ('4.13.table',masterDir,localDir) : dump; -# Clutter filter indicator +# Clutter filter indicator codetable[1] clutterFilterIndicator ('4.14.table',masterDir,localDir) : dump; -# Constant antenna elevation angle (tenths of degree true) +# Constant antenna elevation angle (tenths of degree true) unsigned[1] constantAntennaElevationAngle : dump; -# Accumulation interval (minutes) +# Accumulation interval (minutes) unsigned[2] accumulationInterval : dump; -# Reference reflectivity for echo top (dB) +# Reference reflectivity for echo top (dB) unsigned[1] referenceReflectivityForEchoTop : dump; -# Range bin spacing (meters) +# Range bin spacing (meters) unsigned[3] rangeBinSpacing : dump; -# Radial angular spacing (tenths of degree true) +# Radial angular spacing (tenths of degree true) unsigned[2] radialAngularSpacing : dump; diff --git a/definitions/grib2/template.4.89.def b/definitions/grib2/template.4.89.def new file mode 100644 index 000000000..eee84fade --- /dev/null +++ b/definitions/grib2/template.4.89.def @@ -0,0 +1,11 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.89, Post-processed quantile forecasts at a horizontal level or in a horizontal layer at a point in time + +include "grib2/template.4.parameter.def" +include "grib2/template.4.postproc.def" +include "grib2/template.4.generating_process.def" +include "grib2/template.4.forecast_time.def" +include "grib2/template.4.point_in_time.def" +include "grib2/template.4.horizontal.def" +include "grib2/template.4.quantile.def" diff --git a/definitions/grib2/template.4.90.def b/definitions/grib2/template.4.90.def new file mode 100644 index 000000000..94e5cc8e4 --- /dev/null +++ b/definitions/grib2/template.4.90.def @@ -0,0 +1,11 @@ +# (C) Copyright 2005- ECMWF. + +# TEMPLATE 4.90, Post-processed quantile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval + +include "grib2/template.4.parameter.def" +include "grib2/template.4.postproc.def" +include "grib2/template.4.generating_process.def" +include "grib2/template.4.forecast_time.def" +include "grib2/template.4.horizontal.def" +include "grib2/template.4.quantile.def" +include "grib2/template.4.statistical.def" diff --git a/definitions/grib2/template.4.categorical.def b/definitions/grib2/template.4.categorical.def index 561f28b18..102d50e51 100644 --- a/definitions/grib2/template.4.categorical.def +++ b/definitions/grib2/template.4.categorical.def @@ -1,21 +1,14 @@ # (C) Copyright 2005- ECMWF. -# Total number of forecast probabilities -unsigned[1] numberOfCategories : dump; +# Total number of forecast probabilities +unsigned[1] numberOfCategories : dump; -# categories +# Categories categories list(numberOfCategories) { codetable[1] categoryType ('4.91.table',masterDir,localDir): dump; unsigned[1] codeFigure : dump; - # Scale factor of lower limit unsigned[1] scaleFactorOfLowerLimit : can_be_missing,dump ; - - # Scaled value of lower limit unsigned[4] scaledValueOfLowerLimit : can_be_missing,dump ; - - # Scale factor of upper limit unsigned[1] scaleFactorOfUpperLimit : can_be_missing,dump; - - # Scaled value of upper limit unsigned[4] scaledValueOfUpperLimit : can_be_missing,dump; } diff --git a/definitions/grib2/template.4.circular_cluster.def b/definitions/grib2/template.4.circular_cluster.def index f6e2cade4..31c85bb78 100644 --- a/definitions/grib2/template.4.circular_cluster.def +++ b/definitions/grib2/template.4.circular_cluster.def @@ -1,45 +1,45 @@ # (C) Copyright 2005- ECMWF. -# Cluster identifier +# Cluster identifier unsigned[1] clusterIdentifier : dump; alias number=clusterIdentifier; -# Number of cluster to which the high resolution control belongs +# Number of cluster to which the high resolution control belongs unsigned[1] numberOfClusterHighResolution : dump; -# Number of cluster to which the low resolution control belongs +# Number of cluster to which the low resolution control belongs unsigned[1] numberOfClusterLowResolution : dump; -# Total number of clusters +# Total number of clusters unsigned[1] totalNumberOfClusters : dump; alias totalNumber=totalNumberOfClusters; -# Clustering method +# Clustering method codetable[1] clusteringMethod ('4.8.table',masterDir,localDir) : dump; -# Latitude of central point in cluster domain +# Latitude of central point in cluster domain unsigned[4] latitudeOfCentralPointInClusterDomain : dump; -# Longitude of central point in cluster domain +# Longitude of central point in cluster domain unsigned[4] longitudeOfCentralPointInClusterDomain : dump; -# Radius of cluster domain +# Radius of cluster domain unsigned[4] radiusOfClusterDomain : dump ; -# NC - Number of forecasts in the cluster +# NC - Number of forecasts in the cluster unsigned[1] numberOfForecastsInTheCluster : dump; -alias NC = numberOfForecastsInTheCluster; -# Scale factor of standard deviation in the cluster +alias NC = numberOfForecastsInTheCluster; +# Scale factor of standard deviation in the cluster unsigned[1] scaleFactorOfStandardDeviation : edition_specific ; alias scaleFactorOfStandardDeviationInTheCluster=scaleFactorOfStandardDeviation; -# Scaled value of standard deviation in the cluster +# Scaled value of standard deviation in the cluster unsigned[4] scaledValueOfStandardDeviation : dump ; alias scaledValueOfStandardDeviationInTheCluster=scaledValueOfStandardDeviation; -# Scale factor of distance of the cluster from ensemble mean +# Scale factor of distance of the cluster from ensemble mean unsigned[1] scaleFactorOfDistanceFromEnsembleMean : dump; -# Scaled value of distance of the cluster from ensemble mean +# Scaled value of distance of the cluster from ensemble mean unsigned[4] scaledValueOfDistanceFromEnsembleMean : dump; diff --git a/definitions/grib2/template.4.eps.def b/definitions/grib2/template.4.eps.def index bda5c6b25..1f80b38d1 100644 --- a/definitions/grib2/template.4.eps.def +++ b/definitions/grib2/template.4.eps.def @@ -1,17 +1,17 @@ # (C) Copyright 2005- ECMWF. -# Type of ensemble forecast +# Type of ensemble forecast codetable[1] typeOfEnsembleForecast ('4.6.table',masterDir,localDir) = 255 : dump; -# Perturbation number +# Perturbation number unsigned[1] perturbationNumber : dump; alias number=perturbationNumber; -# Number of forecasts in ensemble +# Number of forecasts in ensemble unsigned[1] numberOfForecastsInEnsemble : dump; alias totalNumber=numberOfForecastsInEnsemble; -# Rules for TIGGE, S2S, UERRA and CRRA +# Rules for TIGGE, S2S, UERRA and CRRA if (productionStatusOfProcessedData == 4 || productionStatusOfProcessedData == 5 || productionStatusOfProcessedData == 6 || diff --git a/definitions/grib2/template.4.horizontal.def b/definitions/grib2/template.4.horizontal.def index 954888d36..67a1909da 100644 --- a/definitions/grib2/template.4.horizontal.def +++ b/definitions/grib2/template.4.horizontal.def @@ -1,25 +1,25 @@ # (C) Copyright 2005- ECMWF. -# Type of first fixed surface +# Type of first fixed surface codetable[1] typeOfFirstFixedSurface ('4.5.table',masterDir,localDir) : dump,edition_specific,string_type; meta unitsOfFirstFixedSurface codetable_units(typeOfFirstFixedSurface) : dump; meta nameOfFirstFixedSurface codetable_title(typeOfFirstFixedSurface) : dump; -# Scale factor of first fixed surface +# Scale factor of first fixed surface signed[1] scaleFactorOfFirstFixedSurface = missing() : can_be_missing,dump,edition_specific; -# Scaled value of first fixed surface +# Scaled value of first fixed surface unsigned[4] scaledValueOfFirstFixedSurface = missing() : can_be_missing,dump,edition_specific; -# Type of second fixed surface +# Type of second fixed surface codetable[1] typeOfSecondFixedSurface ('4.5.table',masterDir,localDir) = 255 : dump,edition_specific; meta unitsOfSecondFixedSurface codetable_units(typeOfSecondFixedSurface) : dump; meta nameOfSecondFixedSurface codetable_title(typeOfSecondFixedSurface) : dump; -# Scale factor of second fixed surface +# Scale factor of second fixed surface signed[1] scaleFactorOfSecondFixedSurface = missing() : can_be_missing,dump,edition_specific; -# Scaled value of second fixed surface +# Scaled value of second fixed surface unsigned[4] scaledValueOfSecondFixedSurface = missing() : can_be_missing,dump,edition_specific; transient pressureUnits="hPa"; @@ -75,7 +75,7 @@ if (extraDim) { } } # ECC-1333: levtype should be read-only in GRIB2 - concept mars.levtype(unknown,"marsLevtypeConcept.def",conceptsDir2,conceptsDir1):no_copy; + concept mars.levtype(unknown,"marsLevtypeConcept.def",conceptsDir2,conceptsDir1):no_copy, read_only; # GRIB-372: levelist alias does not pertain to surface parameters if (levtype is "sfc" || levtype is "o2d") { unalias mars.levelist; diff --git a/definitions/grib2/template.4.rectangular_cluster.def b/definitions/grib2/template.4.rectangular_cluster.def index 1d4f359f8..24d2f5138 100644 --- a/definitions/grib2/template.4.rectangular_cluster.def +++ b/definitions/grib2/template.4.rectangular_cluster.def @@ -1,49 +1,49 @@ # (C) Copyright 2005- ECMWF. -# Cluster identifier +# Cluster identifier unsigned[1] clusterIdentifier : dump ; alias number=clusterIdentifier; -# Number of cluster to which the high resolution control belongs +# Number of cluster to which the high resolution control belongs unsigned[1] NH : dump; -# Number of cluster to which the low resolution control belongs +# Number of cluster to which the low resolution control belongs unsigned[1] NL : dump ; -# Total number of clusters +# Total number of clusters unsigned[1] totalNumberOfClusters : dump ; alias totalNumber=totalNumberOfClusters; -# Clustering method +# Clustering method codetable[1] clusteringMethod ('4.8.table',masterDir,localDir) : dump; -# Northern latitude of cluster domain +# Northern latitude of cluster domain unsigned[4] northernLatitudeOfClusterDomain : dump ; -# Southern latitude of cluster domain +# Southern latitude of cluster domain unsigned[4] southernLatitudeOfClusterDomain : dump ; -# Eastern longitude of cluster domain +# Eastern longitude of cluster domain unsigned[4] easternLongitudeOfClusterDomain : dump; -# Western longitude of cluster domain +# Western longitude of cluster domain unsigned[4] westernLongitudeOfClusterDomain : dump ; -# NC - Number of forecasts in the cluster +# NC - Number of forecasts in the cluster unsigned[1] numberOfForecastsInTheCluster : dump ; alias NC = numberOfForecastsInTheCluster; -# Scale factor of standard deviation in the cluster +# Scale factor of standard deviation in the cluster unsigned[1] scaleFactorOfStandardDeviation : edition_specific ; alias scaleFactorOfStandardDeviationInTheCluster=scaleFactorOfStandardDeviation; -# Scaled value of standard deviation in the cluster +# Scaled value of standard deviation in the cluster unsigned[4] scaledValueOfStandardDeviation : dump ; alias scaledValueOfStandardDeviationInTheCluster=scaledValueOfStandardDeviation; -# Scale factor of distance of the cluster from ensemble mean +# Scale factor of distance of the cluster from ensemble mean unsigned[1] scaleFactorOfDistanceFromEnsembleMean : dump ; -# Scaled value of distance of the cluster from ensemble mean +# Scaled value of distance of the cluster from ensemble mean unsigned[4] scaledValueOfDistanceFromEnsembleMean : dump ; diff --git a/definitions/grib2/template.4.statistical.def b/definitions/grib2/template.4.statistical.def index 108e949f9..dfc0e7203 100644 --- a/definitions/grib2/template.4.statistical.def +++ b/definitions/grib2/template.4.statistical.def @@ -1,53 +1,52 @@ # (C) Copyright 2005- ECMWF. -# Year of end of overall time interval +# Year of end of overall time interval unsigned[2] yearOfEndOfOverallTimeInterval =0 : edition_specific; -# Month of end of overall time interval +# Month of end of overall time interval unsigned[1] monthOfEndOfOverallTimeInterval =0 : edition_specific; -# Day of end of overall time interval +# Day of end of overall time interval unsigned[1] dayOfEndOfOverallTimeInterval =0 : edition_specific; -# Hour of end of overall time interval +# Hour of end of overall time interval unsigned[1] hourOfEndOfOverallTimeInterval =0 : edition_specific; -# Minute of end of overall time interval +# Minute of end of overall time interval unsigned[1] minuteOfEndOfOverallTimeInterval =0 : edition_specific; -# Second of end of overall time interval +# Second of end of overall time interval unsigned[1] secondOfEndOfOverallTimeInterval =0 : edition_specific; -# n - number of time range specifications describing the time intervals used to calculate the statistically-processed field +# n - number of time range specifications describing the time intervals used to calculate the statistically-processed field unsigned[1] numberOfTimeRange = 1 : edition_specific; alias n = numberOfTimeRange; -# Total number of data values missing in statistical process +# Total number of data values missing in statistical process unsigned[4] numberOfMissingInStatisticalProcess = 0 : edition_specific; alias totalNumberOfDataValuesMissingInStatisticalProcess=numberOfMissingInStatisticalProcess; statisticalProcessesList list(numberOfTimeRange) { - # Statistical process used to calculate the processed field from the field at each time increment during the time range + # Statistical process used to calculate the processed field from the field at each time increment during the time range codetable[1] typeOfStatisticalProcessing ('4.10.table',masterDir,localDir) : edition_specific; - # Type of time increment between successive fields used in the statistical processing + # Type of time increment between successive fields used in the statistical processing codetable[1] typeOfTimeIncrement ('4.11.table',masterDir,localDir) = 2 : edition_specific; alias typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing=typeOfTimeIncrement; - # Indicator of unit of time for time range over which statistical processing is done + # Indicator of unit of time for time range over which statistical processing is done codetable[1] indicatorOfUnitForTimeRange ('4.4.table',masterDir,localDir) =1 ; - # Length of the time range over which statistical processing is done, in units defined by the previous octet + # Length of the time range over which statistical processing is done, in units defined by the previous octet unsigned[4] lengthOfTimeRange=0 ; - # Indicator of unit of time for the increment between the successive fields used + # Indicator of unit of time for the increment between the successive fields used codetable[1] indicatorOfUnitForTimeIncrement ('4.4.table',masterDir,localDir)=255 ; - # Time increment between successive fields, in units defined by the previous octet + # Time increment between successive fields, in units defined by the previous octet unsigned[4] timeIncrement=0 ; alias timeIncrementBetweenSuccessiveFields=timeIncrement; - } # See GRIB-488. We only support maximum of 2 time ranges diff --git a/definitions/grib2/template.5.2.def b/definitions/grib2/template.5.2.def index 03e74a290..cc3149827 100644 --- a/definitions/grib2/template.5.2.def +++ b/definitions/grib2/template.5.2.def @@ -5,39 +5,39 @@ include "grib2/template.5.packing.def"; include "grib2/template.5.original_values.def"; -# Group splitting method used +# Group splitting method used codetable[1] groupSplittingMethodUsed ('5.4.table',masterDir,localDir); -# Missing value management used +# Missing value management used codetable[1] missingValueManagementUsed ('5.5.table',masterDir,localDir); -# Primary missing value substitute +# Primary missing value substitute unsigned[4] primaryMissingValueSubstitute ; -# Secondary missing value substitute +# Secondary missing value substitute unsigned[4] secondaryMissingValueSubstitute ; -# NG - Number of groups of data values into which field is split +# NG - Number of groups of data values into which field is split unsigned[4] numberOfGroupsOfDataValues ; alias NG = numberOfGroupsOfDataValues; -# Reference for group widths +# Reference for group widths unsigned[1] referenceForGroupWidths ; -# Number of bits used for the group widths +# Number of bits used for the group widths # (after the reference value in octet 36 has been removed) unsigned[1] numberOfBitsUsedForTheGroupWidths ; -# Reference for group lengths +# Reference for group lengths unsigned[4] referenceForGroupLengths ; -# Length increment for the group lengths +# Length increment for the group lengths unsigned[1] lengthIncrementForTheGroupLengths ; -# True length of last group +# True length of last group unsigned[4] trueLengthOfLastGroup ; -# Number of bits used for the scaled group lengths +# Number of bits used for the scaled group lengths # (after subtraction of the reference value given in octets 38-41 and division # by the length increment given in octet 42) unsigned[1] numberOfBitsForScaledGroupLengths ; diff --git a/definitions/grib2/template.5.200.def b/definitions/grib2/template.5.200.def index 2ceca0c69..dee6f449c 100644 --- a/definitions/grib2/template.5.200.def +++ b/definitions/grib2/template.5.200.def @@ -2,6 +2,10 @@ # TEMPLATE 5.200, Grid point data - Run length packing with level values +# added for conversion from other packing +transient referenceValue=0 : hidden; +transient binaryScaleFactor=0 : hidden; + unsigned[1] bitsPerValue : dump; unsigned[2] maxLevelValue : dump; unsigned[2] numberOfLevelValues : dump; diff --git a/definitions/grib2/template.5.40.def b/definitions/grib2/template.5.40.def index a6bf95337..3b2f33ef0 100644 --- a/definitions/grib2/template.5.40.def +++ b/definitions/grib2/template.5.40.def @@ -5,8 +5,8 @@ include "grib2/template.5.packing.def"; include "grib2/template.5.original_values.def"; -codetable[1] typeOfCompressionUsed ('5.40.table',masterDir,localDir) ; +codetable[1] typeOfCompressionUsed ('5.40.table',masterDir,localDir) ; -# Octets 23 Target compression ratio, M:1 (with respect to the bit-depth specified in octet 20), -# when octet 22 indicates Lossy Compression. Otherwise, set to missing. +# Target compression ratio, M:1 (with respect to the bit-depth specified in octet 20), +# when typeOfCompressionUsed indicates Lossy Compression. Otherwise, set to missing. unsigned[1] targetCompressionRatio = 255; diff --git a/definitions/grib2/template.7.200.def b/definitions/grib2/template.7.200.def index 3c738cacb..71459b2cf 100644 --- a/definitions/grib2/template.7.200.def +++ b/definitions/grib2/template.7.200.def @@ -1,6 +1,6 @@ # (C) Copyright 2005- ECMWF. -# TEMPLATE 7.200, Grid point data – run length packing with level values +# TEMPLATE 7.200, Grid point data - Run length packing with level values meta codedValues data_run_length_packing( section7Length, diff --git a/definitions/grib2/tigge_name.def b/definitions/grib2/tigge_name.def deleted file mode 100644 index 76fbb84b5..000000000 --- a/definitions/grib2/tigge_name.def +++ /dev/null @@ -1,45 +0,0 @@ -# Automatically generated by ./tigge_def.pl, do not edit - - '10_meter_u_velocity' = { parameter = 165; } - '10_meter_v_velocity' = { parameter = 166; } - '10_metre_wind_gust_of_at_least_15_m/s' = { parameter = 131070; } - '10_metre_wind_gust_of_at_least_25_m/s' = { parameter = 131071; } - 'convective_available_potential_energy' = { parameter = 59; } - 'convective_inhibition' = { parameter = 228001; } - 'field_capacity' = { parameter = 228170; } - 'geopotential_height' = { parameter = 156; } - 'land_sea_mask' = { parameter = 172; } - 'maximum_wind_gust' = { parameter = 49; } - 'mean_sea_level_pressure' = { parameter = 151; } - 'orography' = { parameter = 228002; } - 'potential_temperature' = { parameter = 3; } - 'potential_vorticity' = { parameter = 60; } - 'sea_surface_temperature_anomaly' = { parameter = 171034; } - 'skin_temperature' = { parameter = 235; } - 'snow_depth_water_equivalent' = { parameter = 228141; } - 'snow_fall_water_equivalent' = { parameter = 228144; } - 'soil_moisture' = { parameter = 228039; } - 'soil_temperature' = { parameter = 228139; } - 'specific_humidity' = { parameter = 133; } - 'sunshine_duration' = { parameter = 189; } - 'surface_air_dew_point_temperature' = { parameter = 168; } - 'surface_air_maximum_temperature' = { parameter = 121; } - 'surface_air_minimum_temperature' = { parameter = 122; } - 'surface_air_temperature' = { parameter = 167; } - 'surface_pressure' = { parameter = 134; } - 'temperature' = { parameter = 130; } - 'time_integrated_outgoing_long_wave_radiation' = { parameter = 179; } - 'time_integrated_surface_latent_heat_flux' = { parameter = 147; } - 'time_integrated_surface_net_solar_radiation' = { parameter = 176; } - 'time_integrated_surface_net_thermal_radiation' = { parameter = 177; } - 'time_integrated_surface_sensible_heat_flux' = { parameter = 146; } - 'total_cloud_cover' = { parameter = 228164; } - 'total_column_water' = { parameter = 136; } - 'total_precipitation' = { parameter = 228228; } - 'total_precipitation_of_at_least_10_mm' = { parameter = 131062; } - 'total_precipitation_of_at_least_20_mm' = { parameter = 131063; } - 'u_velocity' = { parameter = 131; } - 'v_velocity' = { parameter = 132; } - 'wilting_point' = { parameter = 228171; } - 'default' = { parameter = 99999; } - diff --git a/definitions/grib2/tigge_parameter.def b/definitions/grib2/tigge_parameter.def deleted file mode 100644 index 3ded0bb12..000000000 --- a/definitions/grib2/tigge_parameter.def +++ /dev/null @@ -1,395 +0,0 @@ -# Automatically generated by ./tigge_def.pl, do not edit - -# 10_meter_u_velocity -'165' = { - discipline = 0; - parameterCategory = 2; - parameterNumber = 2; - scaleFactorOfFirstFixedSurface = 0; - scaledValueOfFirstFixedSurface = 10; - typeOfFirstFixedSurface = 103; -} - -# 10_meter_v_velocity -'166' = { - discipline = 0; - parameterCategory = 2; - parameterNumber = 3; - scaleFactorOfFirstFixedSurface = 0; - scaledValueOfFirstFixedSurface = 10; - typeOfFirstFixedSurface = 103; -} - -# 10_metre_wind_gust_of_at_least_15_m/s -'131070' = { - discipline = 0; - parameterCategory = 2; - parameterNumber = 22; - productDefinitionTemplateNumber = 9; - scaleFactorOfFirstFixedSurface = 0; - scaledValueOfFirstFixedSurface = 10; - scaledValueOfLowerLimit = 15; - typeOfFirstFixedSurface = 103; - typeOfStatisticalProcessing = 2; -} - -# 10_metre_wind_gust_of_at_least_25_m/s -'131071' = { - discipline = 0; - parameterCategory = 2; - parameterNumber = 22; - productDefinitionTemplateNumber = 9; - scaleFactorOfFirstFixedSurface = 0; - scaledValueOfFirstFixedSurface = 10; - scaledValueOfLowerLimit = 25; - typeOfFirstFixedSurface = 103; - typeOfStatisticalProcessing = 2; -} - -# convective_available_potential_energy -'59' = { - discipline = 0; - parameterCategory = 7; - parameterNumber = 6; - typeOfFirstFixedSurface = 1; - typeOfSecondFixedSurface = 8; -} - -# convective_inhibition -'228001' = { - discipline = 0; - parameterCategory = 7; - parameterNumber = 7; - typeOfFirstFixedSurface = 1; - typeOfSecondFixedSurface = 8; -} - -# field_capacity -'228170' = { - discipline = 2; - parameterCategory = 3; - parameterNumber = 12; - scaleFactorOfFirstFixedSurface = 0; - scaleFactorOfSecondFixedSurface = 1; - scaledValueOfFirstFixedSurface = 0; - scaledValueOfSecondFixedSurface = 2; - typeOfFirstFixedSurface = 106; - typeOfSecondFixedSurface = 106; -} - -# geopotential_height -'156' = { - discipline = 0; - parameterCategory = 3; - parameterNumber = 5; - typeOfFirstFixedSurface = 100; -} - -# land_sea_mask -'172' = { - discipline = 2; - parameterCategory = 0; - parameterNumber = 0; - typeOfFirstFixedSurface = 1; -} - -# maximum_wind_gust -'49' = { - discipline = 0; - parameterCategory = 2; - parameterNumber = 22; - scaleFactorOfFirstFixedSurface = 0; - scaledValueOfFirstFixedSurface = 10; - typeOfFirstFixedSurface = 103; - typeOfStatisticalProcessing = 2; -} - -# mean_sea_level_pressure -'151' = { - discipline = 0; - parameterCategory = 3; - parameterNumber = 0; - typeOfFirstFixedSurface = 101; -} - -# orography -'228002' = { - discipline = 0; - parameterCategory = 3; - parameterNumber = 5; - typeOfFirstFixedSurface = 1; -} - -# potential_temperature -'3' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 2; - scaleFactorOfFirstFixedSurface = 6; - scaledValueOfFirstFixedSurface = 2; - typeOfFirstFixedSurface = 109; -} - -# potential_vorticity -'60' = { - discipline = 0; - parameterCategory = 2; - parameterNumber = 14; - scaleFactorOfFirstFixedSurface = 0; - scaledValueOfFirstFixedSurface = 320; - typeOfFirstFixedSurface = 107; -} - -# sea_surface_temperature_anomaly -'171034' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 9; - typeOfFirstFixedSurface = 1; -} - -# skin_temperature -'235' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 17; - typeOfFirstFixedSurface = 1; -} - -# snow_depth_water_equivalent -'228141' = { - discipline = 0; - parameterCategory = 1; - parameterNumber = 60; - typeOfFirstFixedSurface = 1; -} - -# snow_fall_water_equivalent -'228144' = { - discipline = 0; - parameterCategory = 1; - parameterNumber = 53; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# soil_moisture -'228039' = { - discipline = 2; - parameterCategory = 0; - parameterNumber = 22; - scaleFactorOfFirstFixedSurface = 0; - scaleFactorOfSecondFixedSurface = 1; - scaledValueOfFirstFixedSurface = 0; - scaledValueOfSecondFixedSurface = 2; - typeOfFirstFixedSurface = 106; - typeOfSecondFixedSurface = 106; -} - -# soil_temperature -'228139' = { - discipline = 2; - parameterCategory = 0; - parameterNumber = 2; - scaleFactorOfFirstFixedSurface = 0; - scaleFactorOfSecondFixedSurface = 1; - scaledValueOfFirstFixedSurface = 0; - scaledValueOfSecondFixedSurface = 2; - typeOfFirstFixedSurface = 106; - typeOfSecondFixedSurface = 106; -} - -# specific_humidity -'133' = { - discipline = 0; - parameterCategory = 1; - parameterNumber = 0; - typeOfFirstFixedSurface = 100; -} - -# sunshine_duration -'189' = { - discipline = 0; - parameterCategory = 6; - parameterNumber = 24; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# surface_air_dew_point_temperature -'168' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 6; - typeOfFirstFixedSurface = 103; -} - -# surface_air_maximum_temperature -'121' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 0; - typeOfFirstFixedSurface = 103; - typeOfStatisticalProcessing = 2; -} - -# surface_air_minimum_temperature -'122' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 0; - typeOfFirstFixedSurface = 103; - typeOfStatisticalProcessing = 3; -} - -# surface_air_temperature -'167' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 0; - typeOfFirstFixedSurface = 103; -} - -# surface_pressure -'134' = { - discipline = 0; - parameterCategory = 3; - parameterNumber = 0; - typeOfFirstFixedSurface = 1; -} - -# temperature -'130' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 0; - typeOfFirstFixedSurface = 100; -} - -# time_integrated_outgoing_long_wave_radiation -'179' = { - discipline = 0; - parameterCategory = 5; - parameterNumber = 5; - typeOfFirstFixedSurface = 8; - typeOfStatisticalProcessing = 1; -} - -# time_integrated_surface_latent_heat_flux -'147' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 10; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# time_integrated_surface_net_solar_radiation -'176' = { - discipline = 0; - parameterCategory = 4; - parameterNumber = 9; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# time_integrated_surface_net_thermal_radiation -'177' = { - discipline = 0; - parameterCategory = 5; - parameterNumber = 5; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# time_integrated_surface_sensible_heat_flux -'146' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 11; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# total_cloud_cover -'228164' = { - discipline = 0; - parameterCategory = 6; - parameterNumber = 1; - typeOfFirstFixedSurface = 1; - typeOfSecondFixedSurface = 8; -} - -# total_column_water -'136' = { - discipline = 0; - parameterCategory = 1; - parameterNumber = 51; - typeOfFirstFixedSurface = 1; - typeOfSecondFixedSurface = 8; -} - -# total_precipitation -'228228' = { - discipline = 0; - parameterCategory = 1; - parameterNumber = 52; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# total_precipitation_of_at_least_10_mm -'131062' = { - discipline = 0; - parameterCategory = 1; - parameterNumber = 52; - productDefinitionTemplateNumber = 9; - scaledValueOfLowerLimit = 10; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# total_precipitation_of_at_least_20_mm -'131063' = { - discipline = 0; - parameterCategory = 1; - parameterNumber = 52; - productDefinitionTemplateNumber = 9; - scaledValueOfLowerLimit = 20; - typeOfFirstFixedSurface = 1; - typeOfStatisticalProcessing = 1; -} - -# u_velocity -'131' = { - discipline = 0; - parameterCategory = 2; - parameterNumber = 2; -} - -# unknown -'default' = { - discipline = 0; - parameterCategory = 0; - parameterNumber = 0; -} - -# v_velocity -'132' = { - discipline = 0; - parameterCategory = 2; - parameterNumber = 3; -} - -# wilting_point -'228171' = { - discipline = 2; - parameterCategory = 0; - parameterNumber = 26; - scaleFactorOfFirstFixedSurface = 0; - scaleFactorOfSecondFixedSurface = 1; - scaledValueOfFirstFixedSurface = 0; - scaledValueOfSecondFixedSurface = 2; - typeOfFirstFixedSurface = 106; - typeOfSecondFixedSurface = 106; -} diff --git a/definitions/grib2/tigge_short_name.def b/definitions/grib2/tigge_short_name.def deleted file mode 100644 index 42ef5c6ea..000000000 --- a/definitions/grib2/tigge_short_name.def +++ /dev/null @@ -1,44 +0,0 @@ -# Automatically generated by ./tigge_def.pl, do not edit - - '10fgg25' = { parameter = 131071; } - '10fgg15' = { parameter = 131070; } - '10v' = { parameter = 166; } - '10u' = { parameter = 165; } - '10u' = { parameter = 49; } - 'ci' = { parameter = 228001; } - 'cap' = { parameter = 228170; } - 'cape' = { parameter = 59; } - 'gh' = { parameter = 156; } - 'lsm' = { parameter = 172; } - 'msl' = { parameter = 151; } - 'orog' = { parameter = 228002; } - 'sd' = { parameter = 228141; } - 'mx2t6' = { parameter = 121; } - '2d' = { parameter = 168; } - 'pv' = { parameter = 60; } - 'pt' = { parameter = 3; } - 'sf' = { parameter = 228144; } - 'skt' = { parameter = 235; } - 'sm' = { parameter = 228039; } - 'str' = { parameter = 177; } - 'sund' = { parameter = 189; } - 'mn2t6' = { parameter = 122; } - 'q' = { parameter = 133; } - 'ssta' = { parameter = 171034; } - '2t' = { parameter = 167; } - 'tcw' = { parameter = 136; } - 'slhf' = { parameter = 147; } - 'st' = { parameter = 228139; } - 'sshf' = { parameter = 146; } - 'sp' = { parameter = 134; } - 't' = { parameter = 130; } - 'tcc' = { parameter = 228164; } - 'ssr' = { parameter = 176; } - 'tpg10' = { parameter = 131062; } - 'tpg20' = { parameter = 131063; } - 'ttr' = { parameter = 179; } - 'tp' = { parameter = 228228; } - 'u' = { parameter = 131; } - 'v' = { parameter = 132; } - 'wilt' = { parameter = 228171; } - 'default' = { parameter = 99999; } diff --git a/definitions/grib2/units.def b/definitions/grib2/units.def index 3ed4f8a6a..37540142d 100644 --- a/definitions/grib2/units.def +++ b/definitions/grib2/units.def @@ -206,7 +206,7 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#10 metre wind gust since previous post-processing +#Maximum 10 metre wind gust since previous post-processing 'm s**-1' = { discipline = 0 ; parameterCategory = 2 ; @@ -326,6 +326,12 @@ parameterCategory = 3 ; parameterNumber = 18 ; } +#Standard deviation of sub-gridscale orography +'m' = { + discipline = 0 ; + parameterCategory = 3 ; + parameterNumber = 20 ; + } #Anisotropy of sub-gridscale orography 'Numeric' = { discipline = 0 ; @@ -2424,6 +2430,14 @@ scaledValueOfFirstFixedSurface = 26315 ; scaleFactorOfFirstFixedSurface = 2 ; } +#Total sky direct short-wave (solar) radiation at surface +'J m**-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 13 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Surface direct short-wave radiation, clear sky 'J m**-2' = { discipline = 0 ; @@ -2432,6 +2446,13 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Cloud base height +'m' = { + discipline = 0 ; + parameterCategory = 6 ; + parameterNumber = 11 ; + typeOfFirstFixedSurface = 2 ; + } #0 degrees C isothermal level (atm) 'm' = { discipline = 0 ; @@ -2441,7 +2462,7 @@ scaledValueOfFirstFixedSurface = 27315 ; scaleFactorOfFirstFixedSurface = 2 ; } -#10 metre wind gust in the last 3 hours +#Maximum 10 metre wind gust in the last 3 hours 'm s**-1' = { discipline = 0 ; parameterCategory = 2 ; @@ -2523,6 +2544,14 @@ parameterCategory = 3 ; parameterNumber = 23 ; } +#Convective available potential energy shear +'m**2 s**-2' = { + discipline = 0 ; + parameterCategory = 7 ; + parameterNumber = 19 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #Tropopause pressure 'Pa' = { discipline = 0 ; @@ -2746,6 +2775,22 @@ is_chemical_srcsink = 1 ; sourceSinkChemicalPhysicalProcess = 10 ; } +#Surface short-wave (solar) radiation downward clear-sky +'J m**-2' = { + discipline = 0 ; + parameterCategory = 4 ; + parameterNumber = 52 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } +#Surface long-wave (thermal) radiation downward clear-sky +'J m**-2' = { + discipline = 0 ; + parameterCategory = 5 ; + parameterNumber = 8 ; + typeOfFirstFixedSurface = 1 ; + typeOfStatisticalProcessing = 1 ; + } #Convective precipitation 'kg m**-2' = { discipline = 0 ; @@ -2984,7 +3029,7 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } -#Runoff water equivalent +#Runoff water equivalent (surface plus subsurface) 'kg m**-2' = { discipline = 2 ; parameterCategory = 0 ; @@ -4086,6 +4131,14 @@ typeOfFirstFixedSurface = 1 ; typeOfStatisticalProcessing = 1 ; } +#Total column integrated ozone +'DU' = { + discipline = 0 ; + parameterCategory = 14 ; + parameterNumber = 2 ; + typeOfFirstFixedSurface = 1 ; + typeOfSecondFixedSurface = 8 ; + } #2 metre relative humidity '%' = { discipline = 0 ; @@ -4433,6 +4486,18 @@ parameterCategory = 1 ; parameterNumber = 15 ; } +#Cloudy reflectance +'%' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 31 ; + } +#Clear reflectance +'%' = { + discipline = 3 ; + parameterCategory = 1 ; + parameterNumber = 32 ; + } #Scaled radiance 'Numeric' = { discipline = 3 ; @@ -4910,7 +4975,7 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } -#Sea ice temperature +#Vertically averaged sea ice temperature 'K' = { discipline = 10 ; parameterCategory = 2 ; @@ -5066,6 +5131,12 @@ scaledValueOfSecondFixedSurface = missing() ; scaleFactorOfSecondFixedSurface = missing() ; } +#Sea ice temperature +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + } #Sea surface practical salinity 'g kg**-1' = { discipline = 10 ; @@ -5973,7 +6044,7 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } -#Time-mean sea ice temperature +#Time-mean vertically averaged sea ice temperature 'K' = { discipline = 10 ; parameterCategory = 2 ; @@ -6142,6 +6213,13 @@ scaleFactorOfSecondFixedSurface = missing() ; typeOfStatisticalProcessing = 0 ; } +#Time-mean sea ice temperature +'K' = { + discipline = 10 ; + parameterCategory = 2 ; + parameterNumber = 8 ; + typeOfStatisticalProcessing = 0 ; + } #Time-mean sea surface practical salinity 'g kg**-1' = { discipline = 10 ; @@ -7543,12 +7621,54 @@ parameterCategory = 0 ; parameterNumber = 20 ; } +#10 metre wind speed +'m s**-1' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 40 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } +#Altimeter wave height +'m' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 37 ; + } +#Altimeter corrected wave height +'m' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 38 ; + } +#Altimeter range relative correction +'~' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 39 ; + } +#10 metre wind direction +'degrees' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 41 ; + typeOfFirstFixedSurface = 102 ; + scaledValueOfFirstFixedSurface = 10 ; + scaleFactorOfFirstFixedSurface = 0 ; + } #2D wave spectra (single) 'm**2 s radian**-1' = { discipline = 10 ; parameterCategory = 0 ; parameterNumber = 86 ; } +#Wave spectral kurtosis +'dimensionless' = { + discipline = 10 ; + parameterCategory = 0 ; + parameterNumber = 43 ; + } #Benjamin-Feir index 'dimensionless' = { discipline = 10 ; @@ -8985,12 +9105,6 @@ parameterCategory = 14 ; parameterNumber = 0 ; } -#Total column integrated ozone -'DU' = { - discipline = 0 ; - parameterCategory = 14 ; - parameterNumber = 2 ; - } #Base spectrum width 'm s**-1' = { discipline = 0 ; diff --git a/definitions/mars/class.table b/definitions/mars/class.table index b1c171c65..55b321573 100644 --- a/definitions/mars/class.table +++ b/definitions/mars/class.table @@ -45,7 +45,7 @@ 44 gg Greenhouse Gases 45 ml Machine learning 46 d1 Destination Earth -47 o6 Ocean ReAnalysis 6 +47 o6 ECMWF Ocean ReAnalysis version 6 (EORA6) 99 te Test 100 at Austria 101 be Belgium diff --git a/definitions/mars/grib.eefo.gbf.def b/definitions/mars/grib.eefo.gbf.def new file mode 100644 index 000000000..e84a28568 --- /dev/null +++ b/definitions/mars/grib.eefo.gbf.def @@ -0,0 +1,9 @@ +alias mars.number = perturbationNumber; + +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + + diff --git a/definitions/mars/grib.eefo.gwt.def b/definitions/mars/grib.eefo.gwt.def new file mode 100644 index 000000000..e84a28568 --- /dev/null +++ b/definitions/mars/grib.eefo.gwt.def @@ -0,0 +1,9 @@ +alias mars.number = perturbationNumber; + +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + + diff --git a/definitions/mars/grib.eefo.pfc.def b/definitions/mars/grib.eefo.pfc.def new file mode 100644 index 000000000..c1bc2b6bd --- /dev/null +++ b/definitions/mars/grib.eefo.pfc.def @@ -0,0 +1,8 @@ +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + +meta marsQuantile sprintf("%d:%d",quantileValue,totalNumberOfQuantiles); +alias mars.quantile = marsQuantile; diff --git a/definitions/mars/grib.eefo.ppm.def b/definitions/mars/grib.eefo.ppm.def new file mode 100644 index 000000000..a8c09a96e --- /dev/null +++ b/definitions/mars/grib.eefo.ppm.def @@ -0,0 +1,9 @@ +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + +meta marsQuantile sprintf("%d:%d",quantileValue,totalNumberOfQuantiles); +alias mars.quantile = marsQuantile; + diff --git a/definitions/mars/grib.enfo.gbf.def b/definitions/mars/grib.enfo.gbf.def new file mode 100644 index 000000000..e84a28568 --- /dev/null +++ b/definitions/mars/grib.enfo.gbf.def @@ -0,0 +1,9 @@ +alias mars.number = perturbationNumber; + +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + + diff --git a/definitions/mars/grib.enfo.gwt.def b/definitions/mars/grib.enfo.gwt.def new file mode 100644 index 000000000..e84a28568 --- /dev/null +++ b/definitions/mars/grib.enfo.gwt.def @@ -0,0 +1,9 @@ +alias mars.number = perturbationNumber; + +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + + diff --git a/definitions/mars/grib.enfo.pfc.def b/definitions/mars/grib.enfo.pfc.def new file mode 100644 index 000000000..c1bc2b6bd --- /dev/null +++ b/definitions/mars/grib.enfo.pfc.def @@ -0,0 +1,8 @@ +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + +meta marsQuantile sprintf("%d:%d",quantileValue,totalNumberOfQuantiles); +alias mars.quantile = marsQuantile; diff --git a/definitions/mars/grib.enfo.ppm.def b/definitions/mars/grib.enfo.ppm.def new file mode 100644 index 000000000..a8c09a96e --- /dev/null +++ b/definitions/mars/grib.enfo.ppm.def @@ -0,0 +1,9 @@ +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + +meta marsQuantile sprintf("%d:%d",quantileValue,totalNumberOfQuantiles); +alias mars.quantile = marsQuantile; + diff --git a/definitions/mars/grib.ocda.tpa.def b/definitions/mars/grib.ocda.tpa.def index d46a8bd2a..d9c2ce22f 100644 --- a/definitions/mars/grib.ocda.tpa.def +++ b/definitions/mars/grib.ocda.tpa.def @@ -6,3 +6,6 @@ alias mars.time = dataTime; unalias mars.step; alias mars.step = stepRange; +if (defined(perturbationNumber)) { + alias mars.number = perturbationNumber; +} diff --git a/definitions/mars/grib.oper.gbf.def b/definitions/mars/grib.oper.gbf.def new file mode 100644 index 000000000..2797330c8 --- /dev/null +++ b/definitions/mars/grib.oper.gbf.def @@ -0,0 +1,5 @@ +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; diff --git a/definitions/mars/grib.oper.gwt.def b/definitions/mars/grib.oper.gwt.def new file mode 100644 index 000000000..2797330c8 --- /dev/null +++ b/definitions/mars/grib.oper.gwt.def @@ -0,0 +1,5 @@ +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; diff --git a/definitions/mars/grib.oper.pfc.def b/definitions/mars/grib.oper.pfc.def new file mode 100644 index 000000000..a8c09a96e --- /dev/null +++ b/definitions/mars/grib.oper.pfc.def @@ -0,0 +1,9 @@ +alias mars.step = stepRange; + +# We need this because 'postProcessing' is defined later +meta ecpt_model sprintf("%s", postProcessing) : no_copy; +alias mars.model = ecpt_model; + +meta marsQuantile sprintf("%d:%d",quantileValue,totalNumberOfQuantiles); +alias mars.quantile = marsQuantile; + diff --git a/definitions/mars/type.table b/definitions/mars/type.table index 94001b890..4850d9f43 100644 --- a/definitions/mars/type.table +++ b/definitions/mars/type.table @@ -69,3 +69,7 @@ 88 gsd Gridded satellite data 89 ga GFAS analysis 90 gai Gridded analysis input +91 gbf Bias-corrected gridbox +92 pfc Point values +93 ppm Point value metrics +94 gwt Weather types diff --git a/examples/C/bufr_set_keys.sh b/examples/C/bufr_set_keys.sh index 96fd48416..3131463cf 100755 --- a/examples/C/bufr_set_keys.sh +++ b/examples/C/bufr_set_keys.sh @@ -10,37 +10,33 @@ . ./include.ctest.sh - -#Define a common label for all the tmp files +# Define a common label for all the tmp files label="bufr_set_keys_test_c" - -#Define tmp file +REDIRECT=/dev/null fBufrTmp=${label}.tmp.bufr rm -f $fBufrTmp -#We check "syno_multi.bufr". The path is -#hardcoded in the example +# We check "syno_multi.bufr". The path is hard coded in the example f=${data_dir}/bufr/syno_multi.bufr -REDIRECT=/dev/null +set +e +${examples_dir}/c_bufr_set_keys +status=$? +set -e +[ $status -ne 0 ] -# +# Run ${examples_dir}/c_bufr_set_keys $fBufrTmp 2> $REDIRECT > $REDIRECT -#Compare modified to the original +# Compare modified to the original set +e ${tools_dir}/bufr_compare $f $fBufrTmp >$REDIRECT 2> $REDIRECT - -#Check if modified is different -if [ $? -eq 0 ]; then - echo "setting keys produced identical files " >&2 - exit 1 -fi - +status=$? set -e +[ $status -ne 0 ] -#Check if modified has the same number of messages +# Check if modified has the same number of messages [ `${tools_dir}/bufr_count $f` -eq `${tools_dir}/bufr_count ${fBufrTmp}` ] -#Clean up +# Clean up rm -f $fBufrTmp diff --git a/examples/C/get_product_kind.sh b/examples/C/get_product_kind.sh index cd6ff1c5b..609274efc 100755 --- a/examples/C/get_product_kind.sh +++ b/examples/C/get_product_kind.sh @@ -15,6 +15,12 @@ fTmp=${label}.tmp fOut=${label}.tmp.out fRef=${label}.tmp.ref +set +e +${examples_dir}/c_get_product_kind +status=$? +set -e +[ $status -eq 1 ] + # Create a file containing one GRIB and three BUFR messages cat ${data_dir}/sample.grib2 ${data_dir}/bufr/syno_multi.bufr >$fTmp diff --git a/examples/C/grib_nearest_multiple.sh b/examples/C/grib_nearest_multiple.sh index d203cfe06..ee43c5881 100755 --- a/examples/C/grib_nearest_multiple.sh +++ b/examples/C/grib_nearest_multiple.sh @@ -15,6 +15,12 @@ temp1=$label.temp1.$$ temp2=$label.temp2.$$ tempRef=$label.ref.$$ +set +e +${examples_dir}/c_grib_nearest_multiple 2>/dev/null +status=$? +set -e +[ $status -eq 1 ] + cat > $temp1 < /dev/null +${examples_dir}/eccodes_f_grib_get_keys diff --git a/examples/F90/grib_keys_iterator.f90 b/examples/F90/grib_keys_iterator.f90 index ca00157b4..dcafe49c3 100644 --- a/examples/F90/grib_keys_iterator.f90 +++ b/examples/F90/grib_keys_iterator.f90 @@ -11,8 +11,6 @@ ! How to use keys_iterator to get all the available ! keys in a GRIB message. ! -! -! program keys_iterator use eccodes implicit none @@ -26,35 +24,32 @@ program keys_iterator call codes_open_file(ifile, & '../../data/regular_latlon_surface.grib1', 'r') - ! Loop on all the messages in a file. - - call codes_grib_new_from_file(ifile, igrib, iret) + ! Loop on all the messages in a file grib_count = 0 - do while (iret /= CODES_END_OF_FILE) + do while (.true.) + call codes_grib_new_from_file(ifile, igrib, iret) + if (iret == CODES_END_OF_FILE) exit grib_count = grib_count + 1 write (*, *) '-- GRIB N. ', grib_count, ' --' - ! valid name_spaces are ls and mars + ! Choose a namespace. E.g. "ls", "time", "parameter", "geography", "statistics" name_space = 'ls' call codes_keys_iterator_new(igrib, kiter, name_space) do call codes_keys_iterator_next(kiter, iret) - if (iret .ne. CODES_SUCCESS) exit !terminate the loop call codes_keys_iterator_get_name(kiter, key) call codes_get(igrib, trim(key), value) all1 = trim(key)//' = '//trim(value) write (*, *) trim(all1) - end do call codes_keys_iterator_delete(kiter) call codes_release(igrib) - call codes_grib_new_from_file(ifile, igrib, iret) end do call codes_close_file(ifile) diff --git a/examples/F90/grib_multi.f90 b/examples/F90/grib_multi.f90 index d486a8eb7..c18b005fe 100644 --- a/examples/F90/grib_multi.f90 +++ b/examples/F90/grib_multi.f90 @@ -10,36 +10,35 @@ ! Description: How to decode GRIB2 multi-field messages. ! Try to turn multi support on and off to ! see the difference. Default is OFF. -! For all the tools default is multi support ON. +! For all the tools (e.g., grib_ls etc) multi support is ON. ! program multi use eccodes implicit none - integer :: iret - integer(kind=4) :: step - integer :: ifile, igrib + integer :: iret, counter + integer(kind=4) :: step + integer :: ifile, igrib call codes_open_file(ifile, '../../data/multi_created.grib2', 'r') - ! turn on support for multi-field messages */ + ! Turn off support for multi-field messages + call codes_grib_multi_support_off() + + ! Turn on support for multi-field messages call codes_grib_multi_support_on() - ! turn off support for multi-field messages */ - !call codes_grib_multi_support_off() - - call codes_grib_new_from_file(ifile, igrib, iret) - ! Loop on all the messages in a file. - + ! Loop on all the messages in a file write (*, *) 'step' - do while (iret /= CODES_END_OF_FILE) + do while (.true.) + call codes_grib_new_from_file(ifile, igrib, iret) + if (iret == CODES_END_OF_FILE) exit + counter = counter + 1 call codes_get(igrib, 'step', step) write (*, '(i3)') step - - call codes_grib_new_from_file(ifile, igrib, iret) - end do call codes_close_file(ifile) + !write(*,*) 'Message count =', counter end program multi diff --git a/examples/F90/grib_multi.sh b/examples/F90/grib_multi.sh index b90c94b5a..0ba6ed54b 100755 --- a/examples/F90/grib_multi.sh +++ b/examples/F90/grib_multi.sh @@ -9,6 +9,8 @@ . ./include.ctest.sh -${examples_dir}/eccodes_f_grib_multi > multi.out -diff multi.out ${data_dir}/multi.ok -rm -f multi.out +temp='temp.eccodes_f_grib_multi.txt' + +${examples_dir}/eccodes_f_grib_multi > $temp +diff $temp ${data_dir}/multi.ok +rm -f $temp diff --git a/examples/F90/grib_precision.f90 b/examples/F90/grib_precision.f90 index 93ee42519..165b805fd 100644 --- a/examples/F90/grib_precision.f90 +++ b/examples/F90/grib_precision.f90 @@ -41,7 +41,7 @@ program precision allocate (values1(size1), stat=iret) allocate (values2(size1), stat=iret) - ! get data values before changing the packing parameters*/ + ! get data values before changing the packing parameters call codes_get(igrib, "values", values1) ! setting decimal precision=2 means that 2 decimal digits diff --git a/examples/F90/grib_read_from_file.f90 b/examples/F90/grib_read_from_file.f90 index 7d38c319d..eaa2c1c6e 100644 --- a/examples/F90/grib_read_from_file.f90 +++ b/examples/F90/grib_read_from_file.f90 @@ -42,16 +42,16 @@ contains call codes_open_file(ifile, input_grib_file, 'r') len1 = size - call codes_read_from_file(ifile, buffer, len1, iret) - do while (iret == CODES_SUCCESS) + do while (.true.) + call codes_read_from_file(ifile, buffer, len1, iret) + if (iret /= CODES_SUCCESS) exit count1 = count1 + 1 if (len1 /= message_lengths(count1)) then write (*, '(a,i3,a,i8,a,i8)') 'Error: Message #', count1, ' length=', len1, '. Expected=', message_lengths(count1) stop end if len1 = size - call codes_read_from_file(ifile, buffer, len1, iret) end do if (iret /= CODES_END_OF_FILE) then diff --git a/examples/F90/grib_samples.f90 b/examples/F90/grib_samples.f90 index 0974b8f5c..6a818a080 100644 --- a/examples/F90/grib_samples.f90 +++ b/examples/F90/grib_samples.f90 @@ -9,7 +9,6 @@ ! ! Description: How to create a new GRIB message from a sample. ! -! program sample use eccodes implicit none @@ -29,7 +28,7 @@ program sample indicatorOfParameter = 61 decimalPrecision = 2 - ! a new GRIB message is loaded from an existing sample. + ! A new GRIB message is loaded from an existing sample. ! Samples are searched in a default sample path (use codes_info ! to see where that is). The default sample path can be changed by ! setting the environment variable ECCODES_SAMPLES_PATH diff --git a/examples/F90/grib_set_keys.f90 b/examples/F90/grib_set_keys.f90 index bbcd5eabe..dcc4aceee 100644 --- a/examples/F90/grib_set_keys.f90 +++ b/examples/F90/grib_set_keys.f90 @@ -30,7 +30,7 @@ program set call codes_set(igrib, 'dataDate', date1) call codes_set(igrib, 'type', marsType) - ! set centre as a integer */ + ! set centre as a integer call codes_set(igrib, 'centre', centre) ! check if it is correct in the actual GRIB message diff --git a/examples/F90/iterator_fortran.f90 b/examples/F90/iterator_fortran.f90 index 10aafaba6..0dcc10b5d 100644 --- a/examples/F90/iterator_fortran.f90 +++ b/examples/F90/iterator_fortran.f90 @@ -26,10 +26,11 @@ program iterator call codes_open_file(ifile, & '../../data/regular_latlon_surface_constant.grib1', 'R') - ! Loop on all the messages in a file. - call codes_grib_new_from_file(ifile, igrib, iret) + ! Loop on all the messages in a file + LOOP: DO WHILE (.true.) + call codes_grib_new_from_file(ifile, igrib, iret) + if (iret == CODES_END_OF_FILE) exit LOOP - LOOP: DO WHILE (iret /= CODES_END_OF_FILE) ! get as a real8 call codes_get(igrib, & 'missingValue', missingValue) @@ -61,8 +62,6 @@ program iterator call grib_iterator_delete(iter) call codes_release(igrib) - call codes_grib_new_from_file(ifile, igrib, iret) - end do LOOP call codes_close_file(ifile) diff --git a/examples/F90/multi_fortran.f90 b/examples/F90/multi_fortran.f90 index 41515fec9..423fb1fb1 100644 --- a/examples/F90/multi_fortran.f90 +++ b/examples/F90/multi_fortran.f90 @@ -17,23 +17,25 @@ program multi use eccodes implicit none - integer :: iret + integer :: iret integer(kind=4) :: parameterCategory, parameterNumber, discipline - integer :: ifile, igrib + integer :: ifile, igrib, counter call codes_open_file(ifile, '../../data/multi.grib2', 'r') - ! Turn on support for multi-field messages */ - call codes_grib_multi_support_on() + ! Turn off support for multi-field messages + call codes_grib_multi_support_off() - ! Turn off support for multi-field messages */ - !call codes_grib_multi_support_off() + ! Turn on support for multi-field messages + call codes_grib_multi_support_on() call codes_grib_new_from_file(ifile, igrib) ! Loop on all the messages in a file. do while (igrib .ne. -1) + counter = counter + 1 + ! get as a integer*4 call codes_get(igrib, 'discipline', discipline) write (*, *) 'discipline=', discipline @@ -63,4 +65,6 @@ program multi end do call codes_close_file(ifile) + write(*,*) 'Message count =',counter + end program multi diff --git a/examples/F90/precision_fortran.f90 b/examples/F90/precision_fortran.f90 index 1a66f7cd8..33429c481 100644 --- a/examples/F90/precision_fortran.f90 +++ b/examples/F90/precision_fortran.f90 @@ -40,7 +40,7 @@ program precision allocate (values1(size), stat=iret) allocate (values2(size), stat=iret) - ! get data values before changing the packing parameters*/ + ! get data values before changing the packing parameters call codes_get(igrib, "values", values1) ! setting decimal precision=2 means that 2 decimal digits diff --git a/examples/F90/set_fortran.f90 b/examples/F90/set_fortran.f90 index 7e3f4ad2f..582677b5b 100644 --- a/examples/F90/set_fortran.f90 +++ b/examples/F90/set_fortran.f90 @@ -33,7 +33,7 @@ program set ! igrib is the grib id to be used in subsequent calls call codes_grib_new_from_file(infile, igrib) - ! set centre as a long */ + ! set centre as a long centre = 80 call codes_set(igrib, 'centre', centre) diff --git a/fortran/eccodes_f90_int.f90 b/fortran/eccodes_f90_int.f90 index 5202aa4f7..83caa7881 100644 --- a/fortran/eccodes_f90_int.f90 +++ b/fortran/eccodes_f90_int.f90 @@ -16,7 +16,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status CODES_SUCCESS if OK, integer value on error interface codes_index_get diff --git a/fortran/eccodes_f90_long_int.f90 b/fortran/eccodes_f90_long_int.f90 index 5399b54be..c124bfae9 100644 --- a/fortran/eccodes_f90_long_int.f90 +++ b/fortran/eccodes_f90_long_int.f90 @@ -16,7 +16,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status CODES_SUCCESS if OK, integer value on error interface codes_index_get diff --git a/fortran/eccodes_f90_tail.f90 b/fortran/eccodes_f90_tail.f90 index 7dfdd952a..faf4e7e36 100644 --- a/fortran/eccodes_f90_tail.f90 +++ b/fortran/eccodes_f90_tail.f90 @@ -121,7 +121,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status CODES_SUCCESS if OK, integer value on error subroutine codes_index_get_int(indexid, key, values, status) @@ -143,7 +143,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status CODES_SUCCESS if OK, integer value on error subroutine codes_index_get_long(indexid, key, values, status) @@ -165,7 +165,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status CODES_SUCCESS if OK, integer value on error subroutine codes_index_get_real8(indexid, key, values, status) @@ -189,7 +189,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status CODES_SUCCESS if OK, integer value on error subroutine codes_index_get_string(indexid, key, values, status) diff --git a/fortran/grib_f90_int.f90 b/fortran/grib_f90_int.f90 index d474cfa8e..d5fdb45f3 100644 --- a/fortran/grib_f90_int.f90 +++ b/fortran/grib_f90_int.f90 @@ -16,7 +16,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status GRIB_SUCCESS if OK, integer value on error interface grib_index_get diff --git a/fortran/grib_f90_long_int.f90 b/fortran/grib_f90_long_int.f90 index 9cd98a352..1d7e53afb 100644 --- a/fortran/grib_f90_long_int.f90 +++ b/fortran/grib_f90_long_int.f90 @@ -16,7 +16,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status GRIB_SUCCESS if OK, integer value on error interface grib_index_get diff --git a/fortran/grib_f90_tail.f90 b/fortran/grib_f90_tail.f90 index 0f8b19103..600e621a5 100644 --- a/fortran/grib_f90_tail.f90 +++ b/fortran/grib_f90_tail.f90 @@ -154,7 +154,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid ID of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status GRIB_SUCCESS if OK, integer value on error subroutine grib_index_get_int(indexid, key, values, status) @@ -184,7 +184,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid ID of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status GRIB_SUCCESS if OK, integer value on error subroutine grib_index_get_long(indexid, key, values, status) @@ -214,7 +214,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status GRIB_SUCCESS if OK, integer value on error subroutine grib_index_get_real8(indexid, key, values, status) @@ -246,7 +246,7 @@ !> \b Examples: \ref grib_index.f90 "grib_index.f90" !> !> @param indexid id of an index created from a file. The index must have been created with the key in argument. - !> @param key key for wich the values are returned + !> @param key key for which the values are returned !> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values. !> @param status GRIB_SUCCESS if OK, integer value on error subroutine grib_index_get_string(indexid, key, values, status) diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.c index 5fb0e97b2..751f28460 100644 --- a/fortran/grib_fortran.c +++ b/fortran/grib_fortran.c @@ -164,7 +164,7 @@ static l_grib_handle* handle_set = NULL; static l_grib_index* index_set = NULL; static l_grib_multi_handle* multi_handle_set = NULL; static l_grib_file* file_set = NULL; -static l_grib_iterator* iterator_set = NULL; +/*static l_grib_iterator* iterator_set = NULL;*/ static l_grib_keys_iterator* keys_iterator_set = NULL; static l_bufr_keys_iterator* bufr_keys_iterator_set = NULL; static grib_oarray* binary_messages = NULL; @@ -474,55 +474,6 @@ static void push_multi_handle(grib_multi_handle *h,int *gid) return; } -static int _push_iterator(grib_iterator *i) -{ - l_grib_iterator* current = iterator_set; - l_grib_iterator* previous = iterator_set; - l_grib_iterator* the_new = NULL; - int myindex = 1; - - if(!iterator_set){ - iterator_set = (l_grib_iterator*)malloc(sizeof(l_grib_iterator)); - Assert(iterator_set); - iterator_set->id = myindex; - iterator_set->i = i; - iterator_set->next = NULL; - return myindex; - } - - while(current){ - if(current->id < 0){ - current->id = -(current->id); - current->i = i; - return current->id; - } - else{ - myindex++; - previous = current; - current = current->next; - } - } - - the_new = (l_grib_iterator*)malloc(sizeof(l_grib_iterator)); - Assert(the_new); - the_new->id = myindex; - the_new->i = i; - the_new->next = current; - previous->next = the_new; - - return myindex; -} - -static int push_iterator(grib_iterator *i) -{ - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init); - GRIB_MUTEX_LOCK(&iterator_mutex); - ret=_push_iterator(i); - GRIB_MUTEX_UNLOCK(&iterator_mutex); - return ret; -} - static int _push_keys_iterator(grib_keys_iterator *i) { l_grib_keys_iterator* current = keys_iterator_set; @@ -700,27 +651,6 @@ static FILE* get_file(int file_id) return NULL; } -static grib_iterator* _get_iterator(int iterator_id) -{ - l_grib_iterator* current = iterator_set; - - while(current){ - if(current->id == iterator_id) return current->i; - current = current->next; - } - return NULL; -} - -static grib_iterator* get_iterator(int iterator_id) -{ - grib_iterator* i=NULL; - GRIB_MUTEX_INIT_ONCE(&once,&init); - GRIB_MUTEX_LOCK(&iterator_mutex); - i=_get_iterator(iterator_id); - GRIB_MUTEX_UNLOCK(&iterator_mutex); - return i; -} - static grib_keys_iterator* _get_keys_iterator(int keys_iterator_id) { l_grib_keys_iterator* current = keys_iterator_set; @@ -865,30 +795,6 @@ static int clear_multi_handle(int multi_handle_id) return ret; } -static int _clear_iterator(int iterator_id) -{ - l_grib_iterator* current = iterator_set; - - while(current){ - if(current->id == iterator_id){ - current->id = -(current->id); - return grib_iterator_delete(current->i); - } - current = current->next; - } - return GRIB_INVALID_ITERATOR; -} - -static int clear_iterator(int iterator_id) -{ - int ret=0; - GRIB_MUTEX_INIT_ONCE(&once,&init); - GRIB_MUTEX_LOCK(&iterator_mutex); - ret=_clear_iterator(iterator_id); - GRIB_MUTEX_UNLOCK(&iterator_mutex); - return ret; -} - static int _clear_keys_iterator(int keys_iterator_id) { l_grib_keys_iterator* current = keys_iterator_set; @@ -1143,8 +1049,96 @@ int grib_f_multi_support_off(){ return grib_f_multi_support_off_(); } - /*****************************************************************************/ +#ifdef FORTRAN_GEOITERATOR_SUPPORT +static int _push_iterator(grib_iterator *i) +{ + l_grib_iterator* current = iterator_set; + l_grib_iterator* previous = iterator_set; + l_grib_iterator* the_new = NULL; + int myindex = 1; + + if(!iterator_set){ + iterator_set = (l_grib_iterator*)malloc(sizeof(l_grib_iterator)); + Assert(iterator_set); + iterator_set->id = myindex; + iterator_set->i = i; + iterator_set->next = NULL; + return myindex; + } + + while(current){ + if(current->id < 0){ + current->id = -(current->id); + current->i = i; + return current->id; + } + else{ + myindex++; + previous = current; + current = current->next; + } + } + + the_new = (l_grib_iterator*)malloc(sizeof(l_grib_iterator)); + Assert(the_new); + the_new->id = myindex; + the_new->i = i; + the_new->next = current; + previous->next = the_new; + + return myindex; +} +static int push_iterator(grib_iterator *i) +{ + int ret=0; + GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_LOCK(&iterator_mutex); + ret=_push_iterator(i); + GRIB_MUTEX_UNLOCK(&iterator_mutex); + return ret; +} +static grib_iterator* _get_iterator(int iterator_id) +{ + l_grib_iterator* current = iterator_set; + + while(current){ + if(current->id == iterator_id) return current->i; + current = current->next; + } + return NULL; +} +static grib_iterator* get_iterator(int iterator_id) +{ + grib_iterator* i=NULL; + GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_LOCK(&iterator_mutex); + i=_get_iterator(iterator_id); + GRIB_MUTEX_UNLOCK(&iterator_mutex); + return i; +} +static int _clear_iterator(int iterator_id) +{ + l_grib_iterator* current = iterator_set; + + while(current){ + if(current->id == iterator_id){ + current->id = -(current->id); + return grib_iterator_delete(current->i); + } + current = current->next; + } + return GRIB_INVALID_ITERATOR; +} +static int clear_iterator(int iterator_id) +{ + int ret=0; + GRIB_MUTEX_INIT_ONCE(&once,&init); + GRIB_MUTEX_LOCK(&iterator_mutex); + ret=_clear_iterator(iterator_id); + GRIB_MUTEX_UNLOCK(&iterator_mutex); + return ret; +} static int _grib_f_iterator_new_(int* gid,int* iterid,int* mode) { int err=0; grib_handle* h; @@ -1176,32 +1170,29 @@ int grib_f_iterator_new__(int* gid,int* iterid,int* mode) { int grib_f_iterator_new(int* gid,int* iterid,int* mode) { return grib_f_iterator_new_(gid,iterid,mode); } - /*****************************************************************************/ int grib_f_iterator_next_(int* iterid,double* lat,double* lon,double* value) { grib_iterator* iter=get_iterator(*iterid); if (!iter) return GRIB_INVALID_ITERATOR; return grib_iterator_next(iter,lat,lon,value); } - int grib_f_iterator_next__(int* iterid,double* lat,double* lon,double* value) { return grib_f_iterator_next_(iterid,lat,lon,value); } int grib_f_iterator_next(int* iterid,double* lat,double* lon,double* value) { return grib_f_iterator_next_(iterid,lat,lon,value); } - /*****************************************************************************/ int grib_f_iterator_delete_(int* iterid) { return clear_iterator(*iterid); } - int grib_f_iterator_delete__(int* iterid) { return grib_f_iterator_delete_(iterid); } int grib_f_iterator_delete(int* iterid) { return grib_f_iterator_delete_(iterid); } +#endif /*FORTRAN_GEOITERATOR_SUPPORT*/ /*****************************************************************************/ static int _grib_f_keys_iterator_new_(int* gid,int* iterid,char* name_space,int len) { @@ -1230,7 +1221,6 @@ int grib_f_keys_iterator_new_(int* gid,int* iterid,char* name_space,int len) { GRIB_MUTEX_UNLOCK(&keys_iterator_mutex) return ret; } - int grib_f_keys_iterator_new__(int* gid,int* iterid,char* name_space,int len) { return grib_f_keys_iterator_new_(gid,iterid,name_space,len); } @@ -1405,7 +1395,7 @@ int grib_f_keys_iterator_rewind(int* kiter) { return grib_f_keys_iterator_rewind_(kiter); } -/*BUFR keys iterator*/ +/* BUFR keys iterator */ /*****************************************************************************/ static int _codes_f_bufr_keys_iterator_new_(int* gid,int* iterid) { int err=0; @@ -1503,7 +1493,6 @@ int codes_f_bufr_keys_iterator_delete(int* iterid) { return codes_f_bufr_keys_iterator_delete_(iterid); } - /*****************************************************************************/ int grib_f_new_from_message_(int* gid, void* buffer , size_t* bufsize){ grib_handle *h = NULL; @@ -2129,11 +2118,12 @@ static void do_the_dump(grib_handle* h) | GRIB_DUMP_FLAG_READ_ONLY | GRIB_DUMP_FLAG_ALIASES | GRIB_DUMP_FLAG_TYPE; - grib_dump_content(h,stdout,"debug", dump_flags, NULL); + grib_dump_content(h,stdout, "debug", dump_flags, NULL); } else { - grib_dump_content(h,stdout,"wmo",0,NULL); + const int dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTET | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + grib_dump_content(h,stdout, "wmo", dump_flags, NULL); } } int grib_f_dump_(int* gid){ diff --git a/fortran/grib_fortran_prototypes.h b/fortran/grib_fortran_prototypes.h index 32920c521..f0267cc79 100644 --- a/fortran/grib_fortran_prototypes.h +++ b/fortran/grib_fortran_prototypes.h @@ -40,16 +40,8 @@ int grib_f_multi_support_on(void); int grib_f_multi_support_off_(void); int grib_f_multi_support_off__(void); int grib_f_multi_support_off(void); -int grib_f_iterator_new_(int *gid, int *iterid, int *mode); -int grib_f_iterator_new__(int *gid, int *iterid, int *mode); -int grib_f_iterator_new(int *gid, int *iterid, int *mode); -int grib_f_iterator_next_(int *iterid, double *lat, double *lon, double *value); -int grib_f_iterator_next__(int *iterid, double *lat, double *lon, double *value); -int grib_f_iterator_next(int *iterid, double *lat, double *lon, double *value); -int grib_f_iterator_delete_(int *iterid); -int grib_f_iterator_delete__(int *iterid); -int grib_f_iterator_delete(int *iterid); +/* GRIB keys iterator */ int grib_f_keys_iterator_new_(int *gid, int *iterid, char *name_space, int len); int grib_f_keys_iterator_new__(int *gid, int *iterid, char *name_space, int len); int grib_f_keys_iterator_new(int *gid, int *iterid, char *name_space, int len); @@ -59,8 +51,14 @@ int grib_f_keys_iterator_next(int *iterid); int grib_f_keys_iterator_delete_(int *iterid); int grib_f_keys_iterator_delete__(int *iterid); int grib_f_keys_iterator_delete(int *iterid); +int grib_f_keys_iterator_get_name_(int *iterid, char *name, int len); +int grib_f_keys_iterator_get_name__(int *kiter, char *name, int len); +int grib_f_keys_iterator_get_name(int *kiter, char *name, int len); +int grib_f_keys_iterator_rewind_(int *kiter); +int grib_f_keys_iterator_rewind__(int *kiter); +int grib_f_keys_iterator_rewind(int *kiter); -/*BUFR keys iterator*/ +/* BUFR keys iterator */ int codes_f_bufr_keys_iterator_new_(int *gid, int *iterid); int codes_f_bufr_keys_iterator_new__(int *gid, int *iterid); int codes_f_bufr_keys_iterator_new(int *gid, int *iterid); @@ -101,12 +99,6 @@ int grib_f_skip_read_only(int *iterid); int grib_f_skip_function_(int *iterid); int grib_f_skip_function__(int *iterid); int grib_f_skip_function(int *iterid); -int grib_f_keys_iterator_get_name_(int *iterid, char *name, int len); -int grib_f_keys_iterator_get_name__(int *kiter, char *name, int len); -int grib_f_keys_iterator_get_name(int *kiter, char *name, int len); -int grib_f_keys_iterator_rewind_(int *kiter); -int grib_f_keys_iterator_rewind__(int *kiter); -int grib_f_keys_iterator_rewind(int *kiter); int grib_f_new_from_message_(int *gid, void *buffer, size_t *bufsize); int grib_f_new_from_message__(int *gid, void *buffer, size_t *bufsize); int grib_f_new_from_message(int *gid, void *buffer, size_t *bufsize); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9b27ae271..fe6ee628f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -35,7 +35,6 @@ list( APPEND eccodes_src_files action_class_set.cc action_class_set_sarray.cc action_class_set_darray.cc - action_class_set_iarray.cc action_class_noop.cc action_class_write.cc action_class_print.cc @@ -152,6 +151,7 @@ list( APPEND eccodes_src_files grib_accessor_class_padtoeven.cc grib_accessor_class_padtomultiple.cc grib_accessor_class_section_padding.cc + grib_accessor_class_packing_type.cc grib_accessor_class_section_pointer.cc grib_accessor_class_position.cc grib_accessor_class_signed.cc @@ -183,7 +183,6 @@ list( APPEND eccodes_src_files grib_accessor_class_data_g1shsimple_packing.cc grib_accessor_class_data_shsimple_packing.cc grib_accessor_class_data_dummy_field.cc - grib_2order_packer_simple.cc grib_accessor_class_variable.cc grib_accessor_class_second_order_bits_per_value.cc grib_accessor_class_data_g2simple_packing.cc @@ -211,7 +210,6 @@ list( APPEND eccodes_src_files grib_accessor_class_data_complex_packing.cc grib_accessor_class_data_g1complex_packing.cc grib_accessor_class_gds_not_present_bitmap.cc - grib_accessor_class_data_apply_gdsnotpresent.cc grib_accessor_class_gds_is_present.cc grib_accessor_class_select_step_template.cc grib_accessor_class_local_definition.cc @@ -318,6 +316,7 @@ list( APPEND eccodes_src_files grib_nearest.cc grib_nearest_class.cc grib_nearest_class_gen.cc + grib_nearest_class_healpix.cc grib_nearest_class_regular.cc grib_nearest_class_reduced.cc grib_nearest_class_latlon_reduced.cc @@ -339,6 +338,7 @@ list( APPEND eccodes_src_files grib_iterator_class_latlon.cc grib_iterator_class_regular.cc grib_iterator_class_space_view.cc + grib_iterator_class_healpix.cc grib_expression.cc codes_util.cc grib_util.cc @@ -359,15 +359,7 @@ list( APPEND eccodes_src_files grib_yacc.h md5.h md5.cc - grib_accessor_class_int16.cc - grib_accessor_class_int16_little_endian.cc - grib_accessor_class_int32.cc - grib_accessor_class_int32_little_endian.cc - grib_accessor_class_int64.cc - grib_accessor_class_int64_little_endian.cc - grib_accessor_class_int8.cc grib_accessor_class_uint16.cc - grib_accessor_class_uint16_little_endian.cc grib_accessor_class_uint32.cc grib_accessor_class_uint32_little_endian.cc grib_accessor_class_uint64.cc diff --git a/src/accessor_class_hierarchy.txt b/src/accessor_class_hierarchy.txt index 97f43b727..2fa53b858 100644 --- a/src/accessor_class_hierarchy.txt +++ b/src/accessor_class_hierarchy.txt @@ -46,7 +46,6 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |---grib_accessor_class_data_apply_bitmap |---grib_accessor_class_data_apply_boustrophedonic |---grib_accessor_class_data_apply_boustrophedonic_bitmap - |---grib_accessor_class_data_apply_gdsnotpresent |---grib_accessor_class_data_secondary_bitmap |-----grib_accessor_class_data_g1secondary_bitmap |-----grib_accessor_class_data_g2secondary_bitmap @@ -90,13 +89,6 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |---grib_accessor_class_hash_array |---grib_accessor_class_headers_only |---grib_accessor_class_ifs_param - |---grib_accessor_class_int16 - |---grib_accessor_class_int16_little_endian - |---grib_accessor_class_int32 - |---grib_accessor_class_int32_little_endian - |---grib_accessor_class_int64 - |---grib_accessor_class_int64_little_endian - |---grib_accessor_class_int8 |---grib_accessor_class_iterator |---grib_accessor_class_label |---grib_accessor_class_long @@ -178,7 +170,6 @@ Generated by src/make_accessor_class_hierarchy_dirs.sh |---grib_accessor_class_to_string |---grib_accessor_class_transient_darray |---grib_accessor_class_uint16 - |---grib_accessor_class_uint16_little_endian |---grib_accessor_class_uint32 |---grib_accessor_class_uint32_little_endian |---grib_accessor_class_uint64 diff --git a/src/action_class_hierarchy.txt b/src/action_class_hierarchy.txt index 8391f6c6e..2074b2c20 100644 --- a/src/action_class_hierarchy.txt +++ b/src/action_class_hierarchy.txt @@ -23,7 +23,6 @@ Action Class Hierarchy |---action_class_template |-action_class_set |-action_class_set_darray - |-action_class_set_iarray |-action_class_set_missing |-action_class_set_sarray |-action_class_when diff --git a/src/action_class_modify.cc b/src/action_class_modify.cc index 9a56fcf4b..c379d7300 100644 --- a/src/action_class_modify.cc +++ b/src/action_class_modify.cc @@ -77,9 +77,7 @@ static void init_class(grib_action_class* c) } /* END_CLASS_IMP */ -grib_action* grib_action_create_modify(grib_context* context, - const char* name, - long flags) +grib_action* grib_action_create_modify(grib_context* context, const char* name, long flags) { grib_action_modify* a; grib_action_class* c = grib_action_class_modify; @@ -110,11 +108,13 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) ga = grib_find_accessor(p->h, a->name); - if (ga) + if (ga) { ga->flags = a->flags; - + } else { - grib_context_log(act->context, GRIB_LOG_DEBUG, "action_class_modify: create_accessor_buffer : No accessor named %s to modify.", a->name); + grib_context_log(act->context, GRIB_LOG_ERROR, "action_class_modify: %s: No accessor named %s to modify", + __func__, a->name); + return GRIB_INTERNAL_ERROR; } return GRIB_SUCCESS; } diff --git a/src/action_class_write.cc b/src/action_class_write.cc index a8c010ed3..6b18a90d6 100644 --- a/src/action_class_write.cc +++ b/src/action_class_write.cc @@ -8,9 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * Enrico Fucile * - ***************************************************************************/ #include "grib_api_internal.h" /* This is used by make_class.pl @@ -114,7 +111,7 @@ static int execute(grib_action* act, grib_handle* h) grib_file* of = NULL; if ((err = grib_get_message(h, &buffer, &size)) != GRIB_SUCCESS) { - grib_context_log(act->context, GRIB_LOG_ERROR, "unable to get message\n"); + grib_context_log(act->context, GRIB_LOG_ERROR, "unable to get message"); return err; } @@ -141,21 +138,22 @@ static int execute(grib_action* act, grib_handle* h) of = grib_file_open(filename, "w", &err); if (!of || !of->handle) { - grib_context_log(act->context, GRIB_LOG_ERROR, "unable to open file %s\n", filename); + grib_context_log(act->context, GRIB_LOG_ERROR, "Unable to open file '%s' for %s", + filename, (a->append ? "appending":"writing")); return GRIB_IO_PROBLEM; } if (h->gts_header) { if (fwrite(h->gts_header, 1, h->gts_header_len, of->handle) != h->gts_header_len) { grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing GTS header to %s", filename); + "Error writing GTS header to '%s'", filename); return GRIB_IO_PROBLEM; } } if (fwrite(buffer, 1, size, of->handle) != size) { grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), - "Error writing to %s", filename); + "Error writing to '%s'", filename); return GRIB_IO_PROBLEM; } @@ -186,7 +184,7 @@ static int execute(grib_action* act, grib_handle* h) grib_file_close(filename, 0, &err); if (err != GRIB_SUCCESS) { - grib_context_log(act->context, GRIB_LOG_ERROR, "unable to write message\n"); + grib_context_log(act->context, GRIB_LOG_ERROR, "Unable to write message"); return err; } diff --git a/src/action_class_set_iarray.cc b/src/deprecated/action_class_set_iarray.cc similarity index 100% rename from src/action_class_set_iarray.cc rename to src/deprecated/action_class_set_iarray.cc diff --git a/src/grib_2order_packer_simple.cc b/src/deprecated/grib_2order_packer_simple.cc similarity index 100% rename from src/grib_2order_packer_simple.cc rename to src/deprecated/grib_2order_packer_simple.cc diff --git a/src/grib_accessor_class_data_apply_gdsnotpresent.cc b/src/deprecated/grib_accessor_class_data_apply_gdsnotpresent.cc similarity index 100% rename from src/grib_accessor_class_data_apply_gdsnotpresent.cc rename to src/deprecated/grib_accessor_class_data_apply_gdsnotpresent.cc diff --git a/src/grib_accessor_class_int16.cc b/src/deprecated/grib_accessor_class_int16.cc similarity index 100% rename from src/grib_accessor_class_int16.cc rename to src/deprecated/grib_accessor_class_int16.cc diff --git a/src/grib_accessor_class_int16_little_endian.cc b/src/deprecated/grib_accessor_class_int16_little_endian.cc similarity index 100% rename from src/grib_accessor_class_int16_little_endian.cc rename to src/deprecated/grib_accessor_class_int16_little_endian.cc diff --git a/src/grib_accessor_class_int32.cc b/src/deprecated/grib_accessor_class_int32.cc similarity index 100% rename from src/grib_accessor_class_int32.cc rename to src/deprecated/grib_accessor_class_int32.cc diff --git a/src/grib_accessor_class_int32_little_endian.cc b/src/deprecated/grib_accessor_class_int32_little_endian.cc similarity index 100% rename from src/grib_accessor_class_int32_little_endian.cc rename to src/deprecated/grib_accessor_class_int32_little_endian.cc diff --git a/src/grib_accessor_class_int64.cc b/src/deprecated/grib_accessor_class_int64.cc similarity index 100% rename from src/grib_accessor_class_int64.cc rename to src/deprecated/grib_accessor_class_int64.cc diff --git a/src/grib_accessor_class_int64_little_endian.cc b/src/deprecated/grib_accessor_class_int64_little_endian.cc similarity index 100% rename from src/grib_accessor_class_int64_little_endian.cc rename to src/deprecated/grib_accessor_class_int64_little_endian.cc diff --git a/src/grib_accessor_class_int8.cc b/src/deprecated/grib_accessor_class_int8.cc similarity index 100% rename from src/grib_accessor_class_int8.cc rename to src/deprecated/grib_accessor_class_int8.cc diff --git a/src/grib_accessor_class_uint16_little_endian.cc b/src/deprecated/grib_accessor_class_uint16_little_endian.cc similarity index 100% rename from src/grib_accessor_class_uint16_little_endian.cc rename to src/deprecated/grib_accessor_class_uint16_little_endian.cc diff --git a/src/eccodes.h b/src/eccodes.h index b5d42c955..d890438f2 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -606,9 +606,9 @@ int codes_grib_get_data(const codes_handle* h, double* lats, double* lons, doubl * Get the next value from a geoiterator. * * @param i : the geoiterator - * @param lat : on output latitude in degree - * @param lon : on output longitude in degree - * @param value : on output value of the point + * @param lat : output latitude in degrees + * @param lon : output longitude in degrees + * @param value : output value of the point * @return positive value if successful, 0 if no more data are available */ int codes_grib_iterator_next(codes_iterator* i, double* lat, double* lon, double* value); @@ -617,9 +617,9 @@ int codes_grib_iterator_next(codes_iterator* i, double* lat, double* lon, double * Get the previous value from a geoiterator. * * @param i : the geoiterator - * @param lat : on output latitude in degree - * @param lon : on output longitude in degree - * @param value : on output value of the point* + * @param lat : output latitude in degrees + * @param lon : output longitude in degrees + * @param value : output value of the point* * @return positive value if successful, 0 if no more data are available */ int codes_grib_iterator_previous(codes_iterator* i, double* lat, double* lon, double* value); @@ -628,7 +628,7 @@ int codes_grib_iterator_previous(codes_iterator* i, double* lat, double* lon, do * Test procedure for values in a geoiterator. * * @param i : the geoiterator - * @return boolean, 1 if the iterator still nave next values, 0 otherwise + * @return boolean, 1 if the iterator still has next values, 0 otherwise */ int codes_grib_iterator_has_next(codes_iterator* i); @@ -685,7 +685,7 @@ int codes_grib_nearest_find(codes_nearest* nearest, const codes_handle* h, doubl /** * Frees a nearest object from memory * - * @param nearest : the nearest + * @param nearest : the nearest neighbour object * @return 0 if OK, integer value on error */ int codes_grib_nearest_delete(codes_nearest* nearest); @@ -1403,6 +1403,7 @@ int codes_check_message_footer(const void* bytes, size_t length, ProductKind pro #define CODES_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA #define CODES_UTIL_GRID_SPEC_LAMBERT_CONFORMAL GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL #define CODES_UTIL_GRID_SPEC_UNSTRUCTURED GRIB_UTIL_GRID_SPEC_UNSTRUCTURED +#define CODES_UTIL_GRID_SPEC_HEALPIX GRIB_UTIL_GRID_SPEC_HEALPIX #define CODES_UTIL_PACKING_TYPE_SAME_AS_INPUT GRIB_UTIL_PACKING_TYPE_SAME_AS_INPUT #define CODES_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX GRIB_UTIL_PACKING_TYPE_SPECTRAL_COMPLEX diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 74a3838d2..3b405a05a 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -83,9 +83,6 @@ grib_action* grib_action_create_set(grib_context* context, const char* name, gri /* action_class_set_darray.cc*/ grib_action* grib_action_create_set_darray(grib_context* context, const char* name, grib_darray* darray); -/* action_class_set_iarray.cc*/ -grib_action* grib_action_create_set_iarray(grib_context* context, const char* name, grib_iarray* iarray); - /* action_class_set_sarray.cc*/ grib_action* grib_action_create_set_sarray(grib_context* context, const char* name, grib_sarray* sarray); @@ -176,31 +173,24 @@ void grib_concept_condition_delete(grib_context* c, grib_concept_condition* v); /* grib_hash_array.cc*/ grib_hash_array_value* grib_integer_hash_array_value_new(grib_context* c, const char* name, grib_iarray* array); -grib_hash_array_value* grib_double_hash_array_value_new(grib_context* c, const char* name, grib_darray* array); void grib_hash_array_value_delete(grib_context* c, grib_hash_array_value* v); /* grib_bufr_descriptor.cc*/ bufr_descriptor* grib_bufr_descriptor_new(grib_accessor* tables_accessor, int code, int silent, int* err); bufr_descriptor* grib_bufr_descriptor_clone(bufr_descriptor* d); int grib_bufr_descriptor_set_code(grib_accessor* tables_accessor, int code, bufr_descriptor* v); -void grib_bufr_descriptor_set_reference(bufr_descriptor* v, long reference); -void grib_bufr_descriptor_set_width(bufr_descriptor* v, long width); void grib_bufr_descriptor_set_scale(bufr_descriptor* v, long scale); int grib_bufr_descriptor_can_be_missing(bufr_descriptor* v); void grib_bufr_descriptor_delete(bufr_descriptor* v); /* grib_bufr_descriptors_array.cc*/ bufr_descriptors_array* grib_bufr_descriptors_array_new(grib_context* c, size_t size, size_t incsize); -bufr_descriptor* grib_bufr_descriptors_array_pop(bufr_descriptors_array* a); bufr_descriptor* grib_bufr_descriptors_array_pop_front(bufr_descriptors_array* a); bufr_descriptors_array* grib_bufr_descriptors_array_push(bufr_descriptors_array* v, bufr_descriptor* val); bufr_descriptors_array* grib_bufr_descriptors_array_append(bufr_descriptors_array* v, bufr_descriptors_array* ar); -bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v, bufr_descriptor* val); bufr_descriptor* grib_bufr_descriptors_array_get(bufr_descriptors_array* a, size_t i); -void grib_bufr_descriptors_array_set(bufr_descriptors_array* a, size_t i, bufr_descriptor* v); void grib_bufr_descriptors_array_delete(bufr_descriptors_array* v); void grib_bufr_descriptors_array_delete_array(bufr_descriptors_array* v); -bufr_descriptor** grib_bufr_descriptors_array_get_array(bufr_descriptors_array* v); size_t grib_bufr_descriptors_array_used_size(bufr_descriptors_array* v); /* grib_darray.cc*/ @@ -208,7 +198,6 @@ void grib_darray_print(const char* title, const grib_darray* darray); grib_darray* grib_darray_new(grib_context* c, size_t size, size_t incsize); grib_darray* grib_darray_push(grib_context* c, grib_darray* v, double val); void grib_darray_delete(grib_context* c, grib_darray* v); -double* grib_darray_get_array(grib_context* c, grib_darray* v); int grib_darray_is_constant(grib_darray* v, double epsilon); size_t grib_darray_used_size(grib_darray* v); @@ -225,9 +214,7 @@ size_t grib_sarray_used_size(grib_sarray* v); grib_oarray* grib_oarray_new(grib_context* c, size_t size, size_t incsize); grib_oarray* grib_oarray_push(grib_context* c, grib_oarray* v, void* val); void grib_oarray_delete(grib_context* c, grib_oarray* v); -void** grib_oarray_get_array(grib_context* c, grib_oarray* v); void* grib_oarray_get(grib_oarray* v, int i); -size_t grib_oarray_used_size(grib_oarray* v); /* grib_iarray.cc*/ void grib_iarray_print(const char* title, const grib_iarray* iarray); @@ -235,8 +222,6 @@ grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize); long grib_iarray_pop(grib_iarray* a); long grib_iarray_pop_front(grib_iarray* a); grib_iarray* grib_iarray_push(grib_iarray* v, long val); -grib_iarray* grib_iarray_push_front(grib_iarray* v, long val); -grib_iarray* grib_iarray_push_array(grib_iarray* v, long* val, size_t size); void grib_iarray_delete(grib_iarray* v); void grib_iarray_delete_array(grib_iarray* v); long* grib_iarray_get_array(grib_iarray* v); @@ -423,24 +408,8 @@ int grib_g1_step_get_steps(grib_accessor* a, long* start, long* theEnd); /* grib_accessor_class_ifs_param.cc*/ -/* grib_accessor_class_int16.cc*/ - -/* grib_accessor_class_int16_little_endian.cc*/ - -/* grib_accessor_class_int32.cc*/ - -/* grib_accessor_class_int32_little_endian.cc*/ - -/* grib_accessor_class_int64.cc*/ - -/* grib_accessor_class_int64_little_endian.cc*/ - -/* grib_accessor_class_int8.cc*/ - /* grib_accessor_class_uint16.cc*/ -/* grib_accessor_class_uint16_little_endian.cc*/ - /* grib_accessor_class_uint32.cc*/ /* grib_accessor_class_uint32_little_endian.cc*/ @@ -574,10 +543,6 @@ int grib_get_g1_message_size(grib_handle* h, grib_accessor* tl, grib_accessor* s /* grib_accessor_class_data_dummy_field.cc*/ -/* grib_2order_packer_simple.cc*/ -void grib_free_second_order_groups(grib_context* c, second_order_packed* sp); -second_order_packed* grib_get_second_order_groups(grib_context* c, const unsigned long* vals, size_t len); - /* grib_accessor_class_variable.cc*/ void accessor_variable_set_type(grib_accessor* a, int type); @@ -633,8 +598,6 @@ bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(gr /* grib_accessor_class_gds_not_present_bitmap.cc*/ -/* grib_accessor_class_data_apply_gdsnotpresent.cc*/ - /* grib_accessor_class_gds_is_present.cc*/ /* grib_accessor_class_select_step_template.cc*/ @@ -802,8 +765,6 @@ unsigned long grib_ibm_nearest_smaller_to_long(double x); int grib_nearest_smaller_ibm_float(double a, double* ret); /* grib_ieeefloat.cc*/ -double grib_ieee_table_e(unsigned long e); -double grib_ieee_table_v(unsigned long e); unsigned long grib_ieee_to_long(double x); double grib_ieeefloat_error(double x); double grib_long_to_ieee(unsigned long x); @@ -980,15 +941,11 @@ grib_handle* grib_fieldset_retrieve(grib_fieldset* set, int i, int* err); /* grib_filepool.cc*/ void grib_file_pool_clean(void); grib_file* grib_file_pool_get_files(void); -int grib_file_pool_read(grib_context* c, FILE* fh); -int grib_file_pool_write(FILE* fh); grib_file* grib_file_open(const char* filename, const char* mode, int* err); void grib_file_pool_delete_file(grib_file* file); void grib_file_close(const char* filename, int force, int* err); void grib_file_close_all(int* err); grib_file* grib_get_file(const char* filename, int* err); -grib_file* grib_find_file(short id); -grib_file* grib_file_new(grib_context* c, const char* name, int* err); void grib_file_delete(grib_file* file); /* grib_geography.cc*/ @@ -1146,7 +1103,6 @@ int grib_yyerror(const char* msg); void grib_parser_include(const char* included_fname); grib_concept_value* grib_parse_concept_file(grib_context* gc, const char* filename); grib_hash_array_value* grib_parse_hash_array_file(grib_context* gc, const char* filename); -grib_rule* grib_parse_rules_file(grib_context* gc, const char* filename); grib_action* grib_parse_file(grib_context* gc, const char* filename); int grib_type_to_int(char id); @@ -1159,9 +1115,7 @@ grib_accessor* grib_find_accessor_fast(grib_handle* h, const char* name); /* grib_scaling.cc*/ double grib_power(long s, long n); -long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret); -long grib_get_bits_per_value(double max, double min, long binary_scale_factor); -long grib_get_decimal_scale_fact(double max, double min, long bpval, long binary_scale); +long grib_get_binary_scale_fact(double max, double min, long bpval, int* error); /* grib_templates.cc*/ grib_handle* codes_external_template(grib_context* c, ProductKind product_kind, const char* name); @@ -1189,7 +1143,6 @@ int grib_set_string(grib_handle* h, const char* name, const char* val, size_t* l int grib_set_string_array(grib_handle* h, const char* name, const char** val, size_t length); int grib_set_bytes_internal(grib_handle* h, const char* name, const unsigned char* val, size_t* length); int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, size_t* length); -int grib_clear(grib_handle* h, const char* name); int grib_set_missing(grib_handle* h, const char* name); int grib_is_missing_long(grib_accessor* a, long x); int grib_is_missing_double(grib_accessor* a, double x); @@ -1327,7 +1280,7 @@ int grib_nearest_find_generic(grib_nearest* nearest, grib_handle* h, double inla double* outlats, double* outlons, double* values, double* distances, int* indexes, size_t* len); /* grib_nearest_class.cc*/ -grib_nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args); +grib_nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args, int* error); /* grib_nearest_class_gen.cc*/ @@ -1357,7 +1310,7 @@ int grib_iterator_init(grib_iterator* i, grib_handle* h, grib_arguments* args); int grib_iterator_delete(grib_iterator* i); /* grib_iterator_class.cc*/ -grib_iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* ret); +grib_iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* error); /* grib_iterator_class_gaussian.cc*/ diff --git a/src/grib_accessor_class.cc b/src/grib_accessor_class.cc index efd28cf6c..df132af08 100644 --- a/src/grib_accessor_class.cc +++ b/src/grib_accessor_class.cc @@ -378,11 +378,10 @@ int grib_get_block_length(grib_section* s, size_t* l) *l = s->length; return GRIB_SUCCESS; -// TODO: Because grib_pack_long takes a SIGNED value, we may have problems +// TODO(masn): Because grib_pack_long takes a SIGNED value, we may have problems // if(s->aclength) { // size_t len = 1; // long plen = 0; - // int ret = grib_unpack_long(s->aclength, &plen, &len); // if(ret == GRIB_SUCCESS && plen != 0) // { @@ -390,7 +389,6 @@ int grib_get_block_length(grib_section* s, size_t* l) // return GRIB_SUCCESS; // } // } - // // empty block // if(s->block->first == NULL) { // *l = 0; @@ -403,7 +401,6 @@ int grib_get_block_length(grib_section* s, size_t* l) // if(s->aclength) { // size_t len = 1; // long plen = *l; - // int ret = grib_pack_long(s->aclength, &plen, &len); // if(ret != GRIB_SUCCESS) // ; diff --git a/src/grib_accessor_class.h b/src/grib_accessor_class.h index 52bbfc49c..e27597551 100644 --- a/src/grib_accessor_class.h +++ b/src/grib_accessor_class.h @@ -35,7 +35,6 @@ extern grib_accessor_class* grib_accessor_class_count_total; extern grib_accessor_class* grib_accessor_class_data_apply_bitmap; extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic; extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap; -extern grib_accessor_class* grib_accessor_class_data_apply_gdsnotpresent; extern grib_accessor_class* grib_accessor_class_data_ccsds_packing; extern grib_accessor_class* grib_accessor_class_data_complex_packing; extern grib_accessor_class* grib_accessor_class_data_dummy_field; @@ -113,13 +112,6 @@ extern grib_accessor_class* grib_accessor_class_headers_only; extern grib_accessor_class* grib_accessor_class_ibmfloat; extern grib_accessor_class* grib_accessor_class_ieeefloat; extern grib_accessor_class* grib_accessor_class_ifs_param; -extern grib_accessor_class* grib_accessor_class_int16; -extern grib_accessor_class* grib_accessor_class_int16_little_endian; -extern grib_accessor_class* grib_accessor_class_int32; -extern grib_accessor_class* grib_accessor_class_int32_little_endian; -extern grib_accessor_class* grib_accessor_class_int64; -extern grib_accessor_class* grib_accessor_class_int64_little_endian; -extern grib_accessor_class* grib_accessor_class_int8; extern grib_accessor_class* grib_accessor_class_iterator; extern grib_accessor_class* grib_accessor_class_julian_date; extern grib_accessor_class* grib_accessor_class_julian_day; @@ -151,6 +143,7 @@ extern grib_accessor_class* grib_accessor_class_octet_number; extern grib_accessor_class* grib_accessor_class_offset_file; extern grib_accessor_class* grib_accessor_class_offset_values; extern grib_accessor_class* grib_accessor_class_pack_bufr_values; +extern grib_accessor_class* grib_accessor_class_packing_type; extern grib_accessor_class* grib_accessor_class_pad; extern grib_accessor_class* grib_accessor_class_padding; extern grib_accessor_class* grib_accessor_class_padto; @@ -194,7 +187,6 @@ extern grib_accessor_class* grib_accessor_class_transient; extern grib_accessor_class* grib_accessor_class_transient_darray; extern grib_accessor_class* grib_accessor_class_trim; extern grib_accessor_class* grib_accessor_class_uint16; -extern grib_accessor_class* grib_accessor_class_uint16_little_endian; extern grib_accessor_class* grib_accessor_class_uint32; extern grib_accessor_class* grib_accessor_class_uint32_little_endian; extern grib_accessor_class* grib_accessor_class_uint64; diff --git a/src/grib_accessor_class_ascii.cc b/src/grib_accessor_class_ascii.cc index 46d18b63d..035b2c9cc 100644 --- a/src/grib_accessor_class_ascii.cc +++ b/src/grib_accessor_class_ascii.cc @@ -229,7 +229,8 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len) size_t l = sizeof(val); char* last = NULL; - grib_unpack_string(a, val, &l); + int err = grib_unpack_string(a, val, &l); + if (err) return err; *v = strtod(val, &last); diff --git a/src/grib_accessor_class_bufr_data_array.cc b/src/grib_accessor_class_bufr_data_array.cc index a48c81737..0b2982491 100644 --- a/src/grib_accessor_class_bufr_data_array.cc +++ b/src/grib_accessor_class_bufr_data_array.cc @@ -2152,7 +2152,7 @@ static grib_accessor* create_accessor_from_descriptor(const grib_accessor* a, gr #define IS_COORDINATE_DESCRIPTOR(a) (a == 8 || a == 1 || a == 2 || a == 4 || a == 5 || a == 6 || a == 7) #define NUMBER_OF_QUALIFIERS_PER_CATEGORY 256 #define NUMBER_OF_QUALIFIERS_CATEGORIES 7 -#define MAX_NUMBER_OF_BITMAPS 5 +#define MAX_NUMBER_OF_BITMAPS 8 // See ECC-1699 static const int number_of_qualifiers = NUMBER_OF_QUALIFIERS_PER_CATEGORY * NUMBER_OF_QUALIFIERS_CATEGORIES; static const int significanceQualifierIndexArray[] = { -1, 0, 1, -1, 2, 3, 4, 5, 6 }; diff --git a/src/grib_accessor_class_bytes.cc b/src/grib_accessor_class_bytes.cc index 158714998..8ad005033 100644 --- a/src/grib_accessor_class_bytes.cc +++ b/src/grib_accessor_class_bytes.cc @@ -165,8 +165,9 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) size_t i = 0, slen = strlen(val); if (slen != expected_slen || *len != expected_slen) { - grib_context_log(c, GRIB_LOG_ERROR,"pack_string: key %s is %lu bytes. Expected a string with %lu characters", - a->name, expected_blen, expected_slen); + grib_context_log(c, GRIB_LOG_ERROR, + "%s: Key %s is %lu bytes. Expected a string with %lu characters (actual length=%zu)", + __func__, a->name, expected_blen, expected_slen, *len); return GRIB_WRONG_ARRAY_SIZE; } @@ -176,7 +177,7 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) for (i = 0; i < (slen/2); i++) { unsigned int byteVal = 0; if (sscanf(val + 2*i, "%02x", &byteVal) != 1) { - grib_context_log(c, GRIB_LOG_ERROR,"pack_string: Invalid hex byte specfication '%.2s'",val + 2*i); + grib_context_log(c, GRIB_LOG_ERROR,"%s: Invalid hex byte specfication '%.2s'", __func__, val + 2*i); grib_context_free(c, bytearray); return GRIB_INVALID_KEY_VALUE; } diff --git a/src/grib_accessor_class_codetable.cc b/src/grib_accessor_class_codetable.cc index d623f09e1..e8e286623 100644 --- a/src/grib_accessor_class_codetable.cc +++ b/src/grib_accessor_class_codetable.cc @@ -682,10 +682,10 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len) if (act->default_value != NULL) { const char* p = 0; size_t s_len = 1; - long l; + long l = 0; int ret = 0; - double d; - char tmp[1024]; + double d = 0; + char tmp[1024] = {0,}; grib_expression* expression = grib_arguments_get_expression(grib_handle_of_accessor(a), act->default_value, 0); int type = grib_expression_native_type(grib_handle_of_accessor(a), expression); switch (type) { @@ -703,8 +703,8 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len) s_len = sizeof(tmp); p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret); if (ret != GRIB_SUCCESS) { - grib_context_log(a->context, GRIB_LOG_FATAL, - "unable to evaluate %s as string", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Unable to evaluate default value of %s as string expression", __func__, a->name); return ret; } s_len = strlen(p) + 1; diff --git a/src/grib_accessor_class_constant.cc b/src/grib_accessor_class_constant.cc index 0d48cddcf..b54de5b88 100644 --- a/src/grib_accessor_class_constant.cc +++ b/src/grib_accessor_class_constant.cc @@ -20,7 +20,7 @@ START_CLASS_DEF CLASS = accessor SUPER = grib_accessor_class_variable - IMPLEMENTS = init;pack_double;pack_long;pack_string;pack_bytes + IMPLEMENTS = init END_CLASS_DEF */ @@ -35,10 +35,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_bytes(grib_accessor*, const unsigned char*, size_t* len); -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int pack_string(grib_accessor*, const char*, size_t* len); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_constant @@ -75,17 +71,17 @@ static grib_accessor_class _grib_accessor_class_constant = { 0, /* get sub_section */ 0, /* pack_missing */ 0, /* is_missing */ - &pack_long, /* pack_long */ + 0, /* pack_long */ 0, /* unpack_long */ - &pack_double, /* pack_double */ + 0, /* pack_double */ 0, /* pack_float */ 0, /* unpack_double */ 0, /* unpack_float */ - &pack_string, /* pack_string */ + 0, /* pack_string */ 0, /* unpack_string */ 0, /* pack_string_array */ 0, /* unpack_string_array */ - &pack_bytes, /* pack_bytes */ + 0, /* pack_bytes */ 0, /* unpack_bytes */ 0, /* pack_expression */ 0, /* notify_change */ @@ -113,23 +109,3 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) { a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } - -static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len) -{ - return GRIB_READ_ONLY; -} - -static int pack_double(grib_accessor* a, const double* val, size_t* len) -{ - return GRIB_READ_ONLY; -} - -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - return GRIB_READ_ONLY; -} - -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - return GRIB_READ_ONLY; -} diff --git a/src/grib_accessor_class_data_complex_packing.cc b/src/grib_accessor_class_data_complex_packing.cc index f10640b6e..95612de5a 100644 --- a/src/grib_accessor_class_data_complex_packing.cc +++ b/src/grib_accessor_class_data_complex_packing.cc @@ -168,13 +168,11 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) static int value_count(grib_accessor* a, long* count) { grib_accessor_data_complex_packing* self = (grib_accessor_data_complex_packing*)a; - int ret = 0; - grib_handle* gh = grib_handle_of_accessor(a); - + int ret = 0; + grib_handle* gh = grib_handle_of_accessor(a); long pen_j = 0; long pen_k = 0; long pen_m = 0; - *count = 0; if (a->length == 0) @@ -188,15 +186,16 @@ static int value_count(grib_accessor* a, long* count) return ret; if (pen_j != pen_k || pen_j != pen_m) { - grib_context_log(a->context, GRIB_LOG_ERROR, "pen_j=%ld, pen_k=%ld, pen_m=%ld\n", pen_j, pen_k, pen_m); - Assert((pen_j == pen_k) && (pen_j == pen_m)); + grib_context_log(a->context, GRIB_LOG_ERROR, "Invalid pentagonal resolution parameters"); + grib_context_log(a->context, GRIB_LOG_ERROR, "pen_j=%ld, pen_k=%ld, pen_m=%ld", pen_j, pen_k, pen_m); + return GRIB_DECODING_ERROR; } *count = (pen_j + 1) * (pen_j + 2); return ret; } -static double calculate_pfactor(grib_context* ctx, const double* spectralField, long fieldTruncation, long subsetTruncation) +static double calculate_pfactor(const grib_context* ctx, const double* spectralField, long fieldTruncation, long subsetTruncation) { /*long n_vals = ((fieldTruncation+1)*(fieldTruncation+2));*/ long loop, index, m, n = 0; @@ -416,10 +415,10 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) return GRIB_NOT_IMPLEMENTED; } - Assert(sub_j == sub_k); - Assert(sub_j == sub_m); - Assert(pen_j == pen_k); - Assert(pen_j == pen_m); + if (sub_j != sub_k || sub_j != sub_m || pen_j != pen_k || pen_j != pen_m) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid pentagonal resolution parameters", cclass_name); + return GRIB_ENCODING_ERROR; + } n_vals = (pen_j + 1) * (pen_j + 2); @@ -790,10 +789,10 @@ static int unpack(grib_accessor* a, T* val, size_t* len) return GRIB_NOT_IMPLEMENTED; } - Assert(sub_j == sub_k); - Assert(sub_j == sub_m); - Assert(pen_j == pen_k); - Assert(pen_j == pen_m); + if (sub_j != sub_k || sub_j != sub_m || pen_j != pen_k || pen_j != pen_m) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid pentagonal resolution parameters", cclass_name); + return GRIB_DECODING_ERROR; + } buf = (unsigned char*)gh->buffer->data; diff --git a/src/grib_accessor_class_data_g1second_order_constant_width_packing.cc b/src/grib_accessor_class_data_g1second_order_constant_width_packing.cc index a18ef2d2d..079e91829 100644 --- a/src/grib_accessor_class_data_g1second_order_constant_width_packing.cc +++ b/src/grib_accessor_class_data_g1second_order_constant_width_packing.cc @@ -258,14 +258,22 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) return ret; secondaryBitmap = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); + if (!secondaryBitmap) + return GRIB_OUT_OF_MEMORY; + grib_decode_long_array(buf, &pos, 1, numberOfSecondOrderPackedValues, secondaryBitmap); pos = 8 * ((pos + 7) / 8); firstOrderValues = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfGroups); + if (!firstOrderValues) + return GRIB_OUT_OF_MEMORY; + grib_decode_long_array(buf, &pos, widthOfFirstOrderValues, numberOfGroups, firstOrderValues); pos = 8 * ((pos + 7) / 8); X = (long*)grib_context_malloc_clear(a->context, sizeof(long) * numberOfSecondOrderPackedValues); + if (!X) + return GRIB_OUT_OF_MEMORY; if (groupWidth > 0) { grib_decode_long_array(buf, &pos, groupWidth, numberOfSecondOrderPackedValues, X); @@ -273,7 +281,11 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) i = -1; while (n < numberOfSecondOrderPackedValues) { i += secondaryBitmap[n]; - X[n] = firstOrderValues[i] + X[n]; + long fovi = 0; + // ECC-1703 + if ( i >=0 && i < numberOfGroups ) + fovi = firstOrderValues[i]; + X[n] = fovi + X[n]; n++; } } @@ -282,7 +294,10 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) i = -1; while (n < numberOfSecondOrderPackedValues) { i += secondaryBitmap[n]; - X[n] = firstOrderValues[i]; + long fovi = 0; + if ( i >=0 && i < numberOfGroups ) + fovi = firstOrderValues[i]; + X[n] = fovi; n++; } } @@ -308,7 +323,8 @@ static int unpack_double(grib_accessor* a, double* values, size_t* len) static int pack_double(grib_accessor* a, const double* cval, size_t* len) { - grib_context_log(a->context, GRIB_LOG_ERROR, "constant width packing not implemented"); + const char* cclass_name = a->cclass->name; + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: %s: Not implemented", cclass_name, __func__); return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_data_g22order_packing.cc b/src/grib_accessor_class_data_g22order_packing.cc index 84f32b3e3..af462d667 100644 --- a/src/grib_accessor_class_data_g22order_packing.cc +++ b/src/grib_accessor_class_data_g22order_packing.cc @@ -1168,57 +1168,33 @@ static void merge_j(struct section* h, int ref_bits, int width_bits, int has_und static int pack_double(grib_accessor* a, const double* val, size_t* len) { - unsigned char* sec7; grib_accessor_data_g22order_packing* self = reinterpret_cast(a); grib_handle* gh = grib_handle_of_accessor(a); const char* cclass_name = a->cclass->name; int err = 0; - long bits_per_value = 0; - // double reference_value = 0; // long nvals_per_group = 0; // long nbits_per_group_val = 0; - long binary_scale_factor; - long decimal_scale_factor; - long optimize_scale_factor; - long typeOfOriginalFieldValues; + long binary_scale_factor, decimal_scale_factor, optimize_scale_factor, typeOfOriginalFieldValues; // long groupSplittingMethodUsed, numberOfGroupsOfDataValues, referenceForGroupWidths; - long missingValueManagementUsed; - long primaryMissingValueSubstitute; - long secondaryMissingValueSubstitute; - long numberOfBitsUsedForTheGroupWidths; - long numberOfBitsUsedForTheScaledGroupLengths; - long orderOfSpatialDifferencing; - long numberOfOctetsExtraDescriptors; + long missingValueManagementUsed, primaryMissingValueSubstitute, secondaryMissingValueSubstitute; + long numberOfBitsUsedForTheGroupWidths, numberOfBitsUsedForTheScaledGroupLengths, orderOfSpatialDifferencing; + long numberOfOctetsExtraDescriptors, bits_per_value = 0, bitmap_present = 0; - int dec_scale; - int bin_scale; - int wanted_bits; - int max_bits; - int use_bitmap; - - int j, j0, k, *v, binary_scale, nbits, has_undef, extra_0, extra_1; - size_t i, ii; - int vmn, vmx, vbits; + int dec_scale, bin_scale, wanted_bits, max_bits, use_bitmap, + j, j0, k, *v, binary_scale, nbits, has_undef, extra_0, extra_1, vmn, vmx, vbits; // Sections - double max_val, min_val, ref, frange, dec_factor, scale; - double mn, mx; + double max_val, min_val, ref, frange, dec_factor, scale, mn, mx; struct section start, *list, *list_backup, *s; // Group - int ngroups, grefmx, glenmn, glenmx, gwidmn, gwidmx, len_last; - int size_sec7; + int ngroups, grefmx, glenmn, glenmx, gwidmn, gwidmx, len_last, size_sec7; int *refs, *lens, *widths, *itmp, *itmp2; - // int est_group_width = 12; int est_group_width = 6; - size_t ndef = 0; - size_t nndata = 0; - size_t nstruct; - - long bitmap_present = 0; + size_t ndef = 0, nndata = 0, nstruct, i, ii; int LEN_SEC_MAX = 127; int LEN_BITS = 7; @@ -1796,7 +1772,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) } size_sec7 += (k >> 3) + ((k & 7) ? 1 : 0); - sec7 = reinterpret_cast(grib_context_malloc(a->context, size_sec7)); + unsigned char* sec7 = reinterpret_cast(grib_context_malloc(a->context, size_sec7)); if (sec7 == NULL) { grib_context_log(a->context, GRIB_LOG_ERROR, "%s packing: unable to allocate %d bytes", cclass_name, size_sec7); return GRIB_OUT_OF_MEMORY; diff --git a/src/grib_accessor_class_data_jpeg2000_packing.cc b/src/grib_accessor_class_data_jpeg2000_packing.cc index 7349def3e..66d6f6767 100644 --- a/src/grib_accessor_class_data_jpeg2000_packing.cc +++ b/src/grib_accessor_class_data_jpeg2000_packing.cc @@ -178,7 +178,7 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) } } - if (a->context->debug == -1) { + if (a->context->debug) { switch (self->jpeg_lib) { case 0: fprintf(stderr, "ECCODES DEBUG jpeg2000_packing: jpeg_lib not set!\n"); @@ -347,6 +347,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) double units_factor = 1.0; double units_bias = 0.0; double* val = (double*)cval; + const char* cclass_name = a->cclass->name; self->dirty = 1; @@ -387,8 +388,7 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) case GRIB_SUCCESS: break; default: - grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_jpeg2000_packing pack_double: unable to compute packing parameters"); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s %s: Unable to compute packing parameters", cclass_name, __func__); return ret; } @@ -453,9 +453,8 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) if (width * height != *len) { grib_context_log(a->context, GRIB_LOG_ERROR, - "grib_accessor_class_data_jpeg2000_packing pack_double: width=%ld height=%ld len=%ld." - " width*height should equal len!", - (long)width, (long)height, (long)*len); + "%s %s: width=%ld height=%ld len=%zu. width*height should equal len!", + cclass_name, __func__, width, height, *len); /* ECC-802: We cannot bomb out here as the user might have changed Ni/Nj and the packingType * but has not yet submitted the new data values. So len will be out of sync! * So issue a warning but proceed. @@ -466,12 +465,23 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) } switch (type_of_compression_used) { - case 0: - Assert(target_compression_ratio == 255); + case 0: // Lossless + if (target_compression_ratio != 255) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s %s: When %s=0 (Lossless), %s must be set to 255", + cclass_name, __func__, self->type_of_compression_used, self->target_compression_ratio); + return GRIB_ENCODING_ERROR; + } helper.compression = 0; break; - case 1: + case 1: // Lossy + if (target_compression_ratio == 255 || target_compression_ratio == 0) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s %s: When %s=1 (Lossy), %s must be specified", + cclass_name, __func__, self->type_of_compression_used, self->target_compression_ratio); + return GRIB_ENCODING_ERROR; + } Assert(target_compression_ratio != 255); Assert(target_compression_ratio != 0); helper.compression = target_compression_ratio; @@ -490,8 +500,8 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) if (bits_per_value == 0) { const long bits_per_value_adjusted = 1; grib_context_log(a->context, GRIB_LOG_DEBUG, - "grib_accessor_class_data_jpeg2000_packing(%s) : bits per value was zero, changed to %d", - self->jpeg_lib == OPENJPEG_LIB ? "openjpeg" : "jasper", bits_per_value_adjusted); + "%s (%s) : bits per value was zero, changed to %ld", + cclass_name, self->jpeg_lib == OPENJPEG_LIB ? "openjpeg" : "jasper", bits_per_value_adjusted); bits_per_value = bits_per_value_adjusted; } helper.bits_per_value = bits_per_value; @@ -517,8 +527,8 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len) if (helper.jpeg_length > simple_packing_size) grib_context_log(a->context, GRIB_LOG_WARNING, - "grib_accessor_data_jpeg2000_packing(%s) : jpeg data (%ld) larger than input data (%ld)", - self->jpeg_lib == OPENJPEG_LIB ? "openjpeg" : "jasper", + "%s (%s) : jpeg data (%ld) larger than input data (%ld)", + cclass_name, self->jpeg_lib == OPENJPEG_LIB ? "openjpeg" : "jasper", helper.jpeg_length, simple_packing_size); Assert(helper.jpeg_length <= helper.buffer_size); diff --git a/src/grib_accessor_class_data_run_length_packing.cc b/src/grib_accessor_class_data_run_length_packing.cc index cfe5370e0..61e581185 100644 --- a/src/grib_accessor_class_data_run_length_packing.cc +++ b/src/grib_accessor_class_data_run_length_packing.cc @@ -149,8 +149,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) long seclen, number_of_values, bits_per_value, max_level_value, number_of_level_values, decimal_scale_factor; long* level_values = NULL; size_t level_values_size = 0; - int i = 0; - long number_of_compressed_values = 0, range = 0, offsetBeforeData = 0, pos = 0; + long i = 0, number_of_compressed_values = 0, range = 0, offsetBeforeData = 0, pos = 0; long v, n, factor, k, j; long* compressed_values = NULL; double level_scale_factor = 0; @@ -214,7 +213,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) while (i < number_of_compressed_values) { if (compressed_values[i] > max_level_value) { grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: numberOfValues mismatch: i=%d, " + "%s: numberOfValues mismatch: i=%ld, " "compressed_values[i]=%ld, max_level_value=%ld", cclass_name, i, compressed_values[i], max_level_value); break; @@ -249,7 +248,132 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) static int pack_double(grib_accessor* a, const double* val, size_t* len) { - grib_context_log(a->context, GRIB_LOG_ERROR, - "%s: Function '%s' is not implemented", a->cclass->name, __func__); - return GRIB_NOT_IMPLEMENTED; + grib_accessor_data_run_length_packing* self = (grib_accessor_data_run_length_packing*)a; + grib_handle* gh = grib_handle_of_accessor(a); + const char* cclass_name = a->cclass->name; + int err = GRIB_SUCCESS; + long number_of_values, bits_per_value, max_level_value, number_of_level_values, decimal_scale_factor; + long* level_values = NULL; + size_t level_values_size = 0; + long i = 0, range = 0, pos = 0, n = 0, j = 0, k = 0, l = 0, missingValueLong = 0; + double level_scale_factor = 0; + unsigned char* buf = NULL; + double missingValue = 9999.0; + size_t n_vals = *len; + + if ((err = grib_get_long_internal(gh, self->number_of_values, &number_of_values)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->bits_per_value, &bits_per_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->max_level_value, &max_level_value)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->number_of_level_values, &number_of_level_values)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_long_internal(gh, self->decimal_scale_factor, &decimal_scale_factor)) != GRIB_SUCCESS) + return err; + if ((err = grib_get_double(gh, "missingValue", &missingValue)) != GRIB_SUCCESS) + return err; + + if (n_vals != number_of_values) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Parameters are invalid: n_vals=%ld(==number_of_values), number_of_values=%ld(==n_vals)", + cclass_name, n_vals, number_of_values); + return GRIB_ENCODING_ERROR; + } + + if (bits_per_value == 0) { + // TODO(masn): What are we meant to do with constant fields? + return GRIB_SUCCESS; + } + + level_values = (long*)grib_context_malloc_clear(a->context, sizeof(long) * number_of_level_values); + level_values_size = number_of_level_values; + if ((err = grib_get_long_array_internal(gh, self->level_values, level_values, &level_values_size)) != GRIB_SUCCESS) + return err; + if (decimal_scale_factor > 127) { + decimal_scale_factor = -(decimal_scale_factor - 128); + } + level_scale_factor = grib_power(-decimal_scale_factor, 10.0); + missingValueLong = (long)(round(missingValue / level_scale_factor)); + for (i = 0; i < number_of_level_values; i++) { + if (missingValueLong == level_values[i]) { + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Parameters are invalid: level_values[%ld]=%ld, missingValueLong=%ld", + cclass_name, i, level_values[i], missingValueLong); + return GRIB_ENCODING_ERROR; + } + } + range = (1 << bits_per_value) - 1 - max_level_value; + if ((max_level_value <= 0) || (number_of_level_values <= 0) || (max_level_value > number_of_level_values) || (range <= 0)) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Parameters are invalid: max_level_value=%ld(>0, <=number_of_level_values), " + "number_of_level_values=%ld(>0, >=max_level_value), range=%ld(>0)", + cclass_name, max_level_value, number_of_level_values, range); + return GRIB_ENCODING_ERROR; + } + buf = (unsigned char*)grib_context_malloc(a->context, 2 * number_of_values); + for (i = 0; i < number_of_values; i++) { + k = (long)(round(val[i] / level_scale_factor)); + err = GRIB_ENCODING_ERROR; + if (missingValueLong == k) { + k = 0; + err = GRIB_SUCCESS; + } else { + for (j = 0; j < max_level_value; j++) { + if (level_values[j] == k) { + k = j + 1; + err = GRIB_SUCCESS; + break; + } + } + } + if (err != GRIB_SUCCESS) { + grib_context_log(a->context, GRIB_LOG_ERROR, + "%s: Values and/or parameters are invalid: val[%ld]=%lf, level_value=%ld, max_level_value=%ld", + cclass_name, i, val[i], k, max_level_value); + return GRIB_ENCODING_ERROR; + } + if (i == 0) { + grib_encode_unsigned_longb(buf, k, &pos, bits_per_value); + } else if (i == number_of_values - 1) { + if (k != l) { + if (n == 0) { + grib_encode_unsigned_longb(buf, k, &pos, bits_per_value); + } else { + while (n >= range) { + grib_encode_unsigned_longb(buf, (n % range) + max_level_value + 1, &pos, bits_per_value); + n = n / range; + } + grib_encode_unsigned_longb(buf, n + max_level_value + 1, &pos, bits_per_value); + grib_encode_unsigned_longb(buf, k, &pos, bits_per_value); + } + } else { + n = n + 1; + while (n >= range) { + grib_encode_unsigned_longb(buf, (n % range) + max_level_value + 1, &pos, bits_per_value); + n = n / range; + } + grib_encode_unsigned_longb(buf, n + max_level_value + 1, &pos, bits_per_value); + } + } else { + if (k != l) { + if ( n == 0 ) { + grib_encode_unsigned_longb(buf, k, &pos, bits_per_value); + } else { + while (n >= range) { + grib_encode_unsigned_longb(buf, (n % range) + max_level_value + 1, &pos, bits_per_value); + n = n / range; + } + grib_encode_unsigned_longb(buf, n + max_level_value + 1, &pos, bits_per_value); + grib_encode_unsigned_longb(buf, k, &pos, bits_per_value); + n = 0; + } + } else { + n = n + 1; + } + } + l = k; + } + grib_context_free(a->context, level_values); + grib_buffer_replace(a, buf, pos/8, 1, 1); + grib_context_buffer_free(a->context, buf); + return err; } diff --git a/src/grib_accessor_class_data_sh_packed.cc b/src/grib_accessor_class_data_sh_packed.cc index 6944c7a0a..a02d60275 100644 --- a/src/grib_accessor_class_data_sh_packed.cc +++ b/src/grib_accessor_class_data_sh_packed.cc @@ -164,8 +164,9 @@ static void init(grib_accessor* a, const long v, grib_arguments* args) static int value_count(grib_accessor* a, long* count) { grib_accessor_data_sh_packed* self = (grib_accessor_data_sh_packed*)a; - grib_handle* hand = grib_handle_of_accessor(a); - int ret = 0; + grib_handle* hand = grib_handle_of_accessor(a); + int ret = 0; + const char* cclass_name = a->cclass->name; long sub_j = 0; long sub_k = 0; @@ -189,8 +190,9 @@ static int value_count(grib_accessor* a, long* count) return ret; if (pen_j != pen_k || pen_j != pen_m) { - grib_context_log(a->context, GRIB_LOG_ERROR, "pen_j=%ld, pen_k=%ld, pen_m=%ld\n", pen_j, pen_k, pen_m); - Assert((pen_j == pen_k) && (pen_j == pen_m)); + grib_context_log(a->context, GRIB_LOG_ERROR, "%s: pen_j=%ld, pen_k=%ld, pen_m=%ld\n", + cclass_name, pen_j, pen_k, pen_m); + return GRIB_DECODING_ERROR; } *count = (pen_j + 1) * (pen_j + 2) - (sub_j + 1) * (sub_j + 2); return ret; @@ -200,20 +202,13 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) { grib_accessor_data_sh_packed* self = (grib_accessor_data_sh_packed*)a; - size_t i = 0; - int ret = GRIB_SUCCESS; - long hcount = 0; - long lcount = 0; - long hpos = 0; - long lup = 0; - long mmax = 0; - long n_vals = 0; + size_t i = 0; + int ret = GRIB_SUCCESS; + long hcount = 0, lcount = 0, hpos = 0, lup = 0, mmax = 0, n_vals = 0; double* scals = NULL; /* double *pscals=NULL; */ - double s = 0; - double d = 0; - double laplacianOperator = 0; + double s = 0, d = 0, laplacianOperator = 0; unsigned char* buf = NULL; unsigned char* hres = NULL; unsigned char* lres = NULL; @@ -223,22 +218,16 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) long maxv = 0; long GRIBEX_sh_bug_present = 0; long ieee_floats = 0; - long offsetdata = 0; long bits_per_value = 0; double reference_value = 0; long binary_scale_factor = 0; long decimal_scale_factor = 0; - long sub_j = 0; - long sub_k = 0; - long sub_m = 0; - long pen_j = 0; - long pen_k = 0; - long pen_m = 0; + long sub_j = 0, sub_k = 0, sub_m = 0, pen_j = 0, pen_k = 0, pen_m = 0; double operat = 0; - int bytes; + int bytes = 0; int err = 0; decode_float_proc decode_float = NULL; @@ -326,7 +315,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len) d = codes_power(-decimal_scale_factor, 10); scals = (double*)grib_context_malloc(a->context, maxv * sizeof(double)); - Assert(scals); + if(!scals) return GRIB_OUT_OF_MEMORY; scals[0] = 0; for (i = 1; i < maxv; i++) { diff --git a/src/grib_accessor_class_double.cc b/src/grib_accessor_class_double.cc index e1888ed0c..3f635720c 100644 --- a/src/grib_accessor_class_double.cc +++ b/src/grib_accessor_class_double.cc @@ -8,10 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************************ - * Enrico Fucile - ***********************************************/ - #include "grib_api_internal.h" /* This is used by make_class.pl @@ -115,13 +111,18 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) double val = 0; size_t l = 1; char repres[1024]; + char format[32] = "%g"; + grib_handle* h = grib_handle_of_accessor(a); grib_unpack_double(a, &val, &l); - if ((val == GRIB_MISSING_DOUBLE) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) + if ((val == GRIB_MISSING_DOUBLE) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) { snprintf(repres, sizeof(repres), "MISSING"); - else - snprintf(repres, sizeof(repres), "%g", val); + } else { + size_t size = sizeof(format); + grib_get_string(h, "formatForDoubles", format, &size); + snprintf(repres, sizeof(repres), format, val); + } l = strlen(repres) + 1; diff --git a/src/grib_accessor_class_evaluate.cc b/src/grib_accessor_class_evaluate.cc index 2c9fdf1e3..596b95884 100644 --- a/src/grib_accessor_class_evaluate.cc +++ b/src/grib_accessor_class_evaluate.cc @@ -15,7 +15,7 @@ START_CLASS_DEF CLASS = accessor SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long + IMPLEMENTS = unpack_long IMPLEMENTS = init MEMBERS= grib_arguments* arg END_CLASS_DEF @@ -32,7 +32,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ -static int pack_long(grib_accessor*, const long* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static void init(grib_accessor*, const long, grib_arguments*); @@ -66,7 +65,7 @@ static grib_accessor_class _grib_accessor_class_evaluate = { 0, /* get sub_section */ 0, /* pack_missing */ 0, /* is_missing */ - &pack_long, /* pack_long */ + 0, /* pack_long */ &unpack_long, /* unpack_long */ 0, /* pack_double */ 0, /* pack_float */ @@ -107,18 +106,12 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static int pack_long(grib_accessor* a, const long* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { - int ret = 0; grib_accessor_evaluate* self = (grib_accessor_evaluate*)a; - grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a), self->arg, 0); + grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(a), self->arg, 0); - ret = grib_expression_evaluate_long(grib_handle_of_accessor(a), e, val); + int ret = grib_expression_evaluate_long(grib_handle_of_accessor(a), e, val); *len = 1; return ret; diff --git a/src/grib_accessor_class_g2end_step.cc b/src/grib_accessor_class_g2end_step.cc index 285a30085..2a044d294 100644 --- a/src/grib_accessor_class_g2end_step.cc +++ b/src/grib_accessor_class_g2end_step.cc @@ -209,18 +209,24 @@ static const int u2s[] = { 1800 /* (15) 30 minutes */ }; -/* See GRIB-488 */ -static int is_special_expver(grib_handle* h) +// See GRIB-488 +static bool is_special_expver(const grib_handle* h) { - int ret = 0; - char strExpVer[50] = {0,}; + int ret = 0; + char strMarsExpVer[50] = {0,}; + char strMarsClass[50] = {0,}; size_t slen = 50; - ret = grib_get_string(h, "experimentVersionNumber", strExpVer, &slen); - if (ret == GRIB_SUCCESS && !strcmp(strExpVer, "1605")) { - return 1; /* Special case of expVer 1605! */ + ret = grib_get_string(h, "mars.class", strMarsClass, &slen); + if (ret == GRIB_SUCCESS && STR_EQUAL(strMarsClass, "em")) { + // em = ERA-CLIM model integration for the 20th-century (ERA-20CM) + slen = 50; + ret = grib_get_string(h, "experimentVersionNumber", strMarsExpVer, &slen); + if (ret == GRIB_SUCCESS && STR_EQUAL(strMarsExpVer, "1605")) { + return true; // Special case of expVer 1605 in class "em" + } } - return 0; + return false; } static int convert_time_range( diff --git a/src/grib_accessor_class_gen.cc b/src/grib_accessor_class_gen.cc index 4846fc5d7..75f84bebd 100644 --- a/src/grib_accessor_class_gen.cc +++ b/src/grib_accessor_class_gen.cc @@ -301,7 +301,7 @@ static int unpack_long(grib_accessor* a, long* v, size_t* len) } } - grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as long", a->name); if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); } @@ -336,7 +336,7 @@ static int unpack(grib_accessor* a, T* v, size_t* len) } } - grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack %s as %s", a->name, Tname); + grib_context_log(a->context, GRIB_LOG_ERROR, "Cannot unpack key '%s' as %s", a->name, Tname); if (grib_get_native_type(grib_handle_of_accessor(a), a->name, &type) == GRIB_SUCCESS) { grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try unpacking as %s", grib_get_type_name(type)); } @@ -356,10 +356,12 @@ static int unpack_float(grib_accessor* a, float* v, size_t* len) static int unpack_string(grib_accessor* a, char* v, size_t* len) { + int err = 0; if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { double val = 0.0; size_t l = 1; - grib_unpack_double(a, &val, &l); + err = grib_unpack_double(a, &val, &l); + if (err) return err; snprintf(v, 64, "%g", val); *len = strlen(v); grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to string", a->name); @@ -369,7 +371,8 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { long val = 0; size_t l = 1; - grib_unpack_long(a, &val, &l); + err = grib_unpack_long(a, &val, &l); + if (err) return err; snprintf(v, 64, "%ld", val); *len = strlen(v); grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string\n", a->name); @@ -388,7 +391,7 @@ static int unpack_string_array(grib_accessor* a, char** v, size_t* len) if (err) return err; v[0] = (char*)grib_context_malloc_clear(a->context, length); - grib_unpack_string(a, v[0], &length); + grib_unpack_string(a, v[0], &length); // TODO(masn): check return value *len = 1; return GRIB_SUCCESS; @@ -466,7 +469,10 @@ static int pack_long(grib_accessor* a, const long* v, size_t* len) grib_context_free(c, val); return ret; } - grib_context_log(c, GRIB_LOG_ERROR, "Should not grib_pack %s as long", a->name); + grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as an integer", a->name); + if (a->cclass->pack_string && a->cclass->pack_string != &pack_string) { + grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); + } return GRIB_NOT_IMPLEMENTED; } @@ -504,7 +510,10 @@ static int pack_double(grib_accessor* a, const double* v, size_t* len) if (do_pack_as_long) { return pack_double_array_as_long(a, v, len); } - grib_context_log(c, GRIB_LOG_ERROR, "Should not grib_pack %s as double", a->name); + grib_context_log(c, GRIB_LOG_ERROR, "Should not pack '%s' as a double", a->name); + if (a->cclass->pack_string && a->cclass->pack_string != &pack_string) { + grib_context_log(c, GRIB_LOG_ERROR, "Try packing as a string"); + } return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_group.cc b/src/grib_accessor_class_group.cc index d4c09a2f5..32f337d3b 100644 --- a/src/grib_accessor_class_group.cc +++ b/src/grib_accessor_class_group.cc @@ -7,9 +7,6 @@ * 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. */ -/*********************************************************** - * Enrico Fucile - ***********************************************************/ #include "grib_api_internal.h" /* @@ -18,9 +15,9 @@ START_CLASS_DEF CLASS = accessor SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double;pack_double + IMPLEMENTS = unpack_string + IMPLEMENTS = unpack_long + IMPLEMENTS = unpack_double IMPLEMENTS = init;dump;string_length IMPLEMENTS = value_count IMPLEMENTS = next_offset @@ -42,9 +39,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int pack_string(grib_accessor*, const char*, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); @@ -84,13 +78,13 @@ static grib_accessor_class _grib_accessor_class_group = { 0, /* get sub_section */ 0, /* pack_missing */ 0, /* is_missing */ - &pack_long, /* pack_long */ + 0, /* pack_long */ &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ + 0, /* pack_double */ 0, /* pack_float */ &unpack_double, /* unpack_double */ 0, /* unpack_float */ - &pack_string, /* pack_string */ + 0, /* pack_string */ &unpack_string, /* unpack_string */ 0, /* pack_string_array */ 0, /* unpack_string_array */ @@ -194,23 +188,6 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_long(grib_accessor* a, const long* v, size_t* len) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_double(grib_accessor* a, const double* v, size_t* len) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); - return GRIB_NOT_IMPLEMENTED; -} - static int unpack_long(grib_accessor* a, long* v, size_t* len) { char val[1024] = {0,}; diff --git a/src/grib_accessor_class_long.cc b/src/grib_accessor_class_long.cc index c939189a5..1f97a539e 100644 --- a/src/grib_accessor_class_long.cc +++ b/src/grib_accessor_class_long.cc @@ -120,6 +120,8 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) long val = 0; size_t l = 1; char repres[1024]; + char format[32] = "%ld"; + grib_handle* h = grib_handle_of_accessor(a); err = grib_unpack_long(a, &val, &l); /* TODO: We should catch all errors but in this case the test ERA_Gen.sh will fail @@ -127,10 +129,13 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) /* if (err) return err; */ (void)err; - if ((val == GRIB_MISSING_LONG) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) + if ((val == GRIB_MISSING_LONG) && ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) != 0)) { snprintf(repres, sizeof(repres), "MISSING"); - else - snprintf(repres, sizeof(repres), "%ld", val); + } else { + size_t size = sizeof(format); + grib_get_string(h, "formatForLongs", format, &size); + snprintf(repres, sizeof(repres), format, val); + } l = strlen(repres) + 1; diff --git a/src/grib_accessor_class_message.cc b/src/grib_accessor_class_message.cc index 3a9ecc910..6a87d00e5 100644 --- a/src/grib_accessor_class_message.cc +++ b/src/grib_accessor_class_message.cc @@ -134,7 +134,8 @@ static void resize(grib_accessor* a, size_t new_size) grib_buffer_replace(a, (const unsigned char*)zero, new_size, 1, 0); grib_context_free(a->context, zero); - grib_context_log(a->context, GRIB_LOG_DEBUG, "resize: grib_accessor_class_message.c %ld %ld %s %s\n", (long)new_size, (long)a->length, a->cclass->name, a->name); + grib_context_log(a->context, GRIB_LOG_DEBUG, "resize: grib_accessor_class_message %ld %ld %s %s", + (long)new_size, (long)a->length, a->cclass->name, a->name); Assert(new_size == a->length); } diff --git a/src/grib_accessor_class_nearest.cc b/src/grib_accessor_class_nearest.cc index 0620b5395..b1a3138d3 100644 --- a/src/grib_accessor_class_nearest.cc +++ b/src/grib_accessor_class_nearest.cc @@ -122,7 +122,7 @@ grib_nearest* grib_nearest_new(const grib_handle* ch, int* error) if (!a) return NULL; - n = grib_nearest_factory(h, na->args); + n = grib_nearest_factory(h, na->args, error); if (n) *error = GRIB_SUCCESS; diff --git a/src/grib_accessor_class_non_alpha.cc b/src/grib_accessor_class_non_alpha.cc index 3b5badd23..e0f52f4d9 100644 --- a/src/grib_accessor_class_non_alpha.cc +++ b/src/grib_accessor_class_non_alpha.cc @@ -7,9 +7,6 @@ * 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. */ -/*********************************************************** - * Enrico Fucile - ***********************************************************/ #include "grib_api_internal.h" /* @@ -181,13 +178,13 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as an integer", a->name); return GRIB_NOT_IMPLEMENTED; } static int pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as a double", a->name); return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_packing_type.cc b/src/grib_accessor_class_packing_type.cc new file mode 100644 index 000000000..a9a4a2deb --- /dev/null +++ b/src/grib_accessor_class_packing_type.cc @@ -0,0 +1,167 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ + +#include "grib_api_internal.h" +/* + This is used by make_class.pl + + START_CLASS_DEF + CLASS = accessor + SUPER = grib_accessor_class_gen + IMPLEMENTS = unpack_string;pack_string + IMPLEMENTS = string_length + IMPLEMENTS = get_native_type + IMPLEMENTS = init + MEMBERS = const char* values + MEMBERS = const char* packing_type + END_CLASS_DEF + */ + +/* START_CLASS_IMP */ + +/* + +Don't edit anything between START_CLASS_IMP and END_CLASS_IMP +Instead edit values between START_CLASS_DEF and END_CLASS_DEF +or edit "accessor.class" and rerun ./make_class.pl + +*/ + +static int get_native_type(grib_accessor*); +static int pack_string(grib_accessor*, const char*, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); +static size_t string_length(grib_accessor*); +static void init(grib_accessor*, const long, grib_arguments*); + +typedef struct grib_accessor_packing_type +{ + grib_accessor att; + /* Members defined in gen */ + /* Members defined in packing_type */ + const char* values; + const char* packing_type; +} grib_accessor_packing_type; + +extern grib_accessor_class* grib_accessor_class_gen; + +static grib_accessor_class _grib_accessor_class_packing_type = { + &grib_accessor_class_gen, /* super */ + "packing_type", /* name */ + sizeof(grib_accessor_packing_type), /* size */ + 0, /* inited */ + 0, /* init_class */ + &init, /* init */ + 0, /* post_init */ + 0, /* destroy */ + 0, /* dump */ + 0, /* next_offset */ + &string_length, /* get length of string */ + 0, /* get number of values */ + 0, /* get number of bytes */ + 0, /* get offset to bytes */ + &get_native_type, /* get native type */ + 0, /* get sub_section */ + 0, /* pack_missing */ + 0, /* is_missing */ + 0, /* pack_long */ + 0, /* unpack_long */ + 0, /* pack_double */ + 0, /* pack_float */ + 0, /* unpack_double */ + 0, /* unpack_float */ + &pack_string, /* pack_string */ + &unpack_string, /* unpack_string */ + 0, /* pack_string_array */ + 0, /* unpack_string_array */ + 0, /* pack_bytes */ + 0, /* unpack_bytes */ + 0, /* pack_expression */ + 0, /* notify_change */ + 0, /* update_size */ + 0, /* preferred_size */ + 0, /* resize */ + 0, /* nearest_smaller_value */ + 0, /* next accessor */ + 0, /* compare vs. another accessor */ + 0, /* unpack only ith value (double) */ + 0, /* unpack only ith value (float) */ + 0, /* unpack a given set of elements (double) */ + 0, /* unpack a given set of elements (float) */ + 0, /* unpack a subarray */ + 0, /* clear */ + 0, /* clone accessor */ +}; + + +grib_accessor_class* grib_accessor_class_packing_type = &_grib_accessor_class_packing_type; + +/* END_CLASS_IMP */ + +static void init(grib_accessor* a, const long l, grib_arguments* args) +{ + int n = 0; + grib_accessor_packing_type* self = (grib_accessor_packing_type*)a; + self->values = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + self->packing_type = grib_arguments_get_name(grib_handle_of_accessor(a), args, n++); + a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION; + a->length = 0; +} + +static size_t string_length(grib_accessor* a) +{ + return 1024; +} + +static int get_native_type(grib_accessor* a) +{ + return GRIB_TYPE_STRING; +} + +static int pack_string(grib_accessor*a, const char* sval, size_t* len) +{ + grib_accessor_packing_type* self = (grib_accessor_packing_type*)a; + grib_handle* h = grib_handle_of_accessor(a); + double* values = NULL; + grib_context* c = a->context; + size_t size = 0; + int err = 0; + + if ((err = grib_get_size(h, self->values, &size)) != GRIB_SUCCESS) + return err; + + values = (double*)grib_context_malloc(c, size * sizeof(double)); + if (!values) return GRIB_OUT_OF_MEMORY; + + if ((err = grib_get_double_array_internal(h, self->values, values, &size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + if ((err = grib_set_string_internal(h, self->packing_type, sval, len)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + if ((err = grib_set_double_array_internal(h, self->values, values, size)) != GRIB_SUCCESS) { + grib_context_free(c, values); + return err; + } + + grib_context_free(c, values); + return GRIB_SUCCESS; +} + +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ + grib_accessor_packing_type* self = (grib_accessor_packing_type*)a; + grib_handle* h = grib_handle_of_accessor(a); + + return grib_get_string(h, self->packing_type, val, len); +} diff --git a/src/grib_accessor_class_to_integer.cc b/src/grib_accessor_class_to_integer.cc index a51ff6972..30fa00251 100644 --- a/src/grib_accessor_class_to_integer.cc +++ b/src/grib_accessor_class_to_integer.cc @@ -7,9 +7,6 @@ * 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. */ -/*********************************************************** - * Enrico Fucile - ***********************************************************/ #include "grib_api_internal.h" /* @@ -206,13 +203,13 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len) static int pack_long(grib_accessor* a, const long* v, size_t* len) { - grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as an integer", a->name); return GRIB_NOT_IMPLEMENTED; } static int pack_double(grib_accessor* a, const double* v, size_t* len) { - grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); + grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as a double", a->name); return GRIB_NOT_IMPLEMENTED; } diff --git a/src/grib_accessor_class_to_string.cc b/src/grib_accessor_class_to_string.cc index 2abfccee1..ce8bf4e74 100644 --- a/src/grib_accessor_class_to_string.cc +++ b/src/grib_accessor_class_to_string.cc @@ -7,9 +7,6 @@ * 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. */ -/*********************************************************** - * Enrico Fucile - ***********************************************************/ #include "grib_api_internal.h" /* @@ -18,9 +15,9 @@ START_CLASS_DEF CLASS = accessor SUPER = grib_accessor_class_gen - IMPLEMENTS = unpack_string;pack_string - IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = unpack_double;pack_double + IMPLEMENTS = unpack_string + IMPLEMENTS = unpack_long + IMPLEMENTS = unpack_double IMPLEMENTS = init;dump;string_length IMPLEMENTS = value_count IMPLEMENTS = next_offset @@ -44,9 +41,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int get_native_type(grib_accessor*); -static int pack_double(grib_accessor*, const double* val, size_t* len); -static int pack_long(grib_accessor*, const long* val, size_t* len); -static int pack_string(grib_accessor*, const char*, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); @@ -88,13 +82,13 @@ static grib_accessor_class _grib_accessor_class_to_string = { 0, /* get sub_section */ 0, /* pack_missing */ 0, /* is_missing */ - &pack_long, /* pack_long */ + 0, /* pack_long */ &unpack_long, /* unpack_long */ - &pack_double, /* pack_double */ + 0, /* pack_double */ 0, /* pack_float */ &unpack_double, /* unpack_double */ 0, /* unpack_float */ - &pack_string, /* pack_string */ + 0, /* pack_string */ &unpack_string, /* unpack_string */ 0, /* pack_string_array */ 0, /* unpack_string_array */ @@ -148,11 +142,11 @@ static int value_count(grib_accessor* a, long* count) static size_t string_length(grib_accessor* a) { grib_accessor_to_string* self = (grib_accessor_to_string*)a; - size_t size = 0; if (self->length) return self->length; + size_t size = 0; grib_get_string_length(grib_handle_of_accessor(a), self->key, &size); return size; } @@ -169,21 +163,21 @@ static int get_native_type(grib_accessor* a) static int unpack_string(grib_accessor* a, char* val, size_t* len) { - int err = 0; grib_accessor_to_string* self = (grib_accessor_to_string*)a; - char buff[512] = {0,}; - size_t length; - size_t size = 512; - length = string_length(a); + int err = 0; + char buff[512] = {0,}; + + size_t length = string_length(a); if (len[0] < length + 1) { grib_context_log(a->context, GRIB_LOG_ERROR, "unpack_string: Wrong size (%lu) for %s, it contains %ld values", - len[0], a->name, a->length + 1); + len[0], a->name, a->length + 1); len[0] = 0; return GRIB_ARRAY_TOO_SMALL; } + size_t size = sizeof(buff); err = grib_get_string(grib_handle_of_accessor(a), self->key, buff, &size); if (err) return err; @@ -199,23 +193,6 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len) return GRIB_SUCCESS; } -static int pack_string(grib_accessor* a, const char* val, size_t* len) -{ - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_long(grib_accessor* a, const long* v, size_t* len) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as long", a->name); - return GRIB_NOT_IMPLEMENTED; -} - -static int pack_double(grib_accessor* a, const double* v, size_t* len) -{ - grib_context_log(a->context, GRIB_LOG_ERROR, " Should not pack %s as double", a->name); - return GRIB_NOT_IMPLEMENTED; -} - static int unpack_long(grib_accessor* a, long* v, size_t* len) { char val[1024] = {0,}; diff --git a/src/grib_accessor_class_uint16.cc b/src/grib_accessor_class_uint16.cc index 8977e92be..e95105b32 100644 --- a/src/grib_accessor_class_uint16.cc +++ b/src/grib_accessor_class_uint16.cc @@ -18,6 +18,7 @@ SUPER = grib_accessor_class_gen IMPLEMENTS = unpack_long IMPLEMENTS = pack_long + IMPLEMENTS = get_native_type END_CLASS_DEF */ @@ -32,6 +33,7 @@ or edit "accessor.class" and rerun ./make_class.pl */ +static int get_native_type(grib_accessor*); static int pack_long(grib_accessor*, const long* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); @@ -59,7 +61,7 @@ static grib_accessor_class _grib_accessor_class_uint16 = { 0, /* get number of values */ 0, /* get number of bytes */ 0, /* get offset to bytes */ - 0, /* get native type */ + &get_native_type, /* get native type */ 0, /* get sub_section */ 0, /* pack_missing */ 0, /* is_missing */ @@ -104,7 +106,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) /*unsigned char* data = grib_handle_of_accessor(a)->buffer->data;*/ if (*len < 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it contains %d values", a->name, 1); *len = 0; return GRIB_ARRAY_TOO_SMALL; } @@ -119,3 +121,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } + +static int get_native_type(grib_accessor* a) +{ + return GRIB_TYPE_LONG; +} diff --git a/src/grib_accessor_class_uint32.cc b/src/grib_accessor_class_uint32.cc index 60e113ae0..01889e79c 100644 --- a/src/grib_accessor_class_uint32.cc +++ b/src/grib_accessor_class_uint32.cc @@ -116,13 +116,11 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_NOT_IMPLEMENTED; } - static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; } - static int get_native_type(grib_accessor* a) { return GRIB_TYPE_LONG; diff --git a/src/grib_accessor_class_uint64.cc b/src/grib_accessor_class_uint64.cc index 2ffe4fc14..1e8ef3a93 100644 --- a/src/grib_accessor_class_uint64.cc +++ b/src/grib_accessor_class_uint64.cc @@ -132,7 +132,6 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } - static int pack_long(grib_accessor* a, const long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; diff --git a/src/grib_accessor_class_validity_time.cc b/src/grib_accessor_class_validity_time.cc index 36af6cb98..e07e71e15 100644 --- a/src/grib_accessor_class_validity_time.cc +++ b/src/grib_accessor_class_validity_time.cc @@ -17,6 +17,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long + IMPLEMENTS = unpack_string IMPLEMENTS = init;dump MEMBERS=const char* date MEMBERS=const char* time @@ -39,6 +40,7 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int unpack_long(grib_accessor*, long* val, size_t* len); +static int unpack_string(grib_accessor*, char*, size_t* len); static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); @@ -84,7 +86,7 @@ static grib_accessor_class _grib_accessor_class_validity_time = { 0, /* unpack_double */ 0, /* unpack_float */ 0, /* pack_string */ - 0, /* unpack_string */ + &unpack_string, /* unpack_string */ 0, /* pack_string_array */ 0, /* unpack_string_array */ 0, /* pack_bytes */ @@ -227,3 +229,24 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_SUCCESS; } + +static int unpack_string(grib_accessor* a, char* val, size_t* len) +{ + int err = 0; + long v = 0; + size_t lsize = 1; + + err = unpack_long(a, &v, &lsize); + if (err) return err; + + if (*len < 5) { + grib_context_log(a->context, GRIB_LOG_ERROR, "Key %s (unpack_string): Buffer too small", a->name); + *len = 5; + return GRIB_BUFFER_TOO_SMALL; + } + + snprintf(val, 64, "%04ld", v); + + len[0] = 5; + return GRIB_SUCCESS; +} diff --git a/src/grib_accessor_classes_hash.cc b/src/grib_accessor_classes_hash.cc index 66c7a9091..ef515c9e1 100644 --- a/src/grib_accessor_classes_hash.cc +++ b/src/grib_accessor_classes_hash.cc @@ -37,12 +37,12 @@ #line 6 "accessor_class_list.gperf" struct accessor_class_hash { char *name; grib_accessor_class **cclass;}; -#define TOTAL_KEYWORDS 211 +#define TOTAL_KEYWORDS 203 #define MIN_WORD_LENGTH 1 #define MAX_WORD_LENGTH 44 #define MIN_HASH_VALUE 1 -#define MAX_HASH_VALUE 620 -/* maximum key range = 620, duplicates = 0 */ +#define MAX_HASH_VALUE 506 +/* maximum key range = 506, duplicates = 0 */ #ifdef __GNUC__ @@ -55,32 +55,32 @@ static unsigned int grib_accessor_classes_get_id (const char *str, size_t len) { static const unsigned short asso_values[] = { - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 0, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 2, 144, - 14, 10, 20, 621, 7, 621, 0, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 0, 621, 0, 82, 111, - 0, 0, 102, 29, 186, 1, 0, 2, 76, 193, - 13, 57, 20, 621, 128, 1, 42, 62, 201, 3, - 18, 21, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 621, 621, 621, 621, 621 + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 0, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 1, 145, + 23, 6, 2, 507, 4, 507, 1, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 0, 507, 0, 69, 84, + 0, 0, 161, 24, 187, 1, 8, 9, 87, 102, + 13, 51, 6, 507, 118, 1, 40, 59, 171, 0, + 4, 6, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 507 }; unsigned int hval = len; @@ -117,550 +117,508 @@ static const struct accessor_class_hash classes[] = #line 9 "accessor_class_list.gperf" {" "}, {""}, {""}, {""}, {""}, -#line 184 "accessor_class_list.gperf" +#line 177 "accessor_class_list.gperf" {"size", &grib_accessor_class_size}, #line 12 "accessor_class_list.gperf" {"ascii", &grib_accessor_class_ascii}, -#line 181 "accessor_class_list.gperf" +#line 174 "accessor_class_list.gperf" {"signed", &grib_accessor_class_signed}, - {""}, {""}, {""}, {""}, {""}, -#line 182 "accessor_class_list.gperf" - {"signed_bits", &grib_accessor_class_signed_bits}, - {""}, -#line 67 "accessor_class_list.gperf" - {"data_raw_packing", &grib_accessor_class_data_raw_packing}, - {""}, -#line 129 "accessor_class_list.gperf" - {"int8", &grib_accessor_class_int8}, - {""}, -#line 73 "accessor_class_list.gperf" - {"data_simple_packing", &grib_accessor_class_data_simple_packing}, -#line 69 "accessor_class_list.gperf" - {"data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap}, -#line 175 "accessor_class_list.gperf" - {"section", &grib_accessor_class_section}, -#line 161 "accessor_class_list.gperf" +#line 154 "accessor_class_list.gperf" {"pad", &grib_accessor_class_pad}, -#line 187 "accessor_class_list.gperf" +#line 180 "accessor_class_list.gperf" {"spd", &grib_accessor_class_spd}, + {""}, #line 75 "accessor_class_list.gperf" - {"dictionary", &grib_accessor_class_dictionary}, -#line 123 "accessor_class_list.gperf" - {"int16", &grib_accessor_class_int16}, -#line 76 "accessor_class_list.gperf" {"dirty", &grib_accessor_class_dirty}, {""}, +#line 175 "accessor_class_list.gperf" + {"signed_bits", &grib_accessor_class_signed_bits}, + {""}, #line 66 "accessor_class_list.gperf" - {"data_png_packing", &grib_accessor_class_data_png_packing}, -#line 177 "accessor_class_list.gperf" - {"section_padding", &grib_accessor_class_section_padding}, -#line 178 "accessor_class_list.gperf" - {"section_pointer", &grib_accessor_class_section_pointer}, -#line 113 "accessor_class_list.gperf" - {"gen", &grib_accessor_class_gen}, -#line 125 "accessor_class_list.gperf" - {"int32", &grib_accessor_class_int32}, - {""}, -#line 58 "accessor_class_list.gperf" - {"data_g22order_packing", &grib_accessor_class_data_g22order_packing}, - {""}, + {"data_raw_packing", &grib_accessor_class_data_raw_packing}, + {""}, {""}, {""}, +#line 72 "accessor_class_list.gperf" + {"data_simple_packing", &grib_accessor_class_data_simple_packing}, +#line 68 "accessor_class_list.gperf" + {"data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap}, +#line 168 "accessor_class_list.gperf" + {"section", &grib_accessor_class_section}, #line 43 "accessor_class_list.gperf" {"data_apply_bitmap", &grib_accessor_class_data_apply_bitmap}, -#line 62 "accessor_class_list.gperf" - {"data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing}, -#line 127 "accessor_class_list.gperf" - {"int64", &grib_accessor_class_int64}, {""}, -#line 174 "accessor_class_list.gperf" - {"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value}, -#line 176 "accessor_class_list.gperf" - {"section_length", &grib_accessor_class_section_length}, -#line 65 "accessor_class_list.gperf" +#line 74 "accessor_class_list.gperf" + {"dictionary", &grib_accessor_class_dictionary}, + {""}, +#line 112 "accessor_class_list.gperf" + {"gen", &grib_accessor_class_gen}, +#line 64 "accessor_class_list.gperf" {"data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing}, -#line 46 "accessor_class_list.gperf" - {"data_apply_gdsnotpresent", &grib_accessor_class_data_apply_gdsnotpresent}, -#line 111 "accessor_class_list.gperf" - {"gds_is_present", &grib_accessor_class_gds_is_present}, +#line 65 "accessor_class_list.gperf" + {"data_png_packing", &grib_accessor_class_data_png_packing}, +#line 170 "accessor_class_list.gperf" + {"section_padding", &grib_accessor_class_section_padding}, +#line 171 "accessor_class_list.gperf" + {"section_pointer", &grib_accessor_class_section_pointer}, #line 44 "accessor_class_list.gperf" {"data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic}, -#line 196 "accessor_class_list.gperf" - {"time", &grib_accessor_class_time}, -#line 114 "accessor_class_list.gperf" - {"getenv", &grib_accessor_class_getenv}, - {""}, -#line 105 "accessor_class_list.gperf" - {"g2grid", &grib_accessor_class_g2grid}, -#line 81 "accessor_class_list.gperf" + {""}, {""}, {""}, {""}, +#line 80 "accessor_class_list.gperf" {"expanded_descriptors", &grib_accessor_class_expanded_descriptors}, - {""}, +#line 155 "accessor_class_list.gperf" + {"padding", &grib_accessor_class_padding}, #line 45 "accessor_class_list.gperf" {"data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap}, -#line 104 "accessor_class_list.gperf" - {"g2end_step", &grib_accessor_class_g2end_step}, -#line 63 "accessor_class_list.gperf" +#line 110 "accessor_class_list.gperf" + {"gds_is_present", &grib_accessor_class_gds_is_present}, +#line 167 "accessor_class_list.gperf" + {"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value}, +#line 169 "accessor_class_list.gperf" + {"section_length", &grib_accessor_class_section_length}, +#line 113 "accessor_class_list.gperf" + {"getenv", &grib_accessor_class_getenv}, +#line 57 "accessor_class_list.gperf" + {"data_g22order_packing", &grib_accessor_class_data_g22order_packing}, +#line 189 "accessor_class_list.gperf" + {"time", &grib_accessor_class_time}, + {""}, +#line 61 "accessor_class_list.gperf" + {"data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing}, + {""}, +#line 153 "accessor_class_list.gperf" + {"packing_type", &grib_accessor_class_packing_type}, +#line 62 "accessor_class_list.gperf" {"data_g2simple_packing", &grib_accessor_class_data_g2simple_packing}, -#line 60 "accessor_class_list.gperf" +#line 59 "accessor_class_list.gperf" {"data_g2complex_packing", &grib_accessor_class_data_g2complex_packing}, -#line 162 "accessor_class_list.gperf" - {"padding", &grib_accessor_class_padding}, + {""}, {""}, +#line 104 "accessor_class_list.gperf" + {"g2grid", &grib_accessor_class_g2grid}, {""}, {""}, {""}, -#line 108 "accessor_class_list.gperf" - {"g2lon", &grib_accessor_class_g2lon}, -#line 149 "accessor_class_list.gperf" +#line 103 "accessor_class_list.gperf" + {"g2end_step", &grib_accessor_class_g2end_step}, +#line 98 "accessor_class_list.gperf" + {"g2_eps", &grib_accessor_class_g2_eps}, +#line 141 "accessor_class_list.gperf" {"nearest", &grib_accessor_class_nearest}, - {""}, {""}, {""}, -#line 194 "accessor_class_list.gperf" + {""}, +#line 156 "accessor_class_list.gperf" + {"padto", &grib_accessor_class_padto}, +#line 187 "accessor_class_list.gperf" {"sum", &grib_accessor_class_sum}, {""}, -#line 209 "accessor_class_list.gperf" +#line 107 "accessor_class_list.gperf" + {"g2lon", &grib_accessor_class_g2lon}, +#line 201 "accessor_class_list.gperf" {"uint8", &grib_accessor_class_uint8}, -#line 99 "accessor_class_list.gperf" - {"g2_eps", &grib_accessor_class_g2_eps}, -#line 193 "accessor_class_list.gperf" + {""}, +#line 186 "accessor_class_list.gperf" {"step_in_units", &grib_accessor_class_step_in_units}, - {""}, -#line 132 "accessor_class_list.gperf" - {"julian_day", &grib_accessor_class_julian_day}, -#line 131 "accessor_class_list.gperf" - {"julian_date", &grib_accessor_class_julian_date}, -#line 64 "accessor_class_list.gperf" +#line 63 "accessor_class_list.gperf" {"data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing}, - {""}, -#line 207 "accessor_class_list.gperf" +#line 199 "accessor_class_list.gperf" {"uint64", &grib_accessor_class_uint64}, -#line 48 "accessor_class_list.gperf" +#line 47 "accessor_class_list.gperf" {"data_complex_packing", &grib_accessor_class_data_complex_packing}, -#line 49 "accessor_class_list.gperf" - {"data_dummy_field", &grib_accessor_class_data_dummy_field}, -#line 205 "accessor_class_list.gperf" +#line 197 "accessor_class_list.gperf" {"uint32", &grib_accessor_class_uint32}, - {""}, {""}, -#line 163 "accessor_class_list.gperf" - {"padto", &grib_accessor_class_padto}, - {""}, -#line 109 "accessor_class_list.gperf" - {"g2step_range", &grib_accessor_class_g2step_range}, -#line 68 "accessor_class_list.gperf" - {"data_run_length_packing", &grib_accessor_class_data_run_length_packing}, #line 13 "accessor_class_list.gperf" {"bit", &grib_accessor_class_bit}, #line 15 "accessor_class_list.gperf" {"bits", &grib_accessor_class_bits}, - {""}, +#line 48 "accessor_class_list.gperf" + {"data_dummy_field", &grib_accessor_class_data_dummy_field}, #line 14 "accessor_class_list.gperf" {"bitmap", &grib_accessor_class_bitmap}, - {""}, -#line 103 "accessor_class_list.gperf" - {"g2date", &grib_accessor_class_g2date}, - {""}, -#line 101 "accessor_class_list.gperf" - {"g2bitmap", &grib_accessor_class_g2bitmap}, -#line 61 "accessor_class_list.gperf" - {"data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap}, -#line 59 "accessor_class_list.gperf" - {"data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing}, -#line 190 "accessor_class_list.gperf" - {"statistics", &grib_accessor_class_statistics}, -#line 16 "accessor_class_list.gperf" - {"bits_per_value", &grib_accessor_class_bits_per_value}, - {""}, -#line 150 "accessor_class_list.gperf" +#line 124 "accessor_class_list.gperf" + {"julian_day", &grib_accessor_class_julian_day}, +#line 123 "accessor_class_list.gperf" + {"julian_date", &grib_accessor_class_julian_date}, +#line 142 "accessor_class_list.gperf" {"non_alpha", &grib_accessor_class_non_alpha}, -#line 183 "accessor_class_list.gperf" - {"simple_packing_error", &grib_accessor_class_simple_packing_error}, - {""}, {""}, {""}, {""}, -#line 191 "accessor_class_list.gperf" - {"statistics_spectral", &grib_accessor_class_statistics_spectral}, -#line 112 "accessor_class_list.gperf" - {"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap}, {""}, -#line 130 "accessor_class_list.gperf" - {"iterator", &grib_accessor_class_iterator}, #line 29 "accessor_class_list.gperf" {"bytes", &grib_accessor_class_bytes}, -#line 97 "accessor_class_list.gperf" - {"g2_aerosol", &grib_accessor_class_g2_aerosol}, -#line 152 "accessor_class_list.gperf" - {"number_of_points", &grib_accessor_class_number_of_points}, -#line 212 "accessor_class_list.gperf" - {"unsigned", &grib_accessor_class_unsigned}, - {""}, {""}, {""}, {""}, -#line 172 "accessor_class_list.gperf" +#line 67 "accessor_class_list.gperf" + {"data_run_length_packing", &grib_accessor_class_data_run_length_packing}, +#line 108 "accessor_class_list.gperf" + {"g2step_range", &grib_accessor_class_g2step_range}, +#line 16 "accessor_class_list.gperf" + {"bits_per_value", &grib_accessor_class_bits_per_value}, + {""}, {""}, {""}, {""}, {""}, +#line 165 "accessor_class_list.gperf" {"scale", &grib_accessor_class_scale}, -#line 213 "accessor_class_list.gperf" - {"unsigned_bits", &grib_accessor_class_unsigned_bits}, {""}, -#line 153 "accessor_class_list.gperf" - {"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian}, -#line 115 "accessor_class_list.gperf" - {"global_gaussian", &grib_accessor_class_global_gaussian}, -#line 198 "accessor_class_list.gperf" - {"to_integer", &grib_accessor_class_to_integer}, - {""}, -#line 192 "accessor_class_list.gperf" - {"step_human_readable", &grib_accessor_class_step_human_readable}, -#line 79 "accessor_class_list.gperf" - {"element", &grib_accessor_class_element}, -#line 180 "accessor_class_list.gperf" - {"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal}, -#line 135 "accessor_class_list.gperf" - {"latitudes", &grib_accessor_class_latitudes}, - {""}, -#line 47 "accessor_class_list.gperf" - {"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing}, -#line 210 "accessor_class_list.gperf" - {"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors}, -#line 168 "accessor_class_list.gperf" - {"raw", &grib_accessor_class_raw}, -#line 208 "accessor_class_list.gperf" - {"uint64_little_endian", &grib_accessor_class_uint64_little_endian}, - {""}, {""}, -#line 206 "accessor_class_list.gperf" - {"uint32_little_endian", &grib_accessor_class_uint32_little_endian}, - {""}, -#line 140 "accessor_class_list.gperf" - {"long", &grib_accessor_class_long}, - {""}, -#line 78 "accessor_class_list.gperf" - {"double", &grib_accessor_class_double}, - {""}, {""}, +#line 183 "accessor_class_list.gperf" + {"statistics", &grib_accessor_class_statistics}, +#line 102 "accessor_class_list.gperf" + {"g2date", &grib_accessor_class_g2date}, +#line 144 "accessor_class_list.gperf" + {"number_of_points", &grib_accessor_class_number_of_points}, #line 100 "accessor_class_list.gperf" - {"g2_mars_labeling", &grib_accessor_class_g2_mars_labeling}, -#line 189 "accessor_class_list.gperf" - {"sprintf", &grib_accessor_class_sprintf}, - {""}, {""}, {""}, -#line 169 "accessor_class_list.gperf" - {"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date}, + {"g2bitmap", &grib_accessor_class_g2bitmap}, {""}, -#line 77 "accessor_class_list.gperf" - {"divdouble", &grib_accessor_class_divdouble}, -#line 106 "accessor_class_list.gperf" - {"g2latlon", &grib_accessor_class_g2latlon}, -#line 199 "accessor_class_list.gperf" - {"to_string", &grib_accessor_class_to_string}, -#line 179 "accessor_class_list.gperf" +#line 60 "accessor_class_list.gperf" + {"data_g2secondary_bitmap", &grib_accessor_class_data_g2secondary_bitmap}, +#line 58 "accessor_class_list.gperf" + {"data_g2bifourier_packing", &grib_accessor_class_data_g2bifourier_packing}, +#line 111 "accessor_class_list.gperf" + {"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap}, +#line 122 "accessor_class_list.gperf" + {"iterator", &grib_accessor_class_iterator}, +#line 184 "accessor_class_list.gperf" + {"statistics_spectral", &grib_accessor_class_statistics_spectral}, +#line 46 "accessor_class_list.gperf" + {"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing}, +#line 145 "accessor_class_list.gperf" + {"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian}, +#line 204 "accessor_class_list.gperf" + {"unsigned", &grib_accessor_class_unsigned}, +#line 138 "accessor_class_list.gperf" + {"md5", &grib_accessor_class_md5}, + {""}, {""}, +#line 96 "accessor_class_list.gperf" + {"g2_aerosol", &grib_accessor_class_g2_aerosol}, +#line 139 "accessor_class_list.gperf" + {"message", &grib_accessor_class_message}, +#line 205 "accessor_class_list.gperf" + {"unsigned_bits", &grib_accessor_class_unsigned_bits}, +#line 172 "accessor_class_list.gperf" {"select_step_template", &grib_accessor_class_select_step_template}, - {""}, {""}, {""}, {""}, -#line 134 "accessor_class_list.gperf" - {"label", &grib_accessor_class_label}, +#line 136 "accessor_class_list.gperf" + {"mars_param", &grib_accessor_class_mars_param}, +#line 202 "accessor_class_list.gperf" + {"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors}, +#line 191 "accessor_class_list.gperf" + {"to_integer", &grib_accessor_class_to_integer}, + {""}, {""}, {""}, +#line 176 "accessor_class_list.gperf" + {"simple_packing_error", &grib_accessor_class_simple_packing_error}, +#line 185 "accessor_class_list.gperf" + {"step_human_readable", &grib_accessor_class_step_human_readable}, +#line 140 "accessor_class_list.gperf" + {"message_copy", &grib_accessor_class_message_copy}, +#line 161 "accessor_class_list.gperf" + {"raw", &grib_accessor_class_raw}, + {""}, {""}, +#line 200 "accessor_class_list.gperf" + {"uint64_little_endian", &grib_accessor_class_uint64_little_endian}, {""}, +#line 198 "accessor_class_list.gperf" + {"uint32_little_endian", &grib_accessor_class_uint32_little_endian}, +#line 114 "accessor_class_list.gperf" + {"global_gaussian", &grib_accessor_class_global_gaussian}, + {""}, {""}, +#line 76 "accessor_class_list.gperf" + {"divdouble", &grib_accessor_class_divdouble}, + {""}, +#line 173 "accessor_class_list.gperf" + {"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal}, +#line 99 "accessor_class_list.gperf" + {"g2_mars_labeling", &grib_accessor_class_g2_mars_labeling}, +#line 78 "accessor_class_list.gperf" + {"element", &grib_accessor_class_element}, +#line 158 "accessor_class_list.gperf" + {"padtomultiple", &grib_accessor_class_padtomultiple}, +#line 127 "accessor_class_list.gperf" + {"latitudes", &grib_accessor_class_latitudes}, +#line 162 "accessor_class_list.gperf" + {"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date}, + {""}, {""}, {""}, +#line 192 "accessor_class_list.gperf" + {"to_string", &grib_accessor_class_to_string}, +#line 132 "accessor_class_list.gperf" + {"long", &grib_accessor_class_long}, #line 19 "accessor_class_list.gperf" {"bufr_data_array", &grib_accessor_class_bufr_data_array}, - {""}, +#line 77 "accessor_class_list.gperf" + {"double", &grib_accessor_class_double}, #line 20 "accessor_class_list.gperf" {"bufr_data_element", &grib_accessor_class_bufr_data_element}, -#line 17 "accessor_class_list.gperf" - {"blob", &grib_accessor_class_blob}, +#line 105 "accessor_class_list.gperf" + {"g2latlon", &grib_accessor_class_g2latlon}, {""}, {""}, #line 26 "accessor_class_list.gperf" {"bufr_simple_thinning", &grib_accessor_class_bufr_simple_thinning}, {""}, -#line 120 "accessor_class_list.gperf" - {"ibmfloat", &grib_accessor_class_ibmfloat}, -#line 56 "accessor_class_list.gperf" - {"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing}, -#line 121 "accessor_class_list.gperf" - {"ieeefloat", &grib_accessor_class_ieeefloat}, -#line 158 "accessor_class_list.gperf" - {"offset_file", &grib_accessor_class_offset_file}, -#line 28 "accessor_class_list.gperf" - {"bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors}, -#line 165 "accessor_class_list.gperf" - {"padtomultiple", &grib_accessor_class_padtomultiple}, +#line 137 "accessor_class_list.gperf" + {"mars_step", &grib_accessor_class_mars_step}, {""}, -#line 202 "accessor_class_list.gperf" - {"trim", &grib_accessor_class_trim}, - {""}, -#line 110 "accessor_class_list.gperf" - {"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name}, - {""}, {""}, {""}, -#line 200 "accessor_class_list.gperf" - {"transient", &grib_accessor_class_transient}, - {""}, -#line 116 "accessor_class_list.gperf" +#line 115 "accessor_class_list.gperf" {"group", &grib_accessor_class_group}, {""}, -#line 166 "accessor_class_list.gperf" +#line 28 "accessor_class_list.gperf" + {"bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors}, +#line 159 "accessor_class_list.gperf" {"position", &grib_accessor_class_position}, -#line 57 "accessor_class_list.gperf" - {"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing}, -#line 50 "accessor_class_list.gperf" - {"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing}, -#line 201 "accessor_class_list.gperf" - {"transient_darray", &grib_accessor_class_transient_darray}, + {""}, {""}, {""}, +#line 17 "accessor_class_list.gperf" + {"blob", &grib_accessor_class_blob}, +#line 109 "accessor_class_list.gperf" + {"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name}, +#line 195 "accessor_class_list.gperf" + {"trim", &grib_accessor_class_trim}, {""}, {""}, -#line 171 "accessor_class_list.gperf" +#line 119 "accessor_class_list.gperf" + {"ibmfloat", &grib_accessor_class_ibmfloat}, + {""}, {""}, +#line 193 "accessor_class_list.gperf" + {"transient", &grib_accessor_class_transient}, +#line 55 "accessor_class_list.gperf" + {"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing}, + {""}, {""}, +#line 56 "accessor_class_list.gperf" + {"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing}, +#line 49 "accessor_class_list.gperf" + {"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing}, +#line 164 "accessor_class_list.gperf" {"round", &grib_accessor_class_round}, -#line 84 "accessor_class_list.gperf" - {"g1_message_length", &grib_accessor_class_g1_message_length}, -#line 124 "accessor_class_list.gperf" - {"int16_little_endian", &grib_accessor_class_int16_little_endian}, -#line 219 "accessor_class_list.gperf" - {"when", &grib_accessor_class_when}, +#line 194 "accessor_class_list.gperf" + {"transient_darray", &grib_accessor_class_transient_darray}, #line 18 "accessor_class_list.gperf" {"budgdate", &grib_accessor_class_budgdate}, - {""}, -#line 146 "accessor_class_list.gperf" - {"md5", &grib_accessor_class_md5}, - {""}, {""}, -#line 126 "accessor_class_list.gperf" - {"int32_little_endian", &grib_accessor_class_int32_little_endian}, -#line 147 "accessor_class_list.gperf" - {"message", &grib_accessor_class_message}, -#line 143 "accessor_class_list.gperf" - {"lookup", &grib_accessor_class_lookup}, -#line 195 "accessor_class_list.gperf" - {"suppressed", &grib_accessor_class_suppressed}, -#line 144 "accessor_class_list.gperf" - {"mars_param", &grib_accessor_class_mars_param}, - {""}, -#line 128 "accessor_class_list.gperf" - {"int64_little_endian", &grib_accessor_class_int64_little_endian}, -#line 142 "accessor_class_list.gperf" - {"longitudes", &grib_accessor_class_longitudes}, -#line 216 "accessor_class_list.gperf" +#line 208 "accessor_class_list.gperf" {"values", &grib_accessor_class_values}, -#line 151 "accessor_class_list.gperf" +#line 143 "accessor_class_list.gperf" {"number_of_coded_values", &grib_accessor_class_number_of_coded_values}, - {""}, -#line 188 "accessor_class_list.gperf" - {"spectral_truncation", &grib_accessor_class_spectral_truncation}, - {""}, {""}, -#line 203 "accessor_class_list.gperf" - {"uint16", &grib_accessor_class_uint16}, -#line 95 "accessor_class_list.gperf" - {"g1step_range", &grib_accessor_class_g1step_range}, +#line 126 "accessor_class_list.gperf" + {"label", &grib_accessor_class_label}, {""}, {""}, #line 38 "accessor_class_list.gperf" {"concept", &grib_accessor_class_concept}, - {""}, {""}, {""}, -#line 87 "accessor_class_list.gperf" - {"g1date", &grib_accessor_class_g1date}, -#line 71 "accessor_class_list.gperf" - {"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked}, -#line 86 "accessor_class_list.gperf" - {"g1bitmap", &grib_accessor_class_g1bitmap}, -#line 55 "accessor_class_list.gperf" - {"data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap}, -#line 148 "accessor_class_list.gperf" - {"message_copy", &grib_accessor_class_message_copy}, {""}, -#line 72 "accessor_class_list.gperf" - {"data_shsimple_packing", &grib_accessor_class_data_shsimple_packing}, +#line 181 "accessor_class_list.gperf" + {"spectral_truncation", &grib_accessor_class_spectral_truncation}, + {""}, {""}, +#line 83 "accessor_class_list.gperf" + {"g1_message_length", &grib_accessor_class_g1_message_length}, +#line 182 "accessor_class_list.gperf" + {"sprintf", &grib_accessor_class_sprintf}, +#line 188 "accessor_class_list.gperf" + {"suppressed", &grib_accessor_class_suppressed}, + {""}, +#line 211 "accessor_class_list.gperf" + {"when", &grib_accessor_class_when}, + {""}, {""}, +#line 178 "accessor_class_list.gperf" + {"smart_table", &grib_accessor_class_smart_table}, {""}, -#line 102 "accessor_class_list.gperf" - {"g2bitmap_present", &grib_accessor_class_g2bitmap_present}, -#line 167 "accessor_class_list.gperf" - {"proj_string", &grib_accessor_class_proj_string}, #line 39 "accessor_class_list.gperf" {"constant", &grib_accessor_class_constant}, - {""}, -#line 27 "accessor_class_list.gperf" - {"bufr_string_values", &grib_accessor_class_bufr_string_values}, -#line 159 "accessor_class_list.gperf" - {"offset_values", &grib_accessor_class_offset_values}, -#line 157 "accessor_class_list.gperf" + {""}, {""}, +#line 160 "accessor_class_list.gperf" + {"proj_string", &grib_accessor_class_proj_string}, +#line 149 "accessor_class_list.gperf" {"octet_number", &grib_accessor_class_octet_number}, -#line 53 "accessor_class_list.gperf" - {"data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing}, - {""}, -#line 139 "accessor_class_list.gperf" - {"local_definition", &grib_accessor_class_local_definition}, -#line 54 "accessor_class_list.gperf" - {"data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing}, - {""}, -#line 138 "accessor_class_list.gperf" - {"library_version", &grib_accessor_class_library_version}, - {""}, -#line 51 "accessor_class_list.gperf" - {"data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing}, -#line 145 "accessor_class_list.gperf" - {"mars_step", &grib_accessor_class_mars_step}, -#line 52 "accessor_class_list.gperf" - {"data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing}, - {""}, -#line 197 "accessor_class_list.gperf" - {"to_double", &grib_accessor_class_to_double}, - {""}, {""}, {""}, {""}, -#line 21 "accessor_class_list.gperf" - {"bufr_elements_table", &grib_accessor_class_bufr_elements_table}, -#line 85 "accessor_class_list.gperf" - {"g1_section4_length", &grib_accessor_class_g1_section4_length}, - {""}, {""}, -#line 214 "accessor_class_list.gperf" - {"validity_date", &grib_accessor_class_validity_date}, -#line 215 "accessor_class_list.gperf" - {"validity_time", &grib_accessor_class_validity_time}, - {""}, {""}, -#line 122 "accessor_class_list.gperf" - {"ifs_param", &grib_accessor_class_ifs_param}, - {""}, {""}, {""}, -#line 218 "accessor_class_list.gperf" - {"vector", &grib_accessor_class_vector}, - {""}, {""}, -#line 117 "accessor_class_list.gperf" - {"gts_header", &grib_accessor_class_gts_header}, -#line 89 "accessor_class_list.gperf" - {"g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly}, -#line 204 "accessor_class_list.gperf" - {"uint16_little_endian", &grib_accessor_class_uint16_little_endian}, - {""}, {""}, -#line 141 "accessor_class_list.gperf" - {"long_vector", &grib_accessor_class_long_vector}, - {""}, {""}, -#line 119 "accessor_class_list.gperf" - {"headers_only", &grib_accessor_class_headers_only}, - {""}, -#line 136 "accessor_class_list.gperf" - {"latlon_increment", &grib_accessor_class_latlon_increment}, -#line 34 "accessor_class_list.gperf" - {"codeflag", &grib_accessor_class_codeflag}, - {""}, {""}, {""}, -#line 25 "accessor_class_list.gperf" - {"bufr_group", &grib_accessor_class_bufr_group}, -#line 33 "accessor_class_list.gperf" - {"closest_date", &grib_accessor_class_closest_date}, - {""}, -#line 217 "accessor_class_list.gperf" - {"variable", &grib_accessor_class_variable}, -#line 74 "accessor_class_list.gperf" - {"decimal_precision", &grib_accessor_class_decimal_precision}, -#line 164 "accessor_class_list.gperf" - {"padtoeven", &grib_accessor_class_padtoeven}, - {""}, -#line 185 "accessor_class_list.gperf" - {"smart_table", &grib_accessor_class_smart_table}, - {""}, {""}, -#line 154 "accessor_class_list.gperf" - {"number_of_values", &grib_accessor_class_number_of_values}, -#line 24 "accessor_class_list.gperf" - {"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets}, - {""}, {""}, -#line 186 "accessor_class_list.gperf" +#line 179 "accessor_class_list.gperf" {"smart_table_column", &grib_accessor_class_smart_table_column}, {""}, +#line 135 "accessor_class_list.gperf" + {"lookup", &grib_accessor_class_lookup}, + {""}, +#line 94 "accessor_class_list.gperf" + {"g1step_range", &grib_accessor_class_g1step_range}, +#line 73 "accessor_class_list.gperf" + {"decimal_precision", &grib_accessor_class_decimal_precision}, + {""}, +#line 134 "accessor_class_list.gperf" + {"longitudes", &grib_accessor_class_longitudes}, +#line 70 "accessor_class_list.gperf" + {"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked}, +#line 27 "accessor_class_list.gperf" + {"bufr_string_values", &grib_accessor_class_bufr_string_values}, +#line 196 "accessor_class_list.gperf" + {"uint16", &grib_accessor_class_uint16}, + {""}, {""}, +#line 71 "accessor_class_list.gperf" + {"data_shsimple_packing", &grib_accessor_class_data_shsimple_packing}, +#line 86 "accessor_class_list.gperf" + {"g1date", &grib_accessor_class_g1date}, + {""}, +#line 85 "accessor_class_list.gperf" + {"g1bitmap", &grib_accessor_class_g1bitmap}, + {""}, +#line 54 "accessor_class_list.gperf" + {"data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap}, +#line 190 "accessor_class_list.gperf" + {"to_double", &grib_accessor_class_to_double}, +#line 101 "accessor_class_list.gperf" + {"g2bitmap_present", &grib_accessor_class_g2bitmap_present}, +#line 120 "accessor_class_list.gperf" + {"ieeefloat", &grib_accessor_class_ieeefloat}, +#line 150 "accessor_class_list.gperf" + {"offset_file", &grib_accessor_class_offset_file}, +#line 206 "accessor_class_list.gperf" + {"validity_date", &grib_accessor_class_validity_date}, +#line 207 "accessor_class_list.gperf" + {"validity_time", &grib_accessor_class_validity_time}, + {""}, +#line 130 "accessor_class_list.gperf" + {"library_version", &grib_accessor_class_library_version}, +#line 210 "accessor_class_list.gperf" + {"vector", &grib_accessor_class_vector}, +#line 84 "accessor_class_list.gperf" + {"g1_section4_length", &grib_accessor_class_g1_section4_length}, + {""}, +#line 52 "accessor_class_list.gperf" + {"data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing}, + {""}, {""}, +#line 53 "accessor_class_list.gperf" + {"data_g1second_order_row_by_row_packing", &grib_accessor_class_data_g1second_order_row_by_row_packing}, + {""}, +#line 24 "accessor_class_list.gperf" + {"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets}, +#line 157 "accessor_class_list.gperf" + {"padtoeven", &grib_accessor_class_padtoeven}, +#line 50 "accessor_class_list.gperf" + {"data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing}, + {""}, +#line 51 "accessor_class_list.gperf" + {"data_g1second_order_general_extended_packing", &grib_accessor_class_data_g1second_order_general_extended_packing}, #line 22 "accessor_class_list.gperf" {"bufr_extract_area_subsets", &grib_accessor_class_bufr_extract_area_subsets}, -#line 160 "accessor_class_list.gperf" - {"pack_bufr_values", &grib_accessor_class_pack_bufr_values}, - {""}, -#line 35 "accessor_class_list.gperf" - {"codetable", &grib_accessor_class_codetable}, + {""}, {""}, {""}, #line 23 "accessor_class_list.gperf" {"bufr_extract_datetime_subsets", &grib_accessor_class_bufr_extract_datetime_subsets}, {""}, -#line 133 "accessor_class_list.gperf" - {"ksec1expver", &grib_accessor_class_ksec1expver}, +#line 21 "accessor_class_list.gperf" + {"bufr_elements_table", &grib_accessor_class_bufr_elements_table}, {""}, {""}, {""}, {""}, -#line 155 "accessor_class_list.gperf" +#line 152 "accessor_class_list.gperf" + {"pack_bufr_values", &grib_accessor_class_pack_bufr_values}, +#line 35 "accessor_class_list.gperf" + {"codetable", &grib_accessor_class_codetable}, +#line 131 "accessor_class_list.gperf" + {"local_definition", &grib_accessor_class_local_definition}, + {""}, +#line 25 "accessor_class_list.gperf" + {"bufr_group", &grib_accessor_class_bufr_group}, + {""}, +#line 88 "accessor_class_list.gperf" + {"g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly}, +#line 146 "accessor_class_list.gperf" + {"number_of_values", &grib_accessor_class_number_of_values}, + {""}, +#line 116 "accessor_class_list.gperf" + {"gts_header", &grib_accessor_class_gts_header}, + {""}, +#line 33 "accessor_class_list.gperf" + {"closest_date", &grib_accessor_class_closest_date}, + {""}, {""}, +#line 209 "accessor_class_list.gperf" + {"variable", &grib_accessor_class_variable}, +#line 133 "accessor_class_list.gperf" + {"long_vector", &grib_accessor_class_long_vector}, +#line 166 "accessor_class_list.gperf" + {"scale_values", &grib_accessor_class_scale_values}, + {""}, {""}, {""}, +#line 128 "accessor_class_list.gperf" + {"latlon_increment", &grib_accessor_class_latlon_increment}, + {""}, {""}, {""}, +#line 147 "accessor_class_list.gperf" {"number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing}, {""}, -#line 70 "accessor_class_list.gperf" - {"data_sh_packed", &grib_accessor_class_data_sh_packed}, - {""}, -#line 80 "accessor_class_list.gperf" +#line 79 "accessor_class_list.gperf" {"evaluate", &grib_accessor_class_evaluate}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 40 "accessor_class_list.gperf" - {"count_file", &grib_accessor_class_count_file}, - {""}, -#line 118 "accessor_class_list.gperf" - {"hash_array", &grib_accessor_class_hash_array}, -#line 173 "accessor_class_list.gperf" - {"scale_values", &grib_accessor_class_scale_values}, - {""}, -#line 107 "accessor_class_list.gperf" - {"g2level", &grib_accessor_class_g2level}, - {""}, {""}, {""}, -#line 90 "accessor_class_list.gperf" - {"g1fcperiod", &grib_accessor_class_g1fcperiod}, -#line 211 "accessor_class_list.gperf" - {"unpack_bufr_values", &grib_accessor_class_unpack_bufr_values}, - {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, +#line 151 "accessor_class_list.gperf" + {"offset_values", &grib_accessor_class_offset_values}, +#line 69 "accessor_class_list.gperf" + {"data_sh_packed", &grib_accessor_class_data_sh_packed}, #line 11 "accessor_class_list.gperf" {"abstract_vector", &grib_accessor_class_abstract_vector}, - {""}, -#line 83 "accessor_class_list.gperf" - {"g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag}, -#line 42 "accessor_class_list.gperf" - {"count_total", &grib_accessor_class_count_total}, - {""}, {""}, {""}, {""}, {""}, {""}, -#line 137 "accessor_class_list.gperf" - {"latlonvalues", &grib_accessor_class_latlonvalues}, +#line 118 "accessor_class_list.gperf" + {"headers_only", &grib_accessor_class_headers_only}, +#line 125 "accessor_class_list.gperf" + {"ksec1expver", &grib_accessor_class_ksec1expver}, {""}, {""}, +#line 41 "accessor_class_list.gperf" + {"count_missing", &grib_accessor_class_count_missing}, +#line 203 "accessor_class_list.gperf" + {"unpack_bufr_values", &grib_accessor_class_unpack_bufr_values}, + {""}, {""}, +#line 121 "accessor_class_list.gperf" + {"ifs_param", &grib_accessor_class_ifs_param}, + {""}, {""}, {""}, #line 36 "accessor_class_list.gperf" {"codetable_title", &grib_accessor_class_codetable_title}, + {""}, {""}, {""}, +#line 89 "accessor_class_list.gperf" + {"g1fcperiod", &grib_accessor_class_g1fcperiod}, +#line 34 "accessor_class_list.gperf" + {"codeflag", &grib_accessor_class_codeflag}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 106 "accessor_class_list.gperf" + {"g2level", &grib_accessor_class_g2level}, +#line 42 "accessor_class_list.gperf" + {"count_total", &grib_accessor_class_count_total}, + {""}, +#line 117 "accessor_class_list.gperf" + {"hash_array", &grib_accessor_class_hash_array}, + {""}, {""}, +#line 37 "accessor_class_list.gperf" + {"codetable_units", &grib_accessor_class_codetable_units}, + {""}, {""}, +#line 129 "accessor_class_list.gperf" + {"latlonvalues", &grib_accessor_class_latlonvalues}, + {""}, {""}, {""}, {""}, #line 30 "accessor_class_list.gperf" {"change_alternative_row_scanning", &grib_accessor_class_change_alternative_row_scanning}, {""}, {""}, {""}, {""}, {""}, {""}, #line 31 "accessor_class_list.gperf" {"change_scanning_direction", &grib_accessor_class_change_scanning_direction}, - {""}, {""}, {""}, {""}, -#line 37 "accessor_class_list.gperf" - {"codetable_units", &grib_accessor_class_codetable_units}, - {""}, -#line 82 "accessor_class_list.gperf" - {"from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value}, - {""}, -#line 156 "accessor_class_list.gperf" + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 148 "accessor_class_list.gperf" {"octahedral_gaussian", &grib_accessor_class_octahedral_gaussian}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, -#line 92 "accessor_class_list.gperf" - {"g1monthlydate", &grib_accessor_class_g1monthlydate}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, #line 10 "accessor_class_list.gperf" {"abstract_long_vector", &grib_accessor_class_abstract_long_vector}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 41 "accessor_class_list.gperf" - {"count_missing", &grib_accessor_class_count_missing}, + {""}, {""}, {""}, +#line 40 "accessor_class_list.gperf" + {"count_file", &grib_accessor_class_count_file}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 91 "accessor_class_list.gperf" + {"g1monthlydate", &grib_accessor_class_g1monthlydate}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 82 "accessor_class_list.gperf" + {"g1_half_byte_codeflag", &grib_accessor_class_g1_half_byte_codeflag}, + {""}, +#line 81 "accessor_class_list.gperf" + {"from_scale_factor_scaled_value", &grib_accessor_class_from_scale_factor_scaled_value}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, #line 32 "accessor_class_list.gperf" {"check_internal_version", &grib_accessor_class_check_internal_version}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 88 "accessor_class_list.gperf" - {"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 96 "accessor_class_list.gperf" - {"g1verificationdate", &grib_accessor_class_g1verificationdate}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 170 "accessor_class_list.gperf" +#line 97 "accessor_class_list.gperf" + {"g2_chemical", &grib_accessor_class_g2_chemical}, +#line 87 "accessor_class_list.gperf" + {"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date}, + {""}, {""}, {""}, {""}, {""}, +#line 163 "accessor_class_list.gperf" {"reference_value_error", &grib_accessor_class_reference_value_error}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, -#line 94 "accessor_class_list.gperf" - {"g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, #line 93 "accessor_class_list.gperf" + {"g1number_of_coded_values_sh_simple", &grib_accessor_class_g1number_of_coded_values_sh_simple}, +#line 92 "accessor_class_list.gperf" {"g1number_of_coded_values_sh_complex", &grib_accessor_class_g1number_of_coded_values_sh_complex}, - {""}, {""}, {""}, {""}, {""}, -#line 98 "accessor_class_list.gperf" - {"g2_chemical", &grib_accessor_class_g2_chemical}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, -#line 91 "accessor_class_list.gperf" - {"g1forecastmonth", &grib_accessor_class_g1forecastmonth} +#line 90 "accessor_class_list.gperf" + {"g1forecastmonth", &grib_accessor_class_g1forecastmonth}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 95 "accessor_class_list.gperf" + {"g1verificationdate", &grib_accessor_class_g1verificationdate} }; -static const struct accessor_class_hash* grib_accessor_classes_hash (const char *str, size_t len) +static const struct accessor_class_hash* grib_accessor_classes_hash(const char *str, size_t len) { unsigned int key = grib_accessor_classes_get_id (str, len); diff --git a/src/grib_accessor_factory.h b/src/grib_accessor_factory.h index 1c79ed01a..96a9bc024 100644 --- a/src/grib_accessor_factory.h +++ b/src/grib_accessor_factory.h @@ -35,7 +35,6 @@ { "data_apply_bitmap", &grib_accessor_class_data_apply_bitmap, }, { "data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic, }, { "data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap, }, -{ "data_apply_gdsnotpresent", &grib_accessor_class_data_apply_gdsnotpresent, }, { "data_ccsds_packing", &grib_accessor_class_data_ccsds_packing, }, { "data_complex_packing", &grib_accessor_class_data_complex_packing, }, { "data_dummy_field", &grib_accessor_class_data_dummy_field, }, @@ -112,13 +111,6 @@ { "ibmfloat", &grib_accessor_class_ibmfloat, }, { "ieeefloat", &grib_accessor_class_ieeefloat, }, { "ifs_param", &grib_accessor_class_ifs_param, }, -{ "int16", &grib_accessor_class_int16, }, -{ "int16_little_endian", &grib_accessor_class_int16_little_endian, }, -{ "int32", &grib_accessor_class_int32, }, -{ "int32_little_endian", &grib_accessor_class_int32_little_endian, }, -{ "int64", &grib_accessor_class_int64, }, -{ "int64_little_endian", &grib_accessor_class_int64_little_endian, }, -{ "int8", &grib_accessor_class_int8, }, { "iterator", &grib_accessor_class_iterator, }, { "julian_date", &grib_accessor_class_julian_date, }, { "julian_day", &grib_accessor_class_julian_day, }, @@ -150,6 +142,7 @@ { "offset_file", &grib_accessor_class_offset_file, }, { "offset_values", &grib_accessor_class_offset_values, }, { "pack_bufr_values", &grib_accessor_class_pack_bufr_values, }, +{ "packing_type", &grib_accessor_class_packing_type, }, { "pad", &grib_accessor_class_pad, }, { "padding", &grib_accessor_class_padding, }, { "padto", &grib_accessor_class_padto, }, @@ -193,7 +186,6 @@ { "transient_darray", &grib_accessor_class_transient_darray, }, { "trim", &grib_accessor_class_trim, }, { "uint16", &grib_accessor_class_uint16, }, -{ "uint16_little_endian", &grib_accessor_class_uint16_little_endian, }, { "uint32", &grib_accessor_class_uint32, }, { "uint32_little_endian", &grib_accessor_class_uint32_little_endian, }, { "uint64", &grib_accessor_class_uint64, }, diff --git a/src/grib_accessor_factory_hash_list b/src/grib_accessor_factory_hash_list index e88a4acff..4c8a05671 100644 --- a/src/grib_accessor_factory_hash_list +++ b/src/grib_accessor_factory_hash_list @@ -36,7 +36,6 @@ count_total, &grib_accessor_class_count_total data_apply_bitmap, &grib_accessor_class_data_apply_bitmap data_apply_boustrophedonic, &grib_accessor_class_data_apply_boustrophedonic data_apply_boustrophedonic_bitmap, &grib_accessor_class_data_apply_boustrophedonic_bitmap -data_apply_gdsnotpresent, &grib_accessor_class_data_apply_gdsnotpresent data_ccsds_packing, &grib_accessor_class_data_ccsds_packing data_complex_packing, &grib_accessor_class_data_complex_packing data_dummy_field, &grib_accessor_class_data_dummy_field @@ -113,13 +112,6 @@ headers_only, &grib_accessor_class_headers_only ibmfloat, &grib_accessor_class_ibmfloat ieeefloat, &grib_accessor_class_ieeefloat ifs_param, &grib_accessor_class_ifs_param -int16, &grib_accessor_class_int16 -int16_little_endian, &grib_accessor_class_int16_little_endian -int32, &grib_accessor_class_int32 -int32_little_endian, &grib_accessor_class_int32_little_endian -int64, &grib_accessor_class_int64 -int64_little_endian, &grib_accessor_class_int64_little_endian -int8, &grib_accessor_class_int8 iterator, &grib_accessor_class_iterator julian_date, &grib_accessor_class_julian_date julian_day, &grib_accessor_class_julian_day @@ -151,6 +143,7 @@ octet_number, &grib_accessor_class_octet_number offset_file, &grib_accessor_class_offset_file offset_values, &grib_accessor_class_offset_values pack_bufr_values, &grib_accessor_class_pack_bufr_values +packing_type, &grib_accessor_class_packing_type pad, &grib_accessor_class_pad padding, &grib_accessor_class_padding padto, &grib_accessor_class_padto @@ -194,7 +187,6 @@ transient, &grib_accessor_class_transient transient_darray, &grib_accessor_class_transient_darray trim, &grib_accessor_class_trim uint16, &grib_accessor_class_uint16 -uint16_little_endian, &grib_accessor_class_uint16_little_endian uint32, &grib_accessor_class_uint32 uint32_little_endian, &grib_accessor_class_uint32_little_endian uint64, &grib_accessor_class_uint64 diff --git a/src/grib_api.h b/src/grib_api.h index 28ff1eec8..9a3e46ffc 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -599,7 +599,7 @@ grib_iterator* grib_iterator_new(const grib_handle* h, unsigned long flags, int* /** * Get latitude/longitude and data values. - * The Latitudes, longitudes and values arrays must be properly allocated by the caller. + * The latitudes, longitudes and values arrays must be properly allocated by the caller. * Their required dimension can be obtained by getting the value of the integer key "numberOfPoints". * * @param h : handle from which geography and data values are taken @@ -614,9 +614,9 @@ int grib_get_data(const grib_handle* h, double* lats, double* lons, double* valu * Get the next value from a geoiterator. * * @param i : the geoiterator - * @param lat : on output latitude in degree - * @param lon : on output longitude in degree - * @param value : on output value of the point + * @param lat : output latitude in degrees + * @param lon : output longitude in degrees + * @param value : output value of the point * @return positive value if successful, 0 if no more data are available */ int grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value); @@ -625,9 +625,9 @@ int grib_iterator_next(grib_iterator* i, double* lat, double* lon, double* value * Get the previous value from a geoiterator. * * @param i : the geoiterator - * @param lat : on output latitude in degree - * @param lon : on output longitude in degree - * @param value : on output value of the point* + * @param lat : output latitude in degrees + * @param lon : output longitude in degrees + * @param value : output value of the point* * @return positive value if successful, 0 if no more data are available */ int grib_iterator_previous(grib_iterator* i, double* lat, double* lon, double* value); @@ -636,7 +636,7 @@ int grib_iterator_previous(grib_iterator* i, double* lat, double* lon, double* v * Test procedure for values in a geoiterator. * * @param i : the geoiterator - * @return boolean, 1 if the geoiterator still nave next values, 0 otherwise + * @return boolean, 1 if the geoiterator still has next values, 0 otherwise */ int grib_iterator_has_next(grib_iterator* i); @@ -1402,6 +1402,7 @@ int grib_get_message_size(const grib_handle* h, size_t* size); #define GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA 10 #define GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL 11 #define GRIB_UTIL_GRID_SPEC_UNSTRUCTURED 12 +#define GRIB_UTIL_GRID_SPEC_HEALPIX 13 typedef struct grib_util_grid_spec { @@ -1431,7 +1432,7 @@ typedef struct grib_util_grid_spec long iScansNegatively; long jScansPositively; - /* Gaussian number */ + /* Gaussian number or HEALPIX Nside */ long N; /* Bitmap */ diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 0ae6ccccf..bf6b3694d 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -204,31 +204,22 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t* attr, int type); #include "grib_api.h" -#define GRIB_UNKNOWN_VALUE -9999.999 -#define GRIB_KEY_UNDEF "undef" - -#define GRIB_HANDLE_BIG_ECMWF_GRIB1 1 - #define MAX_ACCESSOR_ATTRIBUTES 20 #define MAX_FILE_HANDLES_WITH_MULTI 10 #define ACCESSORS_ARRAY_SIZE 5000 #define MAX_NUM_CONCEPTS 2000 #define MAX_NUM_HASH_ARRAY 2000 -#define GRIB_NAMESPACE 10 +#define CODES_NAMESPACE 10 #define MAX_NAMESPACE_LEN 64 -#define GRIB_MY_BUFFER 0 -#define GRIB_USER_BUFFER 1 +#define CODES_MY_BUFFER 0 +#define CODES_USER_BUFFER 1 -#define GRIB_REAL_MODE4 4 -#define GRIB_REAL_MODE8 8 +#define CODES_REAL_MODE8 8 #define MAX_NUM_SECTIONS 12 -#define GRIB_DISPOSABLE_MEMORY 0 -#define GRIB_LONG_LASTING_MEMORY 1 - #define GRIB_LOG_PERROR (1 << 10) #define GRIB_HASH_ARRAY_TYPE_UNKNOWN 0 @@ -236,17 +227,17 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t* attr, int type); #define GRIB_HASH_ARRAY_TYPE_DOUBLE 2 #define GRIB_HASH_ARRAY_TYPE_STRING 3 -#define CODES_GRIB 1 -#define CODES_BUFR 2 +#define CODES_GRIB 1 +#define CODES_BUFR 2 #define CODES_METAR 3 -#define CODES_GTS 4 +#define CODES_GTS 4 #define CODES_BUFR_UNPACK_STRUCTURE 0 -#define CODES_BUFR_UNPACK_FLAT 1 -#define CODES_BUFR_NEW_DATA 2 +#define CODES_BUFR_UNPACK_FLAT 1 +#define CODES_BUFR_NEW_DATA 2 #define MAX_SMART_TABLE_COLUMNS 20 -#define MAX_CODETABLE_ENTRIES 65536 +#define MAX_CODETABLE_ENTRIES 65536 /* ACCESSOR COMPARE FLAGS */ #define GRIB_COMPARE_NAMES (1 << 0) @@ -327,7 +318,6 @@ typedef void (*accessor_resize_proc)(grib_accessor*, size_t); typedef grib_accessor* (*accessor_next_proc)(grib_accessor*, int); typedef grib_section* (*accessor_sub_section_proc)(grib_accessor*); - typedef int (*accessor_pack_missing_proc)(grib_accessor*); typedef int (*accessor_pack_is_missing_proc)(grib_accessor*); typedef int (*accessor_pack_long_proc)(grib_accessor*, const long*, size_t* len); @@ -363,7 +353,6 @@ typedef int (*grib_binop_string_proc)(char*, char*); typedef struct second_order_packed second_order_packed; typedef void grib_expression_visit_proc(void* udata, grib_expression* e); - struct grib_key_value_list { const char* name; @@ -378,7 +367,6 @@ struct grib_key_value_list grib_key_value_list* next; }; - struct second_order_packed { unsigned long nbits_per_widths; @@ -403,9 +391,7 @@ struct grib_packer grib_unpack_proc unpack; /** < unpacking procedure */ }; - /* --------------- */ - typedef struct grib_loader grib_loader; typedef int (*grib_loader_init_accessor_proc)(grib_loader*, grib_accessor*, grib_arguments*); typedef int (*grib_loader_lookup_long_proc)(grib_context*, grib_loader*, const char* name, long* value); @@ -451,7 +437,6 @@ struct grib_accessors_list grib_accessors_list* last; }; - typedef int (*action_create_accessors_handle_proc)(grib_section* p, grib_action* a, grib_loader* h); typedef int (*action_notify_change_proc)(grib_action* a, grib_accessor* observer, grib_accessor* observed); @@ -490,7 +475,6 @@ struct grib_action_class action_execute_proc execute; }; - /** * a buffer * Structure containing the data of a message @@ -590,7 +574,6 @@ struct grib_section size_t padding; }; - struct grib_iterator_class { grib_iterator_class** super; @@ -625,10 +608,6 @@ struct grib_nearest_class }; /* --------------- */ -/* --------------- */ -typedef void (*search_all_callback_proc)(grib_accessor*, void* data); -/* --------------- */ - typedef int (*dumper_init_proc)(grib_dumper*); typedef void (*dumper_dump_proc)(grib_dumper*, grib_accessor*, const char* comment); typedef void (*dumper_dump_section_proc)(grib_dumper*, grib_accessor*, grib_block_of_accessors* block); @@ -713,7 +692,6 @@ typedef struct grib_trie_with_rank_list grib_trie_with_rank_list; typedef struct grib_trie_with_rank grib_trie_with_rank; typedef struct grib_itrie grib_itrie; - /* Dynamic array of strings */ struct grib_sarray { @@ -850,7 +828,6 @@ struct codes_condition double rightDouble; }; - void codes_assertion_failed(const char* message, const char* file, int line); #define MAX_SET_VALUES 10 diff --git a/src/grib_buffer.cc b/src/grib_buffer.cc index 581a66239..370cafc13 100644 --- a/src/grib_buffer.cc +++ b/src/grib_buffer.cc @@ -16,13 +16,13 @@ void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b) { unsigned char* newdata; - if (b->property == GRIB_MY_BUFFER) + if (b->property == CODES_MY_BUFFER) return; newdata = (unsigned char*)grib_context_malloc(c, b->length); memcpy(newdata, b->data, b->length); b->data = newdata; - b->property = GRIB_MY_BUFFER; + b->property = CODES_MY_BUFFER; } grib_buffer* grib_create_growable_buffer(const grib_context* c) @@ -34,7 +34,7 @@ grib_buffer* grib_create_growable_buffer(const grib_context* c) return NULL; } - b->property = GRIB_MY_BUFFER; + b->property = CODES_MY_BUFFER; b->length = 10240; b->ulength = 0; b->data = (unsigned char*)grib_context_malloc_clear(c, b->length); @@ -58,7 +58,7 @@ grib_buffer* grib_new_buffer(const grib_context* c, const unsigned char* data, s return NULL; } - b->property = GRIB_USER_BUFFER; + b->property = CODES_USER_BUFFER; b->length = buflen; b->ulength = buflen; b->ulength_bits = buflen * 8; @@ -69,7 +69,7 @@ grib_buffer* grib_new_buffer(const grib_context* c, const unsigned char* data, s void grib_buffer_delete(const grib_context* c, grib_buffer* b) { - if (b->property == GRIB_MY_BUFFER) + if (b->property == CODES_MY_BUFFER) grib_context_free(c, b->data); b->length = 0; b->ulength = 0; diff --git a/src/grib_bufr_descriptor.cc b/src/grib_bufr_descriptor.cc index 68aa7e290..fa653bc29 100644 --- a/src/grib_bufr_descriptor.cc +++ b/src/grib_bufr_descriptor.cc @@ -89,20 +89,6 @@ int grib_bufr_descriptor_set_code(grib_accessor* tables_accessor, int code, bufr return err; } -void grib_bufr_descriptor_set_reference(bufr_descriptor* v, long reference) -{ - if (!v) - return; - v->reference = reference; -} - -void grib_bufr_descriptor_set_width(bufr_descriptor* v, long width) -{ - if (!v) - return; - v->width = width; -} - void grib_bufr_descriptor_set_scale(bufr_descriptor* v, long scale) { if (!v) diff --git a/src/grib_bufr_descriptors_array.cc b/src/grib_bufr_descriptors_array.cc index a5967f26c..0134048a2 100644 --- a/src/grib_bufr_descriptors_array.cc +++ b/src/grib_bufr_descriptors_array.cc @@ -40,11 +40,11 @@ bufr_descriptors_array* grib_bufr_descriptors_array_new(grib_context* c, size_t return v; } -bufr_descriptor* grib_bufr_descriptors_array_pop(bufr_descriptors_array* a) -{ - a->n -= 1; - return a->v[a->n]; -} +// bufr_descriptor* grib_bufr_descriptors_array_pop(bufr_descriptors_array* a) +// { +// a->n -= 1; +// return a->v[a->n]; +// } bufr_descriptor* grib_bufr_descriptors_array_pop_front(bufr_descriptors_array* a) { @@ -135,40 +135,38 @@ bufr_descriptors_array* grib_bufr_descriptors_array_append(bufr_descriptors_arra return v; } -bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v, bufr_descriptor* val) -{ - size_t i = 0; - if (!v) { - size_t start_size = DYN_ARRAY_SIZE_INIT; - size_t start_incsize = DYN_ARRAY_SIZE_INCR; - v = grib_bufr_descriptors_array_new(0, start_size, start_incsize); - } - - if (v->number_of_pop_front) { - v->v--; - v->number_of_pop_front--; - } - else { - if (v->n >= v->size) - v = grib_bufr_descriptors_array_resize(v); - for (i = v->n; i > 0; i--) - v[i] = v[i - 1]; - } - v->v[0] = val; - v->n++; - - return v; -} +// bufr_descriptors_array* grib_bufr_descriptors_array_push_front(bufr_descriptors_array* v, bufr_descriptor* val) +// { +// size_t i = 0; +// if (!v) { +// size_t start_size = DYN_ARRAY_SIZE_INIT; +// size_t start_incsize = DYN_ARRAY_SIZE_INCR; +// v = grib_bufr_descriptors_array_new(0, start_size, start_incsize); +// } +// if (v->number_of_pop_front) { +// v->v--; +// v->number_of_pop_front--; +// } +// else { +// if (v->n >= v->size) +// v = grib_bufr_descriptors_array_resize(v); +// for (i = v->n; i > 0; i--) +// v[i] = v[i - 1]; +// } +// v->v[0] = val; +// v->n++; +// return v; +// } bufr_descriptor* grib_bufr_descriptors_array_get(bufr_descriptors_array* a, size_t i) { return a->v[i]; } -void grib_bufr_descriptors_array_set(bufr_descriptors_array* a, size_t i, bufr_descriptor* v) -{ - a->v[i] = v; -} +// void grib_bufr_descriptors_array_set(bufr_descriptors_array* a, size_t i, bufr_descriptor* v) +// { +// a->v[i] = v; +// } void grib_bufr_descriptors_array_delete(bufr_descriptors_array* v) { @@ -203,18 +201,16 @@ void grib_bufr_descriptors_array_delete_array(bufr_descriptors_array* v) } } -bufr_descriptor** grib_bufr_descriptors_array_get_array(bufr_descriptors_array* v) -{ - bufr_descriptor** vv; - size_t i; - grib_context* c = grib_context_get_default(); - - vv = (bufr_descriptor**)grib_context_malloc_clear(c, sizeof(bufr_descriptor*) * v->n); - for (i = 0; i < v->n; i++) - vv[i] = grib_bufr_descriptor_clone(v->v[i]); - - return vv; -} +// bufr_descriptor** grib_bufr_descriptors_array_get_array(bufr_descriptors_array* v) +// { +// bufr_descriptor** vv; +// size_t i; +// grib_context* c = grib_context_get_default(); +// vv = (bufr_descriptor**)grib_context_malloc_clear(c, sizeof(bufr_descriptor*) * v->n); +// for (i = 0; i < v->n; i++) +// vv[i] = grib_bufr_descriptor_clone(v->v[i]); +// return vv; +// } size_t grib_bufr_descriptors_array_used_size(bufr_descriptors_array* v) { diff --git a/src/grib_context.cc b/src/grib_context.cc index 90b531f6f..8f52633eb 100644 --- a/src/grib_context.cc +++ b/src/grib_context.cc @@ -83,8 +83,7 @@ static void* default_long_lasting_malloc(const grib_context* c, size_t size) void* ret; ret = malloc(size); if (!ret) { - grib_context_log(c, GRIB_LOG_FATAL, "default_long_lasting_malloc: error allocating %zu bytes", size); - Assert(0); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); } return ret; } @@ -99,8 +98,7 @@ static void* default_buffer_malloc(const grib_context* c, size_t size) void* ret; ret = malloc(size); if (!ret) { - grib_context_log(c, GRIB_LOG_FATAL, "default_buffer_malloc: error allocating %zu bytes", size); - Assert(0); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); } return ret; } @@ -110,8 +108,7 @@ static void* default_buffer_realloc(const grib_context* c, void* p, size_t size) void* ret; ret = realloc(p, size); if (!ret) { - grib_context_log(c, GRIB_LOG_FATAL, "default_buffer_realloc: error allocating %zu bytes", size); - Assert(0); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); } return ret; } @@ -126,8 +123,7 @@ static void* default_malloc(const grib_context* c, size_t size) void* ret; ret = malloc(size); if (!ret) { - grib_context_log(c, GRIB_LOG_FATAL, "default_malloc: error allocating %zu bytes", size); - Assert(0); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); } return ret; } @@ -137,8 +133,7 @@ static void* default_realloc(const grib_context* c, void* p, size_t size) void* ret; ret = realloc(p, size); if (!ret) { - grib_context_log(c, GRIB_LOG_FATAL, "default_realloc: error allocating %zu bytes", size); - Assert(0); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); } return ret; } @@ -297,7 +292,7 @@ static grib_context default_grib_context = { 0, /* grib_concept_path */ 0, /* grib_reader */ 0, /* user data */ - GRIB_REAL_MODE8, /* real mode for fortran */ + CODES_REAL_MODE8, /* real mode for fortran */ #if MANAGE_MEM &grib_transient_free, /* free_mem */ @@ -908,9 +903,7 @@ void* grib_context_malloc_persistent(const grib_context* c, size_t size) { void* p = c->alloc_persistent_mem(c, size); if (!p) { - grib_context_log(c, GRIB_LOG_FATAL, - "grib_context_malloc_persistent: error allocating %zu bytes", size); - Assert(0); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); } return p; } @@ -941,8 +934,7 @@ void* grib_context_malloc(const grib_context* c, size_t size) else p = c->alloc_mem(c, size); if (!p) { - grib_context_log(c, GRIB_LOG_FATAL, "grib_context_malloc: error allocating %zu bytes", size); - Assert(0); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); } return p; } @@ -954,7 +946,7 @@ void* grib_context_realloc(const grib_context* c, void* p, size_t size) c = grib_context_get_default(); q = c->realloc_mem(c, p, size); if (!q) { - grib_context_log(c, GRIB_LOG_FATAL, "grib_context_realloc: error allocating %zu bytes", size); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); return NULL; } return q; @@ -989,7 +981,7 @@ void* grib_context_buffer_malloc(const grib_context* c, size_t size) else p = c->alloc_buffer_mem(c, size); if (!p) { - grib_context_log(c, GRIB_LOG_FATAL, "grib_context_buffer_malloc: error allocating %zu bytes", size); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); return NULL; } return p; @@ -1007,7 +999,7 @@ void* grib_context_buffer_realloc(const grib_context* c, void* p, size_t size) { void* q = c->realloc_buffer_mem(c, p, size); if (!q) { - grib_context_log(c, GRIB_LOG_FATAL, "grib_context_buffer_realloc: error allocating %zu bytes", size); + grib_context_log(c, GRIB_LOG_FATAL, "%s: error allocating %zu bytes", __func__, size); return NULL; } return q; diff --git a/src/grib_darray.cc b/src/grib_darray.cc index 3646e6937..f2250862d 100644 --- a/src/grib_darray.cc +++ b/src/grib_darray.cc @@ -10,7 +10,7 @@ #include "grib_api_internal.h" -/* For debugging purposes */ +// For debugging purposes void grib_darray_print(const char* title, const grib_darray* darray) { size_t i; @@ -46,7 +46,7 @@ grib_darray* grib_darray_new(grib_context* c, size_t size, size_t incsize) v = (grib_darray*)grib_context_malloc_clear(c, sizeof(grib_darray)); if (!v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_darray_new unable to allocate %lu bytes\n", sizeof(grib_darray)); + "grib_darray_new unable to allocate %zu bytes", sizeof(grib_darray)); return NULL; } v->size = size; @@ -56,7 +56,7 @@ grib_darray* grib_darray_new(grib_context* c, size_t size, size_t incsize) v->v = (double*)grib_context_malloc_clear(c, sizeof(double) * size); if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_darray_new unable to allocate %lu bytes\n", sizeof(double) * size); + "grib_darray_new unable to allocate %zu bytes", sizeof(double) * size); return NULL; } return v; @@ -73,7 +73,7 @@ static grib_darray* grib_darray_resize(grib_darray* v) v->size = newsize; if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_darray_resize unable to allocate %lu bytes\n", sizeof(double) * newsize); + "grib_darray_resize unable to allocate %zu bytes", sizeof(double) * newsize); return NULL; } return v; @@ -104,17 +104,17 @@ void grib_darray_delete(grib_context* c, grib_darray* v) grib_context_free(c, v); } -double* grib_darray_get_array(grib_context* c, grib_darray* v) -{ - double* ret = NULL; - size_t i = 0; - if (!v) - return NULL; - ret = (double*)grib_context_malloc_clear(c, sizeof(double) * v->n); - for (i = 0; i < v->n; i++) - ret[i] = v->v[i]; - return ret; -} +// double* grib_darray_get_array(grib_context* c, grib_darray* v) +// { +// double* ret = NULL; +// size_t i = 0; +// if (!v) +// return NULL; +// ret = (double*)grib_context_malloc_clear(c, sizeof(double) * v->n); +// for (i = 0; i < v->n; i++) +// ret[i] = v->v[i]; +// return ret; +// } int grib_darray_is_constant(grib_darray* v, double epsilon) { diff --git a/src/grib_dumper_class_grib_encode_C.cc b/src/grib_dumper_class_grib_encode_C.cc index 91d07b688..5ecb6953d 100644 --- a/src/grib_dumper_class_grib_encode_C.cc +++ b/src/grib_dumper_class_grib_encode_C.cc @@ -342,7 +342,7 @@ static void dump_values(grib_dumper* d, grib_accessor* a) fprintf(self->dumper.out, " size = %zu;\n", size); fprintf(self->dumper.out, " v%s = (%s*)calloc(size,sizeof(%s));\n", stype, stype, stype); fprintf(self->dumper.out, " if(!v%s) {\n", stype); - fprintf(self->dumper.out, " fprintf(stderr,\"failed to allocate %%d bytes\\n\",size*sizeof(%s));\n", stype); + fprintf(self->dumper.out, " fprintf(stderr,\"failed to allocate %%zu bytes\\n\",size*sizeof(%s));\n", stype); fprintf(self->dumper.out, " exit(1);\n"); fprintf(self->dumper.out, " }\n"); diff --git a/src/grib_dumper_class_wmo.cc b/src/grib_dumper_class_wmo.cc index 7c898543a..a884d2966 100644 --- a/src/grib_dumper_class_wmo.cc +++ b/src/grib_dumper_class_wmo.cc @@ -8,11 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - **************************************/ - - #include "grib_api_internal.h" #include /* @@ -225,7 +220,7 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) err = grib_unpack_long(a, &value, &size); set_begin_end(d, a); - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ + //for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) fprintf(self->dumper.out, "%s (int) ", a->creator->op); @@ -239,7 +234,7 @@ static void dump_bits(grib_dumper* d, grib_accessor* a, const char* comment) } if(comment) { - /* ECC-1186: Whole comment is too big, so pick the part that follows the ':' i.e. flag table file */ + // ECC-1186: Whole comment is too big, so pick the part that follows the ':' i.e. flag table file const char* p = strchr(comment, ':'); if (p) fprintf(self->dumper.out," (%s) ]", p+1); else fprintf(self->dumper.out, "]"); @@ -271,7 +266,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) err = grib_unpack_double(a, &value, &size); set_begin_end(d, a); - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ + //for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) @@ -281,7 +276,7 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment) fprintf(self->dumper.out, "%s = MISSING", a->name); else fprintf(self->dumper.out, "%s = %g", a->name, value); - /*if(comment) fprintf(self->dumper.out," [%s]",comment);*/ + // if(comment) fprintf(self->dumper.out," [%s]",comment); if (err == 0) print_hexadecimal(self->dumper.out, d->option_flags, a); @@ -322,7 +317,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) p++; } - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ + //for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) fprintf(self->dumper.out, "%s (str) ", a->creator->op); @@ -332,7 +327,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) if (err == 0) print_hexadecimal(self->dumper.out, d->option_flags, a); - /*if(comment) fprintf(self->dumper.out," [%s]",comment);*/ + // if(comment) fprintf(self->dumper.out," [%s]",comment); if (err) fprintf(self->dumper.out, " *** ERR=%d (%s) [grib_dumper_wmo::dump_string]", err, grib_get_error_message(err)); aliases(d, a); @@ -354,7 +349,7 @@ static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) set_begin_end(d, a); - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ + // for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) fprintf(self->dumper.out, "%s ", a->creator->op); @@ -388,7 +383,7 @@ static void dump_bytes(grib_dumper* d, grib_accessor* a, const char* comment) } k = 0; - /* if(size > 100) size = 100; */ + // if(size > 100) size = 100; while (k < size) { int j; for (i = 0; i < d->depth + 3; i++) @@ -438,12 +433,11 @@ static void dump_values(grib_dumper* d, grib_accessor* a) set_begin_end(d, a); - /* For the DIAG pseudo GRIBs. Key charValues uses 1-byte integers to represent a character */ + // For the DIAG pseudo GRIBs. Key charValues uses 1-byte integers to represent a character if (a->flags & GRIB_ACCESSOR_FLAG_STRING_TYPE) { is_char = 1; } - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ print_offset(self->dumper.out, self->begin, self->theEnd); if ((d->option_flags & GRIB_DUMP_FLAG_TYPE) != 0) { char type_name[32] = ""; @@ -487,7 +481,6 @@ static void dump_values(grib_dumper* d, grib_accessor* a) k = 0; while (k < size) { int j; - /*for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," ");*/ for (j = 0; j < 8 && k < size; j++, k++) { if (is_char) fprintf(self->dumper.out, "'%c'", (char)buf[k]); @@ -503,21 +496,19 @@ static void dump_values(grib_dumper* d, grib_accessor* a) // fprintf(self->dumper.out, "%d %g\n", k, buf[k]); } if (more) { - /*for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," ");*/ + //for(i = 0; i < d->depth + 3 ; i++) fprintf(self->dumper.out," "); fprintf(self->dumper.out, "... %lu more values\n", (unsigned long)more); } - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ fprintf(self->dumper.out, "} # %s %s \n", a->creator->op, a->name); grib_context_free(d->context, buf); } static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment) { - /*grib_dumper_wmo *self = (grib_dumper_wmo*)d; - - for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); - fprintf(self->dumper.out,"----> %s %s %s\n",a->creator->op, a->name,comment?comment:"");*/ +// grib_dumper_wmo *self = (grib_dumper_wmo*)d; +// for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); +// fprintf(self->dumper.out,"----> %s %s %s\n",a->creator->op, a->name,comment?comment:""); } static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block) @@ -531,7 +522,6 @@ static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accesso if (!strncmp(a->name, "section", 7)) is_wmo_section = 1; - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ if (is_wmo_section) { upper = (char*)malloc(strlen(a->name) + 1); Assert(upper); @@ -551,13 +541,13 @@ static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accesso else { } - /*printf("------------- section_offset = %ld\n",self->section_offset);*/ + //printf("------------- section_offset = %ld\n",self->section_offset); d->depth += 3; grib_dump_accessors_block(d, block); d->depth -= 3; - /*for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," ");*/ - /*fprintf(self->dumper.out,"<===== %s %s\n",a->creator->op, a->name);*/ + //for(i = 0; i < d->depth ; i++) fprintf(self->dumper.out," "); + //fprintf(self->dumper.out,"<===== %s %s\n",a->creator->op, a->name); } static void set_begin_end(grib_dumper* d, grib_accessor* a) @@ -631,7 +621,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm err = grib_unpack_string_array(a, values, &size); - /* print_offset(self->dumper.out,d,a); */ + // 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) { diff --git a/src/grib_expression.cc b/src/grib_expression.cc index 9a443c67c..c3cd36305 100644 --- a/src/grib_expression.cc +++ b/src/grib_expression.cc @@ -19,7 +19,7 @@ int grib_expression_native_type(grib_handle* h, grib_expression* g) c = c->super ? *(c->super) : NULL; } if (g->cclass) - grib_context_log(h->context, GRIB_LOG_ERROR, "No native_type() in %s\n", g->cclass->name); + grib_context_log(h->context, GRIB_LOG_ERROR, "No native_type() in %s", g->cclass->name); Assert(1 == 0); return 0; } @@ -55,7 +55,7 @@ const char* grib_expression_evaluate_string(grib_handle* h, grib_expression* g, c = c->super ? *(c->super) : NULL; } if (g->cclass) - grib_context_log(h->context, GRIB_LOG_ERROR, "No evaluate_string() in %s\n", g->cclass->name); + grib_context_log(h->context, GRIB_LOG_ERROR, "No evaluate_string() in %s", g->cclass->name); *err = GRIB_INVALID_TYPE; return 0; diff --git a/src/grib_filepool.cc b/src/grib_filepool.cc index 4ba9a2432..2282fe3eb 100644 --- a/src/grib_filepool.cc +++ b/src/grib_filepool.cc @@ -41,6 +41,8 @@ static void init() static short next_id = 0; +static grib_file* grib_file_new(grib_context* c, const char* name, int* err); + /* Note: A fast cut-down version of strcmp which does NOT return -1 */ /* 0 means input strings are equal and 1 means not equal */ GRIB_INLINE static int grib_inline_strcmp(const char* a, const char* b) @@ -78,115 +80,95 @@ void grib_file_pool_clean() } } -static void grib_file_pool_change_id() -{ - grib_file* file; +// static void grib_file_pool_change_id() +// { +// grib_file* file; +// if (!file_pool.first) +// return; +// file = file_pool.first; +// while (file) { +// file->id += 1000; +// file = file->next; +// } +// } - if (!file_pool.first) - return; +// static grib_file* grib_read_file(grib_context* c, FILE* fh, int* err) +// { +// short marker = 0; +// short id = 0; +// grib_file* file; +// *err = grib_read_short(fh, &marker); +// if (!marker) +// return NULL; +// file = (grib_file*)grib_context_malloc_clear(c, sizeof(grib_file)); +// file->buffer = 0; +// file->name = grib_read_string(c, fh, err); +// if (*err) +// return NULL; +// *err = grib_read_short(fh, &id); +// file->id = id; +// if (*err) +// return NULL; +// file->next = grib_read_file(c, fh, err); +// if (*err) +// return NULL; +// return file; +// } - file = file_pool.first; - while (file) { - file->id += 1000; - file = file->next; - } -} - -static grib_file* grib_read_file(grib_context* c, FILE* fh, int* err) -{ - short marker = 0; - short id = 0; - grib_file* file; - *err = grib_read_short(fh, &marker); - if (!marker) - return NULL; - - file = (grib_file*)grib_context_malloc_clear(c, sizeof(grib_file)); - file->buffer = 0; - file->name = grib_read_string(c, fh, err); - if (*err) - return NULL; - - *err = grib_read_short(fh, &id); - file->id = id; - if (*err) - return NULL; - - file->next = grib_read_file(c, fh, err); - if (*err) - return NULL; - - return file; -} - -static int grib_write_file(FILE* fh, grib_file* file) -{ - int err = 0; - - if (!file) - return grib_write_null_marker(fh); - - err = grib_write_not_null_marker(fh); - if (err) - return err; - - err = grib_write_string(fh, file->name); - if (err) - return err; - - err = grib_write_short(fh, (short)file->id); - if (err) - return err; - - return grib_write_file(fh, file->next); -} +// static int grib_write_file(FILE* fh, grib_file* file) +// { +// int err = 0; +// if (!file) +// return grib_write_null_marker(fh); +// err = grib_write_not_null_marker(fh); +// if (err) +// return err; +// err = grib_write_string(fh, file->name); +// if (err) +// return err; +// err = grib_write_short(fh, (short)file->id); +// if (err) +// return err; +// return grib_write_file(fh, file->next); +// } grib_file* grib_file_pool_get_files() { return file_pool.first; } -int grib_file_pool_read(grib_context* c, FILE* fh) -{ - int err = 0; - short marker = 0; - grib_file* file; +// int grib_file_pool_read(grib_context* c, FILE* fh) +// { +// int err = 0; +// short marker = 0; +// grib_file* file; +// if (!c) c = grib_context_get_default(); +// err = grib_read_short(fh, &marker); +// if (!marker) { +// grib_context_log(c, GRIB_LOG_ERROR, +// "Unable to find file information in index file"); +// return GRIB_INVALID_FILE; +// } +// grib_file_pool_change_id(); +// file = file_pool.first; +// while (file->next) +// file = file->next; +// file->next = grib_read_file(c, fh, &err); +// if (err) +// return err; +// return GRIB_SUCCESS; +// } - if (!c) - c = grib_context_get_default(); - - err = grib_read_short(fh, &marker); - if (!marker) { - grib_context_log(c, GRIB_LOG_ERROR, - "Unable to find file information in index file\n"); - return GRIB_INVALID_FILE; - } - - grib_file_pool_change_id(); - file = file_pool.first; - - while (file->next) - file = file->next; - - file->next = grib_read_file(c, fh, &err); - if (err) - return err; - - return GRIB_SUCCESS; -} - -int grib_file_pool_write(FILE* fh) -{ - int err = 0; - if (!file_pool.first) - return grib_write_null_marker(fh); - - err = grib_write_not_null_marker(fh); - if (err) - return err; - - return grib_write_file(fh, file_pool.first); -} +// int grib_file_pool_write(FILE* fh) +// { +// int err = 0; +// if (!file_pool.first) +// return grib_write_null_marker(fh); +// err = grib_write_not_null_marker(fh); +// if (err) +// return err; +// return grib_write_file(fh, file_pool.first); +// } grib_file* grib_file_open(const char* filename, const char* mode, int* err) { @@ -244,7 +226,7 @@ grib_file* grib_file_open(const char* filename, const char* mode, int* err) } if (!file->handle) { - grib_context_log(file->context, GRIB_LOG_PERROR, "grib_file_open: cannot open file %s", file->name); + grib_context_log(file->context, GRIB_LOG_PERROR, "%s: Cannot open file '%s'", __func__, file->name); *err = GRIB_IO_PROBLEM; GRIB_MUTEX_UNLOCK(&mutex1); return NULL; @@ -254,7 +236,7 @@ grib_file* grib_file_open(const char* filename, const char* mode, int* err) if (file_pool.context->io_buffer_size) { #ifdef POSIX_MEMALIGN if (posix_memalign((void**)&(file->buffer), sysconf(_SC_PAGESIZE), file_pool.context->io_buffer_size)) { - grib_context_log(file->context, GRIB_LOG_FATAL, "posix_memalign unable to allocate io_buffer\n"); + grib_context_log(file->context, GRIB_LOG_FATAL, "posix_memalign unable to allocate io_buffer"); } #else file->buffer = (char*)malloc(file_pool.context->io_buffer_size); @@ -378,35 +360,28 @@ grib_file* grib_get_file(const char* filename, int* err) return file; } -grib_file* grib_find_file(short id) +// grib_file* grib_find_file(short id) +// { +// grib_file* file = NULL; +// if (file_pool.current->name && id == file_pool.current->id) { +// return file_pool.current; +// } +// file = file_pool.first; +// while (file) { +// if (id == file->id) +// break; +// file = file->next; +// } +// return file; +// } + +static grib_file* grib_file_new(grib_context* c, const char* name, int* err) { - grib_file* file = NULL; - - if (file_pool.current->name && id == file_pool.current->id) { - return file_pool.current; - } - - file = file_pool.first; - while (file) { - if (id == file->id) - break; - file = file->next; - } - - return file; -} - -grib_file* grib_file_new(grib_context* c, const char* name, int* err) -{ - grib_file* file; - - if (!c) - c = grib_context_get_default(); - - file = (grib_file*)grib_context_malloc_clear(c, sizeof(grib_file)); + if (!c) c = grib_context_get_default(); + grib_file* file = (grib_file*)grib_context_malloc_clear(c, sizeof(grib_file)); if (!file) { - grib_context_log(c, GRIB_LOG_ERROR, "grib_file_new: unable to allocate memory"); + grib_context_log(c, GRIB_LOG_ERROR, "%s: Unable to allocate memory", __func__); *err = GRIB_OUT_OF_MEMORY; return NULL; } diff --git a/src/grib_geography.cc b/src/grib_geography.cc index dd0f2ec98..d70945d32 100644 --- a/src/grib_geography.cc +++ b/src/grib_geography.cc @@ -91,1955 +91,10 @@ static void gauss_first_guess(long trunc, double* vals) } } -/* Performance: return the precomputed latitudes for N=1280 */ -/* The provided 'lats' array should have allocated 2*N elements */ -static int get_precomputed_latitudes_N1280(double* lats) -{ - lats[0]=89.946187715665616; - lats[1]=89.876478353332288; - lats[2]=89.806357319542244; - lats[3]=89.736143271609578; - lats[4]=89.6658939412157; - lats[5]=89.595627537554492; - lats[6]=89.525351592371393; - lats[7]=89.45506977912261; - lats[8]=89.3847841013921; - lats[9]=89.314495744374256; - lats[10]=89.24420545380525; - lats[11]=89.173913722284126; - lats[12]=89.103620888238879; - lats[13]=89.033327191845927; - lats[14]=88.96303280826325; - lats[15]=88.892737868230952; - lats[16]=88.822442471310097; - lats[17]=88.752146694650691; - lats[18]=88.681850598961759; - lats[19]=88.611554232668382; - lats[20]=88.541257634868515; - lats[21]=88.470960837474877; - lats[22]=88.40066386679355; - lats[23]=88.330366744702559; - lats[24]=88.26006948954614; - lats[25]=88.189772116820762; - lats[26]=88.119474639706425; - lats[27]=88.049177069484486; - lats[28]=87.978879415867283; - lats[29]=87.908581687261687; - lats[30]=87.838283890981543; - lats[31]=87.767986033419561; - lats[32]=87.697688120188062; - lats[33]=87.627390156234085; - lats[34]=87.557092145935584; - lats[35]=87.486794093180748; - lats[36]=87.416496001434894; - lats[37]=87.346197873795816; - lats[38]=87.275899713041966; - lats[39]=87.205601521672108; - lats[40]=87.135303301939786; - lats[41]=87.065005055882821; - lats[42]=86.994706785348129; - lats[43]=86.924408492014166; - lats[44]=86.854110177408927; - lats[45]=86.783811842927179; - lats[46]=86.713513489844246; - lats[47]=86.643215119328573; - lats[48]=86.572916732453024; - lats[49]=86.502618330203831; - lats[50]=86.432319913489792; - lats[51]=86.362021483149363; - lats[52]=86.291723039957418; - lats[53]=86.221424584631109; - lats[54]=86.151126117835304; - lats[55]=86.080827640187209; - lats[56]=86.010529152260403; - lats[57]=85.940230654588888; - lats[58]=85.869932147670127; - lats[59]=85.799633631968391; - lats[60]=85.729335107917464; - lats[61]=85.659036575922883; - lats[62]=85.588738036364362; - lats[63]=85.518439489597966; - lats[64]=85.448140935957483; - lats[65]=85.377842375756586; - lats[66]=85.307543809290152; - lats[67]=85.237245236835548; - lats[68]=85.16694665865414; - lats[69]=85.09664807499216; - lats[70]=85.026349486081983; - lats[71]=84.95605089214304; - lats[72]=84.885752293382765; - lats[73]=84.81545368999717; - lats[74]=84.745155082171991; - lats[75]=84.674856470082915; - lats[76]=84.604557853896708; - lats[77]=84.534259233771479; - lats[78]=84.463960609857125; - lats[79]=84.393661982296322; - lats[80]=84.323363351224444; - lats[81]=84.253064716770425; - lats[82]=84.18276607905679; - lats[83]=84.112467438200326; - lats[84]=84.042168794312317; - lats[85]=83.971870147498763; - lats[86]=83.901571497860914; - lats[87]=83.831272845495249; - lats[88]=83.760974190494011; - lats[89]=83.690675532945292; - lats[90]=83.620376872933264; - lats[91]=83.550078210538487; - lats[92]=83.479779545838113; - lats[93]=83.409480878905782; - lats[94]=83.339182209812321; - lats[95]=83.268883538625232; - lats[96]=83.198584865409657; - lats[97]=83.128286190227698; - lats[98]=83.057987513139125; - lats[99]=82.987688834201322; - lats[100]=82.917390153469313; - lats[101]=82.84709147099602; - lats[102]=82.77679278683226; - lats[103]=82.706494101026948; - lats[104]=82.63619541362705; - lats[105]=82.56589672467787; - lats[106]=82.495598034222837; - lats[107]=82.425299342304029; - lats[108]=82.355000648961692; - lats[109]=82.284701954234833; - lats[110]=82.214403258160871; - lats[111]=82.144104560776; - lats[112]=82.073805862115165; - lats[113]=82.003507162211946; - lats[114]=81.933208461098829; - lats[115]=81.862909758807191; - lats[116]=81.792611055367345; - lats[117]=81.722312350808508; - lats[118]=81.652013645158945; - lats[119]=81.581714938445955; - lats[120]=81.511416230696042; - lats[121]=81.441117521934686; - lats[122]=81.370818812186627; - lats[123]=81.300520101475826; - lats[124]=81.230221389825374; - lats[125]=81.159922677257711; - lats[126]=81.089623963794551; - lats[127]=81.019325249456955; - lats[128]=80.949026534265244; - lats[129]=80.878727818239184; - lats[130]=80.808429101397948; - lats[131]=80.73813038376008; - lats[132]=80.667831665343556; - lats[133]=80.59753294616587; - lats[134]=80.527234226243991; - lats[135]=80.456935505594302; - lats[136]=80.386636784232863; - lats[137]=80.316338062175078; - lats[138]=80.246039339436052; - lats[139]=80.175740616030438; - lats[140]=80.105441891972376; - lats[141]=80.035143167275749; - lats[142]=79.9648444419539; - lats[143]=79.894545716019948; - lats[144]=79.824246989486554; - lats[145]=79.753948262366038; - lats[146]=79.683649534670437; - lats[147]=79.61335080641139; - lats[148]=79.543052077600308; - lats[149]=79.472753348248219; - lats[150]=79.402454618365894; - lats[151]=79.332155887963822; - lats[152]=79.261857157052191; - lats[153]=79.191558425640977; - lats[154]=79.121259693739859; - lats[155]=79.050960961358285; - lats[156]=78.980662228505423; - lats[157]=78.910363495190211; - lats[158]=78.840064761421445; - lats[159]=78.769766027207638; - lats[160]=78.699467292557102; - lats[161]=78.629168557477882; - lats[162]=78.558869821977908; - lats[163]=78.488571086064923; - lats[164]=78.418272349746417; - lats[165]=78.347973613029708; - lats[166]=78.277674875922045; - lats[167]=78.207376138430348; - lats[168]=78.137077400561424; - lats[169]=78.066778662322022; - lats[170]=77.996479923718596; - lats[171]=77.926181184757539; - lats[172]=77.855882445445019; - lats[173]=77.785583705787161; - lats[174]=77.71528496578982; - lats[175]=77.644986225458879; - lats[176]=77.574687484799924; - lats[177]=77.504388743818524; - lats[178]=77.434090002520122; - lats[179]=77.363791260909963; - lats[180]=77.293492518993247; - lats[181]=77.22319377677502; - lats[182]=77.15289503426024; - lats[183]=77.082596291453768; - lats[184]=77.012297548360323; - lats[185]=76.941998804984564; - lats[186]=76.871700061330955; - lats[187]=76.801401317404; - lats[188]=76.731102573208048; - lats[189]=76.660803828747362; - lats[190]=76.59050508402602; - lats[191]=76.520206339048215; - lats[192]=76.449907593817869; - lats[193]=76.379608848338933; - lats[194]=76.3093101026152; - lats[195]=76.239011356650423; - lats[196]=76.16871261044831; - lats[197]=76.098413864012443; - lats[198]=76.028115117346374; - lats[199]=75.957816370453543; - lats[200]=75.887517623337317; - lats[201]=75.81721887600105; - lats[202]=75.746920128447996; - lats[203]=75.67662138068134; - lats[204]=75.60632263270422; - lats[205]=75.536023884519707; - lats[206]=75.465725136130786; - lats[207]=75.395426387540439; - lats[208]=75.325127638751567; - lats[209]=75.254828889766983; - lats[210]=75.184530140589501; - lats[211]=75.114231391221821; - lats[212]=75.043932641666672; - lats[213]=74.973633891926625; - lats[214]=74.903335142004323; - lats[215]=74.833036391902269; - lats[216]=74.762737641622991; - lats[217]=74.692438891168877; - lats[218]=74.622140140542356; - lats[219]=74.551841389745761; - lats[220]=74.481542638781434; - lats[221]=74.411243887651622; - lats[222]=74.340945136358584; - lats[223]=74.270646384904481; - lats[224]=74.200347633291472; - lats[225]=74.13004888152166; - lats[226]=74.059750129597163; - lats[227]=73.98945137751997; - lats[228]=73.919152625292114; - lats[229]=73.848853872915541; - lats[230]=73.778555120392184; - lats[231]=73.70825636772399; - lats[232]=73.637957614912779; - lats[233]=73.567658861960396; - lats[234]=73.497360108868662; - lats[235]=73.427061355639339; - lats[236]=73.356762602274188; - lats[237]=73.2864638487749; - lats[238]=73.216165095143182; - lats[239]=73.145866341380668; - lats[240]=73.075567587489019; - lats[241]=73.005268833469799; - lats[242]=72.934970079324657; - lats[243]=72.864671325055056; - lats[244]=72.794372570662574; - lats[245]=72.724073816148703; - lats[246]=72.653775061514935; - lats[247]=72.583476306762691; - lats[248]=72.513177551893421; - lats[249]=72.442878796908545; - lats[250]=72.3725800418094; - lats[251]=72.302281286597392; - lats[252]=72.231982531273843; - lats[253]=72.161683775840089; - lats[254]=72.091385020297409; - lats[255]=72.02108626464711; - lats[256]=71.950787508890414; - lats[257]=71.880488753028587; - lats[258]=71.810189997062835; - lats[259]=71.739891240994368; - lats[260]=71.669592484824364; - lats[261]=71.599293728553988; - lats[262]=71.528994972184378; - lats[263]=71.458696215716685; - lats[264]=71.388397459152031; - lats[265]=71.318098702491469; - lats[266]=71.247799945736105; - lats[267]=71.177501188887007; - lats[268]=71.107202431945211; - lats[269]=71.036903674911756; - lats[270]=70.966604917787635; - lats[271]=70.896306160573886; - lats[272]=70.826007403271475; - lats[273]=70.755708645881384; - lats[274]=70.685409888404578; - lats[275]=70.615111130841967; - lats[276]=70.544812373194532; - lats[277]=70.474513615463138; - lats[278]=70.404214857648739; - lats[279]=70.333916099752187; - lats[280]=70.263617341774406; - lats[281]=70.193318583716191; - lats[282]=70.123019825578467; - lats[283]=70.052721067362043; - lats[284]=69.982422309067744; - lats[285]=69.912123550696421; - lats[286]=69.841824792248843; - lats[287]=69.771526033725834; - lats[288]=69.701227275128161; - lats[289]=69.630928516456592; - lats[290]=69.560629757711908; - lats[291]=69.490330998894862; - lats[292]=69.420032240006194; - lats[293]=69.349733481046613; - lats[294]=69.279434722016902; - lats[295]=69.209135962917699; - lats[296]=69.138837203749759; - lats[297]=69.068538444513763; - lats[298]=68.998239685210365; - lats[299]=68.927940925840304; - lats[300]=68.85764216640419; - lats[301]=68.787343406902693; - lats[302]=68.717044647336493; - lats[303]=68.646745887706189; - lats[304]=68.576447128012447; - lats[305]=68.506148368255865; - lats[306]=68.435849608437067; - lats[307]=68.365550848556666; - lats[308]=68.295252088615257; - lats[309]=68.224953328613438; - lats[310]=68.154654568551791; - lats[311]=68.084355808430871; - lats[312]=68.014057048251274; - lats[313]=67.943758288013555; - lats[314]=67.873459527718282; - lats[315]=67.803160767365966; - lats[316]=67.732862006957205; - lats[317]=67.662563246492482; - lats[318]=67.592264485972336; - lats[319]=67.521965725397308; - lats[320]=67.451666964767895; - lats[321]=67.381368204084609; - lats[322]=67.311069443347961; - lats[323]=67.240770682558434; - lats[324]=67.170471921716526; - lats[325]=67.100173160822706; - lats[326]=67.029874399877471; - lats[327]=66.95957563888129; - lats[328]=66.889276877834618; - lats[329]=66.818978116737924; - lats[330]=66.748679355591662; - lats[331]=66.678380594396273; - lats[332]=66.608081833152212; - lats[333]=66.537783071859891; - lats[334]=66.467484310519808; - lats[335]=66.397185549132331; - lats[336]=66.326886787697887; - lats[337]=66.256588026216932; - lats[338]=66.186289264689833; - lats[339]=66.115990503117033; - lats[340]=66.045691741498899; - lats[341]=65.975392979835888; - lats[342]=65.905094218128355; - lats[343]=65.834795456376696; - lats[344]=65.764496694581283; - lats[345]=65.694197932742526; - lats[346]=65.623899170860767; - lats[347]=65.553600408936404; - lats[348]=65.483301646969792; - lats[349]=65.413002884961315; - lats[350]=65.342704122911286; - lats[351]=65.272405360820116; - lats[352]=65.202106598688133; - lats[353]=65.131807836515677; - lats[354]=65.061509074303089; - lats[355]=64.991210312050711; - lats[356]=64.920911549758912; - lats[357]=64.850612787427963; - lats[358]=64.780314025058246; - lats[359]=64.710015262650074; - lats[360]=64.639716500203733; - lats[361]=64.569417737719576; - lats[362]=64.499118975197902; - lats[363]=64.428820212639039; - lats[364]=64.358521450043284; - lats[365]=64.288222687410922; - lats[366]=64.21792392474228; - lats[367]=64.147625162037642; - lats[368]=64.07732639929732; - lats[369]=64.00702763652157; - lats[370]=63.93672887371072; - lats[371]=63.866430110865004; - lats[372]=63.796131347984762; - lats[373]=63.725832585070251; - lats[374]=63.655533822121711; - lats[375]=63.585235059139464; - lats[376]=63.514936296123757; - lats[377]=63.444637533074854; - lats[378]=63.374338769993031; - lats[379]=63.304040006878537; - lats[380]=63.23374124373165; - lats[381]=63.163442480552604; - lats[382]=63.093143717341647; - lats[383]=63.022844954099064; - lats[384]=62.952546190825068; - lats[385]=62.882247427519928; - lats[386]=62.811948664183866; - lats[387]=62.741649900817137; - lats[388]=62.67135113741999; - lats[389]=62.60105237399263; - lats[390]=62.530753610535321; - lats[391]=62.460454847048261; - lats[392]=62.3901560835317; - lats[393]=62.319857319985871; - lats[394]=62.249558556410982; - lats[395]=62.179259792807258; - lats[396]=62.108961029174914; - lats[397]=62.038662265514176; - lats[398]=61.968363501825259; - lats[399]=61.898064738108381; - lats[400]=61.827765974363729; - lats[401]=61.757467210591535; - lats[402]=61.687168446791986; - lats[403]=61.616869682965287; - lats[404]=61.546570919111666; - lats[405]=61.476272155231321; - lats[406]=61.405973391324409; - lats[407]=61.335674627391185; - lats[408]=61.265375863431785; - lats[409]=61.195077099446451; - lats[410]=61.124778335435344; - lats[411]=61.054479571398652; - lats[412]=60.984180807336578; - lats[413]=60.913882043249295; - lats[414]=60.843583279137007; - lats[415]=60.773284514999872; - lats[416]=60.702985750838074; - lats[417]=60.632686986651805; - lats[418]=60.562388222441243; - lats[419]=60.492089458206543; - lats[420]=60.421790693947884; - lats[421]=60.35149192966545; - lats[422]=60.28119316535939; - lats[423]=60.21089440102989; - lats[424]=60.140595636677112; - lats[425]=60.070296872301235; - lats[426]=59.999998107902378; - lats[427]=59.929699343480763; - lats[428]=59.859400579036503; - lats[429]=59.78910181456979; - lats[430]=59.718803050080759; - lats[431]=59.64850428556958; - lats[432]=59.578205521036402; - lats[433]=59.507906756481383; - lats[434]=59.43760799190467; - lats[435]=59.3673092273064; - lats[436]=59.29701046268675; - lats[437]=59.226711698045854; - lats[438]=59.156412933383855; - lats[439]=59.086114168700909; - lats[440]=59.015815403997145; - lats[441]=58.945516639272725; - lats[442]=58.875217874527763; - lats[443]=58.804919109762423; - lats[444]=58.73462034497684; - lats[445]=58.664321580171141; - lats[446]=58.594022815345468; - lats[447]=58.523724050499972; - lats[448]=58.453425285634758; - lats[449]=58.383126520749968; - lats[450]=58.312827755845746; - lats[451]=58.242528990922203; - lats[452]=58.172230225979497; - lats[453]=58.101931461017728; - lats[454]=58.031632696037022; - lats[455]=57.961333931037537; - lats[456]=57.891035166019364; - lats[457]=57.820736400982646; - lats[458]=57.75043763592749; - lats[459]=57.680138870854037; - lats[460]=57.60984010576238; - lats[461]=57.539541340652676; - lats[462]=57.469242575525016; - lats[463]=57.398943810379521; - lats[464]=57.328645045216312; - lats[465]=57.258346280035504; - lats[466]=57.188047514837208; - lats[467]=57.117748749621541; - lats[468]=57.047449984388614; - lats[469]=56.977151219138541; - lats[470]=56.90685245387143; - lats[471]=56.836553688587379; - lats[472]=56.766254923286517; - lats[473]=56.695956157968951; - lats[474]=56.625657392634771; - lats[475]=56.555358627284086; - lats[476]=56.485059861917016; - lats[477]=56.41476109653366; - lats[478]=56.34446233113411; - lats[479]=56.274163565718467; - lats[480]=56.203864800286865; - lats[481]=56.133566034839362; - lats[482]=56.063267269376091; - lats[483]=55.992968503897131; - lats[484]=55.922669738402583; - lats[485]=55.852370972892551; - lats[486]=55.782072207367136; - lats[487]=55.711773441826416; - lats[488]=55.641474676270505; - lats[489]=55.571175910699488; - lats[490]=55.500877145113449; - lats[491]=55.430578379512511; - lats[492]=55.360279613896743; - lats[493]=55.289980848266232; - lats[494]=55.219682082621084; - lats[495]=55.149383316961377; - lats[496]=55.07908455128721; - lats[497]=55.008785785598668; - lats[498]=54.938487019895831; - lats[499]=54.868188254178797; - lats[500]=54.797889488447652; - lats[501]=54.727590722702473; - lats[502]=54.657291956943347; - lats[503]=54.586993191170357; - lats[504]=54.516694425383605; - lats[505]=54.446395659583146; - lats[506]=54.376096893769081; - lats[507]=54.305798127941479; - lats[508]=54.235499362100448; - lats[509]=54.165200596246031; - lats[510]=54.094901830378333; - lats[511]=54.024603064497434; - lats[512]=53.954304298603383; - lats[513]=53.884005532696307; - lats[514]=53.813706766776235; - lats[515]=53.743408000843282; - lats[516]=53.673109234897495; - lats[517]=53.602810468938962; - lats[518]=53.53251170296776; - lats[519]=53.462212936983953; - lats[520]=53.391914170987633; - lats[521]=53.321615404978871; - lats[522]=53.251316638957725; - lats[523]=53.181017872924265; - lats[524]=53.110719106878584; - lats[525]=53.040420340820731; - lats[526]=52.970121574750792; - lats[527]=52.899822808668837; - lats[528]=52.829524042574917; - lats[529]=52.759225276469131; - lats[530]=52.688926510351514; - lats[531]=52.618627744222159; - lats[532]=52.548328978081123; - lats[533]=52.478030211928477; - lats[534]=52.407731445764284; - lats[535]=52.337432679588609; - lats[536]=52.26713391340153; - lats[537]=52.196835147203096; - lats[538]=52.126536380993372; - lats[539]=52.056237614772435; - lats[540]=51.985938848540336; - lats[541]=51.915640082297152; - lats[542]=51.845341316042933; - lats[543]=51.775042549777737; - lats[544]=51.704743783501634; - lats[545]=51.634445017214695; - lats[546]=51.56414625091697; - lats[547]=51.493847484608516; - lats[548]=51.423548718289396; - lats[549]=51.353249951959683; - lats[550]=51.282951185619417; - lats[551]=51.21265241926865; - lats[552]=51.14235365290746; - lats[553]=51.072054886535909; - lats[554]=51.001756120154049; - lats[555]=50.931457353761914; - lats[556]=50.86115858735959; - lats[557]=50.790859820947119; - lats[558]=50.720561054524559; - lats[559]=50.650262288091959; - lats[560]=50.579963521649397; - lats[561]=50.509664755196901; - lats[562]=50.439365988734544; - lats[563]=50.369067222262359; - lats[564]=50.298768455780426; - lats[565]=50.228469689288779; - lats[566]=50.158170922787484; - lats[567]=50.087872156276575; - lats[568]=50.017573389756123; - lats[569]=49.947274623226157; - lats[570]=49.876975856686762; - lats[571]=49.80667709013796; - lats[572]=49.736378323579807; - lats[573]=49.66607955701236; - lats[574]=49.595780790435676; - lats[575]=49.525482023849783; - lats[576]=49.455183257254745; - lats[577]=49.384884490650613; - lats[578]=49.314585724037435; - lats[579]=49.244286957415234; - lats[580]=49.173988190784094; - lats[581]=49.103689424144044; - lats[582]=49.03339065749514; - lats[583]=48.963091890837418; - lats[584]=48.892793124170929; - lats[585]=48.822494357495721; - lats[586]=48.752195590811837; - lats[587]=48.681896824119335; - lats[588]=48.611598057418242; - lats[589]=48.541299290708608; - lats[590]=48.47100052399049; - lats[591]=48.400701757263917; - lats[592]=48.330402990528938; - lats[593]=48.260104223785596; - lats[594]=48.189805457033941; - lats[595]=48.119506690274015; - lats[596]=48.049207923505868; - lats[597]=47.978909156729507; - lats[598]=47.908610389945018; - lats[599]=47.838311623152421; - lats[600]=47.76801285635176; - lats[601]=47.697714089543084; - lats[602]=47.627415322726435; - lats[603]=47.557116555901828; - lats[604]=47.486817789069342; - lats[605]=47.416519022228997; - lats[606]=47.346220255380835; - lats[607]=47.275921488524894; - lats[608]=47.205622721661214; - lats[609]=47.13532395478984; - lats[610]=47.065025187910805; - lats[611]=46.994726421024154; - lats[612]=46.924427654129929; - lats[613]=46.85412888722815; - lats[614]=46.783830120318882; - lats[615]=46.713531353402139; - lats[616]=46.643232586477971; - lats[617]=46.572933819546414; - lats[618]=46.502635052607502; - lats[619]=46.432336285661272; - lats[620]=46.362037518707766; - lats[621]=46.291738751747012; - lats[622]=46.221439984779053; - lats[623]=46.151141217803925; - lats[624]=46.080842450821663; - lats[625]=46.01054368383231; - lats[626]=45.94024491683588; - lats[627]=45.869946149832437; - lats[628]=45.799647382821995; - lats[629]=45.729348615804589; - lats[630]=45.659049848780263; - lats[631]=45.588751081749038; - lats[632]=45.51845231471097; - lats[633]=45.448153547666081; - lats[634]=45.377854780614399; - lats[635]=45.30755601355596; - lats[636]=45.237257246490813; - lats[637]=45.166958479418959; - lats[638]=45.096659712340461; - lats[639]=45.026360945255341; - lats[640]=44.956062178163634; - lats[641]=44.885763411065362; - lats[642]=44.81546464396056; - lats[643]=44.745165876849271; - lats[644]=44.674867109731515; - lats[645]=44.604568342607337; - lats[646]=44.534269575476756; - lats[647]=44.463970808339802; - lats[648]=44.39367204119651; - lats[649]=44.323373274046915; - lats[650]=44.253074506891046; - lats[651]=44.182775739728925; - lats[652]=44.112476972560586; - lats[653]=44.042178205386072; - lats[654]=43.971879438205391; - lats[655]=43.9015806710186; - lats[656]=43.831281903825705; - lats[657]=43.760983136626741; - lats[658]=43.690684369421732; - lats[659]=43.620385602210717; - lats[660]=43.550086834993728; - lats[661]=43.479788067770777; - lats[662]=43.409489300541907; - lats[663]=43.339190533307139; - lats[664]=43.26889176606651; - lats[665]=43.19859299882004; - lats[666]=43.128294231567757; - lats[667]=43.057995464309691; - lats[668]=42.987696697045862; - lats[669]=42.917397929776307; - lats[670]=42.847099162501053; - lats[671]=42.776800395220121; - lats[672]=42.706501627933541; - lats[673]=42.63620286064134; - lats[674]=42.565904093343548; - lats[675]=42.495605326040177; - lats[676]=42.425306558731272; - lats[677]=42.355007791416853; - lats[678]=42.284709024096927; - lats[679]=42.214410256771551; - lats[680]=42.144111489440725; - lats[681]=42.073812722104492; - lats[682]=42.003513954762873; - lats[683]=41.933215187415882; - lats[684]=41.862916420063563; - lats[685]=41.792617652705921; - lats[686]=41.722318885343; - lats[687]=41.6520201179748; - lats[688]=41.581721350601363; - lats[689]=41.511422583222718; - lats[690]=41.441123815838885; - lats[691]=41.370825048449873; - lats[692]=41.300526281055724; - lats[693]=41.230227513656445; - lats[694]=41.159928746252085; - lats[695]=41.089629978842645; - lats[696]=41.01933121142816; - lats[697]=40.949032444008644; - lats[698]=40.878733676584126; - lats[699]=40.808434909154634; - lats[700]=40.738136141720176; - lats[701]=40.667837374280786; - lats[702]=40.597538606836487; - lats[703]=40.527239839387299; - lats[704]=40.456941071933244; - lats[705]=40.386642304474343; - lats[706]=40.316343537010617; - lats[707]=40.246044769542102; - lats[708]=40.175746002068806; - lats[709]=40.105447234590748; - lats[710]=40.035148467107952; - lats[711]=39.964849699620437; - lats[712]=39.894550932128247; - lats[713]=39.824252164631375; - lats[714]=39.753953397129855; - lats[715]=39.683654629623703; - lats[716]=39.613355862112947; - lats[717]=39.543057094597607; - lats[718]=39.472758327077692; - lats[719]=39.402459559553229; - lats[720]=39.332160792024254; - lats[721]=39.261862024490775; - lats[722]=39.191563256952804; - lats[723]=39.121264489410365; - lats[724]=39.050965721863491; - lats[725]=38.980666954312184; - lats[726]=38.910368186756479; - lats[727]=38.840069419196389; - lats[728]=38.769770651631937; - lats[729]=38.699471884063136; - lats[730]=38.629173116490001; - lats[731]=38.558874348912568; - lats[732]=38.488575581330842; - lats[733]=38.418276813744846; - lats[734]=38.347978046154608; - lats[735]=38.277679278560143; - lats[736]=38.20738051096145; - lats[737]=38.137081743358586; - lats[738]=38.066782975751536; - lats[739]=37.99648420814033; - lats[740]=37.926185440524989; - lats[741]=37.855886672905527; - lats[742]=37.785587905281965; - lats[743]=37.715289137654317; - lats[744]=37.644990370022605; - lats[745]=37.574691602386856; - lats[746]=37.504392834747065; - lats[747]=37.434094067103274; - lats[748]=37.363795299455489; - lats[749]=37.293496531803719; - lats[750]=37.223197764147997; - lats[751]=37.152898996488332; - lats[752]=37.082600228824752; - lats[753]=37.012301461157264; - lats[754]=36.942002693485883; - lats[755]=36.871703925810628; - lats[756]=36.801405158131523; - lats[757]=36.731106390448581; - lats[758]=36.660807622761808; - lats[759]=36.590508855071242; - lats[760]=36.520210087376888; - lats[761]=36.449911319678755; - lats[762]=36.379612551976876; - lats[763]=36.309313784271254; - lats[764]=36.239015016561908; - lats[765]=36.16871624884886; - lats[766]=36.098417481132117; - lats[767]=36.028118713411708; - lats[768]=35.957819945687639; - lats[769]=35.887521177959933; - lats[770]=35.817222410228595; - lats[771]=35.746923642493655; - lats[772]=35.676624874755113; - lats[773]=35.606326107012997; - lats[774]=35.536027339267314; - lats[775]=35.465728571518085; - lats[776]=35.395429803765317; - lats[777]=35.325131036009047; - lats[778]=35.254832268249267; - lats[779]=35.184533500486005; - lats[780]=35.114234732719261; - lats[781]=35.043935964949064; - lats[782]=34.973637197175435; - lats[783]=34.903338429398374; - lats[784]=34.833039661617903; - lats[785]=34.762740893834028; - lats[786]=34.692442126046771; - lats[787]=34.622143358256153; - lats[788]=34.551844590462188; - lats[789]=34.481545822664863; - lats[790]=34.411247054864234; - lats[791]=34.340948287060286; - lats[792]=34.270649519253041; - lats[793]=34.200350751442521; - lats[794]=34.130051983628725; - lats[795]=34.059753215811682; - lats[796]=33.989454447991392; - lats[797]=33.919155680167876; - lats[798]=33.848856912341155; - lats[799]=33.778558144511237; - lats[800]=33.708259376678136; - lats[801]=33.637960608841851; - lats[802]=33.567661841002426; - lats[803]=33.497363073159853; - lats[804]=33.42706430531414; - lats[805]=33.356765537465314; - lats[806]=33.286466769613391; - lats[807]=33.216168001758369; - lats[808]=33.145869233900278; - lats[809]=33.075570466039117; - lats[810]=33.005271698174909; - lats[811]=32.934972930307666; - lats[812]=32.864674162437396; - lats[813]=32.794375394564113; - lats[814]=32.724076626687825; - lats[815]=32.653777858808567; - lats[816]=32.583479090926325; - lats[817]=32.513180323041112; - lats[818]=32.442881555152965; - lats[819]=32.372582787261891; - lats[820]=32.302284019367875; - lats[821]=32.231985251470959; - lats[822]=32.161686483571145; - lats[823]=32.091387715668439; - lats[824]=32.021088947762863; - lats[825]=31.950790179854422; - lats[826]=31.880491411943137; - lats[827]=31.810192644029012; - lats[828]=31.739893876112063; - lats[829]=31.669595108192297; - lats[830]=31.599296340269738; - lats[831]=31.528997572344384; - lats[832]=31.458698804416255; - lats[833]=31.388400036485361; - lats[834]=31.318101268551715; - lats[835]=31.247802500615318; - lats[836]=31.177503732676204; - lats[837]=31.107204964734358; - lats[838]=31.036906196789811; - lats[839]=30.966607428842572; - lats[840]=30.896308660892647; - lats[841]=30.826009892940046; - lats[842]=30.755711124984781; - lats[843]=30.685412357026873; - lats[844]=30.615113589066322; - lats[845]=30.544814821103138; - lats[846]=30.47451605313735; - lats[847]=30.404217285168947; - lats[848]=30.333918517197947; - lats[849]=30.263619749224372; - lats[850]=30.19332098124822; - lats[851]=30.123022213269511; - lats[852]=30.052723445288244; - lats[853]=29.98242467730444; - lats[854]=29.91212590931811; - lats[855]=29.841827141329258; - lats[856]=29.771528373337894; - lats[857]=29.701229605344039; - lats[858]=29.630930837347698; - lats[859]=29.560632069348884; - lats[860]=29.490333301347597; - lats[861]=29.420034533343859; - lats[862]=29.349735765337677; - lats[863]=29.279436997329057; - lats[864]=29.209138229318015; - lats[865]=29.138839461304556; - lats[866]=29.068540693288696; - lats[867]=28.998241925270449; - lats[868]=28.927943157249814; - lats[869]=28.857644389226806; - lats[870]=28.787345621201432; - lats[871]=28.717046853173709; - lats[872]=28.646748085143642; - lats[873]=28.576449317111244; - lats[874]=28.506150549076519; - lats[875]=28.435851781039485; - lats[876]=28.365553013000145; - lats[877]=28.29525424495851; - lats[878]=28.224955476914594; - lats[879]=28.154656708868405; - lats[880]=28.084357940819952; - lats[881]=28.014059172769244; - lats[882]=27.94376040471629; - lats[883]=27.873461636661098; - lats[884]=27.803162868603682; - lats[885]=27.732864100544052; - lats[886]=27.662565332482213; - lats[887]=27.592266564418171; - lats[888]=27.521967796351948; - lats[889]=27.451669028283543; - lats[890]=27.381370260212968; - lats[891]=27.311071492140236; - lats[892]=27.240772724065348; - lats[893]=27.170473955988321; - lats[894]=27.100175187909159; - lats[895]=27.029876419827872; - lats[896]=26.959577651744471; - lats[897]=26.889278883658971; - lats[898]=26.818980115571364; - lats[899]=26.748681347481678; - lats[900]=26.678382579389908; - lats[901]=26.608083811296069; - lats[902]=26.53778504320017; - lats[903]=26.467486275102218; - lats[904]=26.397187507002222; - lats[905]=26.326888738900195; - lats[906]=26.256589970796135; - lats[907]=26.186291202690064; - lats[908]=26.115992434581983; - lats[909]=26.045693666471902; - lats[910]=25.975394898359827; - lats[911]=25.90509613024577; - lats[912]=25.834797362129745; - lats[913]=25.764498594011751; - lats[914]=25.694199825891793; - lats[915]=25.623901057769892; - lats[916]=25.553602289646051; - lats[917]=25.483303521520277; - lats[918]=25.413004753392578; - lats[919]=25.342705985262967; - lats[920]=25.272407217131445; - lats[921]=25.202108448998025; - lats[922]=25.13180968086272; - lats[923]=25.061510912725527; - lats[924]=24.991212144586456; - lats[925]=24.920913376445526; - lats[926]=24.850614608302738; - lats[927]=24.780315840158096; - lats[928]=24.710017072011613; - lats[929]=24.639718303863294; - lats[930]=24.569419535713152; - lats[931]=24.499120767561195; - lats[932]=24.428821999407425; - lats[933]=24.358523231251851; - lats[934]=24.288224463094483; - lats[935]=24.217925694935328; - lats[936]=24.1476269267744; - lats[937]=24.077328158611696; - lats[938]=24.007029390447226; - lats[939]=23.936730622281004; - lats[940]=23.866431854113038; - lats[941]=23.796133085943328; - lats[942]=23.725834317771888; - lats[943]=23.655535549598721; - lats[944]=23.585236781423838; - lats[945]=23.514938013247242; - lats[946]=23.444639245068949; - lats[947]=23.374340476888957; - lats[948]=23.304041708707278; - lats[949]=23.233742940523921; - lats[950]=23.163444172338895; - lats[951]=23.0931454041522; - lats[952]=23.022846635963852; - lats[953]=22.952547867773848; - lats[954]=22.882249099582204; - lats[955]=22.811950331388925; - lats[956]=22.741651563194019; - lats[957]=22.671352794997489; - lats[958]=22.60105402679935; - lats[959]=22.530755258599601; - lats[960]=22.460456490398254; - lats[961]=22.390157722195315; - lats[962]=22.319858953990789; - lats[963]=22.249560185784691; - lats[964]=22.179261417577013; - lats[965]=22.108962649367779; - lats[966]=22.038663881156989; - lats[967]=21.968365112944642; - lats[968]=21.898066344730758; - lats[969]=21.827767576515338; - lats[970]=21.757468808298391; - lats[971]=21.687170040079913; - lats[972]=21.616871271859928; - lats[973]=21.546572503638437; - lats[974]=21.47627373541544; - lats[975]=21.40597496719095; - lats[976]=21.335676198964972; - lats[977]=21.265377430737512; - lats[978]=21.195078662508585; - lats[979]=21.124779894278181; - lats[980]=21.054481126046323; - lats[981]=20.984182357813012; - lats[982]=20.913883589578251; - lats[983]=20.843584821342048; - lats[984]=20.773286053104417; - lats[985]=20.702987284865355; - lats[986]=20.632688516624874; - lats[987]=20.562389748382977; - lats[988]=20.492090980139672; - lats[989]=20.421792211894967; - lats[990]=20.35149344364887; - lats[991]=20.28119467540138; - lats[992]=20.210895907152516; - lats[993]=20.140597138902272; - lats[994]=20.070298370650661; - lats[995]=19.999999602397686; - lats[996]=19.929700834143357; - lats[997]=19.859402065887682; - lats[998]=19.789103297630657; - lats[999]=19.718804529372303; - lats[1000]=19.648505761112613; - lats[1001]=19.578206992851602; - lats[1002]=19.507908224589269; - lats[1003]=19.437609456325632; - lats[1004]=19.367310688060684; - lats[1005]=19.297011919794439; - lats[1006]=19.226713151526898; - lats[1007]=19.15641438325807; - lats[1008]=19.086115614987968; - lats[1009]=19.015816846716586; - lats[1010]=18.945518078443939; - lats[1011]=18.875219310170031; - lats[1012]=18.804920541894862; - lats[1013]=18.734621773618446; - lats[1014]=18.664323005340787; - lats[1015]=18.594024237061891; - lats[1016]=18.523725468781763; - lats[1017]=18.453426700500408; - lats[1018]=18.383127932217832; - lats[1019]=18.312829163934047; - lats[1020]=18.242530395649048; - lats[1021]=18.172231627362851; - lats[1022]=18.101932859075458; - lats[1023]=18.031634090786874; - lats[1024]=17.96133532249711; - lats[1025]=17.89103655420616; - lats[1026]=17.820737785914044; - lats[1027]=17.75043901762076; - lats[1028]=17.680140249326314; - lats[1029]=17.60984148103071; - lats[1030]=17.539542712733962; - lats[1031]=17.469243944436066; - lats[1032]=17.39894517613704; - lats[1033]=17.328646407836878; - lats[1034]=17.258347639535586; - lats[1035]=17.188048871233182; - lats[1036]=17.117750102929655; - lats[1037]=17.04745133462502; - lats[1038]=16.977152566319283; - lats[1039]=16.906853798012452; - lats[1040]=16.836555029704527; - lats[1041]=16.766256261395515; - lats[1042]=16.69595749308542; - lats[1043]=16.625658724774254; - lats[1044]=16.555359956462013; - lats[1045]=16.485061188148713; - lats[1046]=16.41476241983435; - lats[1047]=16.344463651518936; - lats[1048]=16.274164883202477; - lats[1049]=16.203866114884974; - lats[1050]=16.133567346566434; - lats[1051]=16.063268578246863; - lats[1052]=15.992969809926265; - lats[1053]=15.922671041604652; - lats[1054]=15.852372273282016; - lats[1055]=15.78207350495838; - lats[1056]=15.711774736633735; - lats[1057]=15.641475968308091; - lats[1058]=15.571177199981456; - lats[1059]=15.500878431653829; - lats[1060]=15.430579663325226; - lats[1061]=15.360280894995643; - lats[1062]=15.289982126665089; - lats[1063]=15.219683358333569; - lats[1064]=15.149384590001089; - lats[1065]=15.07908582166765; - lats[1066]=15.008787053333259; - lats[1067]=14.938488284997929; - lats[1068]=14.868189516661655; - lats[1069]=14.797890748324447; - lats[1070]=14.727591979986309; - lats[1071]=14.657293211647247; - lats[1072]=14.586994443307265; - lats[1073]=14.516695674966371; - lats[1074]=14.446396906624567; - lats[1075]=14.376098138281863; - lats[1076]=14.305799369938256; - lats[1077]=14.23550060159376; - lats[1078]=14.165201833248371; - lats[1079]=14.0949030649021; - lats[1080]=14.024604296554955; - lats[1081]=13.954305528206934; - lats[1082]=13.884006759858046; - lats[1083]=13.813707991508297; - lats[1084]=13.743409223157688; - lats[1085]=13.673110454806226; - lats[1086]=13.602811686453919; - lats[1087]=13.532512918100766; - lats[1088]=13.46221414974678; - lats[1089]=13.391915381391959; - lats[1090]=13.32161661303631; - lats[1091]=13.251317844679837; - lats[1092]=13.181019076322551; - lats[1093]=13.110720307964451; - lats[1094]=13.040421539605545; - lats[1095]=12.970122771245832; - lats[1096]=12.899824002885323; - lats[1097]=12.829525234524022; - lats[1098]=12.759226466161934; - lats[1099]=12.688927697799061; - lats[1100]=12.618628929435411; - lats[1101]=12.548330161070988; - lats[1102]=12.478031392705796; - lats[1103]=12.407732624339841; - lats[1104]=12.337433855973126; - lats[1105]=12.267135087605659; - lats[1106]=12.196836319237443; - lats[1107]=12.126537550868482; - lats[1108]=12.056238782498781; - lats[1109]=11.985940014128348; - lats[1110]=11.915641245757183; - lats[1111]=11.845342477385294; - lats[1112]=11.775043709012685; - lats[1113]=11.704744940639358; - lats[1114]=11.634446172265324; - lats[1115]=11.564147403890583; - lats[1116]=11.493848635515141; - lats[1117]=11.423549867139002; - lats[1118]=11.35325109876217; - lats[1119]=11.282952330384653; - lats[1120]=11.212653562006453; - lats[1121]=11.142354793627575; - lats[1122]=11.072056025248026; - lats[1123]=11.001757256867807; - lats[1124]=10.931458488486923; - lats[1125]=10.861159720105382; - lats[1126]=10.790860951723188; - lats[1127]=10.720562183340341; - lats[1128]=10.65026341495685; - lats[1129]=10.579964646572719; - lats[1130]=10.509665878187954; - lats[1131]=10.439367109802557; - lats[1132]=10.369068341416533; - lats[1133]=10.298769573029887; - lats[1134]=10.228470804642624; - lats[1135]=10.158172036254747; - lats[1136]=10.087873267866264; - lats[1137]=10.017574499477174; - lats[1138]=9.9472757310874869; - lats[1139]=9.8769769626972046; - lats[1140]=9.8066781943063344; - lats[1141]=9.7363794259148779; - lats[1142]=9.6660806575228388; - lats[1143]=9.5957818891302242; - lats[1144]=9.5254831207370376; - lats[1145]=9.4551843523432826; - lats[1146]=9.3848855839489662; - lats[1147]=9.3145868155540921; - lats[1148]=9.2442880471586619; - lats[1149]=9.1739892787626829; - lats[1150]=9.1036905103661585; - lats[1151]=9.0333917419690941; - lats[1152]=8.963092973571495; - lats[1153]=8.8927942051733631; - lats[1154]=8.8224954367747017; - lats[1155]=8.7521966683755217; - lats[1156]=8.6818978999758194; - lats[1157]=8.6115991315756055; - lats[1158]=8.5413003631748801; - lats[1159]=8.4710015947736537; - lats[1160]=8.4007028263719228; - lats[1161]=8.3304040579696963; - lats[1162]=8.2601052895669778; - lats[1163]=8.1898065211637725; - lats[1164]=8.1195077527600841; - lats[1165]=8.049208984355916; - lats[1166]=7.9789102159512737; - lats[1167]=7.9086114475461606; - lats[1168]=7.8383126791405831; - lats[1169]=7.7680139107345463; - lats[1170]=7.6977151423280494; - lats[1171]=7.6274163739210996; - lats[1172]=7.557117605513703; - lats[1173]=7.4868188371058624; - lats[1174]=7.4165200686975803; - lats[1175]=7.3462213002888648; - lats[1176]=7.2759225318797176; - lats[1177]=7.2056237634701441; - lats[1178]=7.1353249950601469; - lats[1179]=7.0650262266497315; - lats[1180]=6.994727458238903; - lats[1181]=6.924428689827665; - lats[1182]=6.8541299214160212; - lats[1183]=6.7838311530039768; - lats[1184]=6.7135323845915353; - lats[1185]=6.6432336161787013; - lats[1186]=6.5729348477654792; - lats[1187]=6.5026360793518734; - lats[1188]=6.4323373109378874; - lats[1189]=6.3620385425235257; - lats[1190]=6.2917397741087928; - lats[1191]=6.2214410056936931; - lats[1192]=6.151142237278231; - lats[1193]=6.0808434688624091; - lats[1194]=6.0105447004462347; - lats[1195]=5.9402459320297085; - lats[1196]=5.869947163612836; - lats[1197]=5.7996483951956233; - lats[1198]=5.729349626778073; - lats[1199]=5.6590508583601888; - lats[1200]=5.5887520899419751; - lats[1201]=5.5184533215234373; - lats[1202]=5.4481545531045787; - lats[1203]=5.3778557846854023; - lats[1204]=5.3075570162659149; - lats[1205]=5.2372582478461194; - lats[1206]=5.1669594794260192; - lats[1207]=5.0966607110056197; - lats[1208]=5.0263619425849244; - lats[1209]=4.9560631741639369; - lats[1210]=4.8857644057426626; - lats[1211]=4.8154656373211049; - lats[1212]=4.7451668688992683; - lats[1213]=4.6748681004771564; - lats[1214]=4.6045693320547736; - lats[1215]=4.5342705636321252; - lats[1216]=4.4639717952092139; - lats[1217]=4.3936730267860451; - lats[1218]=4.3233742583626205; - lats[1219]=4.2530754899389471; - lats[1220]=4.1827767215150269; - lats[1221]=4.1124779530908659; - lats[1222]=4.0421791846664661; - lats[1223]=3.9718804162418326; - lats[1224]=3.90158164781697; - lats[1225]=3.8312828793918823; - lats[1226]=3.7609841109665734; - lats[1227]=3.6906853425410477; - lats[1228]=3.6203865741153085; - lats[1229]=3.5500878056893601; - lats[1230]=3.4797890372632065; - lats[1231]=3.4094902688368531; - lats[1232]=3.339191500410303; - lats[1233]=3.2688927319835597; - lats[1234]=3.1985939635566285; - lats[1235]=3.1282951951295126; - lats[1236]=3.0579964267022164; - lats[1237]=2.9876976582747439; - lats[1238]=2.9173988898470999; - lats[1239]=2.8471001214192873; - lats[1240]=2.7768013529913107; - lats[1241]=2.7065025845631743; - lats[1242]=2.6362038161348824; - lats[1243]=2.5659050477064382; - lats[1244]=2.4956062792778466; - lats[1245]=2.4253075108491116; - lats[1246]=2.3550087424202366; - lats[1247]=2.2847099739912267; - lats[1248]=2.2144112055620848; - lats[1249]=2.1441124371328155; - lats[1250]=2.0738136687034232; - lats[1251]=2.0035149002739114; - lats[1252]=1.9332161318442849; - lats[1253]=1.8629173634145471; - lats[1254]=1.792618594984702; - lats[1255]=1.7223198265547539; - lats[1256]=1.6520210581247066; - lats[1257]=1.5817222896945646; - lats[1258]=1.5114235212643317; - lats[1259]=1.4411247528340119; - lats[1260]=1.3708259844036093; - lats[1261]=1.300527215973128; - lats[1262]=1.2302284475425722; - lats[1263]=1.1599296791119456; - lats[1264]=1.0896309106812523; - lats[1265]=1.0193321422504964; - lats[1266]=0.949033373819682; - lats[1267]=0.87873460538881287; - lats[1268]=0.80843583695789356; - lats[1269]=0.73813706852692773; - lats[1270]=0.66783830009591949; - lats[1271]=0.59753953166487306; - lats[1272]=0.52724076323379232; - lats[1273]=0.45694199480268116; - lats[1274]=0.3866432263715438; - lats[1275]=0.31634445794038429; - lats[1276]=0.24604568950920663; - lats[1277]=0.17574692107801482; - lats[1278]=0.10544815264681295; - lats[1279]=0.035149384215604956; - - const size_t ilast = 2559; - for(size_t i=ilast; i>ilast/2; --i) { - lats[i] = -lats[ilast-i]; - } - - return GRIB_SUCCESS; -} - -/* Performance: return the precomputed latitudes for N=640 */ -/* The provided 'lats' array should have allocated 2*N elements */ -static int get_precomputed_latitudes_N640(double* lats) -{ - lats[0] = 89.892396445590066; - lats[1] = 89.753004943174034; - lats[2] = 89.612790258599077; - lats[3] = 89.472389582061126; - lats[4] = 89.331918354381827; - lats[5] = 89.191412986832432; - lats[6] = 89.050888539966436; - lats[7] = 88.91035235926023; - lats[8] = 88.76980845110036; - lats[9] = 88.629259185411627; - lats[10] = 88.488706053376362; - lats[11] = 88.348150039999084; - lats[12] = 88.207591822004105; - lats[13] = 88.067031879650926; - lats[14] = 87.926470563186442; - lats[15] = 87.785908134040668; - lats[16] = 87.645344791295628; - lats[17] = 87.504780689222315; - lats[18] = 87.364215949214667; - lats[19] = 87.223650668104085; - lats[20] = 87.083084924070917; - lats[21] = 86.942518780928566; - lats[22] = 86.801952291278369; - lats[23] = 86.661385498868242; - lats[24] = 86.520818440379529; - lats[25] = 86.380251146798656; - lats[26] = 86.239683644481104; - lats[27] = 86.0991159559849; - lats[28] = 85.958548100730781; - lats[29] = 85.817980095529578; - lats[30] = 85.677411955006008; - lats[31] = 85.536843691942948; - lats[32] = 85.396275317562669; - lats[33] = 85.255706841757572; - lats[34] = 85.115138273281829; - lats[35] = 84.974569619910426; - lats[36] = 84.834000888572191; - lats[37] = 84.693432085462035; - lats[38] = 84.552863216135577; - lats[39] = 84.412294285589354; - lats[40] = 84.271725298329656; - lats[41] = 84.131156258431133; - lats[42] = 83.990587169587158; - lats[43] = 83.850018035153667; - lats[44] = 83.709448858186462; - lats[45] = 83.568879641474325; - lats[46] = 83.428310387567549; - lats[47] = 83.287741098802584; - lats[48] = 83.147171777324388; - lats[49] = 83.006602425105484; - lats[50] = 82.866033043962815; - lats[51] = 82.725463635573107; - lats[52] = 82.584894201485696; - lats[53] = 82.444324743134914; - lats[54] = 82.303755261850071; - lats[55] = 82.163185758865239; - lats[56] = 82.022616235327504; - lats[57] = 81.882046692304485; - lats[58] = 81.741477130791196; - lats[59] = 81.600907551715878; - lats[60] = 81.460337955945846; - lats[61] = 81.319768344292086; - lats[62] = 81.179198717514012; - lats[63] = 81.038629076323318; - lats[64] = 80.898059421387785; - lats[65] = 80.757489753334553; - lats[66] = 80.616920072753146; - lats[67] = 80.47635038019834; - lats[68] = 80.335780676192584; - lats[69] = 80.195210961228469; - lats[70] = 80.054641235770603; - lats[71] = 79.914071500257819; - lats[72] = 79.773501755104689; - lats[73] = 79.632932000703448; - lats[74] = 79.492362237425226; - lats[75] = 79.351792465621628; - lats[76] = 79.211222685625927; - lats[77] = 79.070652897754229; - lats[78] = 78.930083102306568; - lats[79] = 78.789513299567957; - lats[80] = 78.648943489809355; - lats[81] = 78.508373673288318; - lats[82] = 78.367803850250056; - lats[83] = 78.227234020928066; - lats[84] = 78.086664185544819; - lats[85] = 77.946094344312371; - lats[86] = 77.805524497433041; - lats[87] = 77.664954645099883; - lats[88] = 77.524384787497311; - lats[89] = 77.383814924801513; - lats[90] = 77.243245057180829; - lats[91] = 77.102675184796354; - lats[92] = 76.962105307802219; - lats[93] = 76.821535426345932; - lats[94] = 76.680965540568806; - lats[95] = 76.540395650606285; - lats[96] = 76.399825756588143; - lats[97] = 76.259255858638895; - lats[98] = 76.118685956877997; - lats[99] = 75.978116051420102; - lats[100] = 75.837546142375359; - lats[101] = 75.69697622984954; - lats[102] = 75.556406313944308; - lats[103] = 75.41583639475742; - lats[104] = 75.275266472382896; - lats[105] = 75.134696546911186; - lats[106] = 74.994126618429377; - lats[107] = 74.853556687021296; - lats[108] = 74.712986752767719; - lats[109] = 74.57241681574645; - lats[110] = 74.431846876032495; - lats[111] = 74.291276933698185; - lats[112] = 74.150706988813226; - lats[113] = 74.010137041445006; - lats[114] = 73.869567091658411; - lats[115] = 73.728997139516167; - lats[116] = 73.588427185078871; - lats[117] = 73.447857228405013; - lats[118] = 73.307287269551111; - lats[119] = 73.166717308571819; - lats[120] = 73.026147345520002; - lats[121] = 72.885577380446747; - lats[122] = 72.745007413401481; - lats[123] = 72.604437444432065; - lats[124] = 72.463867473584784; - lats[125] = 72.323297500904502; - lats[126] = 72.182727526434604; - lats[127] = 72.042157550217183; - lats[128] = 71.901587572292982; - lats[129] = 71.761017592701492; - lats[130] = 71.620447611481026; - lats[131] = 71.47987762866866; - lats[132] = 71.339307644300462; - lats[133] = 71.198737658411332; - lats[134] = 71.058167671035164; - lats[135] = 70.917597682204899; - lats[136] = 70.777027691952398; - lats[137] = 70.636457700308753; - lats[138] = 70.495887707304007; - lats[139] = 70.355317712967462; - lats[140] = 70.214747717327526; - lats[141] = 70.074177720411782; - lats[142] = 69.933607722247146; - lats[143] = 69.793037722859665; - lats[144] = 69.65246772227475; - lats[145] = 69.511897720517084; - lats[146] = 69.37132771761064; - lats[147] = 69.230757713578825; - lats[148] = 69.090187708444333; - lats[149] = 68.949617702229318; - lats[150] = 68.809047694955296; - lats[151] = 68.668477686643286; - lats[152] = 68.52790767731365; - lats[153] = 68.387337666986312; - lats[154] = 68.246767655680657; - lats[155] = 68.106197643415527; - lats[156] = 67.965627630209354; - lats[157] = 67.825057616080073; - lats[158] = 67.684487601045149; - lats[159] = 67.543917585121662; - lats[160] = 67.403347568326168; - lats[161] = 67.262777550674912; - lats[162] = 67.122207532183722; - lats[163] = 66.981637512867991; - lats[164] = 66.841067492742795; - lats[165] = 66.700497471822814; - lats[166] = 66.559927450122359; - lats[167] = 66.41935742765547; - lats[168] = 66.278787404435761; - lats[169] = 66.138217380476604; - lats[170] = 65.997647355791017; - lats[171] = 65.85707733039176; - lats[172] = 65.716507304291198; - lats[173] = 65.575937277501538; - lats[174] = 65.435367250034616; - lats[175] = 65.294797221902016; - lats[176] = 65.154227193115119; - lats[177] = 65.013657163684968; - lats[178] = 64.873087133622406; - lats[179] = 64.732517102938033; - lats[180] = 64.591947071642196; - lats[181] = 64.451377039745026; - lats[182] = 64.310807007256443; - lats[183] = 64.170236974186125; - lats[184] = 64.029666940543564; - lats[185] = 63.889096906338061; - lats[186] = 63.748526871578648; - lats[187] = 63.607956836274255; - lats[188] = 63.467386800433559; - lats[189] = 63.326816764065093; - lats[190] = 63.186246727177178; - lats[191] = 63.045676689778013; - lats[192] = 62.905106651875542; - lats[193] = 62.764536613477638; - lats[194] = 62.62396657459194; - lats[195] = 62.483396535225978; - lats[196] = 62.342826495387122; - lats[197] = 62.202256455082583; - lats[198] = 62.061686414319418; - lats[199] = 61.921116373104539; - lats[200] = 61.780546331444761; - lats[201] = 61.639976289346727; - lats[202] = 61.499406246816953; - lats[203] = 61.358836203861841; - lats[204] = 61.21826616048768; - lats[205] = 61.077696116700601; - lats[206] = 60.937126072506608; - lats[207] = 60.796556027911663; - lats[208] = 60.655985982921543; - lats[209] = 60.515415937541938; - lats[210] = 60.374845891778421; - lats[211] = 60.234275845636503; - lats[212] = 60.093705799121537; - lats[213] = 59.953135752238794; - lats[214] = 59.812565704993467; - lats[215] = 59.671995657390596; - lats[216] = 59.531425609435225; - lats[217] = 59.390855561132213; - lats[218] = 59.250285512486386; - lats[219] = 59.10971546350244; - lats[220] = 58.96914541418505; - lats[221] = 58.828575364538722; - lats[222] = 58.688005314567938; - lats[223] = 58.547435264277105; - lats[224] = 58.406865213670514; - lats[225] = 58.266295162752428; - lats[226] = 58.125725111526968; - lats[227] = 57.985155059998249; - lats[228] = 57.844585008170284; - lats[229] = 57.704014956047033; - lats[230] = 57.563444903632337; - lats[231] = 57.422874850930043; - lats[232] = 57.282304797943887; - lats[233] = 57.141734744677549; - lats[234] = 57.001164691134662; - lats[235] = 56.860594637318769; - lats[236] = 56.720024583233375; - lats[237] = 56.579454528881925; - lats[238] = 56.438884474267795; - lats[239] = 56.29831441939433; - lats[240] = 56.157744364264779; - lats[241] = 56.017174308882367; - lats[242] = 55.876604253250278; - lats[243] = 55.736034197371588; - lats[244] = 55.595464141249401; - lats[245] = 55.45489408488671; - lats[246] = 55.314324028286471; - lats[247] = 55.173753971451625; - lats[248] = 55.033183914385013; - lats[249] = 54.892613857089486; - lats[250] = 54.752043799567822; - lats[251] = 54.611473741822735; - lats[252] = 54.470903683856939; - lats[253] = 54.330333625673063; - lats[254] = 54.189763567273758; - lats[255] = 54.049193508661538; - lats[256] = 53.90862344983897; - lats[257] = 53.768053390808532; - lats[258] = 53.627483331572677; - lats[259] = 53.486913272133812; - lats[260] = 53.346343212494332; - lats[261] = 53.205773152656562; - lats[262] = 53.065203092622802; - lats[263] = 52.924633032395342; - lats[264] = 52.784062971976404; - lats[265] = 52.643492911368206; - lats[266] = 52.502922850572908; - lats[267] = 52.362352789592649; - lats[268] = 52.221782728429538; - lats[269] = 52.081212667085637; - lats[270] = 51.940642605563028; - lats[271] = 51.800072543863692; - lats[272] = 51.659502481989627; - lats[273] = 51.518932419942786; - lats[274] = 51.378362357725095; - lats[275] = 51.237792295338465; - lats[276] = 51.097222232784773; - lats[277] = 50.956652170065858; - lats[278] = 50.81608210718354; - lats[279] = 50.675512044139623; - lats[280] = 50.534941980935862; - lats[281] = 50.39437191757402; - lats[282] = 50.253801854055808; - lats[283] = 50.113231790382912; - lats[284] = 49.972661726557028; - lats[285] = 49.832091662579785; - lats[286] = 49.691521598452823; - lats[287] = 49.550951534177734; - lats[288] = 49.410381469756118; - lats[289] = 49.269811405189529; - lats[290] = 49.129241340479489; - lats[291] = 48.988671275627539; - lats[292] = 48.848101210635171; - lats[293] = 48.707531145503857; - lats[294] = 48.56696108023506; - lats[295] = 48.42639101483023; - lats[296] = 48.285820949290759; - lats[297] = 48.145250883618075; - lats[298] = 48.004680817813544; - lats[299] = 47.864110751878535; - lats[300] = 47.723540685814392; - lats[301] = 47.582970619622444; - lats[302] = 47.442400553303997; - lats[303] = 47.301830486860368; - lats[304] = 47.161260420292813; - lats[305] = 47.020690353602596; - lats[306] = 46.880120286790955; - lats[307] = 46.73955021985914; - lats[308] = 46.598980152808338; - lats[309] = 46.458410085639763; - lats[310] = 46.317840018354602; - lats[311] = 46.177269950954006; - lats[312] = 46.036699883439134; - lats[313] = 45.896129815811136; - lats[314] = 45.755559748071114; - lats[315] = 45.614989680220205; - lats[316] = 45.474419612259481; - lats[317] = 45.333849544190024; - lats[318] = 45.193279476012933; - lats[319] = 45.052709407729239; - lats[320] = 44.912139339339987; - lats[321] = 44.771569270846214; - lats[322] = 44.630999202248923; - lats[323] = 44.490429133549149; - lats[324] = 44.349859064747854; - lats[325] = 44.209288995846045; - lats[326] = 44.068718926844674; - lats[327] = 43.928148857744716; - lats[328] = 43.787578788547094; - lats[329] = 43.64700871925276; - lats[330] = 43.506438649862638; - lats[331] = 43.365868580377636; - lats[332] = 43.225298510798666; - lats[333] = 43.0847284411266; - lats[334] = 42.944158371362349; - lats[335] = 42.803588301506764; - lats[336] = 42.663018231560706; - lats[337] = 42.522448161525034; - lats[338] = 42.381878091400594; - lats[339] = 42.241308021188203; - lats[340] = 42.100737950888686; - lats[341] = 41.960167880502873; - lats[342] = 41.819597810031553; - lats[343] = 41.679027739475522; - lats[344] = 41.538457668835562; - lats[345] = 41.397887598112455; - lats[346] = 41.257317527306981; - lats[347] = 41.116747456419873; - lats[348] = 40.976177385451912; - lats[349] = 40.835607314403816; - lats[350] = 40.695037243276325; - lats[351] = 40.554467172070169; - lats[352] = 40.41389710078608; - lats[353] = 40.273327029424742; - lats[354] = 40.132756957986885; - lats[355] = 39.992186886473185; - lats[356] = 39.851616814884331; - lats[357] = 39.711046743220997; - lats[358] = 39.570476671483874; - lats[359] = 39.429906599673615; - lats[360] = 39.289336527790894; - lats[361] = 39.148766455836338; - lats[362] = 39.008196383810613; - lats[363] = 38.867626311714339; - lats[364] = 38.727056239548169; - lats[365] = 38.5864861673127; - lats[366] = 38.44591609500857; - lats[367] = 38.305346022636385; - lats[368] = 38.164775950196741; - lats[369] = 38.02420587769025; - lats[370] = 37.883635805117493; - lats[371] = 37.743065732479067; - lats[372] = 37.602495659775542; - lats[373] = 37.461925587007492; - lats[374] = 37.321355514175501; - lats[375] = 37.180785441280122; - lats[376] = 37.040215368321896; - lats[377] = 36.899645295301404; - lats[378] = 36.759075222219167; - lats[379] = 36.618505149075737; - lats[380] = 36.477935075871656; - lats[381] = 36.33736500260742; - lats[382] = 36.196794929283605; - lats[383] = 36.056224855900687; - lats[384] = 35.9156547824592; - lats[385] = 35.775084708959632; - lats[386] = 35.634514635402525; - lats[387] = 35.493944561788332; - lats[388] = 35.353374488117588; - lats[389] = 35.21280441439076; - lats[390] = 35.072234340608333; - lats[391] = 34.931664266770788; - lats[392] = 34.79109419287861; - lats[393] = 34.650524118932253; - lats[394] = 34.509954044932208; - lats[395] = 34.369383970878907; - lats[396] = 34.228813896772813; - lats[397] = 34.088243822614395; - lats[398] = 33.9476737484041; - lats[399] = 33.807103674142361; - lats[400] = 33.66653359982962; - lats[401] = 33.525963525466317; - lats[402] = 33.385393451052892; - lats[403] = 33.244823376589757; - lats[404] = 33.104253302077339; - lats[405] = 32.963683227516071; - lats[406] = 32.823113152906366; - lats[407] = 32.682543078248621; - lats[408] = 32.541973003543255; - lats[409] = 32.401402928790681; - lats[410] = 32.260832853991289; - lats[411] = 32.120262779145477; - lats[412] = 31.979692704253651; - lats[413] = 31.839122629316183; - lats[414] = 31.698552554333489; - lats[415] = 31.55798247930592; - lats[416] = 31.417412404233875; - lats[417] = 31.276842329117731; - lats[418] = 31.136272253957859; - lats[419] = 30.99570217875463; - lats[420] = 30.855132103508407; - lats[421] = 30.71456202821955; - lats[422] = 30.573991952888438; - lats[423] = 30.433421877515418; - lats[424] = 30.292851802100841; - lats[425] = 30.152281726645064; - lats[426] = 30.011711651148435; - lats[427] = 29.87114157561129; - lats[428] = 29.730571500033992; - lats[429] = 29.590001424416862; - lats[430] = 29.449431348760253; - lats[431] = 29.308861273064483; - lats[432] = 29.168291197329893; - lats[433] = 29.027721121556816; - lats[434] = 28.887151045745565; - lats[435] = 28.746580969896474; - lats[436] = 28.606010894009859; - lats[437] = 28.465440818086037; - lats[438] = 28.324870742125327; - lats[439] = 28.184300666128038; - lats[440] = 28.043730590094491; - lats[441] = 27.903160514024975; - lats[442] = 27.762590437919812; - lats[443] = 27.622020361779295; - lats[444] = 27.481450285603731; - lats[445] = 27.340880209393415; - lats[446] = 27.200310133148644; - lats[447] = 27.05974005686971; - lats[448] = 26.919169980556905; - lats[449] = 26.778599904210516; - lats[450] = 26.638029827830831; - lats[451] = 26.497459751418134; - lats[452] = 26.356889674972713; - lats[453] = 26.216319598494842; - lats[454] = 26.075749521984797; - lats[455] = 25.935179445442859; - lats[456] = 25.794609368869299; - lats[457] = 25.654039292264386; - lats[458] = 25.513469215628398; - lats[459] = 25.3728991389616; - lats[460] = 25.232329062264245; - lats[461] = 25.091758985536615; - lats[462] = 24.951188908778963; - lats[463] = 24.810618831991551; - lats[464] = 24.670048755174633; - lats[465] = 24.529478678328466; - lats[466] = 24.388908601453309; - lats[467] = 24.248338524549407; - lats[468] = 24.107768447617016; - lats[469] = 23.96719837065638; - lats[470] = 23.826628293667756; - lats[471] = 23.686058216651375; - lats[472] = 23.545488139607492; - lats[473] = 23.404918062536346; - lats[474] = 23.264347985438178; - lats[475] = 23.123777908313219; - lats[476] = 22.98320783116171; - lats[477] = 22.84263775398389; - lats[478] = 22.70206767677999; - lats[479] = 22.561497599550243; - lats[480] = 22.420927522294875; - lats[481] = 22.280357445014126; - lats[482] = 22.139787367708202; - lats[483] = 21.999217290377352; - lats[484] = 21.858647213021786; - lats[485] = 21.718077135641735; - lats[486] = 21.577507058237412; - lats[487] = 21.436936980809044; - lats[488] = 21.296366903356844; - lats[489] = 21.155796825881037; - lats[490] = 21.015226748381831; - lats[491] = 20.874656670859444; - lats[492] = 20.734086593314085; - lats[493] = 20.593516515745968; - lats[494] = 20.452946438155308; - lats[495] = 20.312376360542309; - lats[496] = 20.171806282907177; - lats[497] = 20.031236205250121; - lats[498] = 19.890666127571347; - lats[499] = 19.750096049871054; - lats[500] = 19.609525972149449; - lats[501] = 19.468955894406733; - lats[502] = 19.328385816643106; - lats[503] = 19.187815738858767; - lats[504] = 19.04724566105391; - lats[505] = 18.906675583228736; - lats[506] = 18.766105505383443; - lats[507] = 18.625535427518219; - lats[508] = 18.484965349633256; - lats[509] = 18.344395271728757; - lats[510] = 18.203825193804899; - lats[511] = 18.063255115861882; - lats[512] = 17.922685037899889; - lats[513] = 17.782114959919113; - lats[514] = 17.641544881919739; - lats[515] = 17.500974803901951; - lats[516] = 17.360404725865926; - lats[517] = 17.219834647811862; - lats[518] = 17.079264569739937; - lats[519] = 16.938694491650331; - lats[520] = 16.798124413543224; - lats[521] = 16.657554335418794; - lats[522] = 16.516984257277226; - lats[523] = 16.376414179118694; - lats[524] = 16.235844100943371; - lats[525] = 16.09527402275144; - lats[526] = 15.954703944543072; - lats[527] = 15.814133866318445; - lats[528] = 15.673563788077727; - lats[529] = 15.532993709821094; - lats[530] = 15.392423631548718; - lats[531] = 15.251853553260768; - lats[532] = 15.111283474957411; - lats[533] = 14.970713396638821; - lats[534] = 14.830143318305167; - lats[535] = 14.689573239956617; - lats[536] = 14.549003161593328; - lats[537] = 14.408433083215476; - lats[538] = 14.267863004823225; - lats[539] = 14.127292926416734; - lats[540] = 13.986722847996173; - lats[541] = 13.8461527695617; - lats[542] = 13.705582691113481; - lats[543] = 13.565012612651675; - lats[544] = 13.424442534176441; - lats[545] = 13.283872455687943; - lats[546] = 13.143302377186339; - lats[547] = 13.002732298671786; - lats[548] = 12.862162220144443; - lats[549] = 12.72159214160447; - lats[550] = 12.58102206305202; - lats[551] = 12.440451984487247; - lats[552] = 12.299881905910311; - lats[553] = 12.159311827321366; - lats[554] = 12.018741748720567; - lats[555] = 11.878171670108063; - lats[556] = 11.73760159148401; - lats[557] = 11.597031512848561; - lats[558] = 11.456461434201868; - lats[559] = 11.315891355544077; - lats[560] = 11.175321276875344; - lats[561] = 11.034751198195819; - lats[562] = 10.894181119505649; - lats[563] = 10.753611040804984; - lats[564] = 10.613040962093971; - lats[565] = 10.472470883372759; - lats[566] = 10.331900804641496; - lats[567] = 10.191330725900327; - lats[568] = 10.050760647149401; - lats[569] = 9.9101905683888614; - lats[570] = 9.7696204896188554; - lats[571] = 9.6290504108395272; - lats[572] = 9.4884803320510205; - lats[573] = 9.3479102532534792; - lats[574] = 9.2073401744470491; - lats[575] = 9.0667700956318686; - lats[576] = 8.9262000168080871; - lats[577] = 8.7856299379758411; - lats[578] = 8.645059859135273; - lats[579] = 8.5044897802865282; - lats[580] = 8.3639197014297419; - lats[581] = 8.223349622565058; - lats[582] = 8.0827795436926184; - lats[583] = 7.9422094648125583; - lats[584] = 7.8016393859250206; - lats[585] = 7.661069307030143; - lats[586] = 7.5204992281280649; - lats[587] = 7.3799291492189223; - lats[588] = 7.2393590703028563; - lats[589] = 7.098788991380002; - lats[590] = 6.9582189124504987; - lats[591] = 6.8176488335144816; - lats[592] = 6.6770787545720891; - lats[593] = 6.5365086756234554; - lats[594] = 6.3959385966687181; - lats[595] = 6.2553685177080123; - lats[596] = 6.1147984387414738; - lats[597] = 5.9742283597692367; - lats[598] = 5.833658280791437; - lats[599] = 5.6930882018082087; - lats[600] = 5.5525181228196869; - lats[601] = 5.4119480438260039; - lats[602] = 5.2713779648272956; - lats[603] = 5.1308078858236934; - lats[604] = 4.9902378068153324; - lats[605] = 4.8496677278023448; - lats[606] = 4.7090976487848639; - lats[607] = 4.5685275697630221; - lats[608] = 4.4279574907369508; - lats[609] = 4.2873874117067841; - lats[610] = 4.1468173326726534; - lats[611] = 4.0062472536346903; - lats[612] = 3.8656771745930261; - lats[613] = 3.7251070955477918; - lats[614] = 3.5845370164991213; - lats[615] = 3.4439669374471427; - lats[616] = 3.3033968583919884; - lats[617] = 3.1628267793337885; - lats[618] = 3.0222567002726746; - lats[619] = 2.8816866212087762; - lats[620] = 2.7411165421422243; - lats[621] = 2.6005464630731496; - lats[622] = 2.4599763840016813; - lats[623] = 2.3194063049279499; - lats[624] = 2.1788362258520855; - lats[625] = 2.0382661467742174; - lats[626] = 1.8976960676944756; - lats[627] = 1.7571259886129893; - lats[628] = 1.6165559095298885; - lats[629] = 1.4759858304453026; - lats[630] = 1.3354157513593612; - lats[631] = 1.194845672272193; - lats[632] = 1.0542755931839276; - lats[633] = 0.91370551409469447; - lats[634] = 0.77313543500462234; - lats[635] = 0.63256535591384055; - lats[636] = 0.49199527682247807; - lats[637] = 0.351425197730664; - lats[638] = 0.21085511863852741; - lats[639] = 0.070285039546197275; - const size_t ilast = 1279; - for(size_t i=ilast; i>ilast/2; --i) { - lats[i] = -lats[ilast-i]; - } - - return GRIB_SUCCESS; -} - /* 'trunc' is the Gaussian number (or order) */ /* i.e. Number of parallels between a pole and the equator. */ /* The provided 'lats' array should have allocated 2*trunc elements */ -static int ecc_grib_get_gaussian_latitudes(long trunc, double* lats) +static int compute_gaussian_latitudes(long trunc, double* lats) { long jlat, iter, legi; double rad2deg, convval, root, legfonc = 0; @@ -2098,12 +153,7 @@ int grib_get_gaussian_latitudes(long trunc, double* lats) { if (trunc <= 0) return GRIB_GEOCALCULUS_PROBLEM; - if (trunc == 1280) - return get_precomputed_latitudes_N1280(lats); - if (trunc == 640) - return get_precomputed_latitudes_N640(lats); - else - return ecc_grib_get_gaussian_latitudes(trunc, lats); + return compute_gaussian_latitudes(trunc, lats); } /* Boolean return type: 1 if the reduced gaussian field is global, 0 for sub area */ diff --git a/src/grib_handle.cc b/src/grib_handle.cc index 34708513e..be5cdecda 100644 --- a/src/grib_handle.cc +++ b/src/grib_handle.cc @@ -196,7 +196,7 @@ static grib_handle* grib_handle_create(grib_handle* gl, grib_context* c, const v return NULL; } - gl->buffer->property = GRIB_USER_BUFFER; + gl->buffer->property = CODES_USER_BUFFER; next = gl->context->grib_reader->first->root; while (next) { @@ -401,7 +401,7 @@ grib_handle* grib_handle_new_from_message_copy(grib_context* c, const void* data memcpy(copy, data, size); g = grib_handle_new_from_message(c, copy, size); - g->buffer->property = GRIB_MY_BUFFER; + g->buffer->property = CODES_MY_BUFFER; return g; } @@ -421,7 +421,7 @@ grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const vo memcpy(copy, data, size); g = grib_handle_new_from_partial_message(c, copy, size); - g->buffer->property = GRIB_MY_BUFFER; + g->buffer->property = CODES_MY_BUFFER; return g; } @@ -607,7 +607,7 @@ static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** data, return NULL; } - gl->buffer->property = GRIB_MY_BUFFER; + gl->buffer->property = CODES_MY_BUFFER; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); @@ -764,7 +764,7 @@ static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, in } gl->offset = gm->offset; - gl->buffer->property = GRIB_MY_BUFFER; + gl->buffer->property = CODES_MY_BUFFER; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); @@ -844,7 +844,7 @@ grib_handle* gts_new_from_file(grib_context* c, FILE* f, int* error) } gl->offset = offset; - gl->buffer->property = GRIB_MY_BUFFER; + gl->buffer->property = CODES_MY_BUFFER; gl->product_kind = PRODUCT_GTS; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); @@ -885,7 +885,7 @@ grib_handle* taf_new_from_file(grib_context* c, FILE* f, int* error) } gl->offset = offset; - gl->buffer->property = GRIB_MY_BUFFER; + gl->buffer->property = CODES_MY_BUFFER; gl->product_kind = PRODUCT_TAF; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); @@ -926,7 +926,7 @@ grib_handle* metar_new_from_file(grib_context* c, FILE* f, int* error) } gl->offset = offset; - gl->buffer->property = GRIB_MY_BUFFER; + gl->buffer->property = CODES_MY_BUFFER; gl->product_kind = PRODUCT_METAR; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); @@ -994,7 +994,7 @@ grib_handle* bufr_new_from_file(grib_context* c, FILE* f, int* error) } gl->offset = offset; - gl->buffer->property = GRIB_MY_BUFFER; + gl->buffer->property = CODES_MY_BUFFER; gl->product_kind = PRODUCT_BUFR; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); @@ -1046,7 +1046,7 @@ grib_handle* any_new_from_file(grib_context* c, FILE* f, int* error) } gl->offset = offset; - gl->buffer->property = GRIB_MY_BUFFER; + gl->buffer->property = CODES_MY_BUFFER; gl->product_kind = PRODUCT_ANY; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); @@ -1119,7 +1119,7 @@ static grib_handle* grib_handle_new_from_file_no_multi(grib_context* c, FILE* f, } gl->offset = offset; - gl->buffer->property = GRIB_MY_BUFFER; + gl->buffer->property = CODES_MY_BUFFER; grib_context_increment_handle_file_count(c); grib_context_increment_handle_total_count(c); @@ -1415,7 +1415,7 @@ int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size) // grib_handle_delete(h); // return NULL; // } -// h->buffer->property = GRIB_USER_BUFFER; +// h->buffer->property = CODES_USER_BUFFER; // h->header_mode = 1; // return h; // } diff --git a/src/grib_hash_array.cc b/src/grib_hash_array.cc index 3e0446b32..54ba4294f 100644 --- a/src/grib_hash_array.cc +++ b/src/grib_hash_array.cc @@ -21,15 +21,14 @@ grib_hash_array_value* grib_integer_hash_array_value_new(grib_context* c, const return v; } -grib_hash_array_value* grib_double_hash_array_value_new(grib_context* c, const char* name, grib_darray* array) -{ - grib_hash_array_value* v = (grib_hash_array_value*)grib_context_malloc_clear_persistent(c, sizeof(grib_hash_array_value)); - - v->name = grib_context_strdup_persistent(c, name); - v->type = GRIB_HASH_ARRAY_TYPE_DOUBLE; - v->darray = array; - return v; -} +// grib_hash_array_value* grib_double_hash_array_value_new(grib_context* c, const char* name, grib_darray* array) +// { +// grib_hash_array_value* v = (grib_hash_array_value*)grib_context_malloc_clear_persistent(c, sizeof(grib_hash_array_value)); +// v->name = grib_context_strdup_persistent(c, name); +// v->type = GRIB_HASH_ARRAY_TYPE_DOUBLE; +// v->darray = array; +// return v; +// } void grib_hash_array_value_delete(grib_context* c, grib_hash_array_value* v) { diff --git a/src/grib_iarray.cc b/src/grib_iarray.cc index 93621dd83..50d16bcaa 100644 --- a/src/grib_iarray.cc +++ b/src/grib_iarray.cc @@ -8,13 +8,9 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * Enrico Fucile - ***************************************************************************/ - #include "grib_api_internal.h" -/* For debugging purposes */ +// For debugging purposes void grib_iarray_print(const char* title, const grib_iarray* iarray) { size_t i; @@ -51,7 +47,7 @@ grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize) v = (grib_iarray*)grib_context_malloc(c, sizeof(grib_iarray)); if (!v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_iarray_new unable to allocate %lu bytes\n", sizeof(grib_iarray)); + "grib_iarray_new unable to allocate %zu bytes", sizeof(grib_iarray)); return NULL; } v->context = c; @@ -62,7 +58,7 @@ grib_iarray* grib_iarray_new(grib_context* c, size_t size, size_t incsize) v->number_of_pop_front = 0; if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_iarray_new unable to allocate %lu bytes\n", sizeof(long) * size); + "grib_iarray_new unable to allocate %zu bytes", sizeof(long) * size); return NULL; } return v; @@ -103,7 +99,7 @@ static grib_iarray* grib_iarray_resize_to(grib_iarray* v, size_t newsize) newv = (long*)grib_context_malloc_clear(c, newsize * sizeof(long)); if (!newv) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_iarray_resize unable to allocate %lu bytes\n", sizeof(long) * newsize); + "grib_iarray_resize unable to allocate %zu bytes", sizeof(long) * newsize); return NULL; } @@ -142,48 +138,45 @@ grib_iarray* grib_iarray_push(grib_iarray* v, long val) return v; } -grib_iarray* grib_iarray_push_front(grib_iarray* v, long val) -{ - size_t start_size = 100; - size_t start_incsize = 100; - size_t i; - if (!v) - v = grib_iarray_new(0, start_size, start_incsize); +// grib_iarray* grib_iarray_push_front(grib_iarray* v, long val) +// { +// size_t start_size = 100; +// size_t start_incsize = 100; +// size_t i; +// if (!v) +// v = grib_iarray_new(0, start_size, start_incsize); +// if (v->number_of_pop_front) { +// v->v--; +// v->number_of_pop_front--; +// } +// else { +// if (v->n >= v->size) +// v = grib_iarray_resize(v); +// for (i = v->n; i > 0; i--) +// v[i] = v[i - 1]; +// } +// v->v[0] = val; +// v->n++; +// return v; +// } - if (v->number_of_pop_front) { - v->v--; - v->number_of_pop_front--; - } - else { - if (v->n >= v->size) - v = grib_iarray_resize(v); - for (i = v->n; i > 0; i--) - v[i] = v[i - 1]; - } - v->v[0] = val; - v->n++; - - return v; -} - -grib_iarray* grib_iarray_push_array(grib_iarray* v, long* val, size_t size) -{ - size_t start_size = size; - size_t start_incsize = 100; - long* vp = 0; - long* valp = val; - if (!v) - v = grib_iarray_new(0, start_size, start_incsize); - - v = grib_iarray_resize_to(v, size + v->n); - vp = v->v + v->n + v->number_of_pop_front; - v->n += size; - while (size) { - *(vp++) = *(valp++); - size--; - } - return v; -} +// grib_iarray* grib_iarray_push_array(grib_iarray* v, long* val, size_t size) +// { +// size_t start_size = size; +// size_t start_incsize = 100; +// long* vp = 0; +// long* valp = val; +// if (!v) +// v = grib_iarray_new(0, start_size, start_incsize); +// v = grib_iarray_resize_to(v, size + v->n); +// vp = v->v + v->n + v->number_of_pop_front; +// v->n += size; +// while (size) { +// *(vp++) = *(valp++); +// size--; +// } +// return v; +// } void grib_iarray_delete(grib_iarray* v) { diff --git a/src/grib_ibmfloat.cc b/src/grib_ibmfloat.cc index d8dc76206..47f0eda35 100644 --- a/src/grib_ibmfloat.cc +++ b/src/grib_ibmfloat.cc @@ -9,85 +9,9 @@ */ #include "grib_api_internal.h" +#include "grib_ibmfloat.h" -#if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; -static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - -static void init() -{ - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex, &attr); - pthread_mutexattr_destroy(&attr); -} -#elif GRIB_OMP_THREADS -static int once = 0; -static omp_nest_lock_t mutex; - -static void init() -{ - GRIB_OMP_CRITICAL(lock_grib_ibmfloat_c) - { - if (once == 0) { - omp_init_nest_lock(&mutex); - once = 1; - } - } -} -#endif - -typedef struct ibm_table_t ibm_table_t; - -struct ibm_table_t -{ - int inited; - double e[128]; - double v[128]; - double vmin; - double vmax; -}; - -static ibm_table_t ibm_table = { 0, {0,}, {0,}, 0, 0 }; - -static void init_ibm_table() -{ - if (!ibm_table.inited) { - unsigned long i; - unsigned long mmin = 0x100000; - unsigned long mmax = 0xffffff; - double e = 1; - for (i = 1; i <= 57; i++) { - e *= 16; - ibm_table.e[i + 70] = e; - ibm_table.v[i + 70] = e * mmin; - } - ibm_table.e[70] = 1; - ibm_table.v[70] = mmin; - e = 1; - for (i = 1; i <= 70; i++) { - e /= 16; - ibm_table.e[70 - i] = e; - ibm_table.v[70 - i] = e * mmin; - } - ibm_table.vmin = ibm_table.v[0]; - ibm_table.vmax = ibm_table.e[127] * mmax; - ibm_table.inited = 1; - /*for (i=0;i<128;i++) printf("++++ ibm_table.v[%d]=%g\n",i,ibm_table.v[i]);*/ - } -} - -static void init_table_if_needed() -{ - GRIB_MUTEX_INIT_ONCE(&once, &init); - GRIB_MUTEX_LOCK(&mutex); - - if (!ibm_table.inited) - init_ibm_table(); - - GRIB_MUTEX_UNLOCK(&mutex); -} +constexpr auto ibm_table = IbmTable{}; static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j) { @@ -116,8 +40,6 @@ unsigned long grib_ibm_to_long(double x) unsigned long e = 0; double rmmax = mmax + 0.5; - init_table_if_needed(); - /* printf("\ngrib_ibm_to_long: x=%.20e\n",x); */ if (x < 0) { s = 1; @@ -137,7 +59,7 @@ unsigned long grib_ibm_to_long(double x) return 0; } - binary_search(ibm_table.v, 127, x, &e); + binary_search(ibm_table.v.data(), 127, x, &e); /* printf("grib_ibm_to_long: e=%ld\n",e); */ @@ -174,8 +96,6 @@ double grib_ibmfloat_error(double x) { unsigned long e = 0; - init_table_if_needed(); - if (x < 0) x = -x; @@ -190,7 +110,7 @@ double grib_ibmfloat_error(double x) return 0; } - binary_search(ibm_table.v, 127, x, &e); + binary_search(ibm_table.v.data(), 127, x, &e); return ibm_table.e[e]; } @@ -203,8 +123,6 @@ double grib_long_to_ibm(unsigned long x) double val = m; - init_table_if_needed(); - /*if(x == 0) return 0;*/ if (c == 0 && m <= 1) return 0; @@ -219,13 +137,11 @@ double grib_long_to_ibm(unsigned long x) double grib_ibm_table_e(unsigned long e) { - init_table_if_needed(); return ibm_table.e[e]; } double grib_ibm_table_v(unsigned long e) { - init_table_if_needed(); return ibm_table.v[e]; } @@ -241,8 +157,6 @@ unsigned long grib_ibm_nearest_smaller_to_long(double x) if (x == 0) return 0; - init_table_if_needed(); - l = grib_ibm_to_long(x); y = grib_long_to_ibm(l); @@ -287,8 +201,6 @@ int grib_nearest_smaller_ibm_float(double a, double* ret) { unsigned long l = 0; - init_table_if_needed(); - if (a > ibm_table.vmax) return GRIB_INTERNAL_ERROR; diff --git a/src/grib_ibmfloat.h b/src/grib_ibmfloat.h new file mode 100644 index 000000000..e521076f5 --- /dev/null +++ b/src/grib_ibmfloat.h @@ -0,0 +1,74 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ + +#pragma once + +#include "grib_scaling.h" + +#include +#include +#include + +/** +.. _init_ieee_table: + +Init IBM Floats Table +===================== + +Initializes the ibm_table with IBM Float values. Nearest smaller values (e.g., reference values for grid_simple) are taken from this table. + +Details +------- + +The table layout is as follows: + ++-------+----------------+------------------------+ +| idx (i) | multiplier (e) | value (v = mmin * e) | ++-------+----------------+------------------------+ +| 0 | 16^(-70) | 0x100000 * 2^(-70) | +| 1 | 16^(-69) | 0x100000 * 2^(-69) | +| ... | ... | ... | +| 126 | 16^56 | 0x100000 * 2^56 | +| 127 | 16^57 | 0x100000 * 2^57 | ++-------+----------------+------------------------+ + +The vmin and vmax boundaries are defined as: + +- vmin = 0x100000 * 2^(-70) +- vmax = 0xffffff * 2^57 +*/ + +struct IbmTable { +private: + using ValueType = double; + static constexpr int TABLESIZE = 128; + static constexpr uint32_t mantissa_min = 0x100000; + static constexpr uint32_t mantissa_max = 0xffffff; + +public: + static constexpr std::array e = []() { + std::array multiplier{}; + multiplier[0] = 0; + for (int i = 0; i < TABLESIZE; ++i) { + multiplier[i] = codes_power(i - 70, 16); + } + return multiplier; + }(); + static constexpr std::array v = []() { + std::array values{}; + values[0] = 0; + for (int i = 0; i < TABLESIZE; ++i) { + values[i] = e[i] * mantissa_min; + } + return values; + }(); + static constexpr ValueType vmin = e[0] * mantissa_min; + static constexpr ValueType vmax = e[127] * mantissa_max; +}; diff --git a/src/grib_ieeefloat.cc b/src/grib_ieeefloat.cc index 8be76e556..5c8ffbb18 100644 --- a/src/grib_ieeefloat.cc +++ b/src/grib_ieeefloat.cc @@ -8,91 +8,11 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * Enrico Fucile - 06.01.2009 * - ***************************************************************************/ #include "grib_ieeefloat.h" -#if GRIB_PTHREADS -static pthread_once_t once = PTHREAD_ONCE_INIT; -static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - -static void init() -{ - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex, &attr); - pthread_mutexattr_destroy(&attr); -} -#elif GRIB_OMP_THREADS -static int once = 0; -static omp_nest_lock_t mutex; - -static void init() -{ - GRIB_OMP_CRITICAL(lock_grib_ieeefloat_c) - { - if (once == 0) { - omp_init_nest_lock(&mutex); - once = 1; - } - } -} -#endif - /* See old implementation in src/deprecated/grib_ieeefloat.c */ -typedef struct ieee_table_t ieee_table_t; - -struct ieee_table_t -{ - int inited; - double e[255]; - double v[255]; - double vmin; - double vmax; -}; - -static ieee_table_t ieee_table = { 0, {0,}, {0,}, 0, 0 }; - -static void init_ieee_table() -{ - if (!ieee_table.inited) { - unsigned long i; - unsigned long mmin = 0x800000; - unsigned long mmax = 0xffffff; - double e = 1; - for (i = 1; i <= 104; i++) { - e *= 2; - ieee_table.e[i + 150] = e; - ieee_table.v[i + 150] = e * mmin; - } - ieee_table.e[150] = 1; - ieee_table.v[150] = mmin; - e = 1; - for (i = 1; i < 150; i++) { - e /= 2; - ieee_table.e[150 - i] = e; - ieee_table.v[150 - i] = e * mmin; - } - ieee_table.vmin = ieee_table.v[1]; - ieee_table.vmax = ieee_table.e[254] * mmax; - ieee_table.inited = 1; - /*for (i=0;i<128;i++) printf("++++ ieee_table.v[%d]=%g\n",i,ieee_table.v[i]);*/ - } -} - -static void init_table_if_needed() -{ - GRIB_MUTEX_INIT_ONCE(&once, &init); - GRIB_MUTEX_LOCK(&mutex); - - if (!ieee_table.inited) - init_ieee_table(); - - GRIB_MUTEX_UNLOCK(&mutex); -} +constexpr auto ieee_table = IeeeTable(); static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j) { @@ -112,18 +32,6 @@ static void binary_search(const double xx[], const unsigned long n, double x, un *j = jl; } -double grib_ieee_table_e(unsigned long e) -{ - init_table_if_needed(); - return ieee_table.e[e]; -} - -double grib_ieee_table_v(unsigned long e) -{ - init_table_if_needed(); - return ieee_table.v[e]; -} - unsigned long grib_ieee_to_long(double x) { unsigned long s = 0; @@ -133,8 +41,6 @@ unsigned long grib_ieee_to_long(double x) unsigned long e = 0; double rmmax = mmax + 0.5; - init_table_if_needed(); - /* printf("\ngrib_ieee_to_long: x=%.20e\n",x); */ if (x < 0) { s = 1; @@ -154,7 +60,7 @@ unsigned long grib_ieee_to_long(double x) return 0; } - binary_search(ieee_table.v, 254, x, &e); + binary_search(ieee_table.v.data(), 254, x, &e); /* printf("grib_ieee_to_long: e=%ld\n",e); */ @@ -191,8 +97,6 @@ double grib_ieeefloat_error(double x) { unsigned long e = 0; - init_table_if_needed(); - if (x < 0) x = -x; @@ -207,7 +111,7 @@ double grib_ieeefloat_error(double x) return 0; } - binary_search(ieee_table.v, 254, x, &e); + binary_search(ieee_table.v.data(), 254, x, &e); return ieee_table.e[e]; } @@ -226,7 +130,6 @@ double grib_long_to_ieee(unsigned long x) Assert(0); } #endif - init_table_if_needed(); if (c == 0 && m == 0) return 0; @@ -258,8 +161,6 @@ unsigned long grib_ieee_nearest_smaller_to_long(double x) if (x == 0) return 0; - init_table_if_needed(); - l = grib_ieee_to_long(x); y = grib_long_to_ieee(l); @@ -304,10 +205,8 @@ int grib_nearest_smaller_ieee_float(double a, double* ret) { unsigned long l = 0; - init_table_if_needed(); - if (a > ieee_table.vmax) { - grib_context* c = grib_context_get_default(); + const grib_context* c = grib_context_get_default(); grib_context_log(c, GRIB_LOG_ERROR, "Number is too large: x=%e > xmax=%e (IEEE float)", a, ieee_table.vmax); return GRIB_INTERNAL_ERROR; diff --git a/src/grib_ieeefloat.h b/src/grib_ieeefloat.h index 74944f2ac..fb198a3cb 100644 --- a/src/grib_ieeefloat.h +++ b/src/grib_ieeefloat.h @@ -11,5 +11,69 @@ #pragma once #include "grib_api_internal.h" +#include "grib_scaling.h" + +#include +#include +#include template int grib_ieee_decode_array(grib_context* c, unsigned char* buf, size_t nvals, int bytes, T* val); + +/** +.. _init_ieee_table: + +Init IEEE Table +=============== + +Initializes the ieee_table with IEEE754 single precision (32-bit) values. Nearest smaller values (e.g., reference values for grid_simple and grid_ccsds) are taken from this table. + +Details +------- + +The table layout is as follows: + ++-------+----------------+------------------------+ +| idx (i) | multiplier (e) | value (v = mmin * e) | ++-------+----------------+------------------------+ +| 0 | 0 | 0 | +| 1 | 2^(-149) | 0x800000 * 2^(-149) | +| 2 | 2^(-148) | 0x800000 * 2^(-148) | +| ... | ... | ... | +| 253 | 2^103 | 0x800000 * 2^103 | +| 254 | 2^104 | 0x800000 * 2^104 | ++-------+----------------+------------------------+ + +The vmin and vmax boundaries are defined as: + +- vmin = 0x800000 * 2^(-149) +- vmax = 0xffffff * 2^104 +*/ + +template +struct IeeeTable { +private: + static_assert(std::is_floating_point::value, "ValueType must be a floating point type"); + static constexpr int TABLESIZE = 255; + static constexpr uint32_t mantissa_min = 0x800000; + static constexpr uint32_t mantissa_max = 0xffffff; + +public: + static constexpr std::array e = []() { + std::array multiplier{}; + multiplier[0] = 0; + for (int i = 1; i < TABLESIZE; ++i) { + multiplier[i] = codes_power(i - 150, 2); + } + return multiplier; + }(); + static constexpr std::array v = []() { + std::array values{}; + values[0] = 0; + for (int i = 1; i < TABLESIZE; ++i) { + values[i] = e[i] * mantissa_min; + } + return values; + }(); + static constexpr ValueType vmin = e[1] * mantissa_min; + static constexpr ValueType vmax = e[254] * mantissa_max; +}; diff --git a/src/grib_index.cc b/src/grib_index.cc index 57efa359e..ca6e0defc 100644 --- a/src/grib_index.cc +++ b/src/grib_index.cc @@ -16,6 +16,8 @@ #define NULL_MARKER 0 #define NOT_NULL_MARKER 255 +#define GRIB_KEY_UNDEF "undef" + /* #if GRIB_PTHREADS */ // static pthread_once_t once = PTHREAD_ONCE_INIT; // static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; diff --git a/src/grib_io.cc b/src/grib_io.cc index d92f3565e..ce8d2aa65 100644 --- a/src/grib_io.cc +++ b/src/grib_io.cc @@ -180,7 +180,7 @@ static int read_GRIB(reader* r, int no_alloc) if (!tmp) return GRIB_OUT_OF_MEMORY; buf = grib_new_buffer(c, tmp, buflen); - buf->property = GRIB_MY_BUFFER; + buf->property = CODES_MY_BUFFER; tmp[i++] = 'G'; tmp[i++] = 'R'; @@ -721,7 +721,7 @@ static int read_BUFR(reader* r, int no_alloc) if (!tmp) return GRIB_OUT_OF_MEMORY; buf = grib_new_buffer(c, tmp, buflen); - buf->property = GRIB_MY_BUFFER; + buf->property = CODES_MY_BUFFER; r->offset = r->tell(r->read_data) - 4; tmp[i++] = 'B'; @@ -1008,7 +1008,7 @@ static int read_any_taf(reader* r) int err = 0; unsigned char* buffer = NULL; unsigned long magic = 0; - unsigned long start = 0x54414620; + unsigned long start = 0x54414620; // 4 chars: TAF plus a space unsigned char tmp[1000] = {0,}; /* Should be enough */ size_t message_size = 0; size_t already_read = 0; @@ -1020,10 +1020,10 @@ static int read_any_taf(reader* r) magic &= 0xffffffff; if (magic == start) { - tmp[i++] = 0x54; - tmp[i++] = 0x41; - tmp[i++] = 0x46; - tmp[i++] = 0x20; + tmp[i++] = 0x54; //T + tmp[i++] = 0x41; //A + tmp[i++] = 0x46; //F + tmp[i++] = 0x20; //space r->offset = r->tell(r->read_data) - 4; @@ -1056,7 +1056,7 @@ static int read_any_metar(reader* r) int err = 0; unsigned char* buffer = NULL; unsigned long magic = 0; - unsigned long start = 0x4d455441; + unsigned long start = 0x4d455441; // 4 chars: META unsigned char tmp[32] = {0,}; /* Should be enough */ size_t message_size = 0; size_t already_read = 0; @@ -1071,10 +1071,10 @@ static int read_any_metar(reader* r) if (r->read(r->read_data, &c, 1, &err) != 1 || err != 0) break; if (c == 'R') { - tmp[i++] = 0x4d; - tmp[i++] = 0x45; - tmp[i++] = 0x54; - tmp[i++] = 0x41; + tmp[i++] = 0x4d; // M + tmp[i++] = 0x45; // E + tmp[i++] = 0x54; // T + tmp[i++] = 0x41; // A tmp[i++] = 'R'; r->offset = r->tell(r->read_data) - 4; diff --git a/src/grib_iterator.cc b/src/grib_iterator.cc index 0844a1fed..9f4fadd95 100644 --- a/src/grib_iterator.cc +++ b/src/grib_iterator.cc @@ -11,7 +11,6 @@ /*************************************************************************** * Enrico Fucile * * Jean Baptiste Filippi - 01.11.2005 * - * * ***************************************************************************/ #include "grib_api_internal.h" @@ -43,7 +42,6 @@ static void init_mutex() } #endif - int grib_get_data(const grib_handle* h, double* lats, double* lons, double* values) { int err = 0; diff --git a/src/grib_iterator_class.cc b/src/grib_iterator_class.cc index 0197a09a4..571221836 100644 --- a/src/grib_iterator_class.cc +++ b/src/grib_iterator_class.cc @@ -31,28 +31,29 @@ static const struct table_entry table[] = { #include "grib_iterator_factory.h" }; -grib_iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* ret) +grib_iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* error) { size_t i = 0; const char* type = (char*)grib_arguments_get_name(h, args, 0); + *error = GRIB_NOT_IMPLEMENTED; - for (i = 0; i < NUMBER(table); i++) + for (i = 0; i < NUMBER(table); i++) { if (strcmp(type, table[i].type) == 0) { grib_iterator_class* c = *(table[i].cclass); grib_iterator* it = (grib_iterator*)grib_context_malloc_clear(h->context, c->size); it->cclass = c; it->flags = flags; - *ret = GRIB_SUCCESS; - *ret = grib_iterator_init(it, h, args); - if (*ret == GRIB_SUCCESS) + *error = grib_iterator_init(it, h, args); + if (*error == GRIB_SUCCESS) return it; grib_context_log(h->context, GRIB_LOG_ERROR, "Geoiterator factory: Error instantiating iterator %s (%s)", - table[i].type, grib_get_error_message(*ret)); + table[i].type, grib_get_error_message(*error)); grib_iterator_delete(it); return NULL; } + } - grib_context_log(h->context, GRIB_LOG_ERROR, "Geoiterator factory: Unknown type: %s for iterator", type); + grib_context_log(h->context, GRIB_LOG_ERROR, "Geoiterator factory: Unknown type: %s", type); return NULL; } diff --git a/src/grib_iterator_class.h b/src/grib_iterator_class.h index 62d3fd5c6..e9f95f5ec 100644 --- a/src/grib_iterator_class.h +++ b/src/grib_iterator_class.h @@ -2,6 +2,7 @@ extern grib_iterator_class* grib_iterator_class_gaussian; extern grib_iterator_class* grib_iterator_class_gaussian_reduced; extern grib_iterator_class* grib_iterator_class_gen; +extern grib_iterator_class* grib_iterator_class_healpix; extern grib_iterator_class* grib_iterator_class_lambert_azimuthal_equal_area; extern grib_iterator_class* grib_iterator_class_lambert_conformal; extern grib_iterator_class* grib_iterator_class_latlon; diff --git a/src/grib_iterator_class_gaussian_reduced.cc b/src/grib_iterator_class_gaussian_reduced.cc index ee81bfce5..cde71f746 100644 --- a/src/grib_iterator_class_gaussian_reduced.cc +++ b/src/grib_iterator_class_gaussian_reduced.cc @@ -8,11 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - **************************************/ - - #include "grib_api_internal.h" #include @@ -87,6 +82,8 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ +#define ITER "Reduced Gaussian grid Geoiterator" + static int next(grib_iterator* iter, double* lat, double* lon, double* val) { grib_iterator_gaussian_reduced* self = (grib_iterator_gaussian_reduced*)iter; @@ -190,7 +187,7 @@ static int iterate_reduced_gaussian_subarea_legacy(grib_iterator* iter, grib_han if (iter->e >= iter->nv) { size_t np = count_subarea_points(h, get_reduced_row, pl, plsize, lon_first, lon_last); grib_context_log(h->context, GRIB_LOG_ERROR, - "Reduced Gaussian Geoiterator (sub-area legacy). Num points=%ld, size(values)=%ld", np, iter->nv); + "%s (sub-area legacy). Num points=%zu, size(values)=%zu", ITER, np, iter->nv); return GRIB_WRONG_GRID; } @@ -256,7 +253,7 @@ static int iterate_reduced_gaussian_subarea(grib_iterator* iter, grib_handle* h, /* Only print error message on the second pass */ size_t np = count_subarea_points(h, get_reduced_row, pl, plsize, lon_first, lon_last); grib_context_log(h->context, GRIB_LOG_ERROR, - "Reduced Gaussian Geoiterator (sub-area). Num points=%ld, size(values)=%ld", np, iter->nv); + "%s (sub-area). Num points=%zu, size(values)=%zu", ITER, np, iter->nv); return GRIB_WRONG_GRID; } self->los[iter->e] = lon2; @@ -315,7 +312,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) if ((ret = grib_get_long_internal(h, sorder, &order)) != GRIB_SUCCESS) return ret; if (order == 0) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Invalid Gaussian grid: N cannot be 0!"); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Invalid grid: N cannot be 0!", ITER); return GRIB_WRONG_GRID; } if ((ret = grib_get_long_internal(h, snj, &nj)) != GRIB_SUCCESS) @@ -385,7 +382,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) /*Try now as NON-global*/ ret = iterate_reduced_gaussian_subarea(iter, h, lat_first, lon_first, lat_last, lon_last, lats, pl, plsize, numlats); if (ret != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_ERROR, "Failed to initialise reduced Gaussian iterator (global)"); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Failed to initialise iterator (global)", ITER); goto finalise; } diff --git a/src/grib_iterator_class_healpix.cc b/src/grib_iterator_class_healpix.cc new file mode 100644 index 000000000..f2e9c0766 --- /dev/null +++ b/src/grib_iterator_class_healpix.cc @@ -0,0 +1,253 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ + +#include "grib_api_internal.h" +#include +#include +#include + +/* + This is used by make_class.pl + + START_CLASS_DEF + CLASS = iterator + SUPER = grib_iterator_class_gen + IMPLEMENTS = destroy + IMPLEMENTS = init;next + MEMBERS = double *lats + MEMBERS = double *lons + MEMBERS = long Nsides + END_CLASS_DEF +*/ + +/* START_CLASS_IMP */ + +/* + +Don't edit anything between START_CLASS_IMP and END_CLASS_IMP +Instead edit values between START_CLASS_DEF and END_CLASS_DEF +or edit "iterator.class" and rerun ./make_class.pl + +*/ + + +static void init_class (grib_iterator_class*); + +static int init (grib_iterator* i,grib_handle*,grib_arguments*); +static int next (grib_iterator* i, double *lat, double *lon, double *val); +static int destroy (grib_iterator* i); + + +typedef struct grib_iterator_healpix{ + grib_iterator it; + /* Members defined in gen */ + int carg; + const char* missingValue; + /* Members defined in healpix */ + double *lats; + double *lons; + long Nsides; +} grib_iterator_healpix; + +extern grib_iterator_class* grib_iterator_class_gen; + +static grib_iterator_class _grib_iterator_class_healpix = { + &grib_iterator_class_gen, /* super */ + "healpix", /* name */ + sizeof(grib_iterator_healpix),/* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &next, /* Next Value */ + 0, /* Previous Value */ + 0, /* Reset the counter */ + 0, /* has next values */ +}; + +grib_iterator_class* grib_iterator_class_healpix = &_grib_iterator_class_healpix; + + +static void init_class(grib_iterator_class* c) +{ + c->previous = (*(c->super))->previous; + c->reset = (*(c->super))->reset; + c->has_next = (*(c->super))->has_next; +} +/* END_CLASS_IMP */ + +#define ITER "HEALPix Geoiterator" +#define RAD2DEG 57.29577951308232087684 // 180 over pi + +size_t HEALPix_nj(size_t N, size_t i) +{ + Assert(0 < N); + size_t ni = 4 * N - 1; + Assert(i < ni); + return i < N ? 4 * (i + 1) : i < 3 * N ? 4 * N + : HEALPix_nj(N, ni - 1 - i); +} + +// Thanks to Willem Deconinck and Pedro Maciel +// +// y[] = { y0, y1, y2, y3, ... }; // the latitude values +// PL[] = { 4, ... } ; // the number of values on each latitude +// xstart[] = { 45, ... }; // the value of first longitude on each latitude +// assume that you have 360 degrees to cover on each latitude +// +// std::vector xstart(4 * N - 1); +// std::vector pl(4 * N - 1); +// // Polar caps +// for (int r = 1; r < N; r++) { +// xstart[r-1] = 45./r; +// pl[r-1] = 4*r; +// xstart[4*N-r-1] = xstart[r-1]; +// pl[4*N-r-1] = pl[r-1]; +// } +// // Equatorial belt +// const double start = 45. / N; +// for (int r = N; r < 2 * N; r++) { +// xstart[r-1] = start * (2. - (r - N + 1) % 2); +// pl[r-1] = 4*N; +// xstart[4*N-r-1] = xstart[r-1]; +// pl[4*N-r-1] = pl[r-1]; +// } +// // Equator +// xstart[2*N-1] = start * (1 - (N % 2 ? 1 : 0)); +// pl[2*N-1] = 4*N; +// +static std::vector HEALPix_longitudes(size_t N, size_t i) +{ + const auto Nj = HEALPix_nj(N, i); + const auto step = 360. / static_cast(Nj); + const auto start = i < N || 3 * N - 1 < i || static_cast((i + N) % 2) ? step / 2. : 0.; + + std::vector longitudes(Nj); + std::generate_n(longitudes.begin(), Nj, [start, step, n = 0ULL]() mutable { return start + static_cast(n++) * step; }); + + return longitudes; +} + +static int iterate_healpix(grib_iterator_healpix* self, long N) +{ + size_t ny, nx; + ny = nx = 4*N - 1; + std::vector latitudes(ny); + + for (long r = 1; r < N; r++) { + latitudes[r - 1] = 90.0 - RAD2DEG * std::acos(1.0 - r * r / (3.0 * N * N)); + latitudes[4 * N - 1 - r] = -latitudes[r - 1]; + } + // Polar caps + for (long r = 1; r < N; r++) { + latitudes[r - 1] = 90.0 - RAD2DEG * std::acos(1.0 - r * r / (3.0 * N * N)); + latitudes[4 * N - 1 - r] = -latitudes[r - 1]; + } + // Equatorial belt + for (long r = N; r < 2 * N; r++) { + latitudes[r - 1] = 90.0 - RAD2DEG * std::acos((4.0 * N - 2.0 * r) / (3.0 * N)); + latitudes[4 * N - 1 - r] = -latitudes[r - 1]; + } + + // Equator + latitudes[2 * N - 1] = 0.0; + + size_t k = 0; + for (size_t i = 0; i < ny; i++) { + // Compute the longitudes at a given latitude + std::vector longitudes = HEALPix_longitudes(N, i); + for (size_t j = 0; j < longitudes.size(); j++) { + self->lons[k] = longitudes[j]; + self->lats[k] = latitudes[i]; + ++k; + } + } + + return GRIB_SUCCESS; +} + +static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) +{ + int err = 0; + grib_iterator_healpix* self = (grib_iterator_healpix*)iter; + + const char* snside = grib_arguments_get_name(h, args, self->carg++); + const char* sorder = grib_arguments_get_name(h, args, self->carg++); + + long N = 0; + if ((err = grib_get_long_internal(h, snside, &N)) != GRIB_SUCCESS) return err; + if (N <= 0) { + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Key %s must be greater than zero", ITER, snside); + return GRIB_WRONG_GRID; + } + + char ordering[32] = {0,}; + size_t slen = sizeof(ordering); + if ((err = grib_get_string_internal(h, sorder, ordering, &slen)) != GRIB_SUCCESS) + return err; + + if (!STR_EQUAL(ordering, "ring")) { + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Only ring ordering is supported", ITER); + return GRIB_WRONG_GRID; + } + + if (grib_is_earth_oblate(h)) { + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Only spherical earth is supported", ITER); + return GRIB_WRONG_GRID; + } + + if (iter->nv != 12 * N * N) { + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%zu!=12x%ldx%ld)", + ITER, iter->nv, N, N); + return GRIB_WRONG_GRID; + } + + self->lats = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); + if (self->lats == NULL) return GRIB_OUT_OF_MEMORY; + self->lons = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); + if (self->lons == NULL) return GRIB_OUT_OF_MEMORY; + + try { + err = iterate_healpix(self, N); + } + catch (...) { + return GRIB_INTERNAL_ERROR; + } + + iter->e = -1; + + return err; +} + +static int next(grib_iterator* iter, double* lat, double* lon, double* val) +{ + grib_iterator_healpix* self = (grib_iterator_healpix*)iter; + + if ((long)iter->e >= (long)(iter->nv - 1)) + return 0; + iter->e++; + + *lat = self->lats[iter->e]; + *lon = self->lons[iter->e]; + if (val && iter->data) { + *val = iter->data[iter->e]; + } + return 1; +} + +static int destroy(grib_iterator* i) +{ + grib_iterator_healpix* self = (grib_iterator_healpix*)i; + const grib_context* c = i->h->context; + + grib_context_free(c, self->lats); + grib_context_free(c, self->lons); + return GRIB_SUCCESS; +} diff --git a/src/grib_iterator_class_lambert_azimuthal_equal_area.cc b/src/grib_iterator_class_lambert_azimuthal_equal_area.cc index f9b76d702..a945ee1d2 100644 --- a/src/grib_iterator_class_lambert_azimuthal_equal_area.cc +++ b/src/grib_iterator_class_lambert_azimuthal_equal_area.cc @@ -81,6 +81,8 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ +#define ITER "Lambert azimuthal equal area Geoiterator" + static int next(grib_iterator* iter, double* lat, double* lon, double* val) { grib_iterator_lambert_azimuthal_equal_area* self = (grib_iterator_lambert_azimuthal_equal_area*)iter; @@ -227,12 +229,12 @@ static int init_oblate(grib_handle* h, /* Allocate latitude and longitude arrays */ self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } lats = self->lats; @@ -308,14 +310,12 @@ static int init_sphere(grib_handle* h, Dy = jScansPositively == 1 ? Dy / 1000 : -Dy / 1000; self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, - "Error allocating %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, - "Error allocating %ld bytes", nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } lats = self->lats; @@ -435,9 +435,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return err; if (iter->nv != nx * ny) { - grib_context_log(h->context, GRIB_LOG_ERROR, - "Wrong number of points (%ld!=%ldx%ld)", - iter->nv, nx, ny); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%zu!=%ldx%ld)", ITER, iter->nv, nx, ny); return GRIB_WRONG_GRID; } if ((err = grib_get_double_internal(h, slatFirstInDegrees, &latFirstInDegrees)) != GRIB_SUCCESS) diff --git a/src/grib_iterator_class_lambert_conformal.cc b/src/grib_iterator_class_lambert_conformal.cc index cf0000953..3e9d51055 100644 --- a/src/grib_iterator_class_lambert_conformal.cc +++ b/src/grib_iterator_class_lambert_conformal.cc @@ -204,12 +204,12 @@ static int init_sphere(grib_handle* h, /* Allocate latitude and longitude arrays */ self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %ld bytes", ITER, nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %ld bytes", ITER, nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } @@ -315,12 +315,12 @@ static int init_oblate(grib_handle* h, /* Allocate latitude and longitude arrays */ self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %ld bytes", ITER, nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %ld bytes", ITER, nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } @@ -414,7 +414,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) } if (iter->nv != nx * ny) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%ld!=%ldx%ld)", ITER, iter->nv, nx, ny); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%zu!=%ldx%ld)", ITER, iter->nv, nx, ny); return GRIB_WRONG_GRID; } diff --git a/src/grib_iterator_class_mercator.cc b/src/grib_iterator_class_mercator.cc index 1f19af9a8..19d7195ff 100644 --- a/src/grib_iterator_class_mercator.cc +++ b/src/grib_iterator_class_mercator.cc @@ -186,12 +186,12 @@ static int init_mercator(grib_handle* h, /* Allocate latitude and longitude arrays */ self->lats = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %ld bytes", ITER, nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %ld bytes", ITER, nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } @@ -270,7 +270,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) } if (iter->nv != ni * nj) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%ld!=%ldx%ld)", ITER, iter->nv, ni, nj); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%zu!=%ldx%ld)", ITER, iter->nv, ni, nj); return GRIB_WRONG_GRID; } diff --git a/src/grib_iterator_class_polar_stereographic.cc b/src/grib_iterator_class_polar_stereographic.cc index 753649141..b9c0314a3 100644 --- a/src/grib_iterator_class_polar_stereographic.cc +++ b/src/grib_iterator_class_polar_stereographic.cc @@ -164,7 +164,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return ret; if (iter->nv != nx * ny) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%ld!=%ldx%ld)", ITER, iter->nv, nx, ny); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%zu!=%ldx%ld)", ITER, iter->nv, nx, ny); return GRIB_WRONG_GRID; } if ((ret = grib_get_double_internal(h, s_latFirstInDegrees, &latFirstInDegrees)) != GRIB_SUCCESS) @@ -244,12 +244,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) } self->lats = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %ld bytes", ITER, iter->nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, iter->nv * sizeof(double)); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %ld bytes", ITER, iter->nv * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, iter->nv * sizeof(double)); return GRIB_OUT_OF_MEMORY; } lats = self->lats; diff --git a/src/grib_iterator_class_regular.cc b/src/grib_iterator_class_regular.cc index 3a614a85b..857112261 100644 --- a/src/grib_iterator_class_regular.cc +++ b/src/grib_iterator_class_regular.cc @@ -98,6 +98,7 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ +#define ITER "Regular grid Geoiterator" static int next(grib_iterator* iter, double* lat, double* lon, double* val) { @@ -148,7 +149,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) long Ni; /* Number of points along a parallel = Nx */ long Nj; /* Number of points along a meridian = Ny */ - double idir, lon1, lon2; + double idir, idir_coded, lon1, lon2; long loi; const char* s_lon1 = grib_arguments_get_name(h, args, self->carg++); @@ -163,22 +164,23 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return ret; if ((ret = grib_get_double_internal(h, s_idir, &idir))) // can be GRIB_MISSING_DOUBLE return ret; + idir_coded = idir; if ((ret = grib_get_long_internal(h, s_Ni, &Ni))) return ret; if (grib_is_missing(h, s_Ni, &ret) && ret == GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Key %s cannot be 'missing' for a regular grid!", s_Ni); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Key %s cannot be 'missing' for a regular grid!", ITER, s_Ni); return GRIB_WRONG_GRID; } if ((ret = grib_get_long_internal(h, s_Nj, &Nj))) return ret; if (grib_is_missing(h, s_Nj, &ret) && ret == GRIB_SUCCESS) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Key %s cannot be 'missing' for a regular grid!", s_Nj); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Key %s cannot be 'missing' for a regular grid!", ITER, s_Nj); return GRIB_WRONG_GRID; } if (Ni*Nj != iter->nv) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Geoiterator: Ni*Nj!=numberOfDataPoints (%ld*%ld!=%zu)", Ni,Nj,iter->nv); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Ni*Nj!=numberOfDataPoints (%ld*%ld!=%zu)", ITER, Ni, Nj, iter->nv); return GRIB_WRONG_GRID; } @@ -223,6 +225,10 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) self->las = (double*)grib_context_malloc(h->context, Nj * sizeof(double)); self->los = (double*)grib_context_malloc(h->context, Ni * sizeof(double)); + if (idir != idir_coded) { + grib_context_log(h->context, GRIB_LOG_DEBUG, "%s: Using idir=%g (coded value=%g)", ITER, idir, idir_coded); + } + for (loi = 0; loi < Ni; loi++) { self->los[loi] = lon1; lon1 += idir; @@ -230,7 +236,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) /* ECC-1406: Due to rounding, errors can accumulate. * So we ensure the last longitude is longitudeOfLastGridPointInDegrees */ - self->los[Ni-1] = lon2; + self->los[Ni-1] = normalise_longitude_in_degrees(lon2); // Also see ECC-1671 return ret; } diff --git a/src/grib_iterator_class_space_view.cc b/src/grib_iterator_class_space_view.cc index c2e402e59..1622f94a5 100644 --- a/src/grib_iterator_class_space_view.cc +++ b/src/grib_iterator_class_space_view.cc @@ -81,6 +81,8 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ +#define ITER "Space view Geoiterator" + static int next(grib_iterator* iter, double* lat, double* lon, double* val) { grib_iterator_space_view* self = (grib_iterator_space_view*)iter; @@ -178,7 +180,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) const char* sXpInGridLengths = grib_arguments_get_name(h, args, self->carg++); const char* sYpInGridLengths = grib_arguments_get_name(h, args, self->carg++); const char* sOrientationInDegrees = grib_arguments_get_name(h, args, self->carg++); - const char* sNrInRadiusOfEarth = grib_arguments_get_name(h, args, self->carg++); + const char* sNrInRadiusOfEarthScaled = grib_arguments_get_name(h, args, self->carg++); const char* sXo = grib_arguments_get_name(h, args, self->carg++); const char* sYo = grib_arguments_get_name(h, args, self->carg++); @@ -206,7 +208,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) } if (iter->nv != nx * ny) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Wrong number of points (%ld!=%ldx%ld)", iter->nv, nx, ny); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Wrong number of points (%zu!=%ldx%ld)", ITER, iter->nv, nx, ny); return GRIB_WRONG_GRID; } if ((ret = grib_get_double_internal(h, sLatOfSubSatellitePointInDegrees, &latOfSubSatellitePointInDegrees)) != GRIB_SUCCESS) @@ -225,11 +227,11 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) return ret; /* Orthographic not supported. This happens when Nr (camera altitude) is missing */ - if (grib_is_missing(h, sNrInRadiusOfEarth, &ret)) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Space View: Orthographic view (Nr missing) not supported"); - return GRIB_NOT_IMPLEMENTED; + if (grib_is_missing(h, "Nr", &ret)) { + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Orthographic view (Nr missing) not supported", ITER); + return GRIB_GEOCALCULUS_PROBLEM; } - if ((ret = grib_get_double_internal(h, sNrInRadiusOfEarth, &nrInRadiusOfEarth)) != GRIB_SUCCESS) + if ((ret = grib_get_double_internal(h, sNrInRadiusOfEarthScaled, &nrInRadiusOfEarth)) != GRIB_SUCCESS) return ret; if ((ret = grib_get_long_internal(h, sXo, &Xo)) != GRIB_SUCCESS) @@ -254,7 +256,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) } if (nrInRadiusOfEarth == 0) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Space View: Key %s must be greater than zero", sNrInRadiusOfEarth); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Key %s must be greater than zero", ITER, sNrInRadiusOfEarthScaled); return GRIB_GEOCALCULUS_PROBLEM; } @@ -265,8 +267,8 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) lop = lonOfSubSatellitePointInDegrees; if (lap != 0.0) { grib_context_log(h->context, GRIB_LOG_ERROR, - "Space View: Key '%s' must be 0 (satellite must be located in the equator plane)", - sLatOfSubSatellitePointInDegrees); + "%s: Key %s must be 0 (satellite must be located in the equator plane)", + ITER, sLatOfSubSatellitePointInDegrees); return GRIB_GEOCALCULUS_PROBLEM; } @@ -280,7 +282,7 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) /* adjustBadlyEncodedEcmwfGribs(h, &nx, &ny, &dx, &dy, &xp, &yp); */ if (dx == 0 || dy == 0) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Space View: Keys %s and %s must be greater than zero", sDx, sDy); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Keys %s and %s must be greater than zero", ITER, sDx, sDy); return GRIB_GEOCALCULUS_PROBLEM; } rx = angular_size / dx; @@ -288,12 +290,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) self->lats = (double*)grib_context_malloc(h->context, array_size); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", array_size); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, array_size); return GRIB_OUT_OF_MEMORY; } self->lons = (double*)grib_context_malloc(h->context, array_size); if (!self->lats) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", array_size); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, array_size); return GRIB_OUT_OF_MEMORY; } lats = self->lats; @@ -318,12 +320,12 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args) /* Store array of sin and cosine values to avoid recalculation */ s_x = (double*)grib_context_malloc(h->context, nx * sizeof(double)); if (!s_x) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nx * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nx * sizeof(double)); return GRIB_OUT_OF_MEMORY; } c_x = (double*)grib_context_malloc(h->context, nx * sizeof(double)); if (!c_x) { - grib_context_log(h->context, GRIB_LOG_ERROR, "Error allocating %ld bytes", nx * sizeof(double)); + grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nx * sizeof(double)); return GRIB_OUT_OF_MEMORY; } diff --git a/src/grib_iterator_factory.h b/src/grib_iterator_factory.h index ad46ced1e..206a6d140 100644 --- a/src/grib_iterator_factory.h +++ b/src/grib_iterator_factory.h @@ -2,6 +2,7 @@ { "gaussian", &grib_iterator_class_gaussian, }, { "gaussian_reduced", &grib_iterator_class_gaussian_reduced, }, { "gen", &grib_iterator_class_gen, }, +{ "healpix", &grib_iterator_class_healpix, }, { "lambert_azimuthal_equal_area", &grib_iterator_class_lambert_azimuthal_equal_area, }, { "lambert_conformal", &grib_iterator_class_lambert_conformal, }, { "latlon", &grib_iterator_class_latlon, }, diff --git a/src/grib_nearest_class.cc b/src/grib_nearest_class.cc index edb4c74cc..42e618ff8 100644 --- a/src/grib_nearest_class.cc +++ b/src/grib_nearest_class.cc @@ -8,11 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/* - * - */ - - #include "grib_api_internal.h" #define NUMBER(x) (sizeof(x) / sizeof(x[0])) @@ -31,26 +26,28 @@ static const struct table_entry table[] = { #include "grib_nearest_factory.h" }; -grib_nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args) +grib_nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args, int* error) { size_t i = 0; - int ret = GRIB_SUCCESS; + *error = GRIB_NOT_IMPLEMENTED; char* type = (char*)grib_arguments_get_name(h, args, 0); - for (i = 0; i < NUMBER(table); i++) + for (i = 0; i < NUMBER(table); i++) { if (strcmp(type, table[i].type) == 0) { grib_nearest_class* c = *(table[i].cclass); grib_nearest* it = (grib_nearest*)grib_context_malloc_clear(h->context, c->size); it->cclass = c; - ret = grib_nearest_init(it, h, args); - if (ret == GRIB_SUCCESS) + *error = grib_nearest_init(it, h, args); + if (*error == GRIB_SUCCESS) return it; - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_factory: error %d instantiating nearest %s", ret, table[i].type); + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_factory: Error instantiating nearest %s (%s)", + table[i].type, grib_get_error_message(*error)); grib_nearest_delete(it); return NULL; } + } - grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_factory : Unknown type : %s for nearest", type); + grib_context_log(h->context, GRIB_LOG_ERROR, "grib_nearest_factory: Unknown type: %s", type); return NULL; } diff --git a/src/grib_nearest_class.h b/src/grib_nearest_class.h index 531eb200a..a1341806a 100644 --- a/src/grib_nearest_class.h +++ b/src/grib_nearest_class.h @@ -1,5 +1,6 @@ /* This file is automatically generated by ./make_class.pl, do not edit */ extern grib_nearest_class* grib_nearest_class_gen; +extern grib_nearest_class* grib_nearest_class_healpix; extern grib_nearest_class* grib_nearest_class_lambert_azimuthal_equal_area; extern grib_nearest_class* grib_nearest_class_lambert_conformal; extern grib_nearest_class* grib_nearest_class_latlon_reduced; diff --git a/src/grib_nearest_class_healpix.cc b/src/grib_nearest_class_healpix.cc new file mode 100644 index 000000000..915556a76 --- /dev/null +++ b/src/grib_nearest_class_healpix.cc @@ -0,0 +1,134 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ + +#include "grib_api_internal.h" + +/* + This is used by make_class.pl + + START_CLASS_DEF + CLASS = nearest + SUPER = grib_nearest_class_gen + IMPLEMENTS = init + IMPLEMENTS = find;destroy + MEMBERS = double* lats + MEMBERS = int lats_count + MEMBERS = double* lons + MEMBERS = int lons_count + MEMBERS = double* distances + MEMBERS = int* k + MEMBERS = int* i + MEMBERS = int* j + MEMBERS = const char* Ni + MEMBERS = const char* Nj + END_CLASS_DEF + + */ + +/* START_CLASS_IMP */ + +/* + +Don't edit anything between START_CLASS_IMP and END_CLASS_IMP +Instead edit values between START_CLASS_DEF and END_CLASS_DEF +or edit "nearest.class" and rerun ./make_class.pl + +*/ + + +static void init_class (grib_nearest_class*); + +static int init (grib_nearest* nearest,grib_handle* h,grib_arguments* args); +static int find(grib_nearest* nearest, grib_handle* h,double inlat, double inlon, unsigned long flags, double* outlats,double* outlons, double *values,double *distances, int *indexes,size_t *len); +static int destroy (grib_nearest* nearest); + +typedef struct grib_nearest_healpix{ + grib_nearest nearest; + /* Members defined in gen */ + const char* values_key; + const char* radius; + int cargs; + /* Members defined in healpix */ + double* lats; + int lats_count; + double* lons; + int lons_count; + double* distances; + int* k; + int* i; + int* j; + const char* Ni; + const char* Nj; +} grib_nearest_healpix; + +extern grib_nearest_class* grib_nearest_class_gen; + +static grib_nearest_class _grib_nearest_class_healpix = { + &grib_nearest_class_gen, /* super */ + "healpix", /* name */ + sizeof(grib_nearest_healpix), /* size of instance */ + 0, /* inited */ + &init_class, /* init_class */ + &init, /* constructor */ + &destroy, /* destructor */ + &find, /* find nearest */ +}; + +grib_nearest_class* grib_nearest_class_healpix = &_grib_nearest_class_healpix; + + +static void init_class(grib_nearest_class* c) +{ +} +/* END_CLASS_IMP */ + +static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args) +{ + grib_nearest_healpix* self = (grib_nearest_healpix*)nearest; + self->Ni = grib_arguments_get_name(h, args, self->cargs++); + self->Nj = grib_arguments_get_name(h, args, self->cargs++); + self->lats = self->lons = self->distances = NULL; + self->lats_count = self->lons_count = 0; + self->i = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); + self->j = (int*)grib_context_malloc(h->context, 2 * sizeof(int)); + return GRIB_SUCCESS; +} + +static int find(grib_nearest* nearest, grib_handle* h, + double inlat, double inlon, unsigned long flags, + double* outlats, double* outlons, + double* values, double* distances, int* indexes, size_t* len) +{ + grib_nearest_healpix* self = (grib_nearest_healpix*)nearest; + return grib_nearest_find_generic( + nearest, h, inlat, inlon, flags, /* inputs */ + + self->values_key, /* outputs to set the 'self' object */ + &(self->lats), + &(self->lats_count), + &(self->lons), + &(self->lons_count), + &(self->distances), + + outlats, outlons, /* outputs of the find function */ + values, distances, indexes, len); +} + +static int destroy(grib_nearest* nearest) +{ + grib_nearest_healpix* self = (grib_nearest_healpix*)nearest; + if (self->lats) grib_context_free(nearest->context, self->lats); + if (self->lons) grib_context_free(nearest->context, self->lons); + if (self->i) grib_context_free(nearest->context, self->i); + if (self->j) grib_context_free(nearest->context, self->j); + if (self->k) grib_context_free(nearest->context, self->k); + if (self->distances) grib_context_free(nearest->context, self->distances); + return GRIB_SUCCESS; +} diff --git a/src/grib_nearest_factory.h b/src/grib_nearest_factory.h index be537e8e6..837524914 100644 --- a/src/grib_nearest_factory.h +++ b/src/grib_nearest_factory.h @@ -1,5 +1,6 @@ /* This file is automatically generated by ./make_class.pl, do not edit */ { "gen", &grib_nearest_class_gen, }, +{ "healpix", &grib_nearest_class_healpix, }, { "lambert_azimuthal_equal_area", &grib_nearest_class_lambert_azimuthal_equal_area, }, { "lambert_conformal", &grib_nearest_class_lambert_conformal, }, { "latlon_reduced", &grib_nearest_class_latlon_reduced, }, diff --git a/src/grib_oarray.cc b/src/grib_oarray.cc index 54a4ca2a5..91e7d9f33 100644 --- a/src/grib_oarray.cc +++ b/src/grib_oarray.cc @@ -8,12 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * - * Enrico Fucile - * - ***************************************************************************/ - #include "grib_api_internal.h" grib_oarray* grib_oarray_new(grib_context* c, size_t size, size_t incsize) @@ -24,7 +18,7 @@ grib_oarray* grib_oarray_new(grib_context* c, size_t size, size_t incsize) v = (grib_oarray*)grib_context_malloc_clear(c, sizeof(grib_oarray)); if (!v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_oarray_new unable to allocate %lu bytes\n", sizeof(grib_oarray)); + "grib_oarray_new unable to allocate %zu bytes", sizeof(grib_oarray)); return NULL; } v->size = size; @@ -34,7 +28,7 @@ grib_oarray* grib_oarray_new(grib_context* c, size_t size, size_t incsize) v->context = c; if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_oarray_new unable to allocate %lu bytes\n", sizeof(char*) * size); + "grib_oarray_new unable to allocate %zu bytes", sizeof(char*) * size); return NULL; } return v; @@ -51,7 +45,7 @@ static grib_oarray* grib_oarray_resize(grib_oarray* v) v->size = newsize; if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_oarray_resize unable to allocate %lu bytes\n", sizeof(char*) * newsize); + "grib_oarray_resize unable to allocate %zu bytes", sizeof(char*) * newsize); return NULL; } return v; @@ -98,17 +92,17 @@ void grib_oarray_delete(grib_context* c, grib_oarray* v) // v->n = 0; // } -void** grib_oarray_get_array(grib_context* c, grib_oarray* v) -{ - void** ret = NULL; - size_t i = 0; - if (!v) - return NULL; - ret = (void**)grib_context_malloc_clear(c, sizeof(char*) * v->n); - for (i = 0; i < v->n; i++) - ret[i] = v->v[i]; - return ret; -} +// void** grib_oarray_get_array(grib_context* c, grib_oarray* v) +// { +// void** ret = NULL; +// size_t i = 0; +// if (!v) +// return NULL; +// ret = (void**)grib_context_malloc_clear(c, sizeof(char*) * v->n); +// for (i = 0; i < v->n; i++) +// ret[i] = v->v[i]; +// return ret; +// } void* grib_oarray_get(grib_oarray* v, int i) { @@ -117,8 +111,3 @@ void* grib_oarray_get(grib_oarray* v, int i) return NULL; return v->v[i]; } - -size_t grib_oarray_used_size(grib_oarray* v) -{ - return v->n; -} diff --git a/src/grib_parse_utils.cc b/src/grib_parse_utils.cc index bbebf7df6..db8897930 100644 --- a/src/grib_parse_utils.cc +++ b/src/grib_parse_utils.cc @@ -804,26 +804,22 @@ grib_hash_array_value* grib_parse_hash_array_file(grib_context* gc, const char* } } -grib_rule* grib_parse_rules_file(grib_context* gc, const char* filename) -{ - if (!gc) - gc = grib_context_get_default(); - - GRIB_MUTEX_INIT_ONCE(&once, &init); - GRIB_MUTEX_LOCK(&mutex_rules); - - gc = gc ? gc : grib_context_get_default(); - grib_parser_context = gc; - - if (parse(gc, filename) == 0) { - GRIB_MUTEX_UNLOCK(&mutex_rules); - return grib_parser_rules; - } - else { - GRIB_MUTEX_UNLOCK(&mutex_rules); - return NULL; - } -} +// grib_rule* grib_parse_rules_file(grib_context* gc, const char* filename) +// { +// if (!gc) gc = grib_context_get_default(); +// GRIB_MUTEX_INIT_ONCE(&once, &init); +// GRIB_MUTEX_LOCK(&mutex_rules); +// gc = gc ? gc : grib_context_get_default(); +// grib_parser_context = gc; +// if (parse(gc, filename) == 0) { +// GRIB_MUTEX_UNLOCK(&mutex_rules); +// return grib_parser_rules; +// } +// else { +// GRIB_MUTEX_UNLOCK(&mutex_rules); +// return NULL; +// } +// } grib_action* grib_parse_file(grib_context* gc, const char* filename) { diff --git a/src/grib_scaling.cc b/src/grib_scaling.cc index 41e77e28e..e49a1e6dc 100644 --- a/src/grib_scaling.cc +++ b/src/grib_scaling.cc @@ -8,10 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************** - * Enrico Fucile - **************************************/ - #include "grib_scaling.h" #include "grib_api_internal.h" @@ -21,7 +17,7 @@ double grib_power(long s, long n) { return codes_power(s, n); } -long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret) +long grib_get_binary_scale_fact(double max, double min, long bpval, int* error) { double range = max - min; double zs = 1; @@ -35,20 +31,19 @@ long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret) double dmaxint=(double)maxint; */ if (bpval >= ulong_size) { - *ret = GRIB_OUT_OF_RANGE; /*overflow*/ + *error = GRIB_OUT_OF_RANGE; /*overflow*/ return 0; } const double dmaxint = codes_power(bpval, 2) - 1; maxint = (unsigned long)dmaxint; /* Now it's safe to cast */ - *ret = 0; + *error = 0; if (bpval < 1) { - *ret = GRIB_ENCODING_ERROR; /* constant field */ + *error = GRIB_ENCODING_ERROR; /* constant field */ return 0; } Assert(bpval >= 1); - /* printf("---- Maxint %ld range=%g\n",maxint,range); */ if (range == 0) return 0; @@ -74,95 +69,77 @@ long grib_get_binary_scale_fact(double max, double min, long bpval, int* ret) } if (scale < -last) { - *ret = GRIB_UNDERFLOW; - /*printf("grib_get_binary_scale_fact: max=%g min=%g\n",max,min);*/ + *error = GRIB_UNDERFLOW; scale = -last; } Assert(scale <= last); return scale; } -long grib_get_bits_per_value(double max, double min, long binary_scale_factor) -{ - double range = max - min; - double zs = 1; - long scale = 0; - const long last = 127; /* Depends on edition, should be parameter */ +// long grib_get_bits_per_value(double max, double min, long binary_scale_factor) +// { +// double range = max - min; +// double zs = 1; +// long scale = 0; +// const long last = 127; /* Depends on edition, should be parameter */ +// unsigned long maxint = codes_power(binary_scale_factor, 2) - 1; +// double dmaxint = (double)maxint; +// if (maxint == 0) +// maxint = 1; +// /* printf("---- Maxint %ld range=%g\n",maxint,range); */ +// if (range == 0) +// return 0; +// /* range -= 1e-10; */ +// while ((range * zs) <= dmaxint) { +// scale--; +// zs *= 2; +// } +// while ((range * zs) > dmaxint) { +// scale++; +// zs /= 2; +// } +// while ((unsigned long)(range * zs + 0.5) <= maxint) { +// scale--; +// zs *= 2; +// } +// while ((unsigned long)(range * zs + 0.5) > maxint) { +// scale++; +// zs /= 2; +// } +// Assert(scale >= -last && scale <= last); +// /* printf("---- scale=%ld\n",scale);*/ +// return scale; +// } - unsigned long maxint = codes_power(binary_scale_factor, 2) - 1; - double dmaxint = (double)maxint; - - if (maxint == 0) - maxint = 1; - - /* printf("---- Maxint %ld range=%g\n",maxint,range); */ - if (range == 0) - return 0; - - /* range -= 1e-10; */ - while ((range * zs) <= dmaxint) { - scale--; - zs *= 2; - } - - while ((range * zs) > dmaxint) { - scale++; - zs /= 2; - } - - while ((unsigned long)(range * zs + 0.5) <= maxint) { - scale--; - zs *= 2; - } - - while ((unsigned long)(range * zs + 0.5) > maxint) { - scale++; - zs /= 2; - } - - Assert(scale >= -last && scale <= last); - /* printf("---- scale=%ld\n",scale);*/ - - return scale; -} - -long grib_get_decimal_scale_fact(double max, double min, long bpval, long binary_scale) -{ - double range = max - min; - double zs = 1; - long scale = 0; - const long last = 127; /* Depends on edition, should be parameter */ - - unsigned long maxint = codes_power(bpval, 2) - 1; - double dmaxint = (double)maxint; - - range *= codes_power(-binary_scale, 2); - - Assert(bpval >= 1); - if (range == 0) - return 0; - - while ((range * zs) > dmaxint) { - scale--; - zs /= 10; - } - while ((range * zs) <= dmaxint) { - scale++; - zs *= 10; - } - - while ((unsigned long)(range * zs + 0.5) > maxint) { - scale--; - zs /= 10; - } - while ((unsigned long)(range * zs + 0.5) <= maxint) { - scale++; - zs *= 10; - } - - /* printf("grib_api: decimal_scale_fact=%ld max=%g min=%g bits_per_value=%ld binary_scale=%ld\n",scale,max,min,bpval,binary_scale); */ - - Assert(scale >= -last && scale <= last); - - return scale; -} +// long grib_get_decimal_scale_fact(double max, double min, long bpval, long binary_scale) +// { +// double range = max - min; +// double zs = 1; +// long scale = 0; +// const long last = 127; /* Depends on edition, should be parameter */ +// unsigned long maxint = codes_power(bpval, 2) - 1; +// double dmaxint = (double)maxint; +// range *= codes_power(-binary_scale, 2); +// Assert(bpval >= 1); +// if (range == 0) +// return 0; +// while ((range * zs) > dmaxint) { +// scale--; +// zs /= 10; +// } +// while ((range * zs) <= dmaxint) { +// scale++; +// zs *= 10; +// } +// while ((unsigned long)(range * zs + 0.5) > maxint) { +// scale--; +// zs /= 10; +// } +// while ((unsigned long)(range * zs + 0.5) <= maxint) { +// scale++; +// zs *= 10; +// } +// /* printf("grib_api: decimal_scale_fact=%ld max=%g min=%g bits_per_value=%ld binary_scale=%ld\n",scale,max,min,bpval,binary_scale); */ +// Assert(scale >= -last && scale <= last); +// return scale; +// } diff --git a/src/grib_scaling.h b/src/grib_scaling.h index 53e3b1d4d..c48b3aa2c 100644 --- a/src/grib_scaling.h +++ b/src/grib_scaling.h @@ -1,10 +1,8 @@ #pragma once -template T codes_power(long s, long n); - /* Return n to the power of s */ template -T codes_power(long s, long n) +constexpr T codes_power(long s, long n) { T divisor = 1.0; if (s == 0) diff --git a/src/grib_timer.cc b/src/grib_timer.cc index 4d41591de..c0b380c00 100644 --- a/src/grib_timer.cc +++ b/src/grib_timer.cc @@ -338,7 +338,7 @@ grib_timer* grib_get_timer(grib_context* c, const char* name, const char* statna { if (!c) c = grib_context_get_default(); - grib_context_log(c, GRIB_LOG_FATAL, "grib_get_timer function not available"); + grib_context_log(c, GRIB_LOG_ERROR, "%s function not available", __func__); return NULL; } @@ -359,24 +359,18 @@ double grib_timer_value(grib_timer* t) void grib_timer_print(grib_timer* t) { - return; } - void grib_timer_partial_rate(grib_timer* t, double start, long total) { - return; } void grib_print_all_timers() { - return; } void grib_reset_all_timers() { - return; } - #endif diff --git a/src/grib_trie_with_rank.cc b/src/grib_trie_with_rank.cc index 9fd326701..d999f9f1f 100644 --- a/src/grib_trie_with_rank.cc +++ b/src/grib_trie_with_rank.cc @@ -485,7 +485,7 @@ int grib_trie_with_rank_insert(grib_trie_with_rank* t, const char* key, void* da grib_oarray_push(t->context, t->objs, data); /* grib_trie_with_rank_insert_in_list(t,data); */ GRIB_MUTEX_UNLOCK(&mutex); - return t->objs->n; /* grib_oarray_used_size(t->objs) */ + return t->objs->n; } /* diff --git a/src/grib_util.cc b/src/grib_util.cc index dcebec9af..5b8f5b9cc 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -114,7 +114,7 @@ static grib_handle* grib_sections_copy_internal(grib_handle* hfrom, grib_handle* h = grib_handle_new_from_message(hfrom->context, buffer, totalLength); /*to allow free of buffer*/ - h->buffer->property = GRIB_MY_BUFFER; + h->buffer->property = CODES_MY_BUFFER; switch (edition) { case 1: @@ -376,12 +376,14 @@ static const char* get_packing_spec_packing_type_name(long packing_spec_packing_ static void print_values(grib_context* c, const grib_util_grid_spec* spec, const grib_util_packing_spec* packing_spec, + const char* input_packing_type, const double* data_values, const size_t data_values_count, /* the data pay load */ const grib_values* keyval_pairs, const size_t count) /* keys and their values */ { size_t i = 0; int isConstant = 1; double v = 0, minVal = DBL_MAX, maxVal = -DBL_MAX; + fprintf(stderr, "ECCODES DEBUG grib_util: input_packing_type = %s\n", input_packing_type); fprintf(stderr, "ECCODES DEBUG grib_util: grib_set_values, setting %zu key/value pairs\n", count); for (i = 0; i < count; i++) { @@ -764,6 +766,19 @@ static int check_handle_against_spec(grib_handle* handle, const long edition, } #endif +static bool grid_type_is_supported_in_edition(const int spec_grid_type, const long edition) +{ + if (edition == 1) { + if (spec_grid_type == GRIB_UTIL_GRID_SPEC_UNSTRUCTURED || + spec_grid_type == GRIB_UTIL_GRID_SPEC_HEALPIX || + spec_grid_type == GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA) + { + return false; + } + } + return true; +} + static const char* get_grid_type_name(const int spec_grid_type) { if (spec_grid_type == GRIB_UTIL_GRID_SPEC_REGULAR_LL) @@ -799,6 +814,9 @@ static const char* get_grid_type_name(const int spec_grid_type) if (spec_grid_type == GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL) return "lambert"; + if (spec_grid_type == GRIB_UTIL_GRID_SPEC_HEALPIX) + return "healpix"; + if (spec_grid_type == GRIB_UTIL_GRID_SPEC_UNSTRUCTURED) return "unstructured_grid"; @@ -866,6 +884,7 @@ static int get_grib_sample_name(grib_handle* h, long editionNumber, case GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA: case GRIB_UTIL_GRID_SPEC_UNSTRUCTURED: case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL: + case GRIB_UTIL_GRID_SPEC_HEALPIX: snprintf(sample_name, sample_name_len, "GRIB%ld", editionNumber); break; default: @@ -942,7 +961,7 @@ grib_handle* grib_util_set_spec(grib_handle* h, char sample_name[1024]; /* name of the GRIB sample file */ char input_grid_type[100]; char input_packing_type[100]; - long input_bits_per_value = 0, editionNumber = 0, input_decimal_scale_factor = 0; + long editionNumber = 0; size_t count = 0, len = 100, slen = 20, input_grid_type_len = 100; double laplacianOperator; int i = 0, packingTypeIsSet = 0, setSecondOrder = 0, setJpegPacking = 0, setCcsdsPacking = 0; @@ -951,13 +970,8 @@ grib_handle* grib_util_set_spec(grib_handle* h, int global_grid = 0; /* boolean */ int expandBoundingBox = 0; - static grib_util_packing_spec default_packing_spec = {0,}; Assert(h); - if (!packing_spec) { - packing_spec = &default_packing_spec; - } - /* Get edition number from input handle */ if ((*err = grib_get_long(h, "edition", &editionNumber)) != 0) { if (c->write_on_fail) grib_write_message(h, "error.grib", "w"); @@ -969,13 +983,6 @@ grib_handle* grib_util_set_spec(grib_handle* h, } grib_get_string(h, "packingType", input_packing_type, &len); - grib_get_long(h, "bitsPerValue", &input_bits_per_value); - grib_get_long(h, "decimalScaleFactor", &input_decimal_scale_factor); - if (h->context->debug == -1) { - fprintf(stderr, "ECCODES DEBUG grib_util: input_packing_type = %s\n", input_packing_type); - fprintf(stderr, "ECCODES DEBUG grib_util: input_bits_per_value = %ld\n", input_bits_per_value); - fprintf(stderr, "ECCODES DEBUG grib_util: input_decimal_scale_factor = %ld\n", input_decimal_scale_factor); - } /* ECC-1201, ECC-1529, ECC-1530: Make sure input packing type is preserved */ if (packing_spec->packing == GRIB_UTIL_PACKING_SAME_AS_INPUT && @@ -1016,16 +1023,11 @@ grib_handle* grib_util_set_spec(grib_handle* h, goto cleanup; } - if (spec->grid_type == GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA || - spec->grid_type == GRIB_UTIL_GRID_SPEC_UNSTRUCTURED) { - if (editionNumber == 1) { /* These grid types are not available in edition 1 */ - if (h->context->debug == -1) - fprintf(stderr, - "ECCODES DEBUG grib_util: '%s' specified " - "but input is GRIB1. Output must be a higher edition!\n", - grid_type); - convertEditionEarlier = 1; - } + if (!grid_type_is_supported_in_edition(spec->grid_type, editionNumber)) { + fprintf(stderr, "ECCODES WARNING %s: '%s' specified " + "but input is GRIB edition %ld. Output must be a higher edition!\n", + __func__, grid_type, editionNumber); + convertEditionEarlier = 1; } h_sample = grib_handle_new_from_samples(NULL, sample_name); @@ -1165,6 +1167,12 @@ grib_handle* grib_util_set_spec(grib_handle* h, // should be 'double' and not integer. WMO GRIB2 uses millimetres! // TODO(masn): Add other keys like Latin1, LoV etc break; + case GRIB_UTIL_GRID_SPEC_HEALPIX: + COPY_SPEC_LONG(bitmapPresent); + if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue); + COPY_SPEC_LONG(N); // Nside + COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees); + break; case GRIB_UTIL_GRID_SPEC_REDUCED_GG: case GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG: @@ -1292,10 +1300,8 @@ grib_handle* grib_util_set_spec(grib_handle* h, keep_matrix = 0; /* ECC-911 */ } if (keep_matrix) { - int ret; SET_STRING_VALUE("packingType", "grid_simple_matrix"); - ret = grib_get_long(h, "numberOfDirections", &numberOfDirections); - if (ret == GRIB_SUCCESS) { + if (GRIB_SUCCESS == grib_get_long(h, "numberOfDirections", &numberOfDirections)) { grib_get_long(h, "numberOfDirections", &numberOfDirections); SET_LONG_VALUE("NC1", numberOfDirections); grib_get_long(h, "numberOfFrequencies", &numberOfFrequencies); @@ -1412,7 +1418,7 @@ grib_handle* grib_util_set_spec(grib_handle* h, if (h->context->debug == -1) { fprintf(stderr, "ECCODES DEBUG grib_util: global_grid = %d\n", global_grid); fprintf(stderr, "ECCODES DEBUG grib_util: expandBoundingBox = %d\n", expandBoundingBox); - print_values(h->context, spec, packing_spec, data_values, data_values_count, values, count); + print_values(h->context, spec, packing_spec, input_packing_type, data_values, data_values_count, values, count); } /* Apply adjustments to bounding box if needed */ @@ -1528,7 +1534,7 @@ grib_handle* grib_util_set_spec(grib_handle* h, } if (editionNumber > 1 || packing_spec->editionNumber > 1) { /* ECC-353 */ - /* JPEG packing is not available in GRIB edition 1 and has to be done AFTER we set data values */ + /* Some packing types are not available in GRIB1 and have to be done AFTER we set data values */ if (setJpegPacking == 1) { *err = grib_set_string(h_out, "packingType", "grid_jpeg", &slen); if (*err != GRIB_SUCCESS) { @@ -1578,8 +1584,7 @@ grib_handle* grib_util_set_spec(grib_handle* h, return h_out; cleanup: - if (h_out) - grib_handle_delete(h_out); + grib_handle_delete(h_out); return NULL; } @@ -1823,7 +1828,7 @@ int parse_keyval_string(const char* grib_tool, if (*p == ':') { values[i].type = grib_type_to_int(*(p + 1)); if (*(p + 1) == 'n') - values[i].type = GRIB_NAMESPACE; + values[i].type = CODES_NAMESPACE; *p = '\0'; p++; } diff --git a/src/grib_value.cc b/src/grib_value.cc index 0626b029a..e244d3c65 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -37,8 +37,13 @@ static void print_debug_info__set_array(grib_handle* h, const char* func, const size_t N = 7, i = 0; T minVal = std::numeric_limits::max(); T maxVal = -std::numeric_limits::max(); + double missingValue = 0; Assert( h->context->debug ); + if (grib_get_double(h, "missingValue", &missingValue)!=GRIB_SUCCESS) { + missingValue = 9999.0; + } + if (length <= N) N = length; fprintf(stderr, "ECCODES DEBUG %s key=%s, %zu entries (", func, name, length); @@ -49,6 +54,7 @@ static void print_debug_info__set_array(grib_handle* h, const char* func, const if (N >= length) fprintf(stderr, ") "); else fprintf(stderr, "...) "); for (i = 0; i < length; ++i) { + if (val[i] == (T)missingValue) continue; if (val[i] < minVal) minVal = val[i]; if (val[i] > maxVal) maxVal = val[i]; } @@ -537,25 +543,22 @@ int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, s return GRIB_NOT_FOUND; } -int grib_clear(grib_handle* h, const char* name) -{ - int ret = 0; - grib_accessor* a = NULL; - - a = grib_find_accessor(h, name); - - if (a) { - if (a->length == 0) - return 0; - if ((ret = grib_pack_zero(a)) != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to clear %s (%s)", - name, grib_get_error_message(ret)); - return ret; - } - - /*grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name);*/ - return GRIB_NOT_FOUND; -} +// int grib_clear(grib_handle* h, const char* name) +// { +// int ret = 0; +// grib_accessor* a = NULL; +// a = grib_find_accessor(h, name); +// if (a) { +// if (a->length == 0) +// return 0; +// if ((ret = grib_pack_zero(a)) != GRIB_SUCCESS) +// grib_context_log(h->context, GRIB_LOG_ERROR, "unable to clear %s (%s)", +// name, grib_get_error_message(ret)); +// return ret; +// } +// /*grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name);*/ +// return GRIB_NOT_FOUND; +// } int grib_set_missing(grib_handle* h, const char* name) { @@ -1623,7 +1626,7 @@ static int grib_get_key_value(grib_handle* h, grib_key_value_list* kv) err = grib_get_bytes(h, kv->name, (unsigned char*)kv->string_value, &size); kv->error = err; break; - case GRIB_NAMESPACE: + case CODES_NAMESPACE: iter = grib_keys_iterator_new(h, 0, kv->name); list = (grib_key_value_list*)grib_context_malloc_clear(h->context, sizeof(grib_key_value_list)); kv->namespace_value = list; @@ -1672,7 +1675,7 @@ void grib_key_value_list_delete(grib_context* c, grib_key_value_list* kvl) grib_key_value_list* p = NULL; while (next) { p = next->next; - if (next->type == GRIB_NAMESPACE) + if (next->type == CODES_NAMESPACE) grib_key_value_list_delete(c, next->namespace_value); grib_clean_key_value(c, next); diff --git a/src/grib_vdarray.cc b/src/grib_vdarray.cc index 9aadbf455..5ec7fc80b 100644 --- a/src/grib_vdarray.cc +++ b/src/grib_vdarray.cc @@ -8,15 +8,9 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * - * Enrico Fucile - * - ***************************************************************************/ - #include "grib_api_internal.h" -/* For debugging purposes */ +// For debugging purposes void grib_vdarray_print(const char* title, const grib_vdarray* vdarray) { size_t i = 0; @@ -38,7 +32,7 @@ grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize) v = (grib_vdarray*)grib_context_malloc_clear(c, sizeof(grib_vdarray)); if (!v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_vdarray_new unable to allocate %lu bytes\n", sizeof(grib_vdarray)); + "%s: Unable to allocate %zu bytes", __func__, sizeof(grib_vdarray)); return NULL; } v->size = size; @@ -48,7 +42,7 @@ grib_vdarray* grib_vdarray_new(grib_context* c, size_t size, size_t incsize) v->v = (grib_darray**)grib_context_malloc_clear(c, sizeof(grib_darray*) * size); if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_vdarray_new unable to allocate %lu bytes\n", sizeof(grib_darray*) * size); + "%s: Unable to allocate %zu bytes", __func__, sizeof(grib_darray*) * size); return NULL; } return v; @@ -65,7 +59,7 @@ static grib_vdarray* grib_vdarray_resize(grib_vdarray* v) v->size = newsize; if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_vdarray_resize unable to allocate %lu bytes\n", sizeof(grib_darray*) * newsize); + "%s: Unable to allocate %lu bytes\n", __func__, sizeof(grib_darray*) * newsize); return NULL; } return v; diff --git a/src/grib_viarray.cc b/src/grib_viarray.cc index 5a9aa4ddb..bc6e1bc18 100644 --- a/src/grib_viarray.cc +++ b/src/grib_viarray.cc @@ -10,7 +10,7 @@ #include "grib_api_internal.h" -/* For debugging purposes */ +// For debugging purposes void grib_viarray_print(const char* title, const grib_viarray* viarray) { size_t i; @@ -33,7 +33,7 @@ grib_viarray* grib_viarray_new(grib_context* c, size_t size, size_t incsize) v = (grib_viarray*)grib_context_malloc_clear(c, sizeof(grib_viarray)); if (!v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_viarray_new unable to allocate %lu bytes\n", sizeof(grib_viarray)); + "%s: Unable to allocate %zu bytes", __func__, sizeof(grib_viarray)); return NULL; } v->size = size; @@ -43,7 +43,7 @@ grib_viarray* grib_viarray_new(grib_context* c, size_t size, size_t incsize) v->v = (grib_iarray**)grib_context_malloc_clear(c, sizeof(grib_iarray*) * size); if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_viarray_new unable to allocate %lu bytes\n", sizeof(grib_iarray*) * size); + "%s: Unable to allocate %zu bytes", __func__, sizeof(grib_iarray*) * size); return NULL; } return v; @@ -60,7 +60,7 @@ static grib_viarray* grib_viarray_resize(grib_viarray* v) v->size = newsize; if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_viarray_resize unable to allocate %lu bytes\n", sizeof(grib_iarray*) * newsize); + "%s: Unable to allocate %zu bytes", __func__, sizeof(grib_iarray*) * newsize); return NULL; } return v; diff --git a/src/grib_vsarray.cc b/src/grib_vsarray.cc index 9f1d1bb3f..9de0650f7 100644 --- a/src/grib_vsarray.cc +++ b/src/grib_vsarray.cc @@ -8,15 +8,9 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/*************************************************************************** - * - * Enrico Fucile - * - ***************************************************************************/ - #include "grib_api_internal.h" -/* For debugging purposes */ +// For debugging purposes void grib_vsarray_print(const char* title, const grib_vsarray* vsarray) { size_t i = 0; @@ -41,7 +35,7 @@ grib_vsarray* grib_vsarray_new(grib_context* c, size_t size, size_t incsize) v = (grib_vsarray*)grib_context_malloc_clear(c, sizeof(grib_vsarray)); if (!v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_vsarray_new unable to allocate %lu bytes\n", sizeof(grib_vsarray)); + "%s: Unable to allocate %zu bytes", __func__, sizeof(grib_vsarray)); return NULL; } v->size = size; @@ -51,7 +45,7 @@ grib_vsarray* grib_vsarray_new(grib_context* c, size_t size, size_t incsize) v->v = (grib_sarray**)grib_context_malloc_clear(c, sizeof(grib_sarray*) * size); if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_vsarray_new unable to allocate %lu bytes\n", sizeof(grib_sarray*) * size); + "%s: Unable to allocate %zu bytes", __func__, sizeof(grib_sarray*) * size); return NULL; } return v; @@ -68,7 +62,7 @@ static grib_vsarray* grib_vsarray_resize(grib_vsarray* v) v->size = newsize; if (!v->v) { grib_context_log(c, GRIB_LOG_ERROR, - "grib_vsarray_resize unable to allocate %lu bytes\n", sizeof(grib_sarray*) * newsize); + "%s: Unable to allocate %zu bytes", __func__, sizeof(grib_sarray*) * newsize); return NULL; } return v; diff --git a/src/iterator_class_hierarchy.txt b/src/iterator_class_hierarchy.txt index e692fa5c7..ffd961e9d 100644 --- a/src/iterator_class_hierarchy.txt +++ b/src/iterator_class_hierarchy.txt @@ -2,6 +2,7 @@ Iterator Class Hierarchy |-grib_iterator_class_gen |---grib_iterator_class_gaussian_reduced + |---grib_iterator_class_healpix |---grib_iterator_class_lambert_azimuthal_equal_area |---grib_iterator_class_lambert_conformal |---grib_iterator_class_latlon_reduced diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fa4cb5545..a2abbfdc3 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,6 +21,7 @@ list(APPEND test_c_bins unit_tests bufr_keys_iter grib_keys_iter + grib_keys_iter_skip grib_geo_iter gauss_sub grib_nearest_test @@ -31,6 +32,7 @@ list(APPEND test_c_bins grib_optimize_scaling grib_optimize_scaling_sh grib_set_force + grib_run_length_packing grib_partial_message grib_ecc-386 grib_ecc-1467 @@ -53,6 +55,7 @@ list(APPEND test_c_bins grib_set_bytes grib_copy_message grib_packing_order + grib_unpack_subarray grib_sh_imag grib_spectral grib_lam_bf @@ -84,12 +87,15 @@ if( HAVE_BUILD_TOOLS ) bufr_check_descriptors definitions grib2_version + grib_accessors grib_calendar grib_md5 grib_cfNames + grib_ifsParam grib_packing_order filter_substr grib_uerra + grib_ecpoint grib_s2s grib_fire # grib_true_imagery @@ -140,6 +146,7 @@ if( HAVE_BUILD_TOOLS ) grib_grid_unstructured grib_grid_lambert_conformal grib_grid_polar_stereographic + grib_grid_healpix grib_g1monthlydate grib_g1day_of_the_year_date grib_g1fcperiod) @@ -156,6 +163,7 @@ if( HAVE_BUILD_TOOLS ) grib_grid_space_view grib_partial_message grib_headers_only + grib_unpack_subarray grib_count bufr_templates bufr_dump_data @@ -184,6 +192,7 @@ if( HAVE_BUILD_TOOLS ) bufr_change_edition bufr_keys_iter grib_keys_iter + grib_keys_iter_skip grib_geo_iter bufr_get_element bufr_wmo_tables @@ -228,11 +237,13 @@ if( HAVE_BUILD_TOOLS ) grib_set_bytes grib_set_force bufr_ecc-556 + codes_ecc-1698 gts_get gts_ls gts_count gts_compare wrap + taf pseudo_diag metar_ls metar_get @@ -414,7 +425,7 @@ if( HAVE_BUILD_TOOLS ) ecbuild_add_test( TARGET eccodes_t_grib_to_netcdf TYPE SCRIPT - CONDITION HAVE_NETCDF AND ENABLE_EXTRA_TESTS + CONDITION HAVE_NETCDF AND ENABLE_EXTRA_TESTS AND NOT ECCODES_ON_WINDOWS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_to_netcdf.sh TEST_DEPENDS eccodes_download_gribs ) @@ -456,7 +467,7 @@ if( HAVE_BUILD_TOOLS ) # Performance test. Must have -DENABLE_TIMER=ON ecbuild_add_test( TARGET eccodes_t_grib_ecc-386 TYPE SCRIPT - CONDITION ENABLE_EXTRA_TESTS AND ENABLE_TIMER + CONDITION ENABLE_EXTRA_TESTS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ecc-386.sh TEST_DEPENDS eccodes_download_gribs ) else() diff --git a/tests/bufr_change_edition.sh b/tests/bufr_change_edition.sh index 98228556a..b21cfc482 100755 --- a/tests/bufr_change_edition.sh +++ b/tests/bufr_change_edition.sh @@ -15,7 +15,8 @@ cd ${data_dir}/bufr # Define a common label for all the tmp files label="bufr_change_edition_test" -fBufrTmp=${label}".bufr.tmp" +tempBufr=temp.${label}".bufr" +tempLog=temp.$label.log bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt` @@ -23,12 +24,24 @@ for f in ${bufr_files}; do if [ "$f" = "ias1_240.bufr" ]; then continue; fi # Convert to BUFR edition 4 - ${tools_dir}/bufr_set -s editionNumber=4 $f $fBufrTmp - ${tools_dir}/bufr_compare -b edition $f $fBufrTmp + ${tools_dir}/bufr_set -s editionNumber=4 $f $tempBufr + ${tools_dir}/bufr_compare -b edition $f $tempBufr - ed=`${tools_dir}/bufr_get -w count=1 -p editionNumber $fBufrTmp` + ed=`${tools_dir}/bufr_get -w count=1 -p editionNumber $tempBufr` [ "$ed" = "4" ] - done -rm -f $fBufrTmp +# Unsupported editions +# ----------------------- +f=$ECCODES_SAMPLES_PATH/BUFR3.tmpl +${tools_dir}/bufr_set -s edition=1 $f $tempBufr +set +e +${tools_dir}/bufr_dump -O $tempBufr > $tempLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "unreadable message" $tempLog + + +# Clean up +rm -f $tempBufr $tempLog diff --git a/tests/bufr_compare.sh b/tests/bufr_compare.sh index 8175cd30b..e4c41cce6 100755 --- a/tests/bufr_compare.sh +++ b/tests/bufr_compare.sh @@ -281,6 +281,24 @@ ${tools_dir}/bufr_compare -b stationOrSiteName $fBufrTmp1 $fBufrTmp2 unset ECCODES_BUFR_MULTI_ELEMENT_CONSTANT_ARRAYS rm -f $fBufrTmp1 $fBufrTmp2 +# Through index +# ------------- +tempIndex1=temp.$label.1.idx +tempIndex2=temp.$label.2.idx +f=$ECCODES_SAMPLES_PATH/BUFR3_local.tmpl +${tools_dir}/bufr_set -s ident:s=66611 $f $fBufrTmp +${tools_dir}/bufr_index_build -N -o $tempIndex1 $f +${tools_dir}/bufr_index_build -N -o $tempIndex2 $fBufrTmp + +set +e +${tools_dir}/bufr_compare $tempIndex1 $tempIndex2 +status=$? +set -e +[ $status -eq 1 ] + +${tools_dir}/bufr_compare -bident -v $tempIndex1 $tempIndex2 +rm -f $tempIndex1 $tempIndex2 + # Clean up # ------------- diff --git a/tests/bufr_coordinate_descriptors.cc b/tests/bufr_coordinate_descriptors.cc index d743024a2..f005ab5a5 100755 --- a/tests/bufr_coordinate_descriptors.cc +++ b/tests/bufr_coordinate_descriptors.cc @@ -34,6 +34,7 @@ int main(int argc, char* argv[]) char* filename = NULL; FILE* fin = NULL; int is_coord = 0; + int is_header = 0; assert (argc == 2); filename = argv[1]; @@ -78,6 +79,10 @@ int main(int argc, char* argv[]) is_coord = codes_bufr_key_is_coordinate(h, "nosuchkey", &err); assert(err == CODES_NOT_FOUND); + assert(is_coord == 0); + is_header = codes_bufr_key_is_header(h, "nosuchkey", &err); + assert(err == CODES_NOT_FOUND); + assert(is_header == 0); codes_bufr_keys_iterator_delete(kiter); codes_handle_delete(h); diff --git a/tests/bufr_copy.sh b/tests/bufr_copy.sh index e2dcffcbc..eb3b877fb 100755 --- a/tests/bufr_copy.sh +++ b/tests/bufr_copy.sh @@ -98,6 +98,18 @@ ${tools_dir}/bufr_copy -s unpack=1 -w stormIdentifier=none $fBufrInput $fBufrTmp [ ! -f "$fBufrTmp" ] +#------------------------------------------------------------------- +echo "Test: corner cases ..." +#------------------------------------------------------------------- +echo BUFR > $fBufrTmp +set +e +${tools_dir}/bufr_copy $fBufrTmp /dev/null > $fLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -w "unreadable message" $fLog + + # Clean up #----------- rm -f $fLog $fBufrTmp diff --git a/tests/bufr_dump_data.sh b/tests/bufr_dump_data.sh index 1eacbb1f8..4f8594755 100755 --- a/tests/bufr_dump_data.sh +++ b/tests/bufr_dump_data.sh @@ -13,8 +13,8 @@ # Define a common label for all the tmp files label="bufr_dump_data_test" -fLog=${label}".log" -fJsonTmp=${label}".json.tmp" +fLog=temp.$label.log +fJsonTmp=temp.$label.json if [ $HAVE_MEMFS -eq 1 ]; then unset ECCODES_DEFINITION_PATH @@ -58,6 +58,26 @@ grep -q "parsing include file" $fLog unset ECCODES_DEBUG unset ECCODES_LOG_STREAM +# This one should fail +file=${data_dir}/bufr/vos308014_v3_26.bufr +set +e +${tools_dir}/bufr_dump -ja $file +status=$? +set -e +[ $status -ne 0 ] + +set +e +${tools_dir}/bufr_dump $file +status=$? +set -e +[ $status -ne 0 ] + +set +e +${tools_dir}/bufr_dump -p $file +status=$? +set -e +[ $status -ne 0 ] + #============================================== # Testing a malformed bufr file (see ECC-110) #============================================== diff --git a/tests/bufr_get.sh b/tests/bufr_get.sh index 41052db70..57dade77e 100755 --- a/tests/bufr_get.sh +++ b/tests/bufr_get.sh @@ -36,6 +36,11 @@ id=`${tools_dir}/bufr_get -p edition,identifier avhn_87.bufr` id=`${tools_dir}/bufr_get -p edition,identifier aaen_55.bufr` [ "$id" = "4 BUFR" ] +set +e +${tools_dir}/bufr_get -p identifier:d avhn_87.bufr +status=$? +set -e +[ $status -ne 0 ] #------------------------------------------- # Test "-p" switch diff --git a/tests/bufr_ls.sh b/tests/bufr_ls.sh index 2d8e2d157..2879ed36f 100755 --- a/tests/bufr_ls.sh +++ b/tests/bufr_ls.sh @@ -64,6 +64,18 @@ ${tools_dir}/bufr_ls -s satelliteID=313 -p satelliteID aaen_55.bufr > $fTmp grep -q "313" $fTmp +# ------------------------ +# Test corner cases +# ------------------------ +echo BUFR > $fTmp +set +e +${tools_dir}/bufr_ls $fTmp > $fLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -w "unreadable message" $fLog + + # Clean up rm -f $fLog $res_ls rm -f $fTmp diff --git a/tests/bufr_split_by_rdbSubtype.sh b/tests/bufr_split_by_rdbSubtype.sh index 5bd28151c..faa4b49e2 100755 --- a/tests/bufr_split_by_rdbSubtype.sh +++ b/tests/bufr_split_by_rdbSubtype.sh @@ -17,6 +17,7 @@ fRules=${label}.filter # Do all the work in a temporary directory temp_dir=tempdir.${label} +rm -rf $temp_dir mkdir -p $temp_dir cd $temp_dir @@ -43,6 +44,21 @@ for f in ${bufr_files}; do rm -f out.filter_by_rdbSubtype.* done +# Failing cases +# ---------------- +set +e +${tools_dir}/bufr_split_by_rdbSubtype +status=$? +set -e +[ $status -eq 1 ] + +set +e +${tools_dir}/bufr_split_by_rdbSubtype $data_dir +status=$? +set -e +[ $status -eq 1 ] + + # Clean up # ------------- cd $test_dir diff --git a/tests/codes_ecc-1698.sh b/tests/codes_ecc-1698.sh new file mode 100755 index 000000000..d7e0d49ec --- /dev/null +++ b/tests/codes_ecc-1698.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +REDIRECT=/dev/null + +label="codes_ecc-1698_test" +tempGrib=temp.$label.grib +tempBufr=temp.$label.bufr +tempFilt=temp.$label.filt +tempLog=temp.$label.log +tempRef=temp.$label.ref + +sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +sample_bufr4=$ECCODES_SAMPLES_PATH/BUFR4.tmpl + +# Double to string +# ------------------ +infile=$sample_grib2 +result=$(${tools_dir}/grib_get -p maximum:s $infile) +[ "$result" = "1" ] +result=$(${tools_dir}/grib_get -s formatForDoubles=%e -p maximum:s $infile) +[ "$result" = "1.000000e+00" ] + +infile=${data_dir}/sample.grib2 +result=$(${tools_dir}/grib_get -s formatForDoubles=%e -p minimum:s $infile) +[ "$result" = "2.704668e+02" ] + + +# Integer to string +# ------------------ +infile=${data_dir}/sample.grib2 +result=$(${tools_dir}/grib_get -s formatForLongs=%lX -p year:s $infile) +[ "$result" = "7D8" ] + + +rm -f $tempGrib $tempBufr $tempFilt $tempLog $tempRef diff --git a/tests/codes_export_resource.sh b/tests/codes_export_resource.sh index c9795e944..fddb45c45 100755 --- a/tests/codes_export_resource.sh +++ b/tests/codes_export_resource.sh @@ -43,6 +43,12 @@ cmp $ECCODES_DEFINITION_PATH/$f $temp # Failing cases # ---------------- +set +e +${tools_dir}/codes_export_resource +status=$? +set -e +[ $status -eq 1 ] + set +e ${tools_dir}/codes_export_resource -d nonexistent $temp status=$? @@ -55,6 +61,11 @@ status=$? set -e [ $status -eq 1 ] +set +e +${tools_dir}/codes_export_resource -z A B +status=$? +set -e +[ $status -eq 1 ] # Clean up diff --git a/tests/codes_info.sh b/tests/codes_info.sh index 189dfd20a..4d81e2061 100755 --- a/tests/codes_info.sh +++ b/tests/codes_info.sh @@ -39,6 +39,16 @@ export GRIB_DEFINITION_PATH=/tmp/dtest export GRIB_SAMPLES_PATH=/tmp/stest ${tools_dir}/codes_info > $tempLog grep -q "This is for backward compatibility" $tempLog +unset GRIB_DEFINITION_PATH +unset GRIB_SAMPLES_PATH + +# Obscure environment variables +export _ECCODES_ECMWF_TEST_DEFINITION_PATH=abc +export _ECCODES_ECMWF_TEST_SAMPLES_PATH=def +ECCODES_DEBUG=1 ${tools_dir}/codes_info +unset _ECCODES_ECMWF_TEST_DEFINITION_PATH +unset _ECCODES_ECMWF_TEST_SAMPLES_PATH + # Clean up rm -f $tempLog diff --git a/tests/codes_split_file.sh b/tests/codes_split_file.sh index 88021b4c2..641739a55 100755 --- a/tests/codes_split_file.sh +++ b/tests/codes_split_file.sh @@ -16,6 +16,7 @@ temp=$label.temp.grib # Do all the work in a temporary directory temp_dir=tempdir.${label} +rm -rf $temp_dir mkdir -p $temp_dir cd $temp_dir @@ -23,7 +24,7 @@ cd $temp_dir # ----------------------------- cp ${data_dir}/mixed.grib ./ input=mixed.grib -${tools_dir}/codes_split_file 3 $input +${tools_dir}/codes_split_file -v 3 $input # There should now be 3 new files. Make sure they are valid ${tools_dir}/grib_ls mixed.grib_001 ${tools_dir}/grib_ls mixed.grib_002 @@ -59,6 +60,25 @@ total=`${tools_dir}/codes_count tigge_ecmwf.grib2_[0-9]*` cat tigge_ecmwf.grib2_[0-9][0-9][0-9] > $temp ${tools_dir}/grib_compare $input $temp +# Failing cases +# ---------------- +set +e +${tools_dir}/codes_split_file +status=$? +set -e +[ $status -eq 1 ] + +set +e +${tools_dir}/codes_split_file 4 $data_dir +status=$? +set -e +[ $status -eq 1 ] + +set +e +${tools_dir}/codes_split_file 0 $input +status=$? +set -e +[ $status -eq 1 ] # Clean up cd $test_dir diff --git a/tests/filter_substr.sh b/tests/filter_substr.sh index bcf29ef44..37ffadbcc 100755 --- a/tests/filter_substr.sh +++ b/tests/filter_substr.sh @@ -34,5 +34,19 @@ EOF ${tools_dir}/grib_filter - $sample 2>$temp < 0" $temp + +${tools_dir}/grib_filter - $sample 2>$temp < $tempText grep -q "Individual member for large ensemble forecast.*continuous or non-continuous interval" $tempText +# stepType & PDTNs +# -------------------- +test_PDTN_conversions() +{ + # Arguments + # $1 = product def template for instantaneous + # $2 = product def template for interval-based + pdtn_instant=$1 + pdtn_interval=$2 + $tools_dir/grib_set -s productDefinitionTemplateNumber=$pdtn_instant,stepType=accum $sample2 $temp + grib_check_key_equals $temp productDefinitionTemplateNumber $pdtn_interval + $tools_dir/grib_set -s stepType=instant $temp $temp1 + grib_check_key_equals $temp1 productDefinitionTemplateNumber $pdtn_instant +} + +test_PDTN_conversions 2 12 +test_PDTN_conversions 3 13 +test_PDTN_conversions 4 14 +test_PDTN_conversions 5 9 +test_PDTN_conversions 6 10 +test_PDTN_conversions 40 42 +test_PDTN_conversions 41 43 +# test_PDTN_conversions 45 85 # TODO +test_PDTN_conversions 57 67 +test_PDTN_conversions 58 68 +test_PDTN_conversions 71 73 + # Clean up rm -f $temp $temp1 $temp2 $tempFilt $tempText diff --git a/tests/grib_accessors.sh b/tests/grib_accessors.sh new file mode 100755 index 000000000..18011d3f8 --- /dev/null +++ b/tests/grib_accessors.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +label="grib_accessors_test" +tempText=temp.$label.txt + +if [ $ECCODES_ON_WINDOWS -eq 1 ]; then + echo "$0: This test is currently disabled on Windows" + exit 0 +fi + +# Accessors like uint16, uint32 etc +# ---------------------------------- +tempDir=${label}.temp.dir +rm -rf $tempDir +mkdir -p $tempDir/definitions/grib2 +bootfile=$tempDir/definitions/grib2/boot.def +cat $def_dir/grib2/boot.def > $bootfile +echo "uint16 key_uint16: transient;" >> $bootfile +echo "uint32 key_uint32: transient;" >> $bootfile +echo "uint32_little_endian key_uint32_le: transient;" >> $bootfile + +echo "uint64 key_uint64: transient;" >> $bootfile +echo "uint64_little_endian key_uint64_le: transient;" >> $bootfile + +echo "key_tos1 = to_string(kindOfProduct,0,1);" >> $bootfile +echo "key_tos2 = to_string(dataDate,0,3);" >> $bootfile +echo >> $bootfile + +curr_defs=$ECCODES_DEFINITION_PATH +export ECCODES_DEFINITION_PATH=$PWD/$tempDir/definitions:$curr_defs + +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +set +e +# Not yet fully implemented +${tools_dir}/grib_get -p key_uint16 $input > $tempText 2>&1 +${tools_dir}/grib_get -p key_uint32 $input >> $tempText 2>&1 +${tools_dir}/grib_get -p key_uint32_le $input >> $tempText 2>&1 +set -e + +# TODO +# grib_check_key_equals $input 'key_uint64,key_uint64_le' '0 0' + +# kindOfProduct = GRIB, dataDate = 20070323 +grib_check_key_equals $input 'key_tos1,key_tos2' 'G 200' +grib_check_key_equals $input 'key_tos2:d,key_tos2:i' '200 200' + +rm -rf $tempDir + + +# Clean up +rm -f $tempText diff --git a/tests/grib_change_packing.sh b/tests/grib_change_packing.sh index 322572c8e..2b4d8ebf5 100755 --- a/tests/grib_change_packing.sh +++ b/tests/grib_change_packing.sh @@ -55,6 +55,11 @@ test_packing() { result=`${tools_dir}/grib_get -p accuracy $temp` [ $result -eq 0 -o $result -eq 32 -o $result -eq 64 ] + temp1=$temp.1 + ${tools_dir}/grib_set -s setPackingType=$packing $grib $temp1 + ${tools_dir}/grib_compare $temp $temp1 + rm -f $temp1 + shift done diff --git a/tests/grib_change_scanning.sh b/tests/grib_change_scanning.sh index 2312c1ca3..25c5e005b 100755 --- a/tests/grib_change_scanning.sh +++ b/tests/grib_change_scanning.sh @@ -121,6 +121,14 @@ status=$? set -e [ $status -ne 0 ] +# Invalid Ni/Nj +${tools_dir}/grib_set -s Ni=9 $ECCODES_SAMPLES_PATH/GRIB2.tmpl $tempGribA +set +e +${tools_dir}/grib_set -s swapScanningAlternativeRows=1 $tempGribA $tempGribB +status=$? +set -e +[ $status -ne 0 ] + # ECC-1492 grib_check_key_equals "$ECCODES_SAMPLES_PATH/GRIB1.tmpl" iScansNegatively,iScansPositively '0 1' grib_check_key_equals "$ECCODES_SAMPLES_PATH/GRIB1.tmpl" jScansNegatively,jScansPositively '1 0' diff --git a/tests/grib_check_gaussian_grids.sh b/tests/grib_check_gaussian_grids.sh index 3d5dc7169..474eaf726 100755 --- a/tests/grib_check_gaussian_grids.sh +++ b/tests/grib_check_gaussian_grids.sh @@ -13,6 +13,7 @@ label="grib_check_gaussian_grids_test" tempGrib=temp.$label.grib tempText=temp.$label.txt +${tools_dir}/grib_check_gaussian_grid -V # Check all sample GRIBs with a Gaussian grid samples_dir=$ECCODES_SAMPLES_PATH @@ -27,7 +28,17 @@ for gg in ${samples_dir}/reduced_gg_*tmpl; do done -# Set wrong angle and re-test. Should fail +# Set wrong N. Should fail +input=$samples_dir/reduced_gg_pl_32_grib2.tmpl +${tools_dir}/grib_set -s N=0 $input $tempGrib +set +e +${tools_dir}/grib_check_gaussian_grid -v $tempGrib 2> $tempText +status=$? +set -e +[ $status -eq 1 ] +grep -q "Error: N should be > 0" $tempText + +# Set wrong angle. Should fail input=$samples_dir/reduced_gg_pl_1280_grib2.tmpl ${tools_dir}/grib_set -s longitudeOfLastGridPoint=359929680 $input $tempGrib set +e @@ -38,7 +49,7 @@ set -e grep -q "Error: longitudeOfLastGridPointInDegrees.*but should be" $tempText -# Set wrong numberOfDataPoints and re-test. Should fail +# Set wrong numberOfDataPoints. Should fail input=$samples_dir/reduced_gg_pl_96_grib2.tmpl ${tools_dir}/grib_set -s numberOfDataPoints=44 $input $tempGrib set +e @@ -49,11 +60,11 @@ set -e grep -q "Error: Sum of pl array 50662 does not match numberOfDataPoints 44" $tempText -# Set wrong numberOfValues and re-test. Should fail +# Set wrong numberOfValues. Should fail input=$samples_dir/reduced_gg_pl_96_grib2.tmpl ${tools_dir}/grib_set -s numberOfValues=44 $input $tempGrib set +e -${tools_dir}/grib_check_gaussian_grid -v $tempGrib 2> $tempText +${tools_dir}/grib_check_gaussian_grid -f -v $tempGrib 2> $tempText status=$? set -e [ $status -eq 1 ] @@ -61,4 +72,20 @@ cat $tempText grep -q "Error: Sum of pl array 50662 does not match numberOfValues 44" $tempText +# Other errors/warnings +# ---------------------- +set +e +${tools_dir}/grib_check_gaussian_grid +status=$? +set -e +[ $status -eq 1 ] + +${tools_dir}/grib_check_gaussian_grid -v $data_dir > $tempText +grep -q "not a regular file" $tempText + +${tools_dir}/grib_check_gaussian_grid -v $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempText +grep -q "ignoring" $tempText + + +# Clean up rm -f $tempGrib $tempText diff --git a/tests/grib_check_param_concepts.sh b/tests/grib_check_param_concepts.sh index d16fe3135..940762ddc 100755 --- a/tests/grib_check_param_concepts.sh +++ b/tests/grib_check_param_concepts.sh @@ -24,6 +24,8 @@ $EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/gri $EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/tigge/paramId.def $EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/s2s/paramId.def $EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/era6/paramId.def +$EXEC ${test_dir}/grib_check_param_concepts paramId $ECCODES_DEFINITION_PATH/grib2/localConcepts/destine/paramId.def + $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/shortName.def $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/ecmf/shortName.def @@ -32,6 +34,7 @@ $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/g $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/tigge/shortName.def $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/s2s/shortName.def $EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/era6/shortName.def +$EXEC ${test_dir}/grib_check_param_concepts shortName $ECCODES_DEFINITION_PATH/grib2/localConcepts/destine/shortName.def # Check the group: name.def paramId.def shortName.def units.def cfVarName.def # ---------------------------------------------------------------------------- diff --git a/tests/grib_compare.sh b/tests/grib_compare.sh index e2a9d705c..d83228e2c 100755 --- a/tests/grib_compare.sh +++ b/tests/grib_compare.sh @@ -16,12 +16,27 @@ REDIRECT=/dev/null outfile=temp.$label.grib rm -f $outfile +# Use of -a/-c +set +e +infile1=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl +infile2=$ECCODES_SAMPLES_PATH/reduced_gg_pl_48_grib2.tmpl +${tools_dir}/grib_compare -a -c longitudeOfLastGridPoint $infile1 $infile2 +status=$? +set -e +[ $status -eq 1 ] + + +# Use of -c namespace +infile1=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl +${tools_dir}/grib_set -s year=2019 $infile1 $outfile +${tools_dir}/grib_compare -c data:n $infile1 $outfile + # Header (meta-data) keys infile=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl ${tools_dir}/grib_set -d4 $infile $outfile set +e -${tools_dir}/grib_compare $infile $outfile +${tools_dir}/grib_compare -v $infile $outfile status=$? set -e [ $status -eq 1 ] @@ -36,7 +51,7 @@ ${tools_dir}/grib_compare -b indicatorOfParameter,paramId,shortName $infile $out # ---------------------------------------- # Test the -r switch # ---------------------------------------- -infile=${data_dir}/v.grib2 +infile=${data_dir}/tigge_cf_ecmwf.grib2 for i in 1 2 3; do ${tools_dir}/grib_copy -wcount=$i $infile temp.$label.$i done @@ -46,6 +61,20 @@ cat temp.$label.3 temp.$label.2 temp.$label.1 > temp.$label.321 # Compare files in which the messages are not in the same order ${tools_dir}/grib_compare -r temp.$label.213 temp.$label.321 +# Make a change in the data values of 2nd file +${tools_dir}/grib_set -s scaleValuesBy=1.1 temp.$label.2 temp.$label.2.changed +cat temp.$label.2 temp.$label.1 temp.$label.3 > temp.$label.213 +cat temp.$label.3 temp.$label.2.changed temp.$label.1 > temp.$label.321 +set +e +${tools_dir}/grib_compare -d -r temp.$label.213 temp.$label.321 +status=$? +set -e +[ $status -eq 1 ] + +cmp temp.$label.2.changed error2_1.grib +cmp temp.$label.2 error1_1.grib +rm -f error1_1.grib error2_1.grib +rm -f temp.$label.2.changed rm -f temp.$label.1 temp.$label.2 temp.$label.3 temp.$label.213 temp.$label.321 # ---------------------------------------------- @@ -223,6 +252,20 @@ set -e [ $status -eq 1 ] +# Failing cases +# ----------------- +set +e +${tools_dir}/grib_compare -H -c data:n $temp1 $temp2 +status=$? +set -e +[ $status -eq 1 ] + +set +e +${tools_dir}/grib_compare -a $temp1 $temp2 +status=$? +set -e +[ $status -eq 1 ] + # Clean up # --------- diff --git a/tests/grib_copy.sh b/tests/grib_copy.sh index c66fcef61..09b0c50f1 100755 --- a/tests/grib_copy.sh +++ b/tests/grib_copy.sh @@ -15,7 +15,8 @@ cd ${data_dir} # Define a common label for all the tmp files label="grib_copy_test" -temp=${label}".grib.tmp" +temp=temp.$label.grib +fLog=temp.$label.log echo "Test: The -g option..." # ----------------------------------- @@ -49,7 +50,7 @@ echo "Test: ECC-1086 invalid message ..." # This file is 179 bytes long. We chop the last byte to create # an invalid GRIB message (Final 7777 is 777) input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl -badGrib=${label}".bad.grib" +badGrib=temp.$label.bad.grib head -c 178 $input > $badGrib set +e ${tools_dir}/grib_copy $badGrib /dev/null # Only the bad GRIB @@ -89,6 +90,17 @@ status=$? set -e [ $status -ne 0 ] +#------------------------------------------------------------------- +echo "Test: corner cases ..." +#------------------------------------------------------------------- +echo GRIB > $badGrib +set +e +${tools_dir}/grib_copy $badGrib /dev/null > $fLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -w "unreadable message" $fLog + #${tools_dir}/grib_copy -w count=1 -X 57143 $input $temp #Last msg #r1=`${tools_dir}/grib_get -w count=37 -n ls $input` @@ -107,4 +119,4 @@ set -e # Clean up #----------- -rm -f $temp $badGrib $combinedGrib +rm -f $temp $badGrib $combinedGrib $fLog diff --git a/tests/grib_dump.sh b/tests/grib_dump.sh index 7b45501db..7dabcfaf4 100755 --- a/tests/grib_dump.sh +++ b/tests/grib_dump.sh @@ -98,4 +98,14 @@ if [ $HAVE_JPEG -eq 0 ]; then set -e fi +# Use -s option +file=$data_dir/sample.grib2 +${tools_dir}/grib_dump -s year=1909 $file > $temp 2>&1 +grep -q "dataDate = 19090206" $temp + +# Skip handle +${tools_dir}/grib_dump -w count=4 $file > $temp 2>&1 + + +# Clean up rm -f $temp diff --git a/tests/grib_dump_samples.sh b/tests/grib_dump_samples.sh index db5baaaa4..ba4f7d870 100755 --- a/tests/grib_dump_samples.sh +++ b/tests/grib_dump_samples.sh @@ -30,7 +30,8 @@ samples=" for sfile in $samples; do sample="$ECCODES_SAMPLES_PATH/$sfile" - ${tools_dir}/grib_dump -O $sample >/dev/null + ${tools_dir}/grib_dump -Oa $sample >/dev/null + ${tools_dir}/grib_dump -atH $sample >/dev/null done # Test grib_dump with -t option diff --git a/tests/grib_ecc-1167.sh b/tests/grib_ecc-1167.sh index 3bd4cb37f..32db7af41 100755 --- a/tests/grib_ecc-1167.sh +++ b/tests/grib_ecc-1167.sh @@ -32,6 +32,7 @@ grib_check_key_equals $temp2 uuidOfHGrid '10991111111111111111115000110000' # Test errors +# -------------- set +e # Invalid HEX ${tools_dir}/grib_set -s uuidOfHGrid=DEZZBEef10203040b00b1e50001100FF $temp1 $temp2 2>$errlog @@ -40,6 +41,15 @@ set -e [ $status -ne 0 ] grep -q "Invalid hex byte specfication 'ZZ'" $errlog +# Packing as an integer +set +e +${tools_dir}/grib_set -s uuidOfHGrid=12345 $temp1 $temp2 2>$errlog +status=$? +set -e +[ $status -ne 0 ] +grep -q "Should not pack 'uuidOfHGrid' as an integer" $errlog +grep -q "Try packing as a string" $errlog + # Clean up rm -f $temp1 $temp2 $errlog diff --git a/tests/grib_ecc-1560.sh b/tests/grib_ecc-1560.sh index d2d1de9d5..55495daa9 100755 --- a/tests/grib_ecc-1560.sh +++ b/tests/grib_ecc-1560.sh @@ -63,3 +63,4 @@ grib_check_key_equals $tempGrib scaledValueOfFirstFixedSurface 3456 # Clean up rm -f $temp_PDTN08_Grib $temp_PDTN11_Grib $tempGrib +rm -f $temp_PDTN00_Grib diff --git a/tests/grib_ecc-386.cc b/tests/grib_ecc-386.cc index 70c430f97..d4e238c4f 100755 --- a/tests/grib_ecc-386.cc +++ b/tests/grib_ecc-386.cc @@ -21,7 +21,6 @@ static void usage(const char* prog) exit(1); } -#ifdef ECCODES_TIMER int main(int argc, char** argv) { grib_timer* tes = grib_get_timer(0, "decoding", 0, 0); @@ -32,7 +31,7 @@ int main(int argc, char** argv) double* values = NULL; double duration_actual = 0; const double duration_max = 3.6; /* seconds */ - const int num_repetitions = 1000; + const int num_repetitions = 100; if (argc < 2) usage(argv[0]); @@ -73,9 +72,9 @@ int main(int argc, char** argv) fclose(in); return 0; } -#else -int main(int argc, char** argv) -{ - return 0; -} -#endif + +// int main(int argc, char** argv) +// { +// return 0; +// } +// #endif diff --git a/tests/grib_ecc-967.sh b/tests/grib_ecc-967.sh index 6ecc94e46..f332bbcc7 100755 --- a/tests/grib_ecc-967.sh +++ b/tests/grib_ecc-967.sh @@ -17,7 +17,7 @@ label="grib_ecc-967_test" temp=temp.${label}.grib -# Pick a master tables version number way to big! +# Pick a master tables version number way too big! # But one day we will actually get to it. input=$ECCODES_SAMPLES_PATH/reduced_gg_pl_160_grib2.tmpl ${tools_dir}/grib_set -s tablesVersion=253 $input $temp diff --git a/tests/grib_ecpoint.sh b/tests/grib_ecpoint.sh new file mode 100755 index 000000000..875d3cfd4 --- /dev/null +++ b/tests/grib_ecpoint.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + + +label="grib_ecPoint_test" +tempGrib=temp.$label.grib + +sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +latest=`${tools_dir}/grib_get -p tablesVersionLatest $sample_grib2` + +# 1. bias-corrected +## we check if we can set PDTN 73 and typeOfPostProcessing to ecPoint, ecPoint versioning and MARS type +${tools_dir}/grib_set -s tablesVersion=$latest,productDefinitionTemplateNumber=73,backgroundProcess=1,\ +setLocalDefinition=1,grib2LocalSectionNumber=1,type=gbf,class=od,stream=enfo,\ +generatingProcessIdentifier=2,typeOfPostProcessing=206 $sample_grib2 $tempGrib +grib_check_key_equals $tempGrib backgroundProcess,generatingProcessIdentifier,typeOfPostProcessing,type "1 2 206 gbf" +rm -f $tempGrib + +# 2. Point values +## we check if we can set PDTN 90 and typeOfPostProcessing to ecPoint, ecPoint versioning, MARS type, quantile +${tools_dir}/grib_set -s tablesVersion=$latest,productDefinitionTemplateNumber=90,backgroundProcess=1,\ +setLocalDefinition=1,grib2LocalSectionNumber=1,type=pfc,class=od,stream=enfo,\ +totalNumberOfQuantiles=1000,quantileValue=995,\ +generatingProcessIdentifier=2,typeOfPostProcessing=206 $sample_grib2 $tempGrib +grib_check_key_equals $tempGrib backgroundProcess,generatingProcessIdentifier,typeOfPostProcessing,type,quantile "1 2 206 pfc 995:1000" +rm -f $tempGrib + +# 3. Point value metrics +## we check if we can set PDTN 90 and typeOfPostProcessing to ecPoint, ecPoint versioning, MARS type, quantile +${tools_dir}/grib_set -s tablesVersion=$latest,productDefinitionTemplateNumber=90,backgroundProcess=1,\ +setLocalDefinition=1,grib2LocalSectionNumber=1,type=ppm,class=od,stream=enfo,\ +totalNumberOfQuantiles=1000,quantileValue=995,\ +generatingProcessIdentifier=2,typeOfPostProcessing=206 $sample_grib2 $tempGrib +grib_check_key_equals $tempGrib backgroundProcess,generatingProcessIdentifier,typeOfPostProcessing,type,quantile "1 2 206 ppm 995:1000" +rm -f $tempGrib + +# 4. weather types +## we check if we can set PDTN 73 and typeOfPostProcessing to ecPoint, ecPoint versioning and MARS type +${tools_dir}/grib_set -s tablesVersion=$latest,productDefinitionTemplateNumber=73,backgroundProcess=1,\ +setLocalDefinition=1,grib2LocalSectionNumber=1,type=gwt,class=od,stream=enfo,\ +generatingProcessIdentifier=2,typeOfPostProcessing=206 $sample_grib2 $tempGrib +grib_check_key_equals $tempGrib backgroundProcess,generatingProcessIdentifier,typeOfPostProcessing,type "1 2 206 gwt" + +# Clean up +rm -f $tempGrib diff --git a/tests/grib_filter.sh b/tests/grib_filter.sh index ff5f81b83..6a7ebb38f 100755 --- a/tests/grib_filter.sh +++ b/tests/grib_filter.sh @@ -214,6 +214,15 @@ switch (packingType) { EOF ${tools_dir}/grib_filter $tempFilt $data_dir/sample.grib2 ${data_dir}/ccsds.grib2 $data_dir/spherical_model_level.grib2 +cat >$tempFilt <$tempFilt < $tempOut +grep -q "Ni defined: true" $tempOut + + +cat >$tempFilt < $tempOut +grep -q "N defined: false" $tempOut + +cat >$tempFilt < $tempOut +grep -q "No args: false" $tempOut + + +# Use of dummy expression (=true) +cat >$tempFilt < $tempOut +grep -q "case 1" $tempOut +grep -q "case 2" $tempOut + +# Rules +cat >$tempFilt < $tempOut + + +cat >$tempFilt < $tempOut +status=$? +set -e +[ $status -ne 0 ] +grep "Assertion failure" $tempOut + +# Use of the "length" expression +cat >$tempFilt < $tempOut + +# Decode an integer key as string +cat >$tempFilt < $tempOut +cat $tempOut +grep "MISSING" $tempOut + # Clean up rm -f $tempGrib $tempFilt $tempOut $tempRef diff --git a/tests/grib_geo_iter.cc b/tests/grib_geo_iter.cc index 28b7603fe..b9d23830f 100755 --- a/tests/grib_geo_iter.cc +++ b/tests/grib_geo_iter.cc @@ -73,6 +73,22 @@ int main(int argc, char** argv) Assert(grib_iterator_has_next(iter) == 0); + { + // Test getting the previous value from a geoiterator. + // Note: Only implemented for regular grids + char gridType[128] = {0,}; + size_t len = sizeof(gridType); + GRIB_CHECK(grib_get_string(h, "gridType", gridType, &len), 0); + if (strstr(gridType, "regular_")) { + double last_lat = 0, last_lon = 0, last_value = 0; + int result = grib_iterator_previous(iter, &last_lat, &last_lon, &last_value); + Assert(result == 1); + Assert(lat == last_lat); + Assert(lon == last_lon); + Assert(value == last_value); + } + } + grib_iterator_delete(iter); grib_handle_delete(h); diff --git a/tests/grib_get_fail.sh b/tests/grib_get_fail.sh index 9f34e83b8..a94ad80f6 100755 --- a/tests/grib_get_fail.sh +++ b/tests/grib_get_fail.sh @@ -12,20 +12,19 @@ label="grib_get_fail_test" tempText=temp.$label.txt -REDIRECT=/dev/null # Check input file has been downloaded [ -f ${data_dir}/regular_latlon_surface.grib1 ] # Expect failure as the key does not exist set +e -${tools_dir}/grib_get -p boomerang ${data_dir}/regular_latlon_surface.grib1 2> $REDIRECT > $REDIRECT -if [ $? -eq 0 ] ; then - exit 1; # Should not have succeeded -fi +${tools_dir}/grib_get -p boomerang ${data_dir}/regular_latlon_surface.grib1 +status=$? set -e +[ $status -ne 0 ] # ECC-1551: Print which key does not exist +# ----------------------------------------- set +e ${tools_dir}/grib_get -p Ni,Nh,Nj $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempText 2>&1 status=$? @@ -33,4 +32,5 @@ set -e [ $status -ne 0 ] grep -q "Nh (Key/value not found)" $tempText +# Clean up rm -f $tempText diff --git a/tests/grib_gridType.sh b/tests/grib_gridType.sh index 01d91a4b8..491a1481c 100755 --- a/tests/grib_gridType.sh +++ b/tests/grib_gridType.sh @@ -135,6 +135,7 @@ grib2_gridded_types=" lambert_bf mercator_bf polar_stereographic_bf + healpix " grib2_spectral_types=" sh diff --git a/tests/grib_grid_healpix.sh b/tests/grib_grid_healpix.sh new file mode 100755 index 000000000..82ee2b257 --- /dev/null +++ b/tests/grib_grid_healpix.sh @@ -0,0 +1,92 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + +. ./include.ctest.sh + +# Define a common label for all the tmp files +label="grib_healpix_test" +tempFilter="temp.${label}.filt" +tempGrib="temp.${label}.grib" +tempLog="temp.${label}.log" + +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + +latest=`${tools_dir}/grib_get -p tablesVersionLatest $input` + +# Create a filter +cat > $tempFilter <&2 + exit 1 +fi +grib_check_key_equals $tempGrib gridType,orderingConvention,N,Nside 'healpix ring 32 32' +grib_check_key_equals $tempGrib gridDefinitionTemplateNumber,gridName '150 H32' +if [ $latest -gt 31 ]; then + grib_check_key_equals $tempGrib gridDefinitionDescription 'Hierarchical Equal Area isoLatitude Pixelization grid' +fi + +${tools_dir}/grib_dump -O -p section_3 $tempGrib +${tools_dir}/grib_ls -jn geography $tempGrib + +# Geoiterator +# ------------- +rm -f $tempGrib +cat > $tempFilter < $tempFilter < $tempLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Nside must be greater than zero" $tempLog + +set +e +${tools_dir}/grib_get_data -s orderingConvention=nested $tempGrib > $tempLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Only ring ordering is supported" $tempLog + + +# Clean up +rm -f $tempFilter $tempGrib $tempLog diff --git a/tests/grib_grid_lamb_az_eq_area.sh b/tests/grib_grid_lamb_az_eq_area.sh index b2675b597..abd4e1afb 100755 --- a/tests/grib_grid_lamb_az_eq_area.sh +++ b/tests/grib_grid_lamb_az_eq_area.sh @@ -61,6 +61,8 @@ grib_check_key_equals $GRIB_OUTFILE xDirectionGridLengthInMetres,yDirectionGridL # Nearest ${tools_dir}/grib_ls -l 67,-33,1 $GRIB_OUTFILE +# jPointsAreConsecutive +${tools_dir}/grib_get_data -s jPointsAreConsecutive=1 $GRIB_OUTFILE > $DATA_OUTFILE # Oblate spheroid # -------------------- @@ -89,7 +91,7 @@ EOF rm -f "$GRIB_OUTFILE" ${tools_dir}/grib_filter -o $GRIB_OUTFILE $FILTER_FILE $GRIB_INFILE -${tools_dir}/grib_get_data $GRIB_OUTFILE +${tools_dir}/grib_get_data $GRIB_OUTFILE > $DATA_OUTFILE # Clean up diff --git a/tests/grib_grid_polar_stereographic.sh b/tests/grib_grid_polar_stereographic.sh index 2d1e73291..251dd0095 100755 --- a/tests/grib_grid_polar_stereographic.sh +++ b/tests/grib_grid_polar_stereographic.sh @@ -22,6 +22,9 @@ ${tools_dir}/grib_get_data $input > $tempOut ${tools_dir}/grib_ls -l 60,0 $input +# Scanning mode +${tools_dir}/grib_get_data -s iScansNegatively=1 $input > $tempOut + # Clean up rm -f $tempFilter $tempGrib $tempOut diff --git a/tests/grib_grid_space_view.sh b/tests/grib_grid_space_view.sh index 4c0e2b07f..5b987cd53 100755 --- a/tests/grib_grid_space_view.sh +++ b/tests/grib_grid_space_view.sh @@ -44,7 +44,23 @@ fi ${tools_dir}/grib_get_data $tempGrib2 > $tempOut ${tools_dir}/grib_ls -l 50,0 $tempGrib2 -rm -f $tempGrib2 + +# Invalid cases +set +e +${tools_dir}/grib_get_data -sNr=missing $tempGrib2 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Orthographic view (Nr missing) not supported" $tempOut + +set +e +${tools_dir}/grib_get_data -sNr=0 $tempGrib2 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "must be greater than zero" $tempOut + +rm -f $tempGrib2 $tempOut # ----------- # GRIB1 diff --git a/tests/grib_ifsParam.sh b/tests/grib_ifsParam.sh new file mode 100755 index 000000000..f8c5d78a8 --- /dev/null +++ b/tests/grib_ifsParam.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +label="grib_ifsParam_test" +tempLog=temp.$label.log +tempGrib=temp.$label.grib +tempText=temp.$label.txt + +sample_g1="$ECCODES_SAMPLES_PATH/GRIB1.tmpl" +sample_g2="$ECCODES_SAMPLES_PATH/GRIB2.tmpl" + +${tools_dir}/grib_set -s paramId=167 $sample_g1 $tempGrib +grib_check_key_equals $tempGrib ifsParam 167 + +${tools_dir}/grib_set -s paramId=129001 $sample_g1 $tempGrib +grib_check_key_equals $tempGrib ifsParam 1 + +${tools_dir}/grib_set -s paramId=200001 $sample_g1 $tempGrib +grib_check_key_equals $tempGrib ifsParam 1 + +${tools_dir}/grib_set -s paramId=211001 $sample_g1 $tempGrib +grib_check_key_equals $tempGrib ifsParam 210001 + + +# Clean up +rm -f $tempGrib $tempText $tempLog diff --git a/tests/grib_iterator.sh b/tests/grib_iterator.sh index 1c63056cb..4b8eec5f7 100755 --- a/tests/grib_iterator.sh +++ b/tests/grib_iterator.sh @@ -65,5 +65,11 @@ set +e grep -q "Grid description is wrong or inconsistent" $tempText +${tools_dir}/grib_ls -s Ni=missing -j -p latLonValues $data_dir/sample.grib2 > $tempText 2>&1 +cat $tempText +grep -q "Key Ni cannot be 'missing' for a regular grid" $tempText +grep -q "latlonvalues: Unable to create iterator" $tempText + + # Clean up rm -f $tempText $tempGrib diff --git a/tests/grib_jpeg.sh b/tests/grib_jpeg.sh index e6c2485da..dfe8a8f61 100755 --- a/tests/grib_jpeg.sh +++ b/tests/grib_jpeg.sh @@ -129,6 +129,32 @@ ${tools_dir}/grib_set -d1 ${data_dir}/jpeg.grib2 $tempGrib grib_check_key_equals $tempGrib isConstant 1 ${tools_dir}/grib_ls -n statistics $tempGrib +ECCODES_DEBUG=-1 ${tools_dir}/grib_ls -n statistics $data_dir/jpeg.grib2 +${tools_dir}/grib_set -r -s unitsBias=2,unitsFactor=3 $data_dir/jpeg.grib2 $tempGrib + +# typeOfCompressionUsed and targetCompressionRatio +set +e +${tools_dir}/grib_set -r -s typeOfCompressionUsed=1,targetCompressionRatio=255 $data_dir/jpeg.grib2 $tempGrib +status=$? +set -e +[ $status -ne 0 ] + +set +e +${tools_dir}/grib_set -r -s typeOfCompressionUsed=1,targetCompressionRatio=0 $data_dir/jpeg.grib2 $tempGrib +status=$? +set -e +[ $status -ne 0 ] + +set +e +${tools_dir}/grib_set -r -s typeOfCompressionUsed=0,targetCompressionRatio=1 $data_dir/jpeg.grib2 $tempGrib +status=$? +set -e +[ $status -ne 0 ] + +tempDump=temp.$label.jpg +ECCODES_GRIB_DUMP_JPG_FILE=$tempDump ${tools_dir}/grib_copy -r $data_dir/jpeg.grib2 $tempGrib +[ -f $tempDump ] +rm -f $tempDump # Clean up rm -f $tempFilt $tempGrib diff --git a/tests/grib_keys_iter_skip.cc b/tests/grib_keys_iter_skip.cc new file mode 100644 index 000000000..54d5d1c79 --- /dev/null +++ b/tests/grib_keys_iter_skip.cc @@ -0,0 +1,59 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ +#include +#include +#include + +#include "grib_api_internal.h" + +int main(int argc, char* argv[]) +{ + grib_handle* h = NULL; + int err = 0; + + Assert(argc == 2); + const char* fname = argv[1]; + FILE* f = fopen(fname, "rb"); + Assert(f); + + unsigned long flags[] = { + GRIB_KEYS_ITERATOR_SKIP_READ_ONLY, + GRIB_KEYS_ITERATOR_SKIP_OPTIONAL, + GRIB_KEYS_ITERATOR_SKIP_EDITION_SPECIFIC, + GRIB_KEYS_ITERATOR_SKIP_CODED, + GRIB_KEYS_ITERATOR_SKIP_COMPUTED, + GRIB_KEYS_ITERATOR_SKIP_DUPLICATES, + GRIB_KEYS_ITERATOR_SKIP_FUNCTION + }; + const unsigned long N = sizeof(flags)/sizeof(unsigned long); + + while ((h = grib_handle_new_from_file(0, f, &err)) != NULL) { + + for (unsigned long i=0; i 0); + ++count; + } + grib_keys_iterator_delete(kiter); + printf("File=%s: Flag=%lu, count=%zu\n", fname, flags[i], count); + } + + grib_handle_delete(h); + } + + fclose(f); + return 0; +} diff --git a/tests/grib_keys_iter_skip.sh b/tests/grib_keys_iter_skip.sh new file mode 100755 index 000000000..4b5e6fb28 --- /dev/null +++ b/tests/grib_keys_iter_skip.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +label="grib_keys_iter_skip_test" + +gribs=" + row.grib + grid_ieee.grib + reduced_gaussian_model_level.grib1 + sample.grib2 + gfs.c255.grib2 +" +for f in $gribs; do + g=$data_dir/$f + ${test_dir}/grib_keys_iter_skip $g +done diff --git a/tests/grib_ls.sh b/tests/grib_ls.sh index 29ede3bcf..f702c0747 100755 --- a/tests/grib_ls.sh +++ b/tests/grib_ls.sh @@ -40,6 +40,7 @@ ${tools_dir}/grib_ls -l 0,0,1 $infile >> $tempLog ${tools_dir}/grib_get -l 0,0,1 $infile >> $tempLog ${tools_dir}/grib_get -p count,step $infile >> $tempLog ${tools_dir}/grib_get -P count $infile >> $tempLog +${tools_dir}/grib_get -i 0 $infile files=" reduced_gaussian_lsm.grib1 reduced_gaussian_model_level.grib1 @@ -114,6 +115,14 @@ echo "ECC-278: grib_ls -n namespace..." ${tools_dir}/grib_ls -n geography $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib2.tmpl ${tools_dir}/grib_ls -n data $sample_g1 +set +e +${tools_dir}/grib_ls -n nosuchnamespace $sample_g1 > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "does not contain any key" $tempText + + # Angle subdivisions grib_check_key_equals $sample_g1 angleSubdivisions 1000 grib_check_key_equals $sample_g2 angleSubdivisions 1000000 @@ -201,6 +210,22 @@ set -e [ $status -ne 0 ] grep -q "Invalid file offset" $tempText +# Decode an ascii key as double +file=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl +grib_check_key_equals $file 'expver:d' 1 +grib_check_key_equals $file 'expver:s' '0001' + + +${tools_dir}/grib_ls -j -l0,0 -p referenceValue:d $data_dir/sample.grib2 +${tools_dir}/grib_ls -j -l0,0 -p referenceValue:i $data_dir/sample.grib2 + +set +e +${tools_dir}/grib_ls -l0,0,666 $data_dir/sample.grib2 > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Wrong mode given" $tempText + # Clean up rm -f $temp1 $temp2 $tempText $tempLog diff --git a/tests/grib_mars_keys1.sh b/tests/grib_mars_keys1.sh index b1be74ea9..d13d880fd 100755 --- a/tests/grib_mars_keys1.sh +++ b/tests/grib_mars_keys1.sh @@ -21,6 +21,16 @@ types_table=$ECCODES_DEFINITION_PATH/mars/type.table classes_table=$ECCODES_DEFINITION_PATH/mars/class.table streams_table=$ECCODES_DEFINITION_PATH/mars/stream.table +# Set as integers +${tools_dir}/grib_set -s mars.type=11 $grib2_sample $tempGrib +grib_check_key_equals $tempGrib type pf + +${tools_dir}/grib_set -s mars.class=11 $grib2_sample $tempGrib +grib_check_key_equals $tempGrib class en + +${tools_dir}/grib_set -s mars.stream=1033 $grib2_sample $tempGrib +grib_check_key_equals $tempGrib stream enfh + # Check basic mars namespace keys # -------------------------------- ${tools_dir}/grib_ls -jm $grib2_sample > $tempOut @@ -103,5 +113,5 @@ for t in $mars_types; do grib_check_key_equals $tempGrib "mars.type:i" $t done - +# Clean up rm -f $tempGrib $tempOut $tempRef diff --git a/tests/grib_proj_string.sh b/tests/grib_proj_string.sh index 9dc1e8557..e1a60ca56 100755 --- a/tests/grib_proj_string.sh +++ b/tests/grib_proj_string.sh @@ -86,7 +86,7 @@ ${tools_dir}/grib_get -p projString:i $grib2_sample > $tempText 2>&1 status=$? set -e [ $status -ne 0 ] -grep -q "ERROR.*Cannot unpack projTargetString as long" $tempText +grep -q "ERROR.*Cannot unpack.*projTargetString.* as long" $tempText grep -q "Hint: Try unpacking as string" $tempText set +e @@ -94,7 +94,7 @@ ${tools_dir}/grib_get -p projString:d $grib2_sample > $tempText 2>&1 status=$? set -e [ $status -ne 0 ] -grep -q "ERROR.*Cannot unpack projTargetString as double" $tempText +grep -q "ERROR.*Cannot unpack.*projTargetString.* as double" $tempText grep -q "Hint: Try unpacking as string" $tempText diff --git a/tests/grib_run_length_packing.cc b/tests/grib_run_length_packing.cc new file mode 100644 index 000000000..ec6ef53a3 --- /dev/null +++ b/tests/grib_run_length_packing.cc @@ -0,0 +1,63 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ +#include +#include "eccodes.h" +#undef NDEBUG +#include + +// Provided by Tatsuya Noyori + +int main(int argc, char* argv[]) +{ + size_t str_len = 0; + long number_of_values = 4, bits_per_value = 8, max_level_value = 3, number_of_level_values = 5, decimal_scale_factor = 1; + size_t level_values_length = number_of_level_values; + long level_values[] = { 101L, 102L, 103L, 104L, 105L }; + double* values = NULL; + size_t values_length = number_of_values; + values = (double*)malloc(values_length * sizeof(double)); + values[0] = 9999.0; + + assert(argc == 2); + + for (size_t i = 1; i < values_length; i++) { + values[i] = (double)((100.0 + i) / 10.0); + } + codes_handle* h = codes_grib_handle_new_from_samples(0, "GRIB2"); + + CODES_CHECK(codes_set_long(h, "numberOfDataPoints", number_of_values), 0); + CODES_CHECK(codes_set_long(h, "Ni", sqrt(number_of_values)), 0); + CODES_CHECK(codes_set_long(h, "Nj", sqrt(number_of_values)), 0); + + CODES_CHECK(codes_set_double(h, "latitudeOfFirstGridPointInDegrees", 35.000000), 0); + CODES_CHECK(codes_set_double(h, "longitudeOfFirstGridPointInDegrees", 135.000000), 0); + CODES_CHECK(codes_set_double(h, "latitudeOfLastGridPointInDegrees", 35.000000 + (0.012500 * sqrt(number_of_values))), 0); + CODES_CHECK(codes_set_double(h, "longitudeOfLastGridPointInDegrees", 135.000000 + (0.008333 * sqrt(number_of_values))), 0); + CODES_CHECK(codes_set_double(h, "iDirectionIncrementInDegrees", 0.012500), 0); + CODES_CHECK(codes_set_double(h, "jDirectionIncrementInDegrees", 0.008333), 0); + CODES_CHECK(codes_set_long(h, "jScansPositively", 1), 0); + + CODES_CHECK(codes_set_string(h, "shortName", "t", &str_len), 0); + CODES_CHECK(codes_set_long(h, "numberOfValues", 1), 0); + CODES_CHECK(codes_set_string(h, "packingType", "grid_run_length", &str_len), 0); + CODES_CHECK(codes_set_long(h, "numberOfValues", number_of_values), 0); + CODES_CHECK(codes_set_long(h, "bitsPerValue", bits_per_value), 0); + CODES_CHECK(codes_set_long(h, "maxLevelValue", max_level_value), 0); + CODES_CHECK(codes_set_long(h, "numberOfLevelValues", number_of_level_values), 0); + CODES_CHECK(codes_set_long(h, "decimalScaleFactor", decimal_scale_factor), 0); + CODES_CHECK(codes_set_long_array(h, "levelValues", level_values, level_values_length), 0); + CODES_CHECK(codes_set_double_array(h, "values", values, values_length), 0); + + CODES_CHECK(codes_write_message(h, argv[1], "w"), 0); + codes_handle_delete(h); + + free(values); + return 0; +} diff --git a/tests/grib_run_length_packing.sh b/tests/grib_run_length_packing.sh index e9be4f4ac..ce44c7c95 100755 --- a/tests/grib_run_length_packing.sh +++ b/tests/grib_run_length_packing.sh @@ -16,6 +16,8 @@ label="grib_run_length_packing_test" tempGrib=temp.$label.grib tempLog=temp.$label.log +# Decoding +# ------------------ input=$data_dir/run_length_packing.grib2 if [ ! -f "$input" ]; then echo " Input data file missing: $input" @@ -30,4 +32,16 @@ stats=$(${tools_dir}/grib_get -F%.5f -p packingType,min,max,avg $input) grib_check_key_equals $input numberOfMissing 71493 grib_check_key_equals $input missingValuesPresent 1 +# Encoding +# ----------------- +$EXEC ${test_dir}/grib_run_length_packing $tempGrib +${tools_dir}/grib_dump -O $tempGrib +${tools_dir}/grib_get_data -mXXX $tempGrib +grib_check_key_equals $tempGrib packingType grid_run_length + +stats=`${tools_dir}/grib_get -M -F%.1f -p min,max,avg $tempGrib` +[ "$stats" = "10.1 10.3 10.2" ] + + +# Clean up rm -f $tempGrib $tempLog diff --git a/tests/grib_s2s.sh b/tests/grib_s2s.sh index e4cd8388a..139013606 100755 --- a/tests/grib_s2s.sh +++ b/tests/grib_s2s.sh @@ -39,5 +39,14 @@ status=$? set -e [ $status -ne 0 ] +# Reforecasts +${tools_dir}/grib_set -s \ + tablesVersion=14,productionStatusOfProcessedData=6,productDefinitionTemplateNumber=60 \ + $grib2_sample $temp1 +${tools_dir}/grib_ls -jm $temp1 +grib_check_key_equals $temp1 mars.hdate '20070323' +grib_check_key_equals $temp1 mars.stream 'enfh' +grib_check_key_equals $temp1 isHindcast '1' + # Clean up rm -f $temp1 $temp2 $tempSample diff --git a/tests/grib_second_order.sh b/tests/grib_second_order.sh index 7fab5e736..a50c8f681 100755 --- a/tests/grib_second_order.sh +++ b/tests/grib_second_order.sh @@ -183,6 +183,24 @@ ${tools_dir}/grib_set -s scaleValuesBy=1.1 boustrophedonic.grib1 $temp1 unset ECCODES_GRIBEX_BOUSTROPHEDONIC +# data_g1second_order_constant_width_packing +# ------------------------------------------ +input=second_ord_rbr.grib1 +${tools_dir}/grib_set -s Ni=2,Nj=74,secondOrderOfDifferentWidth=0,secondaryBitmapPresent=1 $input $temp1 +grib_check_key_equals $temp1 packingType grid_second_order_constant_width +${tools_dir}/grib_dump -O $temp1 > $REDIRECT +set +e +${tools_dir}/grib_set -s scaleValuesBy=2 $temp1 $temp2 > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Not implemented" $tempText + +${tools_dir}/grib_get_data $temp1 > $REDIRECT +${tools_dir}/grib_ls -l46,1 $temp1 > $REDIRECT +${tools_dir}/grib_ls -j -l46,1,1 $temp1 > $REDIRECT + + # Clean up rm -f $temp_stat1 $temp_stat2 rm -f $temp1 $temp2 $temp3 $sec_ord_bmp diff --git a/tests/grib_set.sh b/tests/grib_set.sh index 45ddc4fb0..1b8be144b 100755 --- a/tests/grib_set.sh +++ b/tests/grib_set.sh @@ -18,6 +18,8 @@ temp=temp.grib_set.out rm -f $outfile +${tools_dir}/grib_set -V + ${tools_dir}/grib_set -v -p levtype,centre,levtype,centre:l -s levtype=pl,centre=80 $infile $outfile >$REDIRECT levtype=`${tools_dir}/grib_get -p levtype $outfile` @@ -85,6 +87,17 @@ set -e [ $status -ne 0 ] grep -q "Trying to encode a negative value of -1 for key of type unsigned" $temp +# Bad value for -d +# ---------------- +input=${data_dir}/reduced_gaussian_sub_area.grib2 +set +e +${tools_dir}/grib_set -d hello $input $outfile 2>$temp +status=$? +set -e +[ $status -ne 0 ] +grep -q "Invalid number" $temp + + # ECC-1605: Out-of-bounds value for signed keys # ---------------------------------------------------- if [ $ECCODES_ON_WINDOWS -eq 0 ]; then @@ -195,6 +208,34 @@ count=`${tools_dir}/grib_count $outfile` [ $count -eq 1 ] grib_check_key_equals $outfile shortName '2t' +# Key with no_fail flag +# ------------------------ +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +grib_check_key_equals $input 'typeOfProcessedData:i' '2' +${tools_dir}/grib_set -s typeOfProcessedData=rubbish $input $outfile +grib_check_key_equals $outfile 'typeOfProcessedData:i' '255' # set to default + +# Codetable mismatch +# ------------------------ +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +set +e +${tools_dir}/grib_set -s stepUnits=d $input $outfile > $temp 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "stepUnits: No such code table entry.*Did you mean" $temp + +# ------------------------ +# Unreadable message +# ------------------------ +echo GRIB > $outfile +set +e +${tools_dir}/grib_set -s edition=2 $outfile /dev/null > $temp 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "unreadable message" $temp + # Clean up rm -f $outfile $temp diff --git a/tests/grib_step.sh b/tests/grib_step.sh index e3f90142b..0a5cf7425 100755 --- a/tests/grib_step.sh +++ b/tests/grib_step.sh @@ -17,6 +17,9 @@ tempGrb=${data_dir}/temp.$label.out.grib templog=${data_dir}/temp.$label.log rm -f $templog $tempGrb +grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + for i in 0 10 do for s in 0 1200 600 6000 @@ -83,8 +86,6 @@ hourEnd=$1; dayEnd=$2 # ECC-134 case-sensitivity # -------------------------- -grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl -grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl temp=temp.step.$$.grib # M is for Month (code 3) ${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=M $grib1_sample $temp @@ -147,6 +148,14 @@ grib_check_key_equals $input "dataDate,dataTime,step" "20061205 1200 6" grib_check_key_equals $input "validityDate,validityTime" "20061205 1800" grib_check_key_equals $input "validityDateTime:s" "20061205 001800" +# ECC-1704: Key validityTime as string +# ----------------------------------------------- +result=$( ${tools_dir}/grib_get -p validityTime:s -s dataTime=0000 $grib2_sample ) +[ "$result" = "0000" ] +input=$data_dir/simple.grib +grib_check_key_equals $input "validityTime:s" "0600" + + # Key julianDay # ----------------------------------------------- input=${data_dir}/sample.grib2 @@ -155,7 +164,13 @@ ${tools_dir}/grib_set -s julianDay=2454504 $input $temp grib_check_key_equals $input day 6 grib_check_key_equals $temp day 7 +# Seconds (ignored) +# ----------------------------------------------- +${tools_dir}/grib_ls -s second=9 -n time $grib2_sample 2>$templog +# Something should have been written to stderr +[ -s $templog ] +grep -q "Truncating time: non-zero seconds.* ignored" $templog # Clean up -rm -f $temp +rm -f $temp $templog rm -f $grib2File.p8tmp ${grib2File}.tmp x.grib diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index 9e2151b7c..e83f9a620 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -36,6 +36,7 @@ if command -v "ncdump" >/dev/null 2>&1; then NC_DUMPER="ncdump" fi + echo "Test ECC-1041: One parameter with different expvers ..." # ------------------------------------------------------------ # This has 5 messages, all 'tp'. Change the first message to have a different expver @@ -48,23 +49,22 @@ if test "x$NC_DUMPER" != "x"; then grep -q "short tp_0001" $tempText fi -if [ $ECCODES_ON_WINDOWS -eq 0 ]; then - echo "Test HDF5 decoding ..." - # --------------------------- - # Note: this is only available in NetCDF-4. So need to check if the command worked with -k3 - input=${data_dir}/sample.grib2 - set +e - ${tools_dir}/grib_to_netcdf -k3 -o $tempNetcdf $input 2>/dev/null - stat=$? - set -e - if [ $stat -eq 0 ]; then - have_netcdf4=1 - ${tools_dir}/grib_dump -TA -O $tempNetcdf - res=`${tools_dir}/grib_get -TA -p identifier $tempNetcdf` - [ "$res" = "HDF5" ] - fi +echo "Test HDF5 decoding ..." +# --------------------------- +# Note: this is only available in NetCDF-4. So need to check if the command worked with -k3 +input=${data_dir}/sample.grib2 +set +e +${tools_dir}/grib_to_netcdf -k3 -o $tempNetcdf $input 2>/dev/null +stat=$? +set -e +if [ $stat -eq 0 ]; then + have_netcdf4=1 + ${tools_dir}/grib_dump -TA -O $tempNetcdf + res=`${tools_dir}/grib_get -TA -p identifier $tempNetcdf` + [ "$res" = "HDF5" ] fi + grib_files="\ regular_latlon_surface.grib2 \ regular_latlon_surface.grib1 \ diff --git a/tests/grib_unpack_subarray.cc b/tests/grib_unpack_subarray.cc new file mode 100644 index 000000000..3321b4040 --- /dev/null +++ b/tests/grib_unpack_subarray.cc @@ -0,0 +1,54 @@ +/* + * (C) Copyright 2005- ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * + * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by + * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. + */ + +#include "grib_api_internal.h" + +int main(int argc, char** argv) +{ + Assert(argc == 2); + + int err = 0; + size_t nvalues = 0; + const char* filename = argv[1]; + grib_context* c = grib_context_get_default(); + + FILE* fin = fopen(filename, "r"); + Assert(fin); + grib_handle* h = grib_handle_new_from_file(0, fin, &err); + Assert(h); + Assert(!err); + + grib_accessor* a = grib_find_accessor(h, "codedValues"); + Assert(a); + GRIB_CHECK(grib_get_size(h, "codedValues", &nvalues), 0); + double* all_values = (double*)grib_context_malloc(c, sizeof(double) * nvalues); + double* sub_values = (double*)grib_context_malloc(c, sizeof(double) * nvalues); + Assert(all_values); + Assert(sub_values); + + size_t len = nvalues; + GRIB_CHECK(grib_unpack_double(a, all_values, &len), 0); + + size_t start = nvalues / 10; + len = nvalues / 5; + printf("nvalues=%zu, start=%zu, len=%zu\n", nvalues, start, len); + GRIB_CHECK(grib_unpack_double_subarray(a, sub_values, start, len), 0); + for (size_t i = 0; i < len; ++i) { + //printf("sub[%zu]=%.10e\n", start + i, sub_values[i]); + Assert(all_values[start+i] == sub_values[i]); + } + + grib_context_free(c, all_values); + grib_context_free(c, sub_values); + grib_handle_delete(h); + fclose(fin); + + return 0; +} diff --git a/tests/grib_unpack_subarray.sh b/tests/grib_unpack_subarray.sh new file mode 100755 index 000000000..43bc730d8 --- /dev/null +++ b/tests/grib_unpack_subarray.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.ctest.sh + +label="grib_unpack_subarray_test" +temp=${label}".grib.tmp" + +infile=$data_dir/sample.grib2 +$EXEC ${test_dir}/grib_unpack_subarray $infile + +# Clean up +rm -f $temp diff --git a/tests/gts_compare.sh b/tests/gts_compare.sh index 77f0e2754..3fd648a1d 100755 --- a/tests/gts_compare.sh +++ b/tests/gts_compare.sh @@ -10,24 +10,18 @@ . ./include.ctest.sh -#set -x - -#Enter data dir +# Enter data dir cd ${data_dir}/gts -#Define a common label for all the tmp files +# Define a common label for all the tmp files label="gts_compare_test" -#Create log file fLog=${label}".log" rm -f $fLog touch $fLog -#Define tmp GTS file fGtsTmp=${label}".gts.tmp" fRules=${label}".filt" -fBufrInput1=${label}".bufr.input1" -fBufrInput2=${label}".bufr.input2" #---------------------------------------------------- # Test: comparing same files @@ -35,7 +29,7 @@ fBufrInput2=${label}".bufr.input2" gts_file="EGRR20150317121020_00493212.DAT" echo "Test: comparing the same files" >> $fLog echo "file: $gts_file" >> $fLog -${tools_dir}//gts_compare $gts_file $gts_file +${tools_dir}/gts_compare $gts_file $gts_file #---------------------------------------------------- # Test: comparing two different files @@ -46,18 +40,37 @@ cat > $fRules<&2 exit 1 fi +# The -d option should have created these two files +[ -f error1_1.gts ] +[ -f error2_1.gts ] +rm -f error1_1.gts error2_1.gts #---------------------------------------------------- # Test: comparing with and without the -b switch #---------------------------------------------------- -${tools_dir}//gts_compare -b GG $gts_file $fGtsTmp >> $fLog +# Add wrong blocklist. Should still fail +set +e +${tools_dir}/gts_compare -b CCCC $gts_file $fGtsTmp +status=$? +set -e +[ $status -eq 1 ] +# Add correct blocklist +${tools_dir}/gts_compare -b GG $gts_file $fGtsTmp -#Clean up +# Test with file of the same name in a dir +tempDir=temp.$label.dir +rm -fr $tempDir +mkdir $tempDir +cp $gts_file $tempDir +${tools_dir}/gts_compare $gts_file $tempDir +rm -r $tempDir + +# Clean up rm -f $fLog $fGtsTmp $fRules diff --git a/tests/gts_ls.sh b/tests/gts_ls.sh index 313f7b6df..3de662f3e 100755 --- a/tests/gts_ls.sh +++ b/tests/gts_ls.sh @@ -45,4 +45,12 @@ ${tools_dir}/gts_ls -p TT,AA,II,CCCC,YY,GG,gg,BBB $f 2> $REDIRECT > $res_ls diff $ref_ls $res_ls >$REDIRECT 2> $REDIRECT +#------------------------------------------- +# Decode the key 'theMessage' +#------------------------------------------- +echo 'print "[theMessage]";' | ${tools_dir}/gts_filter - $gts_file + +${tools_dir}/gts_ls -wcount=1 -p theMessage $f + +# Clean up rm -f $fLog $res_ls diff --git a/tests/metar_compare.sh b/tests/metar_compare.sh index ee016bd9f..ea277df2c 100755 --- a/tests/metar_compare.sh +++ b/tests/metar_compare.sh @@ -10,20 +10,18 @@ . ./include.ctest.sh -#set -x - -#Enter data dir +# Enter data dir cd ${data_dir}/metar -#Define a common label for all the tmp files +# Define a common label for all the tmp files label="metar_compare_test" -#Create log file +# Create log file fLog=${label}".log" rm -f $fLog touch $fLog -#Define tmp METAR file +# Define tmp METAR file fMetarTmp=${label}".metar.tmp" #---------------------------------------------------- @@ -39,7 +37,7 @@ ${tools_dir}/metar_compare $metar_file $metar_file #---------------------------------------------------- sed -e 's:^METAR VECC 022350Z 00000KT 1600 BR NSC 15/13 Q1013 NOSIG:METAR VECC 022349Z 00000KT 1600 BR NSC 15/13 Q1013 NOSIG:' < metar.txt > $fMetarTmp set +e -${tools_dir}/metar_compare $metar_file $fMetarTmp +${tools_dir}/metar_compare -v -d -f $metar_file $fMetarTmp status=$? set -e if [ $status -eq 0 ]; then @@ -47,10 +45,22 @@ if [ $status -eq 0 ]; then exit 1 fi +# The -d option should have created these files +rm -f error1_1.metar error2_1.metar error1_2.metar error2_2.metar + #---------------------------------------------------- # Test: comparing with and without the -b switch #---------------------------------------------------- -# ${tools_dir}/metar_compare -b GG $metar_file $fMetarTmp >> $fLog +if [ $ECCODES_ON_WINDOWS -eq 0 ]; then + # Add wrong blocklist. Should still fail + set +e + ${tools_dir}/metar_compare -b CCCC $metar_file $fMetarTmp + status=$? + set -e + [ $status -eq 1 ] + # Add correct blocklist + ${tools_dir}/metar_compare -b minute,theMessage $metar_file $fMetarTmp +fi -#Clean up +# Clean up rm -f $fLog $fMetarTmp diff --git a/tests/taf.sh b/tests/taf.sh new file mode 100755 index 000000000..adc758361 --- /dev/null +++ b/tests/taf.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# (C) Copyright 2005- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +# Tests for TAF (Terminal Aerodrome Forecast) + +. ./include.ctest.sh + +label="taf_test" +tempTaf=temp.$label.taf +tempOut=temp.$label.out +tempTxt=temp.$label.txt +tempRef=temp.$label.ref + +cat >$tempTaf<strict = 1; @@ -306,27 +304,12 @@ int grib_tool_init(grib_runtime_options* options) /* Check 1st file is not a directory */ exit_if_input_is_directory(tool_name, options->infile_extra->name); - if (grib_options_on("r")) { - const char* filename[1]; - filename[0] = options->infile_extra->name; - options->random = 1; - options->orderby = strdup(orderby); - options->idx = grib_fieldset_new_from_files(context, filename, - nfiles, 0, 0, 0, orderby, &ret); - if (ret) { - fprintf(stderr, "%s: Unable to create index for input file %s (%s)", - tool_name, options->infile_extra->name, grib_get_error_message(ret)); - exit(ret); - } - } - else { - options->random = 0; - options->infile_extra->file = fopen(options->infile_extra->name, "r"); + options->random = 0; + options->infile_extra->file = fopen(options->infile_extra->name, "r"); - if (!options->infile_extra->file) { - perror(options->infile_extra->name); - exit(1); - } + if (!options->infile_extra->file) { + perror(options->infile_extra->name); + exit(1); } global_tolerance = 0; @@ -475,6 +458,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) if (compare_handles(h, global_handle, options)) { error++; + write_messages(h, global_handle); if (!force) exit(1); } @@ -483,10 +467,9 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) return 0; } - else if (options->random) - global_handle = grib_fieldset_next_handle(options->idx, &err); - else + else { global_handle = bufr_handle_new_from_file_x(h->context, options->infile_extra->file, options->mode, 0, &err); + } if (!global_handle || err != GRIB_SUCCESS) { morein2++; @@ -497,6 +480,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) if (compare_handles(global_handle, h, options)) { error++; + write_messages(global_handle, h); if (!two_way) { /* If two_way mode: Don't exit yet. Show further differences */ if (!force) @@ -510,6 +494,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) printf(" Swapping handles (two-way mode)\n"); if (compare_handles(h, global_handle, options)) { error++; + write_messages(h, global_handle); if (!force) exit(1); } @@ -530,7 +515,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { int err = 0; - if (!options->through_index && !options->random) { + if (!options->through_index) { global_handle = codes_bufr_handle_new_from_file(h->context, options->infile_extra->file, &err); if (!global_handle || err != GRIB_SUCCESS) @@ -1223,7 +1208,6 @@ static int compare_attributes(grib_handle* handle1, grib_handle* handle2, grib_r if (compare_attribute(handle1, handle2, options, aa, prefix, err)) { (*err)++; - write_messages(handle1, handle2); ret = 1; } @@ -1243,7 +1227,6 @@ static int compare_attribute(grib_handle* handle1, grib_handle* handle2, grib_ru snprintf(fullname, fullnameMaxLen, "%s->%s", prefix, a->name); if (compare_values(options, handle1, handle2, fullname, GRIB_TYPE_UNDEFINED)) { (*err)++; - write_messages(handle1, handle2); ret = 1; } /* Recurse if this key has children */ @@ -1321,13 +1304,11 @@ static int compare_all_dump_keys(grib_handle* handle1, grib_handle* handle2, gri /* Compare the key itself */ if (compare_values(options, handle1, handle2, prefix, GRIB_TYPE_UNDEFINED)) { (*pErr)++; - write_messages(handle1, handle2); ret = 1; } /* Now compare the key attributes (if any) */ if (compare_attributes(handle1, handle2, options, xa, prefix, pErr)) { (*pErr)++; - write_messages(handle1, handle2); ret = 1; } if (dofree) @@ -1346,23 +1327,11 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt grib_keys_iterator* iter = NULL; const char* name = NULL; - /* mask only if no -c option or headerMode (-H)*/ - if (blocklist && (!listFromCommandLine || headerMode)) { - /* See ECC-245, GRIB-573, GRIB-915: Do not change handles in memory */ - /* - grib_string_list* nextb=blocklist; - while (nextb) { - grib_clear(handle1,nextb->value); - grib_clear(handle2,nextb->value); - nextb=nextb->next; - }*/ - } - if (listFromCommandLine && onlyListed) { for (i = 0; i < options->compare_count; i++) { if (blocklisted(options->compare[i].name)) continue; - if (options->compare[i].type == GRIB_NAMESPACE) { + if (options->compare[i].type == CODES_NAMESPACE) { iter = grib_keys_iterator_new(handle1, 0, options->compare[i].name); if (!iter) { grib_context_log(handle1->context, GRIB_LOG_ERROR, "unable to get iterator"); @@ -1376,7 +1345,6 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt continue; if (compare_values(options, handle1, handle2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(handle1, handle2); } } grib_keys_iterator_delete(iter); @@ -1384,7 +1352,6 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt else { if (compare_values(options, handle1, handle2, options->compare[i].name, options->compare[i].type)) err++; - write_messages(handle1, handle2); } } } @@ -1424,7 +1391,7 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt for (i = 0; i < options->compare_count; i++) { if (blocklisted(name)) continue; - if (options->compare[i].type == GRIB_NAMESPACE) { + if (options->compare[i].type == CODES_NAMESPACE) { iter = grib_keys_iterator_new(handle1, 0, options->compare[i].name); if (!iter) { grib_context_log(handle1->context, GRIB_LOG_ERROR, @@ -1439,7 +1406,6 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt continue; if (compare_values(options, handle1, handle2, name, GRIB_TYPE_UNDEFINED)) { err++; - write_messages(handle1, handle2); if (compare_all_dump_keys(handle1, handle2, options, &err)) { err++; } @@ -1450,7 +1416,6 @@ static int compare_handles(grib_handle* handle1, grib_handle* handle2, grib_runt else { if (compare_values(options, handle1, handle2, options->compare[i].name, options->compare[i].type)) { err++; - write_messages(handle1, handle2); if (compare_all_dump_keys(handle1, handle2, options, &err)) { err++; } diff --git a/tools/codes_split_file.cc b/tools/codes_split_file.cc index 8896053c1..384904602 100644 --- a/tools/codes_split_file.cc +++ b/tools/codes_split_file.cc @@ -32,21 +32,15 @@ static void usage(const char* prog) static int split_file(FILE* in, const char* filename, const int nchunks, unsigned long* count) { void* mesg = NULL; - FILE* out; size_t size = 0, read_size = 0, insize = 0, chunk_size, msg_size = 0, num_msg = 0; - size_t ofilenameMaxLen = 0; off_t offset = 0; - int err = GRIB_SUCCESS; - int i; - char* ofilename; + int err = GRIB_SUCCESS, i = 0; grib_context* c = grib_context_get_default(); - - if (!in) - return 1; + assert(in); /* name of output file */ - ofilenameMaxLen = strlen(filename) + 10; - ofilename = (char*)calloc(1, ofilenameMaxLen); + size_t ofilenameMaxLen = strlen(filename) + 10; + char* ofilename = (char*)calloc(1, ofilenameMaxLen); fseeko(in, 0, SEEK_END); insize = ftello(in); @@ -61,7 +55,7 @@ static int split_file(FILE* in, const char* filename, const int nchunks, unsigne i = 1; snprintf(ofilename, ofilenameMaxLen, OUTPUT_FILENAME_FORMAT, filename, i); - out = fopen(ofilename, "w"); + FILE* out = fopen(ofilename, "w"); if (!out) { perror(ofilename); free(ofilename); @@ -71,7 +65,6 @@ static int split_file(FILE* in, const char* filename, const int nchunks, unsigne while (err != GRIB_END_OF_FILE) { mesg = wmo_read_any_from_file_malloc(in, 0, &size, &offset, &err); num_msg++; - /*printf("=1=%d\t%d\t%d\n",*count,size,insize);*/ if (mesg != NULL && err == 0) { if (fwrite(mesg, 1, size, out) != size) { perror(ofilename); @@ -115,8 +108,6 @@ static int split_file(FILE* in, const char* filename, const int nchunks, unsigne int main(int argc, char* argv[]) { - FILE* infh = NULL; - char* filename; int i, status = 0; int err = 0, nchunks = 0; unsigned long count = 0; @@ -140,12 +131,12 @@ int main(int argc, char* argv[]) } i++; - filename = argv[i]; + const char* filename = argv[i]; if (path_is_directory(filename)) { fprintf(stderr, "ERROR: %s: Is a directory\n", filename); return 1; } - infh = fopen(filename, "rb"); + FILE* infh = fopen(filename, "rb"); if (!infh) { perror(filename); return 1; diff --git a/tools/grib_compare.cc b/tools/grib_compare.cc index dbcb8ed7e..800c3eca6 100644 --- a/tools/grib_compare.cc +++ b/tools/grib_compare.cc @@ -14,6 +14,7 @@ grib_option grib_options[] = { /* {id, args, help}, on, command_line, value*/ { "r", 0, "Compare files in which the messages are not in the same order. This option is time expensive.\n", 0, 1, 0 }, { "b:", 0, 0, 0, 1, 0 }, + { "d", 0, "Write different messages on files.\n", 0, 1, 0 }, { "e", 0, "Edition independent compare. It is used to compare GRIB edition 1 and 2.\n", 0, 1, 0 }, { "2", 0, "Enable two-way comparison.\n", 0, 1, 0 }, { "c:", 0, 0, 0, 1, 0 }, @@ -64,7 +65,6 @@ static double global_tolerance = 0; static int packingCompare = 0; static grib_string_list* blocklist = 0; static int compareAbsolute = 1; - static int error = 0; static int count = 0; static int lastPrint = 0; @@ -87,6 +87,8 @@ static int listFromCommandLine = 0; static int editionIndependent = 0; static int verbose = 0; static double tolerance_factor = 1; +static int write_error = 0; +static int write_count = 0; static grib_handle* handle1 = NULL; static int global_counter = 0; @@ -152,6 +154,42 @@ static double compare_double_relative(const double* a, const double* b, double t return relativeError > tolerance ? relativeError : 0; } +static void write_message(grib_handle* h, const char* str) +{ + const void* m; + size_t s; + char fname[1024] = {0,}; + FILE* fh; + + grib_get_message(h, &m, &s); + snprintf(fname, sizeof(fname), "%s_%d.grib", str, write_count); + + fh = fopen(fname, "w"); + if (!fh) { + grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Error opening %s", fname); + exit(GRIB_IO_PROBLEM); + } + + if (fwrite(m, 1, s, fh) != s) { + grib_context_log(h->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR), + "Error writing to %s", fname); + exit(GRIB_IO_PROBLEM); + } + + fclose(fh); +} + +static void write_messages(grib_handle* handle1, grib_handle* handle2) +{ + if (!write_error) + return; + write_count++; + + write_message(handle1, "error1"); + write_message(handle2, "error2"); +} + static int blocklisted(const char* name) { grib_string_list* b = blocklist; @@ -212,6 +250,11 @@ int grib_tool_init(grib_runtime_options* options) else two_way = 0; + if (grib_options_on("d")) + write_error = 1; + else + write_error = 0; + verbose = grib_options_on("v"); listFromCommandLine = 0; @@ -460,6 +503,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* hand if (compare_handles(handle2, handle1, options)) { error++; + write_messages(handle2, handle1); if (!force) exit(1); } @@ -481,6 +525,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* hand if (compare_handles(handle1, handle2, options)) { error++; + write_messages(handle1, handle2); if (!two_way) { /* If two_way mode: Don't exit yet. Show further differences */ if (!force) exit(1); @@ -491,6 +536,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* hand handles_swapped = 1; if (compare_handles(handle2, handle1, options)) { error++; + write_messages(handle2, handle1); if (!force) exit(1); } else { @@ -1143,16 +1189,15 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option grib_keys_iterator* iter = NULL; grib_context* context = handle1->context; - /* mask only if no -c option or headerMode (-H)*/ - if (blocklist && (!listFromCommandLine || headerMode)) { - /* See ECC-245, GRIB-573, GRIB-915: Do not change handles in memory */ - /* grib_string_list* nextb=blocklist; - while (nextb) { - grib_clear(h1,nextb->value); - grib_clear(h2,nextb->value); - nextb=nextb->next; - } */ - } + //if (blocklist && (!listFromCommandLine || headerMode)) { + // See ECC-245, GRIB-573, GRIB-915: Do not change handles in memory! + // grib_string_list* nextb=blocklist; + // while (nextb) { + // grib_clear(h1,nextb->value); + // grib_clear(h2,nextb->value); + // nextb=nextb->next; + // } + //} if (headerMode) { // An alternative implementation: @@ -1193,8 +1238,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option if (blocklisted(name)) continue; - if (compare_values(options, h11, h22, name, GRIB_TYPE_UNDEFINED)) + if (compare_values(options, h11, h22, name, GRIB_TYPE_UNDEFINED)) { err++; + } } grib_keys_iterator_delete(iter); @@ -1207,7 +1253,7 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option for (i = 0; i < options->compare_count; i++) { if (blocklisted(options->compare[i].name)) continue; - if (options->compare[i].type == GRIB_NAMESPACE) { + if (options->compare[i].type == CODES_NAMESPACE) { int num_keys_in_namespace = 0; iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { @@ -1220,8 +1266,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option if (blocklisted(name)) continue; - if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; + } } grib_keys_iterator_delete(iter); if (num_keys_in_namespace == 0 && !editionIndependent) { @@ -1229,8 +1276,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option } } else { - if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) + if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) { err++; + } } } } @@ -1255,8 +1303,9 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option if (blocklisted(name)) continue; - if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; + } } grib_keys_iterator_delete(iter); @@ -1265,7 +1314,7 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option for (i = 0; i < options->compare_count; i++) { if (blocklisted(options->compare[i].name)) continue; - if (options->compare[i].type == GRIB_NAMESPACE) { + if (options->compare[i].type == CODES_NAMESPACE) { iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { printf("ERROR: unable to get iterator for %s\n", options->compare[i].name); @@ -1277,14 +1326,16 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option if (blocklisted(name)) continue; - if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) + if (compare_values(options, h1, h2, name, GRIB_TYPE_UNDEFINED)) { err++; + } } grib_keys_iterator_delete(iter); } else { - if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) + if (compare_values(options, h1, h2, options->compare[i].name, options->compare[i].type)) { err++; + } } } } diff --git a/tools/grib_get_data.cc b/tools/grib_get_data.cc index 5682e3875..83b87421d 100644 --- a/tools/grib_get_data.cc +++ b/tools/grib_get_data.cc @@ -15,7 +15,6 @@ static grib_values* get_key_values(grib_runtime_options* options, grib_handle* h grib_option grib_options[] = { /* {id, args, help}, on, command_line, value */ - { "q", 0, 0, 1, 0, 0 }, { "S", 0, 0, 1, 0, 0 }, { "M", 0, 0, 0, 1, 0 }, { "m:", "missingValue", @@ -183,8 +182,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) exit(1); } if (size != (size_t)numberOfPoints) { - if (!grib_options_on("q")) - fprintf(stderr, "ERROR: Wrong number of points %ld\n", numberOfPoints); + fprintf(stderr, "ERROR: Wrong number of points %ld\n", numberOfPoints); if (grib_options_on("f")) exit(1); } diff --git a/tools/grib_options.cc b/tools/grib_options.cc index 78e82d1d8..475f22fdf 100644 --- a/tools/grib_options.cc +++ b/tools/grib_options.cc @@ -386,7 +386,7 @@ int grib_process_runtime_options(grib_context* context, int argc, char** argv, g if (grib_options_on("e")) { for (i = 0; i < names_count; i++) { options->compare[i + options->compare_count].name = names[i]; - options->compare[i + options->compare_count].type = GRIB_NAMESPACE; + options->compare[i + options->compare_count].type = CODES_NAMESPACE; } options->compare_count += names_count; } diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index faa2ca00f..ce038d07f 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -179,10 +179,11 @@ int grib_tool(int argc, char** argv) dump_file = stdout; } - /* ECC-926: Currently only GRIB indexing works. Disable the through_index if BUFR, GTS etc */ - if (global_options.mode == MODE_GRIB && + /* ECC-926: Currently only GRIB and BUFR indexing work. Disable the through_index if GTS etc */ + if ((global_options.mode == MODE_GRIB || global_options.mode == MODE_BUFR) && is_index_file(global_options.infile->name) && - (global_options.infile_extra && is_index_file(global_options.infile_extra->name))) { + (global_options.infile_extra && is_index_file(global_options.infile_extra->name))) + { global_options.through_index = 1; return grib_tool_index(&global_options); } diff --git a/tools/gts_compare.cc b/tools/gts_compare.cc index 047839d4a..c17e25c3d 100644 --- a/tools/gts_compare.cc +++ b/tools/gts_compare.cc @@ -79,7 +79,6 @@ int lastPrint = 0; int force = 0; double maxAbsoluteError = 1e-19; int onlyListed = 1; -int headerMode = 0; int morein1 = 0; int morein2 = 0; int listFromCommandLine = 0; @@ -185,11 +184,6 @@ int grib_tool_init(grib_runtime_options* options) else onlyListed = 1; - if (grib_options_on("H")) - headerMode = 1; - else - headerMode = 0; - if (grib_options_on("H") && grib_options_on("c:")) { printf("Error: -H and -c options are incompatible. Choose one of the two please.\n"); exit(1); @@ -270,10 +264,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int err = 0; count++; - if (options->random) - global_handle = grib_fieldset_next_handle(options->idx, &err); - else - global_handle = gts_handle_new_from_file_x(h->context, options->infile_extra->file, options->mode, 0, &err); + global_handle = gts_handle_new_from_file_x(h->context, options->infile_extra->file, options->mode, 0, &err); if (!global_handle || err != GRIB_SUCCESS) { morein2++; @@ -296,7 +287,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { int err = 0; - if (!options->through_index && !options->random) { + if (!options->through_index) { global_handle = gts_new_from_file(h->context, options->infile_extra->file, &err); if (!global_handle || err != GRIB_SUCCESS) @@ -730,60 +721,11 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option grib_keys_iterator* iter = NULL; const char* name = NULL; - /* mask only if no -c option or headerMode (-H)*/ - if (blocklist && (!listFromCommandLine || headerMode)) { - grib_string_list* nextb = blocklist; - while (nextb) { - grib_clear(h1, nextb->value); - grib_clear(h2, nextb->value); - nextb = nextb->next; - } - } - - if (headerMode) { - const void *msg1 = NULL, *msg2 = NULL; - size_t size1 = 0, size2 = 0; - grib_handle *h11, *h22; - GRIB_CHECK_NOLINE(grib_get_message_headers(h1, &msg1, &size1), 0); - GRIB_CHECK_NOLINE(grib_get_message_headers(h2, &msg2, &size2), 0); - if (size1 == size2 && !memcmp(msg1, msg2, size1)) - return 0; - - err = 0; - h11 = grib_handle_new_from_partial_message(h1->context, msg1, size1); - h22 = grib_handle_new_from_partial_message(h1->context, msg2, size2); - - iter = grib_keys_iterator_new(h11, - GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); - - if (!iter) { - printf("ERROR: unable to get iterator\n"); - exit(1); - } - - while (grib_keys_iterator_next(iter)) { - name = grib_keys_iterator_get_name(iter); - /*printf("----- comparing %s\n",name);*/ - - if (blocklisted(name)) - continue; - if (compare_values(options, h11, h22, name, GRIB_TYPE_UNDEFINED)) { - err++; - write_messages(h11, h22); - } - } - - grib_keys_iterator_delete(iter); - grib_handle_delete(h11); - grib_handle_delete(h22); - return err; - } - if (listFromCommandLine && onlyListed) { for (i = 0; i < options->compare_count; i++) { if (blocklisted((char*)options->compare[i].name)) continue; - if (options->compare[i].type == GRIB_NAMESPACE) { + if (options->compare[i].type == CODES_NAMESPACE) { iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { printf("ERROR: unable to get iterator\n"); @@ -844,7 +786,7 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option for (i = 0; i < options->compare_count; i++) { if (blocklisted(name)) continue; - if (options->compare[i].type == GRIB_NAMESPACE) { + if (options->compare[i].type == CODES_NAMESPACE) { iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { printf("ERROR: unable to get iterator for %s\n", options->compare[i].name); diff --git a/tools/metar_compare.cc b/tools/metar_compare.cc index 4b1a8ee46..4a9024483 100644 --- a/tools/metar_compare.cc +++ b/tools/metar_compare.cc @@ -332,10 +332,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int err = 0; count++; - if (options->random) - global_handle = grib_fieldset_next_handle(options->idx, &err); - else - global_handle = metar_handle_new_from_file_x(h->context, options->infile_extra->file, options->mode, 0, &err); + global_handle = metar_handle_new_from_file_x(h->context, options->infile_extra->file, options->mode, 0, &err); if (!global_handle || err != GRIB_SUCCESS) { morein2++; @@ -358,7 +355,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h) int grib_tool_skip_handle(grib_runtime_options* options, grib_handle* h) { int err = 0; - if (!options->through_index && !options->random) { + if (!options->through_index) { global_handle = metar_new_from_file(h->context, options->infile_extra->file, &err); if (!global_handle || err != GRIB_SUCCESS) @@ -905,21 +902,11 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option grib_keys_iterator* iter = NULL; const char* name = NULL; - /* mask only if no -c option (-H)*/ - if (blocklist && !listFromCommandLine) { - grib_string_list* nextb = blocklist; - while (nextb) { - grib_clear(h1, nextb->value); - grib_clear(h2, nextb->value); - nextb = nextb->next; - } - } - if (listFromCommandLine && onlyListed) { for (i = 0; i < options->compare_count; i++) { if (blocklisted((char*)options->compare[i].name)) continue; - if (options->compare[i].type == GRIB_NAMESPACE) { + if (options->compare[i].type == CODES_NAMESPACE) { iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { printf("ERROR: unable to get iterator\n"); @@ -960,7 +947,7 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option for (i = 0; i < options->compare_count; i++) { if (blocklisted(name)) continue; - if (options->compare[i].type == GRIB_NAMESPACE) { + if (options->compare[i].type == CODES_NAMESPACE) { iter = grib_keys_iterator_new(h1, 0, options->compare[i].name); if (!iter) { printf("ERROR: unable to get iterator for %s\n", options->compare[i].name);