Merge branch 'develop' into feature/chemId_mars

This commit is contained in:
shahramn 2024-03-21 11:12:59 +00:00
commit a9ca018cd6
308 changed files with 4591 additions and 2608 deletions

View File

@ -3,7 +3,7 @@ build:
- ecbuild
- ninja
- aec
- netcdf4/new
- netcdf4
parallel: 64
cmake_options:
- -DENABLE_EXTRA_TESTS=1

View File

@ -8,7 +8,7 @@ module unload ecmwf-toolbox
module load cdo/new
module load numdiff
module load nccmp
module load netcdf4/new
module load netcdf4
module load gnuparallel/new
module load python3

View File

@ -23,7 +23,7 @@ jobs:
ecbuild
ninja
aec
netcdf4/new
netcdf4
--parallel: 64
--cmake-options: |
-DENABLE_EXTRA_TESTS=1

View File

@ -1,6 +1,7 @@
Enrico Fucile
Shahram Najm
Eugen Betke
Enrico Fucile
Pedro Maciel
Sandor Kertesz
Sebastien Villaume
Florian Rathgeber

View File

@ -73,17 +73,11 @@ endif()
###############################################################################
# some variables/options of this project
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
ecbuild_add_cxx_flags("-Wno-write-strings")
ecbuild_add_cxx_flags("-Wno-deprecated")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
ecbuild_add_cxx_flags("-Wno-write-strings")
ecbuild_add_cxx_flags("-Wno-deprecated")
else()
ecbuild_add_cxx_flags("-Wno-writable-strings")
endif()
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Cray" )
# ecbuild_add_cxx_flags("-Wno-write-strings" NO_FAIL)
# ecbuild_add_cxx_flags("-Wno-writable-strings" NO_FAIL)
# ecbuild_add_cxx_flags("-Wno-deprecated" NO_FAIL)
if( CMAKE_CXX_COMPILER_ID STREQUAL "Cray" )
set(CMAKE_CXX_FLAGS "-hstd=c++11 ${CMAKE_CXX_FLAGS}")
endif()
@ -201,8 +195,8 @@ ecbuild_add_option( FEATURE INSTALL_ECCODES_SAMPLES
ecbuild_add_option( FEATURE MEMORY_MANAGEMENT DESCRIPTION "Enable memory management" DEFAULT OFF ADVANCED )
ecbuild_add_option( FEATURE ALIGN_MEMORY DESCRIPTION "Enable memory alignment" DEFAULT OFF ADVANCED )
ecbuild_add_option( FEATURE TIMER DESCRIPTION "Enable timer" DEFAULT OFF ADVANCED )
ecbuild_add_option( FEATURE ECCODES_THREADS DESCRIPTION "Enable POSIX threads" DEFAULT OFF ADVANCED )
ecbuild_add_option( FEATURE ECCODES_OMP_THREADS DESCRIPTION "Enable OpenMP threads" DEFAULT OFF ADVANCED )
ecbuild_add_option( FEATURE ECCODES_THREADS DESCRIPTION "Enable thread-safety using POSIX threads" DEFAULT OFF ADVANCED )
ecbuild_add_option( FEATURE ECCODES_OMP_THREADS DESCRIPTION "Enable thread-safety using OpenMP threads" DEFAULT OFF ADVANCED )
ecbuild_add_option( FEATURE EXTRA_TESTS DESCRIPTION "Enable extended regression testing" DEFAULT OFF ADVANCED )
###############################################################################

View File

@ -33,8 +33,6 @@ However it requires that cmake be installed on your system.
To add the Python3 bindings, use pip3 install from PyPI as follows:
> pip3 install eccodes
or
> pip3 install --install-option="--prefix=/path/to/where/you/install/eccodes" eccodes
You can also pass options to the cmake command above. Some typical examples are:

View File

@ -60,11 +60,6 @@ To add the Python3 bindings, use pip3 install from PyPI as follows:
```
pip3 install eccodes
```
or
```
pip3 install --install-option="--prefix=/path/to/where/you/install/eccodes" eccodes
```
For more details, please see:
https://confluence.ecmwf.int/display/ECC/ecCodes+installation

View File

@ -1,3 +1,5 @@
SET(ENABLE_EXTRA_TESTS ON CACHE BOOL "Enable extra tests")
SET(ENABLE_ECCODES_THREADS ON CACHE BOOL "Enable POSIX threads")
SET(ENABLE_MEMFS ON CACHE BOOL "Enable MEMFS")
SET(ENABLE_EXTRA_TESTS ON CACHE BOOL "Enable extra tests")
SET(ECCODES_INSTALL_EXTRA_TOOLS ON CACHE BOOL "Install extra tools")
SET(ENABLE_ECCODES_THREADS ON CACHE BOOL "Enable POSIX threads")
SET(ENABLE_MEMFS ON CACHE BOOL "Enable MEMFS")
# SET(ENABLE_JPG_LIBOPENJPEG OFF CACHE BOOL "Disable OpenJPEG")

View File

@ -62,4 +62,6 @@ Test2...
- -47120001 -> 6
Test3...
Test4...
Test5...
All OK

View File

@ -18,12 +18,12 @@ constant defaultTypeOfLevel="unknown" : hidden;
gribDataQualityChecks = getenv("ECCODES_GRIB_DATA_QUALITY_CHECKS","0") : hidden;
if (gribDataQualityChecks) {
template LIMITS "param_limits.def";
template LIMITS "param_limits.def";
}
# GRIBEX special boustrophedonic mode. See GRIB-472
# If the environment variable is not defined, the key will be 0
GRIBEX_boustrophedonic = getenv("ECCODES_GRIBEX_BOUSTROPHEDONIC","0") :hidden;
GRIBEX_boustrophedonic = getenv("ECCODES_GRIBEX_BOUSTROPHEDONIC","0") :hidden;
constant zero=0 : hidden;
constant one=1 : hidden;
@ -61,65 +61,65 @@ transient produceLargeConstantFields = 0 : hidden;
meta libraryVersion library_version() : hidden;
lookup[4] kindOfProduct (0,identifier) : hidden;
lookup[4] kindOfProduct (0,identifier) : hidden;
# grib templates
# `ABCD` is a number, each letter being a byte
if(kindOfProduct == `GRIB`){
lookup[1] GRIBEditionNumber (7,editionNumber) : edition_specific ;
template GRIB "grib[GRIBEditionNumber:l]/boot.def" ;
lookup[1] GRIBEditionNumber (7,editionNumber) : edition_specific;
template GRIB "grib[GRIBEditionNumber:l]/boot.def" ;
}
if(kindOfProduct == `BUDG` ){
template BUDG "budg/boot.def" ;
template BUDG "budg/boot.def" ;
}
if(kindOfProduct == `DIAG`){
template DIAG "diag/boot.def" ;
template DIAG "diag/boot.def" ;
}
if(kindOfProduct == `TIDE`){
template TIDE "tide/boot.def" ;
template TIDE "tide/boot.def" ;
}
if(kindOfProduct == `BUFR`){
template BUFR "bufr/boot.def" ;
#constant BUFRstr="BUFR"; #ECC-742
template BUFR "bufr/boot.def" ;
#constant BUFRstr="BUFR"; #ECC-742
#alias identifier=BUFRstr;
}
if(kindOfProduct == `CDFX`){
template CDF "cdf/boot.def" ;
constant CDFstr="netCDF";
template CDF "cdf/boot.def" ;
constant CDFstr="netCDF";
alias ls.identifier=CDFstr;
}
if(kindOfProduct == 17632522 ){
template GTS "gts/boot.def" ;
template GTS "gts/boot.def" ;
constant GTSstr="GTS";
alias ls.identifier=GTSstr;
}
if(kindOfProduct == `META` ){
template METAR "metar/boot.def" ;
template METAR "metar/boot.def" ;
constant METARstr="METAR";
alias identifier=METARstr;
}
if(kindOfProduct == `TAF ` ){
template TAF "taf/boot.def" ;
template TAF "taf/boot.def" ;
constant TAFstr="TAF";
alias ls.identifier=TAFstr;
}
if(kindOfProduct == 2303214662){
template HDF5 "hdf5/boot.def" ;
constant HDF5str="HDF5";
template HDF5 "hdf5/boot.def" ;
constant HDF5str="HDF5";
alias ls.identifier=HDF5str;
}
if(kindOfProduct == `WRAP`){
template WRAP "wrap/boot.def" ;
constant WRAPstr="WRAP";
template WRAP "wrap/boot.def" ;
constant WRAPstr="WRAP";
alias ls.identifier=WRAPstr;
}

View File

@ -51,7 +51,7 @@ unsigned[2] numberOfSubsets : dump;
alias ls.numberOfSubsets=numberOfSubsets;
if (section2Present && bufrHeaderCentre==98 && section2Length==52) {
if ( rdbType == 2 || rdbType == 3 || rdbType == 8 || rdbType == 12 ) {
if ( rdbType == 2 || rdbType == 3 || rdbType == 8 || rdbType == 12 || rdbType == 30 ) {
transient isSatelliteType=1;
} else {
transient isSatelliteType=0;

View File

@ -2,19 +2,26 @@
0 0 WMO Secretariat
1 ammc Melbourne (WMC)
2 2 Melbourne (WMC)
3 3 Melbourne (WMC)
4 rums Moscow (WMC)
5 5 Moscow (WMC)
6 6 Moscow (WMC)
7 kwbc US National Weather Service - NCEP (WMC)
8 8 US National Weather Service - NWSTG (WMC)
9 9 US National Weather Service - Other (WMC)
10 10 Cairo (RSMC/RAFC)
11 11 Cairo (RSMC/RAFC)
12 12 Dakar (RSMC/RAFC)
13 13 Dakar (RSMC/RAFC)
14 14 Nairobi (RSMC/RAFC)
16 16 Atananarivo (RSMC)
15 15 Nairobi (RSMC/RAFC)
16 16 Casablanca (RSMC)
17 17 Tunis (RSMC)
18 18 Tunis-Casablanca (RSMC)
20 20 Las Palmas (RAFC)
21 21 Algiers (RSMC)
22 22 Lagos (RSMC)
22 22 ACMAD
23 23 Mozambique (NMC)
24 fapr Pretoria (RSMC)
26 26 Khabarovsk (RSMC)
28 vabb New Delhi (IMD)
@ -23,27 +30,38 @@
32 32 Tashkent (RSMC)
33 33 Jeddah (RSMC)
34 rjtd Japanese Meteorological Agency - Tokyo (RSMC)
36 36 Bankok
37 37 Ulan Bator
36 36 Bangkok
37 37 Ulaanbaatar
38 babj Beijing (RSMC)
40 rksl Seoul
41 sabm Buenos Aires (RSMC/RAFC)
43 43 Brasilia (RSMC/RAFC)
45 45 Santiago
46 sbsj Brasilian Space Agency - INPE
47 47 Colombia (NMC)
48 48 Ecuador (NMC)
49 49 Peru (NMC)
50 50 Venezuela (Bolivarian Republic of) (NMC)
51 51 Miami (RSMC/RAFC)
52 52 National Hurricane Center, Miami
53 53 Canadian Meteorological Service - Montreal (RSMC)
54 cwao Canadian Meteorological Service - Montreal (RSMC)
55 55 San Francisco
56 56 ARINC Centre
57 57 U.S. Air Force - Global Weather Center
58 fnmo US Navy - Fleet Numerical Oceanography Center
59 59 NOAA Forecast Systems Lab, Boulder CO
60 60 National Center for Atmospheric Research (NCAR), Boulder, CO
61 61 Service ARGOS - Landover
62 62 US Naval Oceanographic Office
63 63 International Research Institute for Climate and Society (IRI)
64 64 Honolulu
65 65 Darwin (RSMC)
67 67 Melbourne (RSMC)
69 nzkl Wellington (RSMC/RAFC)
71 71 Nadi (RSMC)
72 72 Singapore
73 73 Malaysia (NMC)
74 egrr U.K. Met Office - Exeter
76 76 Moscow (RSMC/RAFC)
78 edzw Offenbach (RSMC)
@ -65,9 +83,34 @@
97 97 European Space Agency (ESA)
98 ecmf European Centre for Medium-Range Weather Forecasts
99 99 DeBilt, Netherlands
100 100 Brazzaville
101 101 Abidjan
102 102 Libya (NMC)
103 103 Madagascar (NMC)
104 104 Mauritius (NMC)
105 105 Niger (NMC)
106 106 Seychelles (NMC)
107 107 Uganda (NMC)
108 108 United Republic of Tanzania (NMC)
109 109 Zimbabwe (NMC)
110 110 Hong-Kong
145 145 French Guiana
146 146 Brazilian Navy Hydrographic Centre
147 147 National Commission on Space Activities (CONAE) - Argentina
148 148 Brazilian Department of Airspace Control - DECEA
160 160 US NOAA/NESDIS
161 161 US NOAA Office of Oceanic and Atmospheric Research
173 nasa US National Aeronautics and Space Administration (NASA)
174 174 Integrated Science Data Management/Marine Environmental Data Service (ISDM/MEDS - Canada)
175 175 University Corporation for Atmospheric Research (UCAR) - United States
176 176 Cooperative Institute for Meteorological Satellite Studies (CIMSS) - United States
177 177 NOAA National Ocean Service - United States
178 178 Spire Global, Inc.
179 179 GeoOptics, Inc.
180 180 PlanetiQ
181 181 Atmospheric and Environmental Research (AER)
195 wiix Indonesia (NMC)
204 niwa National Institute of Water and Atmospheric Research (NIWA - New Zealand)
210 210 Frascati (ESA/ESRIN)
@ -85,6 +128,8 @@
222 222 Albania (NMC)
223 223 Armenia (NMC)
224 lowm Austria
225 225 Azerbaijan (NMC)
226 226 Belarus (NMC)
227 ebum Belgium (NMC)
228 228 Bosnia and Herzegovina (NMC)
229 229 Bulgaria (NMC)
@ -94,6 +139,7 @@
233 eidb Dublin
234 234 Israel (NMC)
235 ingv INGV
238 238 Lithuania (NMC)
239 crfc CERFAX
240 240 Malta (NMC)
241 241 Monaco

View File

@ -89,7 +89,7 @@ if (horizontalCoordinateDefinition == 0) {
{
meta coordinateIndexNumber evaluate(coordinate4Flag+coordinate3Flag);
# levelist latitude longitude
# levelist latitude longitude
if (coordinateIndexNumber== 3) {
meta marsLatitude divdouble( coordinate1Start,1000000);
meta marsLongitude divdouble( coordinate2Start,1000000);
@ -145,15 +145,15 @@ if (horizontalCoordinateDefinition == 0) {
alias mars.range = marsRange;
}
}
# product
alias mars.product = coordAveragingTims;
# date
if (marsType == TYPE_OR && averaging1Flag == P_INST) {
#remove mars.date;
alias mars.date = verificationDate;
#remove mars.step;
constant stepZero = 0;
alias mars.step =stepZero;
}
# product
alias mars.product = coordAveragingTims;
# date
if (marsType == TYPE_OR && averaging1Flag == P_INST) {
#remove mars.date;
alias mars.date = verificationDate;
#remove mars.step;
constant stepZero = 0;
alias mars.step =stepZero;
}
}
}

View File

@ -16,9 +16,9 @@ constant tablesVersionLatest = 32 : edition_specific;
constant false = 0 : hidden;
constant true = 1 : hidden;
constant million = 1000000 : hidden;
constant grib2divider = 1000000;
alias extraDimensionPresent=zero;
transient angleSubdivisions=grib2divider; # micro degrees
constant grib2divider = 1000000;
alias extraDimensionPresent = zero;
transient angleSubdivisions = grib2divider; # micro degrees
transient forceStepUnits = 255 : hidden;
meta gts_header gts_header() : no_copy,hidden,read_only;
@ -26,8 +26,8 @@ meta gts_TTAAii gts_header(20,6) : no_copy,hidden,read_only;
meta gts_CCCC gts_header(27,4) : no_copy,hidden,read_only;
meta gts_ddhh00 gts_header(32,6) : no_copy,hidden,read_only;
transient missingValue = 9999;
constant ieeeFloats = 1 : edition_specific;
transient missingValue = 9999;
constant ieeeFloats = 1 : edition_specific;
constant isHindcast = 0;
include "grib2/section.0.def"
@ -43,3 +43,13 @@ template core "grib2/sections.def";
#}
template section_8 "grib2/section.8.def";
# ECC-1779: Add keys to identify experimental and deprecated templates
# The low-level transient keys template_is_XXX
# are set inside the template definition files
concept isTemplateDeprecated(false) {
1 = { template_is_deprecated = 1; }
}
concept isTemplateExperimental(false) {
1 = { template_is_experimental = 1; }
}

View File

@ -3786,6 +3786,22 @@
typeOfFirstFixedSurface = 187 ;
typeOfSecondFixedSurface = 185 ;
}
#Convective snowfall water equivalent
'csfwe' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 55 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Large-scale snowfall water equivalent
'lsfwe' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 56 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Burned area
'fba' = {
discipline = 2 ;

View File

@ -2,4 +2,5 @@
1 CMIP6 Coupled Model Intercomparison Project Phase 6
2 ScenarioMIP Scenario Model Intercomparison Project
3 HighResMIP High Resolution Model Intercomparison Project
4 story-nudging Climate storylines by nudging to reanalysis
65535 65535 Missing

View File

@ -7,4 +7,8 @@
6 SSP2-4.5 Shared Socio-economic Pathways 2-4.5
7 SSP3-7.0 Shared Socio-economic Pathways 3-7.0
8 SSP5-8.5 Shared Socio-economic Pathways 5-8.5
9 Tplus1.5K Warmer world at 1.5 degrees K above pre-industrial temperatures
10 Tplus2.0K Warmer world at 2.0 degrees K above pre-industrial temperatures
11 Tplus3.0K Warmer world at 3.0 degrees K above pre-industrial temperatures
12 Tplus4.0K Warmer world at 4.0 degrees K above pre-industrial temperatures
65535 65535 Missing

View File

@ -21,6 +21,7 @@
39 39 4DVar model errors for long window 4Dvar system
41 41 The Flood Awareness System
42 42 Lead Centre for Wave Forecast Verification
43 43 EERIE project MARS labelling
60 60 Ocean data analysis date and analysis time
192 192 Multiple ECMWF local definitions
300 300 Multi-dimensional parameters (deprecated)

View File

@ -1,4 +1,6 @@
# Local Definition 28 - COSMO local area EPS
# (C) Copyright 2005- ECMWF.
# Local definition 28 - COSMO local area EPS
unsigned[4] baseDateEPS : dump;
unsigned[2] baseTimeEPS : dump;

View File

@ -1,6 +1,6 @@
# (C) Copyright 2005- ECMWF.
# Definition 42 - WMO Lead Centre for Wave Forecast Verification (LC-WFV)
# Local definition 42 - WMO Lead Centre for Wave Forecast Verification (LC-WFV)
codetable[2] lcwfvSuiteName "grib2/lcwfv_suiteName.table" : dump;
alias mars.origin = lcwfvSuiteName;

View File

@ -0,0 +1,21 @@
# (C) Copyright 2005- ECMWF.
# Local definition 43 - Class ed EERIE project climate keywords
# CMIP related activity keyword
codetable[2] activity "grib2/destine_activity.table" ;
alias mars.activity = activity;
# CMIP related experiment keyword
codetable[2] experiment "grib2/destine_experiment.table" ;
alias mars.experiment = experiment;
# Climate run realization keyword, which relates to an initial condition perturbation
unsigned[1] realization = 255 ;
alias mars.realization = realization;
# Remove mars domain from this data
unalias mars.domain;
# Add some padding just in case we want more keys in the future
pad padding_loc43(30);

View File

@ -0,0 +1,53 @@
# Automatically generated by ./create_def.pl, do not edit
#Snow depth
'lwe_thickness_of_surface_snow_amount' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 254 ;
}
#Large-scale precipitation
'lwe_thickness_of_stratiform_precipitation_amount' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Convective precipitation
'lwe_thickness_of_convective_precipitation_amount' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snowfall
'lwe_thickness_of_snowfall_amount' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Total cloud cover
'cloud_area_fraction' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Evaporation
'lwe_thickness_of_water_evaporation_amount' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}

View File

@ -1,4 +1,106 @@
# Automatically generated by ./create_def.pl, do not edit
#Surface runoff
'sro' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Sub-surface runoff
'ssro' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snow depth
'sd' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 254 ;
}
#Large-scale precipitation
'lsp' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Convective precipitation
'cp' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snowfall
'sf' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Total cloud cover
'tcc' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Evaporation
'e' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Low cloud cover
'lcc' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 193 ;
}
#Runoff
'ro' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 201 ;
typeOfStatisticalProcessing = 1 ;
}
#Total precipitation
'tp' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Forecast albedo
'fal' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 193 ;
}
#Mean surface runoff rate
'msror' = {
localTablesVersion = 1 ;
@ -17,6 +119,15 @@
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 0 ;
}
#Potential evaporation
'pev' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Mean total snowfall rate
'mtsfr' = {
localTablesVersion = 1 ;

View File

@ -1,4 +1,106 @@
# Automatically generated by ./create_def.pl, do not edit
#Surface runoff
'Surface runoff' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Sub-surface runoff
'Sub-surface runoff' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snow depth
'Snow depth' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 254 ;
}
#Large-scale precipitation
'Large-scale precipitation' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Convective precipitation
'Convective precipitation' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snowfall
'Snowfall' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Total cloud cover
'Total cloud cover' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Evaporation
'Evaporation' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Low cloud cover
'Low cloud cover' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 193 ;
}
#Runoff
'Runoff' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 201 ;
typeOfStatisticalProcessing = 1 ;
}
#Total precipitation
'Total precipitation' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Forecast albedo
'Forecast albedo' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 193 ;
}
#Mean surface runoff rate
'Mean surface runoff rate' = {
localTablesVersion = 1 ;
@ -17,6 +119,15 @@
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 0 ;
}
#Potential evaporation
'Potential evaporation' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Mean total snowfall rate
'Mean total snowfall rate' = {
localTablesVersion = 1 ;

View File

@ -1,4 +1,106 @@
# Automatically generated by ./create_def.pl, do not edit
#Surface runoff
'8' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Sub-surface runoff
'9' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snow depth
'141' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 254 ;
}
#Large-scale precipitation
'142' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Convective precipitation
'143' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snowfall
'144' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Total cloud cover
'164' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Evaporation
'182' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Low cloud cover
'186' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 193 ;
}
#Runoff
'205' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 201 ;
typeOfStatisticalProcessing = 1 ;
}
#Total precipitation
'228' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Forecast albedo
'243' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 193 ;
}
#Mean surface runoff rate
'172008' = {
localTablesVersion = 1 ;
@ -17,6 +119,15 @@
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 0 ;
}
#Potential evaporation
'228251' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Mean total snowfall rate
'172144' = {
localTablesVersion = 1 ;

View File

@ -1,4 +1,106 @@
# Automatically generated by ./create_def.pl, do not edit
#Surface runoff
'sro' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Sub-surface runoff
'ssro' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snow depth
'sd' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 254 ;
}
#Large-scale precipitation
'lsp' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Convective precipitation
'cp' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snowfall
'sf' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Total cloud cover
'tcc' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Evaporation
'e' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Low cloud cover
'lcc' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 193 ;
}
#Runoff
'ro' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 201 ;
typeOfStatisticalProcessing = 1 ;
}
#Total precipitation
'tp' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Forecast albedo
'fal' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 193 ;
}
#Mean surface runoff rate
'msror' = {
localTablesVersion = 1 ;
@ -17,6 +119,15 @@
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 0 ;
}
#Potential evaporation
'pev' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Mean total snowfall rate
'mtsfr' = {
localTablesVersion = 1 ;

View File

@ -1,4 +1,106 @@
# Automatically generated by ./create_def.pl, do not edit
#Surface runoff
'm' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Sub-surface runoff
'm' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snow depth
'm of water equivalent' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 254 ;
}
#Large-scale precipitation
'm' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Convective precipitation
'm' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snowfall
'm of water equivalent' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Total cloud cover
'(0 - 1)' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Evaporation
'm of water equivalent' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Low cloud cover
'(0 - 1)' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 193 ;
}
#Runoff
'm' = {
localTablesVersion = 1 ;
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 201 ;
typeOfStatisticalProcessing = 1 ;
}
#Total precipitation
'm' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Forecast albedo
'(0 - 1)' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 193 ;
}
#Mean surface runoff rate
'm s**-1' = {
localTablesVersion = 1 ;
@ -17,6 +119,15 @@
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 0 ;
}
#Potential evaporation
'm' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Mean total snowfall rate
'm of water equivalent s**-1' = {
localTablesVersion = 1 ;

View File

@ -182,4 +182,11 @@
scaledValueOfSecondFixedSurface = missing() ;
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Snow depth water equivalent
'sd' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 60 ;
typeOfStatisticalProcessing = 0 ;
}

View File

@ -182,4 +182,11 @@
scaledValueOfSecondFixedSurface = missing() ;
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Snow depth water equivalent
'Snow depth water equivalent' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 60 ;
typeOfStatisticalProcessing = 0 ;
}

View File

@ -182,4 +182,11 @@
scaledValueOfSecondFixedSurface = missing() ;
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Snow depth water equivalent
'228141' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 60 ;
typeOfStatisticalProcessing = 0 ;
}

View File

@ -182,4 +182,11 @@
scaledValueOfSecondFixedSurface = missing() ;
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Snow depth water equivalent
'sd' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 60 ;
typeOfStatisticalProcessing = 0 ;
}

View File

@ -182,4 +182,11 @@
scaledValueOfSecondFixedSurface = missing() ;
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Snow depth water equivalent
'kg m**-2' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 60 ;
typeOfStatisticalProcessing = 0 ;
}

View File

@ -3786,6 +3786,22 @@
typeOfFirstFixedSurface = 187 ;
typeOfSecondFixedSurface = 185 ;
}
#Convective snowfall water equivalent
'Convective snowfall water equivalent' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 55 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Large-scale snowfall water equivalent
'Large-scale snowfall water equivalent' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 56 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Burned area
'Burned area' = {
discipline = 2 ;

View File

@ -3786,6 +3786,22 @@
typeOfFirstFixedSurface = 187 ;
typeOfSecondFixedSurface = 185 ;
}
#Convective snowfall water equivalent
'231057' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 55 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Large-scale snowfall water equivalent
'231058' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 56 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Burned area
'232000' = {
discipline = 2 ;

View File

@ -3786,6 +3786,22 @@
typeOfFirstFixedSurface = 187 ;
typeOfSecondFixedSurface = 185 ;
}
#Convective snowfall water equivalent
'csfwe' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 55 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Large-scale snowfall water equivalent
'lsfwe' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 56 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Burned area
'fba' = {
discipline = 2 ;

View File

@ -4,7 +4,8 @@
# template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def";
# codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy;
meta stepUnits optimal_step_units(forecastTime,indicatorOfUnitOfTimeRange,lengthOfTimeRange,indicatorOfUnitForTimeRange) : transient,dump;
# See ECC-1768 re why no_copy is needed
meta stepUnits optimal_step_units(forecastTime,indicatorOfUnitOfTimeRange,lengthOfTimeRange,indicatorOfUnitForTimeRange) : dump,no_copy;
transient startStepUnit = 255 : hidden; # 255 means MISSING. See code table 4.4
transient endStepUnit = 255 : hidden;
# The lowercase version is to unify it with the helper key in the MARS language

View File

@ -1,7 +1,7 @@
# Code table 4.2 - discipline=0 category=1 for ECMWF
192 192 Snow evaporation rate (kg m-2 s-1)
193 193 Total precipitation rate (m s-1)
194 194 Accumulated freezing rain (m)
194 194 Freezing rain precipitation rate (m s-1)
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)

View File

@ -1,6 +1,11 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 3.1000, Cross-section grid, with points equally spaced on the horizontal
# This template is simply experimental, was not validated at the time of publication
# and should be used only for bilateral previously agreed tests
transient template_is_experimental = 1 : hidden ;
include "grib2/template.3.shape_of_the_earth.def"
constant isGridded = true;

View File

@ -1,6 +1,11 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 3.1100, Hovmoller diagram grid with points equally spaced on the horizontal
# This template is simply experimental, was not validated at the time of publication
# and should be used only for bilateral previously agreed tests
transient template_is_experimental = 1 : hidden;
include "grib2/template.3.shape_of_the_earth.def"
constant isGridded = true;

View File

@ -1,6 +1,10 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 3.1200, Time section grid
# This template is simply experimental, was not validated at the time of publication
# and should be used only for bilateral previously agreed tests
transient template_is_experimental = 1 : hidden;
constant isGridded = true;
# NT - Number of time steps

View File

@ -62,12 +62,12 @@ include "grib2/template.3.scanning_mode.def"
# Latin 1 - first latitude from the pole at which the secant cone cuts the sphere
signed[4] Latin1 : edition_specific;
alias FirstLatitude=Latin1;
alias firstLatitude=Latin1;
meta geography.Latin1InDegrees scale(Latin1,one,grib2divider,truncateDegrees) : dump;
# Latin 2 - second latitude from the pole at which the secant cone cuts the sphere
signed[4] Latin2 : dump;
alias SecondLatitude=Latin2;
alias secondLatitude=Latin2;
meta geography.Latin2InDegrees scale(Latin2,one,grib2divider,truncateDegrees) : dump;
# Latitude of the southern pole of projection

View File

@ -38,12 +38,12 @@ flags[1] projectionCentreFlag 'grib2/tables/[tablesVersion]/3.5.table' : dump;
# Latin 1 - first latitude from the pole at which the secant cone cuts the sphere
signed[4] Latin1 : edition_specific;
alias FirstLatitude=Latin1;
alias firstLatitude=Latin1;
meta geography.Latin1InDegrees scale(Latin1,one,grib2divider,truncateDegrees) : dump;
# Latin 2 - second latitude from the pole at which the secant cone cuts the sphere
signed[4] Latin2 : dump;
alias SecondLatitude=Latin2;
alias secondLatitude=Latin2;
meta geography.Latin2InDegrees scale(Latin2,one,grib2divider,truncateDegrees) : dump;
# Latitude of the southern pole of projection

View File

@ -27,7 +27,7 @@ concept orderingConvention(unknown) {
"ring" = { ordering = 0; }
"nested" = { ordering = 1; }
} : dump;
alias geography.pointsOrdering = orderingConvention;
alias geography.orderingConvention = orderingConvention;
flags[1] scanningMode 'grib2/tables/[tablesVersion]/3.13.table';
flagbit iScansNegatively(scanningMode,7) : dump; # WMO bit 1

View File

@ -73,12 +73,12 @@ _if (shapeOfTheEarth == 3){
# ECC-979
# The 'scale' accessor works with integers so rounds its first argument
# which is not what we want because the inputs are doubles with decimal
# expansions. So use the trick of dividing by 0.001 to multiply by 1000
# expansions.
#
# meta earthMajorAxisInMetres scale(earthMajorAxis, thousand, one, zero);
# meta earthMinorAxisInMetres scale(earthMinorAxis, thousand, one, zero);
meta earthMajorAxisInMetres divdouble(earthMajorAxis, 0.001);
meta earthMinorAxisInMetres divdouble(earthMinorAxis, 0.001);
meta earthMajorAxisInMetres multdouble(earthMajorAxis, 1000);
meta earthMinorAxisInMetres multdouble(earthMinorAxis, 1000);
}
_if (shapeOfTheEarth == 7){
# Major and minor axes specified (in m) by data producer

View File

@ -2,6 +2,9 @@
# TEMPLATE 4.10, Percentile forecasts at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval
# This template was not validated at the time of publication and should be used with caution.
transient template_is_experimental = 1 : hidden;
include "grib2/template.4.parameter.def"
include "grib2/template.4.generating_process.def"
include "grib2/template.4.forecast_time.def"

View File

@ -1,6 +1,9 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 4.1000, Cross section of analysis and forecast at a point in time
# This template is experimental, was not validated at the time of publication
# and should be used only for bilateral previously agreed tests
transient template_is_experimental = 1 : hidden;
include "grib2/template.4.parameter.def"
include "grib2/template.4.generating_process.def"

View File

@ -1,6 +1,9 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 4.1001, Cross section of averaged or otherwise statistically processed analysis or forecast over a range of time
# This template is experimental, was not validated at the time of publication
# and should be used only for bilateral previously agreed tests
transient template_is_experimental = 1 : hidden;
include "grib2/template.4.parameter.def"
include "grib2/template.4.generating_process.def"

View File

@ -1,6 +1,9 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 4.1100, Hovmoller-type grid with no averaging or other statistical processing
# This template is experimental, was not validated at the time of publication
# and should be used only for bilateral previously agreed tests
transient template_is_experimental = 1 : hidden;
include "grib2/template.4.parameter.def"
include "grib2/template.4.generating_process.def"

View File

@ -2,8 +2,27 @@
# TEMPLATE 4.1101, Hovmoller-type grid with averaging or other statistical processing
# This template is experimental, was not validated at the time of publication and should be used only for bilateral previously agreed tests.
# (Octets 35-50 are very similar to octets 43-58 of product definition template 4.8, but the meaning of some fields differs slightly)
transient template_is_experimental = 1 : hidden;
include "grib2/template.4.parameter.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.statistical.def"
unsigned[4] numberOfMissingInStatisticalProcess = 0 : edition_specific;
alias totalNumberOfDataValuesMissingInStatisticalProcess=numberOfMissingInStatisticalProcess;
codetable[1] typeOfStatisticalProcessing ('4.10.table',masterDir,localDir) : edition_specific;
codetable[1] typeOfTimeIncrement ('4.11.table',masterDir,localDir) = 2 : edition_specific;
alias typeOfTimeIncrementBetweenSuccessiveFieldsUsedInTheStatisticalProcessing=typeOfTimeIncrement;
codetable[1] indicatorOfUnitForTimeRange ('4.4.table',masterDir,localDir) =1 ;
unsigned[4] lengthOfTimeRange=0 ;
codetable[1] indicatorOfUnitForTimeIncrement ('4.4.table',masterDir,localDir)=255 ;
unsigned[4] timeIncrement=0 ;
alias timeIncrementBetweenSuccessiveFields=timeIncrement;
# include "grib2/template.4.statistical.def"

View File

@ -2,6 +2,7 @@
# TEMPLATE 4.44, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol
# It is recommended not to use this template. PDT 4.48 should be used instead with optical wave length range set to missing
transient template_is_deprecated = 1 : hidden;
# GRIB-530: Special case for aerosol thanks to WMO error

View File

@ -1,7 +1,9 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 4.83, Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval with source/sink
# Note: This template is deprecated. Template 4.84 should be used instead.
# It is recommended not to use this template. Product definition template 4.84 should be used instead because it contains an additional octet to specify the type of generating process
transient template_is_deprecated = 1 : hidden;
include "grib2/template.4.parameter.def"
include "grib2/template.4.aerosol.def"

View File

@ -8,3 +8,12 @@ signed[1] scaleFactorOfFirstWavelength : dump;
signed[4] scaledValueOfFirstWavelength : dump;
signed[1] scaleFactorOfSecondWavelength = missing(): can_be_missing,dump;
signed[4] scaledValueOfSecondWavelength = missing(): can_be_missing,dump;
meta firstWavelength from_scale_factor_scaled_value(scaleFactorOfFirstWavelength, scaledValueOfFirstWavelength);
meta secondWavelength from_scale_factor_scaled_value(scaleFactorOfSecondWavelength, scaledValueOfSecondWavelength);
alias firstWavelengthInMetres = firstWavelength;
alias secondWavelengthInMetres = secondWavelength;
constant billion = 1000000000 : hidden;
meta firstWavelengthInNanometres multdouble(firstWavelength, billion) : read_only;
meta secondWavelengthInNanometres multdouble(secondWavelength, billion) : read_only;

View File

@ -3,16 +3,20 @@
## Direction part
unsigned[2] waveDirectionNumber : dump;
alias mars.direction = waveDirectionNumber;
alias directionNumber = waveDirectionNumber;
unsigned[2] numberOfWaveDirections = 1 : dump;
alias totalNumberOfWaveDirections = numberOfWaveDirections;
alias numberOfDirections = totalNumberOfWaveDirections;
## Frequency part
unsigned[2] waveFrequencyNumber : dump;
alias mars.frequency = waveFrequencyNumber;
alias frequencyNumber = waveFrequencyNumber;
unsigned[2] numberOfWaveFrequencies = 1 : dump;
alias totalNumberOfWaveFrequencies = numberOfWaveFrequencies;
alias numberOfFrequencies = totalNumberOfWaveFrequencies;
constant waveLevType="sfc";
alias mars.levtype = waveLevType;

View File

@ -3,11 +3,15 @@
## Direction part
signed[1] scaleFactorOfWaveDirections : dump;
alias integerScalingFactorAppliedToDirections = scaleFactorOfWaveDirections;
alias directionScalingFactor = integerScalingFactorAppliedToDirections;
unsigned[4] scaledValuesOfWaveDirections[numberOfWaveDirections] : dump;
alias scaledDirections = scaledValuesOfWaveDirections ;
## Frequency part
signed[1] scaleFactorOfWaveFrequencies : dump;
alias integerScalingFactorAppliedToFrequencies = scaleFactorOfWaveFrequencies;
alias frequencyScalingFactor = integerScalingFactorAppliedToFrequencies;
unsigned[4] scaledValuesOfWaveFrequencies[numberOfWaveFrequencies] : dump;
alias scaledFrequencies = scaledValuesOfWaveFrequencies;

View File

@ -1,8 +1,9 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 5.1, Matrix values at grid point - simple packing
# Preliminary note:
# This template was not validated at the time of publication and should be used with caution
transient template_is_experimental = 1 : hidden;
include "grib2/template.5.packing.def"

View File

@ -2,8 +2,9 @@
# TEMPLATE 5.61, Grid point data - Simple packing with logarithmic preprocessing
# Note from WMO document:
# This template is experimental, was not validated at the time of publication and should be used only for bilateral previously agreed tests
transient template_is_experimental = 1 : hidden;
constant typeOfPreProcessing = 1;
include "grib2/template.5.packing.def"

View File

@ -1,6 +1,8 @@
# (C) Copyright 2005- ECMWF.
# TEMPLATE 7.1, Matrix values at grid point -simple packing
# TEMPLATE 7.1, Matrix values at grid point - simple packing
# This template was not validated at the time of publication and should be used with caution
transient template_is_experimental = 1 : hidden;
meta codedValues data_g2simple_packing(
section7Length,

View File

@ -6,13 +6,13 @@ if (bitsPerValue) {
meta groupWidths unsigned_bits(widthOfWidths,numberOfGroups) : read_only;
meta groupLengths unsigned_bits(widthOfLengths,numberOfGroups) : read_only;
meta firstOrderValues unsigned_bits(widthOfFirstOrderValues,numberOfGroups) : read_only;
meta countOfGroupLengths sum(groupLengths);
# meta countOfGroupLengths sum(groupLengths);
}
transient halfByte=0;
position offsetBeforeData;
if(bitmapPresent) {
if(bitmapPresent) {
meta codedValues data_g1second_order_general_extended_packing(
#simple_packing args
section7Length,
@ -49,7 +49,6 @@ if(bitmapPresent) {
widthOfSPD,
orderOfSPD,
numberOfPoints
): read_only;
alias data.packedValues = codedValues;
@ -91,7 +90,6 @@ if(bitmapPresent) {
widthOfSPD,
orderOfSPD,
numberOfPoints
) : dump;
alias codedValues=values;
alias data.packedValues = values;

View File

@ -5,12 +5,12 @@
meta groupWidths unsigned_bits(widthOfWidths,numberOfGroups) : read_only;
meta groupLengths unsigned_bits(widthOfLengths,numberOfGroups) : read_only;
meta firstOrderValues unsigned_bits(widthOfFirstOrderValues,numberOfGroups) : read_only;
meta countOfGroupLengths sum(groupLengths);
# meta countOfGroupLengths sum(groupLengths);
transient halfByte=0;
position offsetBeforeData;
if(bitmapPresent) {
if(bitmapPresent) {
meta codedValues data_g1second_order_general_extended_packing(
#simple_packing args
section7Length,
@ -47,7 +47,6 @@ if(bitmapPresent) {
widthOfSPD,
orderOfSPD,
numberOfPoints
): read_only;
alias data.packedValues = codedValues;
@ -96,8 +95,7 @@ if(bitmapPresent) {
widthOfSPD,
orderOfSPD,
numberOfPoints
) : dump;
) : dump;
meta values data_apply_boustrophedonic(codedValues,numberOfRows,numberOfColumns,numberOfPoints,pl) : dump;
@ -138,7 +136,6 @@ if(bitmapPresent) {
widthOfSPD,
orderOfSPD,
numberOfPoints
) : dump;
alias codedValues=values;
}

View File

@ -4,6 +4,7 @@
# Note from WMO document:
# This template is experimental, was not validated at the time of publication and should be used only for bilateral previously agreed tests
transient template_is_deprecated = 1 : hidden;
meta codedValues data_g2simple_packing_with_preprocessing(
section7Length,

View File

@ -3786,6 +3786,22 @@
typeOfFirstFixedSurface = 187 ;
typeOfSecondFixedSurface = 185 ;
}
#Convective snowfall water equivalent
'kg m**-2' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 55 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Large-scale snowfall water equivalent
'kg m**-2' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 56 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Burned area
'%' = {
discipline = 2 ;

View File

@ -73,12 +73,12 @@ _if (shapeOfTheEarth == 3){
# ECC-979
# The 'scale' accessor works with integers so rounds its first argument
# which is not what we want because the inputs are doubles with decimal
# expansions. So use the trick of dividing by 0.001 to multiply by 1000
# expansions.
#
# meta earthMajorAxisInMetres scale(earthMajorAxis, thousand, one, zero);
# meta earthMinorAxisInMetres scale(earthMinorAxis, thousand, one, zero);
meta earthMajorAxisInMetres divdouble(earthMajorAxis, 0.001);
meta earthMinorAxisInMetres divdouble(earthMinorAxis, 0.001);
meta earthMajorAxisInMetres multdouble(earthMajorAxis, 1000);
meta earthMinorAxisInMetres multdouble(earthMinorAxis, 1000);
}
_if (shapeOfTheEarth == 7){
# Major and minor axes specified (in m) by data producer

View File

@ -50,6 +50,7 @@
49 gh C3S Global hydrology
50 ci CERISE project
51 ai Operational AIFS
52 ed EERIE project
99 te Test
100 at Austria
101 be Belgium

View File

@ -1,8 +1,14 @@
alias mars.step = endStep;
if (levtype is "o2d" || levtype is "o3d") {
alias mars.step = stepRange;
} else {
alias mars.step = endStep;
}
if (class is "od") { alias mars.system = systemNumber; }
if (class is "me") { alias mars.system = systemNumber; }
if (class is "en") { alias mars.system = systemNumber; }
if (class is "c3") { alias mars.system = systemNumber; }
if (class is "ci") { alias mars.system = systemNumber; }
alias mars.number = perturbationNumber;
alias mars.method = methodNumber;
@ -17,3 +23,4 @@ if (centre == 80 && subCentre == 98 && class is "c3") {
}
if (class is "ci") { unalias mars.method; }

View File

@ -10,6 +10,7 @@ if (class is "od") { alias mars.system = systemNumber; }
if (class is "me") { alias mars.system = systemNumber; }
if (class is "en") { alias mars.system = systemNumber; }
if (class is "c3") { alias mars.system = systemNumber; }
if (class is "ci") { alias mars.system = systemNumber; }
# See ECC-624
if (centre == 80 && subCentre == 98 && class is "c3") {

View File

@ -68,7 +68,7 @@ int main(int argc, char* argv[])
CODES_CHECK(codes_get_message(clone_handle, &buffer, &size), 0);
/* write the buffer to a file */
if (fwrite(buffer, 1, size, out) != size) {
perror(argv[1]);
perror(argv[2]);
return 1;
}
codes_handle_delete(clone_handle);

View File

@ -30,12 +30,12 @@ int main(int argc, char** argv)
codes_handle* h = NULL;
int mcount = 0;
/* turn off support for GRIB2 multi-field messages */
codes_grib_multi_support_off(NULL);
/* turn on support for GRIB2 multi-field messages */
codes_grib_multi_support_on(NULL);
/* turn off support for GRIB2 multi-field messages */
/* codes_multi_support_off(NULL); */
in = fopen(filename, "rb");
if (!in) {
fprintf(stderr, "Error: unable to open file %s\n", filename);

View File

@ -72,7 +72,7 @@ int main(int argc, char** argv)
}
/* open output file */
of = fopen(ofilename, "w");
of = fopen(ofilename, "wb");
if (!of) {
fprintf(stderr, "ERROR: unable to open output file %s\n", ofilename);
exit(1);

View File

@ -9,20 +9,20 @@
. ./include.ctest.sh
#if [ ! -f "${data_dir}/sample.grib2" ]
#then
# echo SKIP: $0
# exit
#fi
label="grib_multi_write_c"
tempGrib=temp.$label.grib
tempText=temp.$label.txt
${examples_dir}/c_grib_multi_write ${data_dir}/sample.grib2 ${data_dir}/multi_sample.grib2 > /dev/null
${examples_dir}/c_grib_multi_write ${data_dir}/sample.grib2 $tempGrib > /dev/null
${tools_dir}/grib_get -p step ${data_dir}/multi_sample.grib2 > ${data_dir}/multi_step.test
${tools_dir}/grib_get -p step $tempGrib > $tempText
diff ${data_dir}/multi_step.test ${data_dir}/multi_step.txt
step=`${tools_dir}/grib_get -M -p step ${data_dir}/multi_sample.grib2`
reference=${data_dir}/multi_step.txt
diff $reference $tempText
# -M = Turn multi-field support off
step=`${tools_dir}/grib_get -M -p step $tempGrib`
[ $step -eq 12 ]
rm -f ${data_dir}/multi_sample.grib2 ${data_dir}/multi_step.test
# Clean up
rm -f $tempGrib $tempText

View File

@ -116,7 +116,7 @@ int main(int argc, char** argv)
/* write the buffer in a file*/
if (fwrite(buffer, 1, size, out) != size) {
perror(argv[1]);
perror(outfile);
exit(1);
}

View File

@ -78,7 +78,7 @@ int main(int argc, char** argv)
/* write the buffer in a file*/
if (fwrite(buffer, 1, size, out) != size) {
perror(argv[1]);
perror(outfile);
exit(1);
}

View File

@ -77,7 +77,7 @@ int main(int argc, char** argv)
/* write the buffer in a file*/
if (fwrite(buffer, 1, size, out) != size) {
perror(argv[1]);
perror(outfile);
exit(1);
}

View File

@ -78,7 +78,7 @@ int main(int argc, char** argv)
/* write the buffer in a file*/
if (fwrite(buffer, 1, size, out) != size) {
perror(argv[1]);
perror(outfile);
exit(1);
}

View File

@ -56,7 +56,6 @@ if( HAVE_BUILD_TOOLS )
grib_clone
grib_ecc-1316
bufr_attributes
bufr_copy_data
bufr_clone
bufr_expanded
bufr_get_keys
@ -130,6 +129,12 @@ foreach( atest ${tests_sanity} )
RESOURCES bufr_read_scatterometer_f.ref
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${atest}.sh )
endforeach()
if( HAVE_BUILD_TOOLS AND NOT CMAKE_CXX_COMPILER_ID MATCHES NVHPC )
# Test which fails on Leonardo
list( APPEND tests_extra bufr_copy_data )
endif()
foreach( atest ${tests_extra} )
ecbuild_add_test( TARGET eccodes_f_${atest}
SOURCES ${atest}.f90

View File

@ -18,7 +18,6 @@ program operator_3_test
call codes_bufr_new_from_samples(ibufr,'BUFR4',iret)
if (iret /= CODES_SUCCESS) then
print *,'ERROR creating BUFR from BUFR4'
stop 1
endif

View File

@ -22,7 +22,6 @@ program bufr_encode
call codes_bufr_new_from_samples(ibufr,'BUFR4',iret)
if (iret/=CODES_SUCCESS) then
print *,'ERROR creating BUFR from BUFR4'
stop 1
endif
call codes_set(ibufr,'masterTableNumber',0)

View File

@ -25,9 +25,9 @@ program bufr_read_tempf
integer :: ibufr
integer :: i, count = 0
integer :: iflag
integer :: status_id, status_ht, status_time = 0, status_p
integer :: status_airt, status_dewt
integer :: status_rsno, status_rssoft, status_balloonwt
integer :: status_id, status_bl, status_num, status_ht, status_time = 0, status_p
integer :: status_airt, status_dewt, status_wdir, status_wsp
integer :: status_rsno, status_rssoft, status_balloonwt, statid_missing
integer(kind=4) :: sizews
integer(kind=4) :: blockNumber, stationNumber
integer(kind=4) :: ymd, hms
@ -74,9 +74,10 @@ program bufr_read_tempf
IF (status_id /= CODES_SUCCESS) statid = dropid
! call codes_is_missing(ibufr, 'shipOrMobileLandStationIdentifier', statid_missing)
! IF (statid_missing == 1) statid = "MISSING"
call codes_get(ibufr, 'blockNumber', blockNumber)
call codes_get(ibufr, 'stationNumber', stationNumber)
IF (blockNumber <= 99.0 .AND. stationNumber <= 1000) write (statid, '(I2.2,I3.3,3X)') blockNumber, stationNumber
blockNumber = 9999
call codes_get(ibufr, 'blockNumber', blockNumber, status_bl)
call codes_get(ibufr, 'stationNumber', stationNumber, status_num)
IF (blockNumber <= 99 .AND. stationNumber <= 1000) write (statid, '(I2.2,I3.3,3X)') blockNumber, stationNumber
call codes_get(ibufr, 'year', year)
call codes_get(ibufr, 'month', month)
@ -118,8 +119,8 @@ program bufr_read_tempf
call codes_get(ibufr, 'extendedVerticalSoundingSignificance', vssVal)
call codes_get(ibufr, 'airTemperature', tVal, status_airt)
call codes_get(ibufr, 'dewpointTemperature', tdVal, status_dewt)
call codes_get(ibufr, 'windDirection', wdirVal)
call codes_get(ibufr, 'windSpeed', wspVal)
call codes_get(ibufr, 'windDirection', wdirVal, status_wdir)
call codes_get(ibufr, 'windSpeed', wspVal, status_wsp)
! ---- Array sizes (pressure size can be larger - wind shear levels)
sizews = size(wspVal)
@ -140,13 +141,21 @@ program bufr_read_tempf
allocate(tdVal(sizews))
tdVal(:) = -999999999.0
END IF
IF (status_wdir /= CODES_SUCCESS) THEN
allocate(wdirVal(sizews))
wdirVal(:) = -999999999.0
END IF
IF (status_wsp /= CODES_SUCCESS) THEN
allocate(wspVal(sizews))
wspVal(:) = -999999999.0
END IF
! ---- Print the values --------------------------------
write (*, '(A,I7,A,A8,I9,I7.6,F9.3,F10.3,2F7.1,I4,I5)') 'Ob: ', count, &
' ', statid, ymd, hms, lat(1), lon(1), htg, htp, INT(sondeType), sizews
IF (status_rsno == CODES_SUCCESS) write (*, '(A,A,A,F7.3)') &
'RS number/software/balloonwt: ', rsnumber, rssoftware, balloonwt
IF (status_ht == CODES_SUCCESS .AND. SIZE(lat) > 1) write (*, '(A,A,F9.3,F10.3,F7.1)') &
IF (status_ht == CODES_SUCCESS .AND. SIZE(lat) > 1) write (*, '(A,A10,F9.3,F10.3,F7.1)') &
'WMO list lat, lon, ht: ', statid, lat(2), lon(2), htec
write (*, '(A)') 'level dtime dlat dlon pressure geopotH airTemp dewPtT windDir windSp signif'
do i = 1, sizews

View File

@ -1604,9 +1604,8 @@ int any_f_new_from_loaded_(int* msgid, int* gid)
/*****************************************************************************/
int codes_f_clear_loaded_from_file_(void)
{
grib_context* c = grib_context_get_default();
/* grib_oarray_delete_content(c,binary_messages); */
grib_oarray_delete(c, binary_messages);
grib_oarray_delete(grib_context_get_default(), binary_messages);
return GRIB_SUCCESS;
}
@ -1711,10 +1710,10 @@ int grib_f_headers_only_new_from_file_(int* fid, int* gid)
}
/*****************************************************************************/
int grib_f_new_from_index_(int* iid, int* gid)
int grib_f_new_from_index_(int* index_id, int* gid)
{
int err = 0;
grib_index* i = get_index(*iid);
grib_index* i = get_index(*index_id);
grib_handle *h = NULL;
if (i) {
@ -1757,16 +1756,15 @@ int grib_f_index_new_from_file_(char* file, char* keys, int* gid, int lfile, int
}
/*****************************************************************************/
int grib_f_index_add_file_(int* iid, char* file, int lfile)
int grib_f_index_add_file_(int* index_id, char* file, int lfile)
{
grib_index *i = get_index(*iid);
int err = GRIB_SUCCESS;
grib_index *i = get_index(*index_id);
char buf[1024];
if (!i) {
return GRIB_INVALID_INDEX;
} else {
err = grib_index_add_file(i,cast_char(buf,file,lfile));
int err = grib_index_add_file(i,cast_char(buf,file,lfile));
return err;
}
}
@ -1928,9 +1926,9 @@ int grib_f_get_size_long_(int* gid, char* key, long* val, int len)
}
/*****************************************************************************/
int grib_f_index_get_size_int_(int* gid, char* key, int* val, int len)
int grib_f_index_get_size_int_(int* index_id, char* key, int* val, int len)
{
grib_index *h = get_index(*gid);
grib_index *h = get_index(*index_id);
int err = GRIB_SUCCESS;
char buf[1024];
size_t tsize = 0;
@ -1944,19 +1942,18 @@ int grib_f_index_get_size_int_(int* gid, char* key, int* val, int len)
}
}
int grib_f_index_get_size_long_(int* gid, char* key, long* val, int len)
int grib_f_index_get_size_long_(int* index_id, char* key, long* val, int len)
{
grib_index *h = get_index(*gid);
int err = GRIB_SUCCESS;
grib_index *h = get_index(*index_id);
char buf[1024];
size_t tsize = 0;
if(!h){
if (!h){
return GRIB_INVALID_GRIB;
}else{
err = grib_index_get_size(h, cast_char(buf,key,len), &tsize);
} else{
int err = grib_index_get_size(h, cast_char(buf,key,len), &tsize);
*val = tsize;
return err;
return err;
}
}
@ -2063,9 +2060,9 @@ int grib_f_get_byte_array_(int* gid, char* key, unsigned char *val, int* size, i
}
/*****************************************************************************/
int grib_f_index_get_string_(int* gid, char* key, char* val, int *eachsize,int* size, int len)
int grib_f_index_get_string_(int* index_id, char* key, char* val, int *eachsize,int* size, int len)
{
grib_index *h = get_index(*gid);
grib_index *h = get_index(*index_id);
int err = GRIB_SUCCESS;
int i;
char buf[1024];
@ -2104,23 +2101,23 @@ int grib_f_index_get_string_(int* gid, char* key, char* val, int *eachsize,int*
}
/*****************************************************************************/
int grib_f_index_get_long_(int* gid, char* key, long *val, int* size, int len)
int grib_f_index_get_long_(int* index_id, char* key, long *val, int* size, int len)
{
grib_index *h = get_index(*gid);
int err = GRIB_SUCCESS;
int err = 0;
grib_index* h = get_index(*index_id);
char buf[1024];
size_t lsize = *size;
if(!h) return GRIB_INVALID_GRIB;
if (!h) return GRIB_INVALID_GRIB;
err = grib_index_get_long(h, cast_char(buf,key,len), val, &lsize);
*size = lsize;
return err;
return err;
}
/*****************************************************************************/
int grib_f_index_get_int_(int* gid, char* key, int *val, int* size, int len)
int grib_f_index_get_int_(int* index_id, char* key, int *val, int* size, int len)
{
grib_index *h = get_index(*gid);
grib_index *h = get_index(*index_id);
int err = GRIB_SUCCESS;
char buf[1024];
size_t lsize = *size, i = 0;
@ -2140,17 +2137,17 @@ int grib_f_index_get_int_(int* gid, char* key, int *val, int* size, int len)
}
/*****************************************************************************/
int grib_f_index_get_real8_(int* gid, char* key, double *val, int* size, int len)
int grib_f_index_get_real8_(int* index_id, char* key, double *val, int* size, int len)
{
grib_index *h = get_index(*gid);
int err = GRIB_SUCCESS;
int err = 0;
grib_index* h = get_index(*index_id);
char buf[1024];
size_t lsize = *size;
if(!h) return GRIB_INVALID_GRIB;
if (!h) return GRIB_INVALID_GRIB;
err = grib_index_get_double(h, cast_char(buf,key,len), val, &lsize);
*size = lsize;
return err;
return err;
}
/*****************************************************************************/
@ -2438,9 +2435,9 @@ int grib_f_set_real4_array_(int* gid, char* key, float* val, int* size, int len)
}
/*****************************************************************************/
int grib_f_index_select_real8_(int* gid, char* key, double* val, int len)
int grib_f_index_select_real8_(int* index_id, char* key, double* val, int len)
{
grib_index *h = get_index(*gid);
grib_index *h = get_index(*index_id);
char buf[1024];
if(!h) return GRIB_INVALID_GRIB;
@ -2448,9 +2445,9 @@ int grib_f_index_select_real8_(int* gid, char* key, double* val, int len)
}
/*****************************************************************************/
int grib_f_index_select_string_(int* gid, char* key, char* val, int len, int vallen)
int grib_f_index_select_string_(int* index_id, char* key, char* val, int len, int vallen)
{
grib_index *h = get_index(*gid);
grib_index *h = get_index(*index_id);
char buf[1024];
char bufval[1024];
@ -2465,9 +2462,9 @@ int grib_f_index_select_string_(int* gid, char* key, char* val, int len, int val
}
/*****************************************************************************/
int grib_f_index_select_int_(int* gid, char* key, int* val, int len)
int grib_f_index_select_int_(int* index_id, char* key, int* val, int len)
{
grib_index *h = get_index(*gid);
grib_index *h = get_index(*index_id);
long lval = *val;
char buf[1024] = {0,};
@ -2476,9 +2473,9 @@ int grib_f_index_select_int_(int* gid, char* key, int* val, int len)
}
/*****************************************************************************/
int grib_f_index_select_long_(int* gid, char* key, long* val, int len)
int grib_f_index_select_long_(int* index_id, char* key, long* val, int len)
{
grib_index *h = get_index(*gid);
grib_index *h = get_index(*index_id);
char buf[1024] = {0,};
if (!h) return GRIB_INVALID_GRIB;

Binary file not shown.

View File

@ -80,6 +80,7 @@ list( APPEND eccodes_src_files
grib_accessor_class_hash_array.cc
grib_accessor_class_decimal_precision.cc
grib_accessor_class_divdouble.cc
grib_accessor_class_multdouble.cc
grib_accessor_class_budgdate.cc
grib_accessor_class_validity_date.cc
grib_accessor_class_validity_time.cc

View File

@ -128,7 +128,7 @@ grib_concept_value* action_concept_get_concept(grib_accessor* a)
int action_concept_get_nofail(grib_accessor* a)
{
grib_action_concept* self = (grib_action_concept*)a->creator;
const grib_action_concept* self = (grib_action_concept*)a->creator;
return self->nofail;
}
@ -397,9 +397,9 @@ int get_concept_condition_string(grib_handle* h, const char* key, const char* va
grib_concept_condition* concept_condition = concept_value->conditions;
if (strcmp(pValue, concept_value->name) == 0) {
while (concept_condition) {
grib_expression* expression = concept_condition->expression;
//grib_expression* expression = concept_condition->expression;
const char* condition_name = concept_condition->name;
Assert(expression);
//Assert(expression);
if (concept_condition_expression_true(h, concept_condition, exprVal) && strcmp(condition_name, "one") != 0) {
length += snprintf(result + length, 2048, "%s%s=%s",
(length == 0 ? "" : ","), condition_name, exprVal);

View File

@ -168,13 +168,14 @@ grib_action* grib_action_create_hash_array(grib_context* context,
a->hash_array = hash_array;
if (hash_array) {
grib_hash_array_value* ha = hash_array;
grib_trie* index = grib_trie_new(context);
while (ha) {
ha->index = index;
grib_trie_insert_no_replace(index, ha->name, ha);
ha = ha->next;
}
grib_context_log(context, GRIB_LOG_FATAL, "%s: 'hash_array_list' not implemented", __func__);
// grib_hash_array_value* ha = hash_array;
// grib_trie* index = grib_trie_new(context);
// while (ha) {
// ha->index = index;
// grib_trie_insert_no_replace(index, ha->name, ha);
// ha = ha->next;
// }
}
act->name = grib_context_strdup_persistent(context, name);
@ -185,17 +186,12 @@ grib_action* grib_action_create_hash_array(grib_context* context,
static void dump(grib_action* act, FILE* f, int lvl)
{
int i = 0;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
printf("hash_array(%s) { ", act->name);
printf("\n");
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
printf("}\n");
// for (int i = 0; i < lvl; i++)
// grib_context_print(act->context, f, " ");
// printf("hash_array(%s) { \n", act->name);
// for (int i = 0; i < lvl; i++)
// grib_context_print(act->context, f, " ");
// printf("}\n");
}
@ -203,14 +199,16 @@ static void destroy(grib_context* context, grib_action* act)
{
grib_action_hash_array* self = (grib_action_hash_array*)act;
grib_hash_array_value* v = self->hash_array;
if (v)
grib_trie_delete(v->index);
while (v) {
grib_hash_array_value* n = v->next;
grib_hash_array_value_delete(context, v);
v = n;
}
// This is currently unset. So assert that it is NULL
const grib_hash_array_value* v = self->hash_array;
Assert(v == NULL);
// if (v)
// grib_trie_delete(v->index);
// while (v) {
// grib_hash_array_value* n = v->next;
// grib_hash_array_value_delete(context, v);
// v = n;
// }
grib_context_free_persistent(context, self->masterDir);
grib_context_free_persistent(context, self->localDir);
@ -338,6 +336,6 @@ grib_hash_array_value* get_hash_array(grib_handle* h, grib_action* a)
const char* get_hash_array_full_path(grib_action* a)
{
grib_action_hash_array* self = (grib_action_hash_array*)a;
const grib_action_hash_array* self = (grib_action_hash_array*)a;
return self->full_path;
}

View File

@ -10,7 +10,6 @@
/***************************************************************************
* Jean Baptiste Filippi - 01.11.2005 *
* Enrico Fucile *
***************************************************************************/
#include "grib_api_internal.h"
/*
@ -107,7 +106,7 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h)
long val = 0;
if ((ret = grib_expression_evaluate_long(p->h, a->expression, &val)) != GRIB_SUCCESS) {
grib_context_log(p->h->context, GRIB_LOG_DEBUG, "List %s creating %d values unable to evaluate long", act->name, val);
grib_context_log(p->h->context, GRIB_LOG_DEBUG, "List %s creating %ld values: Unable to evaluate long", act->name, val);
return ret;
}
@ -161,12 +160,12 @@ static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit)
{
grib_action_list* self = (grib_action_list*)a;
int ret = 0;
long val = 0;
if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(acc), self->expression, &val)) != GRIB_SUCCESS) {
int ret = grib_expression_evaluate_long(grib_handle_of_accessor(acc), self->expression, &val);
if (ret != GRIB_SUCCESS) {
grib_context_log(acc->context, GRIB_LOG_ERROR,
"List %s creating %ld values, unable to evaluate long", acc->name, val);
"List %s creating %ld values: Unable to evaluate long", acc->name, val);
}
*doit = (val != acc->loop);

View File

@ -73,16 +73,15 @@ grib_action* grib_action_create_noop(grib_context* context, const char* fname)
{
char buf[1024];
grib_action_noop* a;
grib_action_class* c = grib_action_class_noop;
grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size);
act->op = grib_context_strdup_persistent(context, "section");
act->cclass = c;
a = (grib_action_noop*)act;
grib_action_noop* a = (grib_action_noop*)act;
act->context = context;
snprintf(buf, 1024, "_noop%p", (void*)a);
snprintf(buf, sizeof(buf), "_noop%p", (void*)a);
act->name = grib_context_strdup_persistent(context, buf);

View File

@ -111,17 +111,13 @@ static void remove_accessor(grib_accessor* a)
a->next->previous = a->previous;
grib_accessor_delete(s->h->context, a);
return;
}
static int create_accessor(grib_section* p, grib_action* act, grib_loader* h)
{
grib_action_remove* a = (grib_action_remove*)act;
grib_accessor* ga = NULL;
ga = grib_find_accessor(p->h, grib_arguments_get_name(p->h, a->args, 0));
grib_accessor* ga = grib_find_accessor(p->h, grib_arguments_get_name(p->h, a->args, 0));
if (ga) {
remove_accessor(ga);
@ -134,15 +130,15 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h)
static void dump(grib_action* act, FILE* f, int lvl)
{
grib_action_remove* a = (grib_action_remove*)act;
int i = 0;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_context_print(act->context, f, "remove %s as %s in %s\n", grib_arguments_get_name(0, a->args, 0), act->name, grib_arguments_get_name(0, a->args, 1));
grib_context_log(act->context, GRIB_LOG_ERROR, "%s: dump not implemented", act->name);
// grib_action_remove* a = (grib_action_remove*)act;
// int i = 0;
// for (i = 0; i < lvl; i++)
// grib_context_print(act->context, f, " ");
// grib_context_print(act->context, f, "remove %s as %s in %s\n",
// grib_arguments_get_name(0, a->args, 0), act->name, grib_arguments_get_name(0, a->args, 1));
}
static void destroy(grib_context* context, grib_action* act)
{
grib_action_remove* a = (grib_action_remove*)act;
@ -151,4 +147,3 @@ static void destroy(grib_context* context, grib_action* act)
grib_context_free_persistent(context, act->name);
grib_context_free_persistent(context, act->op);
}

View File

@ -114,8 +114,8 @@ static int execute(grib_action* a, grib_handle* h)
static void dump(grib_action* act, FILE* f, int lvl)
{
int i = 0;
grib_action_set* self = (grib_action_set*)act;
int i = 0;
const grib_action_set* self = (grib_action_set*)act;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_context_print(act->context, f, self->name);

View File

@ -98,15 +98,14 @@ grib_action* grib_action_create_set_darray(grib_context* context,
static int execute(grib_action* a, grib_handle* h)
{
grib_action_set_darray* self = (grib_action_set_darray*)a;
const grib_action_set_darray* self = (grib_action_set_darray*)a;
return grib_set_double_array(h, self->name, self->darray->v, self->darray->n);
}
static void dump(grib_action* act, FILE* f, int lvl)
{
int i = 0;
grib_action_set_darray* self = (grib_action_set_darray*)act;
const grib_action_set_darray* self = (grib_action_set_darray*)act;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_context_print(act->context, f, self->name);

View File

@ -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
@ -73,8 +70,7 @@ static void init_class(grib_action_class* c)
}
/* END_CLASS_IMP */
grib_action* grib_action_create_set_missing(grib_context* context,
const char* name)
grib_action* grib_action_create_set_missing(grib_context* context, const char* name)
{
char buf[1024];
@ -98,19 +94,19 @@ grib_action* grib_action_create_set_missing(grib_context* context,
static int execute(grib_action* a, grib_handle* h)
{
grib_action_set_missing* self = (grib_action_set_missing*)a;
const grib_action_set_missing* self = (grib_action_set_missing*)a;
return grib_set_missing(h, self->name);
}
static void dump(grib_action* act, FILE* f, int lvl)
{
int i = 0;
grib_action_set_missing* self = (grib_action_set_missing*)act;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_context_print(act->context, f, self->name);
printf("\n");
grib_context_log(act->context, GRIB_LOG_ERROR, "%s %s(): Not implemented", __FILE__, __func__);
// int i = 0;
// const grib_action_set_missing* self = (grib_action_set_missing*)act;
// for (i = 0; i < lvl; i++)
// grib_context_print(act->context, f, " ");
// grib_context_print(act->context, f, self->name);
// printf("\n");
}
static void destroy(grib_context* context, grib_action* act)

View File

@ -72,9 +72,7 @@ static void init_class(grib_action_class* c)
}
/* END_CLASS_IMP */
grib_action* grib_action_create_set_sarray(grib_context* context,
const char* name,
grib_sarray* sarray)
grib_action* grib_action_create_set_sarray(grib_context* context, const char* name, grib_sarray* sarray)
{
char buf[1024];
@ -100,14 +98,13 @@ grib_action* grib_action_create_set_sarray(grib_context* context,
static int execute(grib_action* a, grib_handle* h)
{
grib_action_set_sarray* self = (grib_action_set_sarray*)a;
return grib_set_string_array(h, self->name, (const char**)self->sarray->v, self->sarray->n);
}
static void dump(grib_action* act, FILE* f, int lvl)
{
int i = 0;
grib_action_set_sarray* self = (grib_action_set_sarray*)act;
int i = 0;
const grib_action_set_sarray* self = (grib_action_set_sarray*)act;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_context_print(act->context, f, self->name);

View File

@ -10,7 +10,6 @@
/***************************************************************************
* Jean Baptiste Filippi - 01.11.2005 *
* Enrico Fucile *
***************************************************************************/
#include "grib_api_internal.h"
@ -115,19 +114,17 @@ static void dump(grib_action* act, FILE* f, int lvl)
grib_context_print(act->context, f, "Template %s %s\n", act->name, a->arg);
}
grib_action* get_empty_template(grib_context* c, int* err)
static grib_action* get_empty_template(grib_context* c, int* err)
{
char fname[] = "empty_template.def";
char* path = 0;
path = grib_context_full_defs_path(c, fname);
const char* path = grib_context_full_defs_path(c, fname);
if (path) {
*err = GRIB_SUCCESS;
return grib_parse_file(c, path);
}
else {
*err = GRIB_INTERNAL_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "get_empty_template: unable to get template %s", fname);
grib_context_log(c, GRIB_LOG_ERROR, "%s: Unable to get template %s", __func__, fname);
return NULL;
}
}

View File

@ -122,8 +122,8 @@ static int execute(grib_action* act, grib_handle* h)
static void dump(grib_action* act, FILE* f, int lvl)
{
int i = 0;
grib_action_transient_darray* self = (grib_action_transient_darray*)act;
int i = 0;
const grib_action_transient_darray* self = (grib_action_transient_darray*)act;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_context_print(act->context, f, self->name);

View File

@ -220,7 +220,7 @@ static int bufr_decode_extra_rdb_keys(const void* message, long offset_section2,
DEBUG_ASSERT(hdr->ecmwfLocalSectionPresent);
if (hdr->rdbType == 2 || hdr->rdbType == 3 || hdr->rdbType == 8 || hdr->rdbType == 12) {
if (hdr->rdbType == 2 || hdr->rdbType == 3 || hdr->rdbType == 8 || hdr->rdbType == 12 || hdr->rdbType == 30) {
isSatelliteType = true;
}
if (isSatelliteType || hdr->numberOfSubsets > 1) {

View File

@ -213,6 +213,37 @@ int is_date_valid(long year, long month, long day, long hour, long minute, doubl
return 1;
}
// Return 1 if input date is valid. Otherwise 0
// Note: In the 24-hour time notation, the day begins at midnight, 00:00 or 0:00,
// and the last minute of the day begins at 23:59.
// Where convenient, the notation 24:00 may also be used to refer to midnight
// at the end of a given date — that is, 24:00 of one day is the same time
// as 00:00 of the following day
int is_time_valid(long number)
{
// Number should be 4 digits i.e., HHMM
if (number < 0 || number > 9999) {
return 0;
}
// Extract hours and minutes
long hours = number / 100; // Get the first two digits as hours
long minutes = number % 100; // Get the last two digits as minutes
// Check if hours are within the valid range (00-24)
if (hours < 0 || hours > 24) {
return 0;
}
// Check if minutes are within the valid range (00-59)
if (minutes < 0 || minutes > 59) {
return 0;
}
// All checks pass
return 1;
}
static float float_epsilon(void)
{
float floatEps = 1.0;

View File

@ -1,30 +1,49 @@
/*
* (C) Copyright 2005- ECMWF.
*
* This software is 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.
*/
/*
* Description: concept index
*
*/
#include "grib_api_internal.h"
typedef struct grib_concept_index_keys grib_concept_index_keys;
typedef struct grib_concept_index grib_concept_index;
typedef struct grib_conditions_tree grib_conditions_tree;
typedef struct grib_concept_index_entry grib_concept_index_entry;
typedef struct grib_concept_index_keys grib_concept_index_keys;
struct grib_concept_index_entry {
char* name;
char* value;
int type;
grib_concept_index_entry* next;
};
struct grib_concept_index_keys {
char* name;
int type;
grib_concept_index_keys* next;
};
struct grib_concept_index {
grib_context* context;
grib_concept_index_keys* keys;
grib_conditions_tree* conditions;
};
struct grib_conditions_tree {
char* value;
void* object;
grib_conditions_tree* next;
grib_conditions_tree* next_key;
};
static grib_concept_index_entry* index_entry_new(grib_context* c, grib_concept_index_keys* keys)
{
grib_concept_index_entry* entry = NULL;
grib_concept_index_entry* e;
Assert(keys);
if (!c)
c = grib_context_get_default();
entry = grib_context_malloc_clear(c, sizeof(grib_concept_index_entry));
entry = (grib_concept_index_entry*)grib_context_malloc_clear(c, sizeof(grib_concept_index_entry));
if (!entry)
grib_context_log(c, GRIB_LOG_FATAL, "grib_concept_index_entry unable to allocate");
e = entry;
@ -32,7 +51,7 @@ static grib_concept_index_entry* index_entry_new(grib_context* c, grib_concept_i
while (keys && keys->name) {
e->name = grib_context_strdup(c, keys->name);
e->type = keys->type;
e->next = grib_context_malloc_clear(c, sizeof(grib_concept_index_entry));
e->next = (grib_concept_index_entry*)grib_context_malloc_clear(c, sizeof(grib_concept_index_entry));
if (!e->next)
grib_context_log(c, GRIB_LOG_FATAL, "grib_concept_index_entry unable to allocate");
@ -65,17 +84,17 @@ static int index_insert_entry(grib_concept_index* index, grib_concept_index_entr
while (keys->name) {
if (!cur) {
cur = grib_context_malloc_clear_persistent(index->context, sizeof(grib_conditions_tree));
cur = (grib_conditions_tree*)grib_context_malloc_clear_persistent(index->context, sizeof(grib_conditions_tree));
if (!cur)
grib_context_log(index->context, GRIB_LOG_FATAL, "index_insert_entry unable to allocate");
prev->next = cur;
}
value = entry->value ? entry->value : "*";
char* value = entry->value ? entry->value : (char*)"*";
while (cur && (!cur->value || (found = !strcmp(cur->value, value)) == 0))
cur = cur->next;
if (!found) {
cur->next = grib_context_malloc_clear_persistent(index->context, sizeof(grib_conditions_tree));
cur->next = (grib_conditions_tree*)grib_context_malloc_clear_persistent(index->context, sizeof(grib_conditions_tree));
Assert(cur->next);
cur = cur->next;
}
@ -103,6 +122,9 @@ static void index_add_conditions(grib_concept_index* index, grib_concept_conditi
char s[512] = {0,};
grib_concept_index_entry* e;
grib_concept_index_entry* entry = index_entry_new(index->context, index->keys);
long lres;
double dres;
int err = 0;
while (c) {
size_t size = 512;
@ -136,7 +158,7 @@ static void index_add_conditions(grib_concept_index* index, grib_concept_conditi
e->value = grib_context_strdup(index->context, s);
if (!e->name) {
e->name = grib_context_strdup(index->context, c->name);
e->next = grib_context_malloc_clear_persistent(index->context, sizeof(grib_concept_index_entry));
e->next = (grib_concept_index_entry*)grib_context_malloc_clear_persistent(index->context, sizeof(grib_concept_index_entry));
if (!e->next)
grib_context_log(index->context, GRIB_LOG_FATAL, "index_add_conditions unable to allocate");
}
@ -156,14 +178,13 @@ grib_concept_index* grib_concept_index_new_from_concept(grib_context* c, grib_co
if (!c)
c = grib_context_get_default();
index = grib_context_malloc_clear_persistent(c, sizeof(grib_concept_index));
index->keys = grib_context_malloc_clear_persistent(c, sizeof(grib_concept_index_key));
index->conditions = grib_context_malloc_clear_persistent(c, sizeof(grib_conditions_tree));
index->conditions = grib_context_malloc_clear_persistent(c, sizeof(grib_conditions_tree));
index = (grib_concept_index*)grib_context_malloc_clear_persistent(c, sizeof(grib_concept_index));
index->keys = (grib_concept_index_keys*)grib_context_malloc_clear_persistent(c, sizeof(grib_concept_index_keys));
index->conditions = (grib_conditions_tree*)grib_context_malloc_clear_persistent(c, sizeof(grib_conditions_tree));
index->context = c;
while (concept) {
index_add_conditions(index, concept->conditions, err);
index_add_conditions(index, concept->conditions);
concept = concept->next;
}

View File

@ -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"
/*
@ -89,7 +84,7 @@ static void init_class(grib_expression_class* c)
static const char* get_name(grib_expression* g)
{
grib_expression_column* e = (grib_expression_column*)g;
const grib_expression_column* e = (grib_expression_column*)g;
return e->name;
}
@ -131,7 +126,6 @@ static void destroy(grib_context* c, grib_expression* g)
grib_context_free_persistent(c, e->name);
}
grib_expression* new_column_expression(grib_context* c, const char* name)
{
grib_expression_column* e = grib_context_malloc_clear_persistent(c, sizeof(grib_expression_column));

View File

@ -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"
/*
@ -22,7 +17,7 @@
CLASS = expression
IMPLEMENTS = destroy
IMPLEMENTS = native_type
IMPLEMENTS = evaluate;print
IMPLEMENTS = print
IMPLEMENTS = add_dependency
MEMBERS = long value
END_CLASS_DEF
@ -83,15 +78,9 @@ static void init_class(grib_expression_class* c)
}
/* END_CLASS_IMP */
static long evaluate(grib_expression* g, grib_handle* h)
{
grib_expression_constant* e = (grib_expression_constant*)g;
return e->value;
}
static void print(grib_context* c, grib_expression* g, grib_handle* f)
{
grib_expression_constant* e = (grib_expression_constant*)g;
const grib_expression_constant* e = (grib_expression_constant*)g;
printf("constant(%ld)", e->value);
}
@ -100,7 +89,6 @@ static void destroy(grib_context* c, grib_expression* g)
/* grib_expression_constant* e = (grib_expression_constant*)g; */
}
static void add_dependency(grib_expression* g, grib_accessor* observer)
{
/* grib_expression_constant* e = (grib_expression_constant*)g; */

View File

@ -1,3 +1,13 @@
/*
* (C) Copyright 2005- ECMWF.
*
* This software is 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
#ifdef ECCODES_ON_WINDOWS
@ -57,7 +67,6 @@ grib_action* grib_action_create_assert(grib_context* context, grib_expression* e
/* action_class_template.cc*/
grib_action* grib_action_create_template(grib_context* context, int nofail, const char* name, const char* arg1);
grib_action* get_empty_template(grib_context* c, int* err);
/* action_class_trigger.cc*/
grib_action* grib_action_create_trigger(grib_context* context, grib_arguments* args, grib_action* block);
@ -109,7 +118,6 @@ grib_action* grib_action_create_transient_darray(grib_context* context, const ch
/* grib_accessor.cc*/
void grib_accessor_dump(grib_accessor* a, grib_dumper* f);
int grib_pack_missing(grib_accessor* a);
int grib_pack_zero(grib_accessor* a);
int grib_is_missing_internal(grib_accessor* a);
int grib_pack_double(grib_accessor* a, const double* v, size_t* len);
int grib_pack_float(grib_accessor* a, const float* v, size_t* len);
@ -151,17 +159,12 @@ grib_accessor* grib_next_accessor(grib_accessor* a);
void grib_resize(grib_accessor* a, size_t new_size);
int grib_compare_accessors(grib_accessor* a1, grib_accessor* a2, int compare_flags);
int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_if_clash);
int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr);
int grib_accessor_delete_attribute(grib_accessor* a, const char* name);
grib_accessor* grib_accessor_get_attribute_by_index(grib_accessor* a, int index);
const char* grib_accessor_get_name(grib_accessor* a);
grib_accessor* grib_accessor_get_attribute_index(grib_accessor* a, const char* name, int* index);
int grib_accessor_has_attributes(grib_accessor* a);
grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name);
grib_accessors_list* grib_accessors_list_create(grib_context* c);
void grib_accessors_list_push(grib_accessors_list* al, grib_accessor* a, int rank);
grib_accessors_list* grib_accessors_list_last(grib_accessors_list* al);
grib_accessors_list* grib_accessors_list_find(grib_accessors_list* al, const grib_accessor* a);
void grib_accessors_list_delete(grib_context* c, grib_accessors_list* al);
/* grib_concept.cc*/
@ -172,7 +175,6 @@ 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);
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);
@ -656,7 +658,6 @@ void grib_index_dump(FILE* fout, grib_index* index, unsigned long flags);
char* grib_get_field_file(grib_index* index, off_t* offset);
grib_handle* grib_handle_new_from_index(grib_index* index, int* err);
grib_handle* codes_new_from_index(grib_index* index, int message_type, int* err);
void grib_index_rewind(grib_index* index);
int codes_index_set_product_kind(grib_index* index, ProductKind product_kind);
int codes_index_set_unpack_bufr(grib_index* index, int unpack);
int is_index_file(const char* filename);
@ -927,7 +928,6 @@ 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);
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);
@ -1104,10 +1104,10 @@ double grib_power(long s, long n);
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);
char* get_external_template_path(grib_context* c, const char* name);
grib_handle* codes_external_sample(grib_context* c, ProductKind product_kind, const char* name);
char* get_external_sample_path(grib_context* c, const char* name);
/* grib_dependency.cc*/
/* grib_dependency.cc */
grib_handle* grib_handle_of_accessor(const grib_accessor* a);
void grib_dependency_add(grib_accessor* observer, grib_accessor* observed);
void grib_dependency_remove_observed(grib_accessor* observed);
@ -1311,7 +1311,6 @@ const char* grib_expression_get_name(grib_expression* g);
void grib_expression_print(grib_context* ctx, grib_expression* g, grib_handle* f);
void grib_expression_free(grib_context* ctx, grib_expression* g);
void grib_expression_add_dependency(grib_expression* e, grib_accessor* observer);
int grib_expression_set_value(grib_handle* h, grib_expression* g, grib_values* v);
grib_arguments* grib_arguments_new(grib_context* c, grib_expression* g, grib_arguments* n);
void grib_arguments_free(grib_context* c, grib_arguments* g);
void grib_arguments_print(grib_context* c, grib_arguments* g, grib_handle* f);
@ -1331,6 +1330,7 @@ char* codes_getenv(const char* name);
int codes_check_grib_ieee_packing_value(int value);
int codes_flush_sync_close_file(FILE* f);
int is_date_valid(long year, long month, long day, long hour, long minute, double second);
int is_time_valid(long number); // number is HHMM
int compute_scaled_value_and_scale_factor(double input, int64_t scaled_value_max, int64_t scale_factor_max, int64_t* ret_value, int64_t* ret_factor);
/* grib_util.cc*/
@ -1347,9 +1347,9 @@ int grib2_is_PDTN_Aerosol(long productDefinitionTemplateNumber);
int grib2_is_PDTN_AerosolOptical(long productDefinitionTemplateNumber);
int grib2_select_PDTN(int is_eps, int is_instant, int is_chemical, int is_chemical_srcsink, int is_chemical_distfn, int is_aerosol, int is_aerosol_optical);
size_t sum_of_pl_array(const long* pl, size_t plsize);
int grib_is_earth_oblate(grib_handle* h);
int grib_is_earth_oblate(const grib_handle* h);
int grib_check_data_values_minmax(grib_handle* h, const double min_val, const double max_val);
int grib_producing_large_constant_fields(grib_handle* h, int edition);
int grib_producing_large_constant_fields(const grib_handle* h, int edition);
int grib_util_grib_data_quality_check(grib_handle* h, double min_val, double max_val);
/* bufr_util.cc*/
@ -1381,8 +1381,6 @@ long grib_op_eq(long a, long b);
long grib_op_ne(long a, long b);
long grib_op_lt(long a, long b);
long grib_op_gt(long a, long b);
long grib_op_and(long a, long b);
long grib_op_or(long a, long b);
long grib_op_ge(long a, long b);
long grib_op_le(long a, long b);
long grib_op_bit(long a, long b);

View File

@ -1,20 +1,14 @@
typedef const char* string; /* to keep make_class.pl happy */
static void init_class (grib_expression_class*);
static void init(grib_expression* e);
static void destroy(grib_context*,grib_expression* e);
static void print(grib_context*,grib_expression*,grib_handle*);
static void add_dependency(grib_expression* e, grib_accessor* observer);
static string get_name(grib_expression* e);
static int native_type(grib_expression*,grib_handle*);
static int evaluate_long(grib_expression*,grib_handle*,long*);
static int evaluate_double(grib_expression*,grib_handle*,double*);
static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*);
static void init(grib_expression* e);
static void destroy(grib_context*,grib_expression* e);
static void print(grib_context*,grib_expression*,grib_handle*);
static void add_dependency(grib_expression* e, grib_accessor* observer);
static string get_name(grib_expression* e);
static int native_type(grib_expression*,grib_handle*);
static int evaluate_long(grib_expression*,grib_handle*,long*);
static int evaluate_double(grib_expression*,grib_handle*,double*);
static string evaluate_string(grib_expression*,grib_handle*,char*,size_t*,int*);
typedef struct grib_expression_NAME{
grib_expression base;
@ -28,7 +22,6 @@ static grib_expression_class _grib_expression_class_NAME = {
"NAME", /* name */
sizeof(grib_expression_NAME),/* size of instance */
0, /* inited */
&init_class, /* init_class */
&init, /* constructor */
&destroy, /* destructor */
&print,
@ -44,8 +37,3 @@ grib_expression_class* grib_expression_class_NAME = &_grib_expression_class_NAME
ADD_TO_FILE grib_expression_class.h extern grib_expression_class* grib_expression_class_NAME;
ADD_TO_FILE grib_expression_factory.h { "NAME", &grib_expression_class_NAME, },
static void init_class(grib_expression_class* c)
{
INIT
}

Some files were not shown because too many files have changed in this diff Show More