Merge branch 'develop' into feature/mtg2

This commit is contained in:
Sebastien Villaume 2024-01-08 09:49:54 +00:00
commit 3eb42ce745
190 changed files with 31043 additions and 33974 deletions

132
.cproject
View File

@ -1,132 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.cross.so.debug.1887207789">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.so.debug.1887207789" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/ecCodes"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/ecCodes/Debug"/>
<entry flags="RESOLVED" kind="libraryFile" name="ecCodes" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.so.debug.1887207789" name="Debug" parent="cdt.managedbuild.config.gnu.cross.so.debug">
<folderInfo id="cdt.managedbuild.config.gnu.cross.so.debug.1887207789." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.so.debug.416864500" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.so.debug">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1362241153" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder arguments="" buildPath="/var/tmp/cmake_build/build-eccodes" command="make" id="cdt.managedbuild.builder.gnu.cross.876773823" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="6" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.480849067" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1430529908" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.1408637585" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.19096666" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1532524478" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.1903075903" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.1941013604" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1393105821" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">
<option defaultValue="true" id="gnu.c.link.option.shared.1833873259" name="Shared (-shared)" superClass="gnu.c.link.option.shared" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.239826819" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1237847268" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<option defaultValue="true" id="gnu.cpp.link.option.shared.343149061" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" valueType="boolean"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.2042650456" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1346864522" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.610978424" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.cross.so.release.1101645981">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.so.release.1101645981" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/ecCodes"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/ecCodes/Release"/>
<entry flags="RESOLVED" kind="libraryFile" name="ecCodes" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.so.release.1101645981" name="Release" parent="cdt.managedbuild.config.gnu.cross.so.release">
<folderInfo id="cdt.managedbuild.config.gnu.cross.so.release.1101645981." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.so.release.1696856780" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.so.release">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.923290480" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/ecCodes}/Release" id="cdt.managedbuild.builder.gnu.cross.1553796951" managedBuildOn="true" name="Gnu Make Builder.Release" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.1057888993" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1617966377" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.674178935" superClass="gnu.c.compiler.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.37480136" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.1096096828" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.1248406075" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.17815586" superClass="gnu.cpp.compiler.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1414758339" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">
<option defaultValue="true" id="gnu.c.link.option.shared.1907010607" superClass="gnu.c.link.option.shared" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.160410096" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1590201569" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<option defaultValue="true" id="gnu.cpp.link.option.shared.177399663" superClass="gnu.cpp.link.option.shared" valueType="boolean"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.1207944287" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1698226637" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1593893847" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="ecCodes.cdt.managedbuild.target.gnu.cross.so.1965317215" name="Shared Library" projectType="cdt.managedbuild.target.gnu.cross.so"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.debug.1887207789;cdt.managedbuild.config.gnu.cross.so.debug.1887207789.;cdt.managedbuild.tool.gnu.cross.c.compiler.480849067;cdt.managedbuild.tool.gnu.c.compiler.input.19096666">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.so.release.1101645981;cdt.managedbuild.config.gnu.cross.so.release.1101645981.;cdt.managedbuild.tool.gnu.cross.c.compiler.1057888993;cdt.managedbuild.tool.gnu.c.compiler.input.37480136">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/ecCodes"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/ecCodes"/>
</configuration>
</storageModule>
</cproject>

View File

@ -12,8 +12,10 @@ module load netcdf4/new
module load gnuparallel/new
module load python3
version=$(cat $TMPDIR/eccodes/VERSION)
cd ~masn/REGRESSION_TESTING/ecCodes
./par-suite.sh -w $TMPDIR/install/eccodes
./par-suite.sh -w $TMPDIR/install/eccodes/$version
# For debugging specific test(s)
# ./seq-suite.sh -w $TMPDIR/install/eccodes -d -t py_
# ./seq-suite.sh -w $TMPDIR/install/eccodes/$version -d -t py_

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>eccodes</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.config.gnu.cross.so.debug.1887207789" name="Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-766511048364220641" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
<configuration id="cdt.managedbuild.config.gnu.cross.so.release.1101645981" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-766511048364220641" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
</project>

View File

@ -1 +1 @@
2.33.0
2.34.0

View File

@ -90,3 +90,5 @@ gfs.complex.mvmu.grib2
mercator.grib2
run_length_packing.grib2
boustrophedonic.grib1
reduced_gaussian_sub_area.legacy.grib1

View File

@ -39,7 +39,7 @@
38 38 sgvv SIGMA COORD VERT VEL [sec/sec]
39 39 omeg OMEGA [Pa/s]
40 40 omg2 VERTICAL VELOCITY [m/s]
41 41 abvo ABSOLUTE VORTICITY [10**5/sec]
41 41 abvo ABSOLUTE VORTICITY [10**5/sec]
42 42 abdv ABSOLUTE DIVERGENCE [10**5/sec]
43 43 vort VORTICITY [1/s]
44 44 divg DIVERGENCE [1/s]
@ -54,17 +54,17 @@
53 53 hmxr HUMIDITY MIXING RATIO [kg/kg]
54 54 agpl INST. PRECIPITABLE WATER [Kg/m2]
55 55 vapp VAPOUR PRESSURE [Pa hpa]
56 56 sadf SATURATION DEFICIT [Pa hPa]
56 56 sadf SATURATION DEFICIT [Pa hPa]
57 57 evap EVAPORATION [Kg/m2/day]
58 58 var58 undefined
59 59 prcr PRECIPITATION RATE [kg/m2/day]
59 59 prcr PRECIPITATION RATE [kg/m2/day]
60 60 thpb THUNDER PROBABILITY [%]
61 61 prec TOTAL PRECIPITATION [Kg/m2/day]
62 62 prge LARGE SCALE PRECIPITATION [Kg/m2/day]
63 63 prcv CONVECTIVE PRECIPITATION [Kg/m2/day]
64 64 neve SNOWFALL [Kg/m2/day]
65 65 wenv WAT EQUIV ACC SNOW DEPTH [kg/m2]
66 66 nvde SNOW DEPTH [cm]
66 66 nvde SNOW DEPTH [cm]
67 67 mxld MIXED LAYER DEPTH [m cm]
68 68 tthd TRANS THERMOCLINE DEPTH [m cm]
69 69 mthd MAIN THERMOCLINE DEPTH [m cm]
@ -72,7 +72,7 @@
71 71 cbnv CLOUD COVER [0-1]
72 72 cvnv CONVECTIVE CLOUD COVER [0-1]
73 73 lwnv LOW CLOUD COVER [0-1]
74 74 mdnv MEDIUM CLOUD COVER [0-1]
74 74 mdnv MEDIUM CLOUD COVER [0-1]
75 75 hinv HIGH CLOUD COVER [0-1]
76 76 wtnv CLOUD WATER [kg/m2]
77 77 bli BEST LIFTED INDEX (TO 500 HPA) [K]
@ -85,17 +85,17 @@
84 84 albe ALBEDO [%]
85 85 dstp DEEP SOIL TEMPERATURE [K]
86 86 soic SOIL MOISTURE CONTENT [Kg/m2]
87 87 vege VEGETATION [%]
87 87 vege VEGETATION [%]
88 88 var88 undefined
89 89 dens DENSITY [kg/m3]
90 90 var90 Undefined
91 91 icec ICE CONCENTRATION [fraction]
92 92 icet ICE THICKNESS [m]
93 93 iced DIRECTION OF ICE DRIFT [deg]
94 94 ices SPEED OF ICE DRIFT [m/s]
94 94 ices SPEED OF ICE DRIFT [m/s]
95 95 iceu U-COMP OF ICE DRIFT [m/s]
96 96 icev V-COMP OF ICE DRIFT [m/s]
97 97 iceg ICE GROWTH [m]
97 97 iceg ICE GROWTH [m]
98 98 icdv ICE DIVERGENCE [sec/sec]
99 99 var99 undefined
100 100 shcw SIG HGT COM WAVE/SWELL [m]
@ -155,7 +155,7 @@
154 154 fdlt FLIGHT LEVELS TEMPERATURE [K]
155 155 fdlu FLIGHT LEVELS U-WIND [m/s]
156 156 fdlv FLIGHT LEVELS V-WIND [m/s]
157 157 tppp TROPOPAUSE PRESSURE [hPa]
157 157 tppp TROPOPAUSE PRESSURE [hPa]
158 158 tppt TROPOPAUSE TEMPERATURE [K]
159 159 tppu TROPOPAUSE U-WIND COMPONENT [m/s]
160 160 tppv TROPOPAUSE v-WIND COMPONENT [m/s]
@ -170,16 +170,16 @@
169 169 vmfl VERT. INTEGRATED MOISTURE FLUX CONV. [kg/(m2*s)]
170 170 vadv VERTICAL MOISTURE ADVECTION [kg/(kg*s)]
171 171 nhcm NEG. HUM. CORR. MOISTURE SOURCE [kg/(kg*s)]
172 172 lglh LARGE SCALE LATENT HEATING [K/s]
173 173 lgms LARGE SCALE MOISTURE SOURCE [1/s]
174 174 smav SOIL MOISTURE AVAILABILITY [0-1]
172 172 lglh LARGE SCALE LATENT HEATING [K/s]
173 173 lgms LARGE SCALE MOISTURE SOURCE [1/s]
174 174 smav SOIL MOISTURE AVAILABILITY [0-1]
175 175 tgrz SOIL TEMPERATURE OF ROOT ZONE [K]
176 176 bslh BARE SOIL LATENT HEAT [Ws/m2]
177 177 evpp POTENTIAL SFC EVAPORATION [m]
178 178 rnof RUNOFF [kg/m2/s)]
179 179 pitp INTERCEPTION LOSS [W/m2]
180 180 vpca VAPOR PRESSURE OF CANOPY AIR SPACE [mb]
181 181 qsfc SURFACE SPEC HUMIDITY [kg/kg]
181 181 qsfc SURFACE SPEC HUMIDITY [kg/kg]
182 182 ussl SOIL WETNESS OF SURFACE [0-1]
183 183 uzrs SOIL WETNESS OF ROOT ZONE [0-1]
184 184 uzds SOIL WETNESS OF DRAINAGE ZONE [0-1]
@ -196,7 +196,7 @@
195 195 vsst SURFACE MERIDIONAL WIND STRESS [Pa]
196 196 suvf SURFACE MOMENTUM FLUX [W/m2]
197 197 iswf INCIDENT SHORT WAVE FLUX [W/m2]
198 198 ghfl TIME AVE GROUND HT FLX [W/m2]
198 198 ghfl TIME AVE GROUND HT FLX [W/m2]
199 199 var199 undefined
200 200 lwbc NET LONG WAVE AT BOTTOM (CLEAR) [W/m2]
201 201 lwtc OUTGOING LONG WAVE AT TOP (CLEAR) [W/m2]

View File

@ -49,7 +49,7 @@ if(bitmapPresent) {
bitmap
): read_only;
alias data.packedValues = codedValues;
alias data.packedValues = codedValues;
meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump;
} else {

View File

@ -175,6 +175,6 @@ if(matrixOfValues == 0)
}
meta packingError simple_packing_error(bitsPerValue,binaryScaleFactor,decimalScaleFactor,referenceValue,ibm) : no_copy;
meta numberOfCodedValues number_of_coded_values(bitsPerValue,offsetBeforeData,offsetAfterData,halfByte,numberOfValues) : dump;
template statistics "common/statistics_grid.def";
template missing_values "common/missing_values_grid.def";

View File

@ -38,7 +38,7 @@ flags[1] scanningModeForOneDiamond 'grib1/grid.192.78.3.10.table';
transient numberOfPoints= nd *(Ni + 1) * (Ni + 1);
alias numberOfDataPoints=numberOfPoints;
meta numberOfValues
number_of_values(values,bitsPerValue,numberOfDataPoints,
bitmapPresent,bitmap,numberOfCodedValues) : dump;

View File

@ -1,16 +1,15 @@
# (C) Copyright 2005- ECMWF.
#
# Description Octet Code Ksec1 Count
# ----------- ----- ---- ----- -----
#localDefinitionNumber 41 I1 37 -
#class 42 I1 38 -
#type 43 I1 39 -
#stream 44 I2 40 -
#experimentVersionNumber 46 A4 41 -
#number 50 I1 42 -
#total 51 I1 43 -
#spareSetToZero 52 PAD n/a 1
# Description Octet Code Ksec1 Count
# ----------- ----- ---- ----- -----
#localDefinitionNumber 41 I1 37 -
#class 42 I1 38 -
#type 43 I1 39 -
#stream 44 I2 40 -
#experimentVersionNumber 46 A4 41 -
#number 50 I1 42 -
#total 51 I1 43 -
#spareSetToZero 52 PAD n/a 1
#
template mars_labeling "grib1/mars_labeling.def";

View File

@ -12,7 +12,7 @@
#
# author: Sebastien Villaume
# created: 6 Oct 2011
# modified: 13 May 2013
# modified: 13 May 2013
#
# This piece of definition is common to all SMHI definitions

View File

@ -1,6 +1,6 @@
#
# Definition for SMHI Swedish Meteorological and Hydrological Institut.
#
#
# contact: sebastien.villaume@smhi.se
codetable[1] localDefinitionNumber 'grib1/localDefinitionNumber.82.table' = 82 : dump;
@ -11,4 +11,4 @@ template ls_labeling "grib1/ls_labeling.82.def";
### MARS LABELING ###
template mars_labeling "grib1/mars_labeling.82.def";
template_nofail marsKeywords "mars/eswi/grib1.[stream:s].[type:s].def";
template_nofail marsKeywords "mars/eswi/grib1.[stream:s].[type:s].def";

View File

@ -12,7 +12,7 @@ constant wrongPadding=1 : hidden;
unsigned[1] perturbationNumber : dump;
unsigned[1] numberOfForecastsInEnsemble : dump;
alias totalNumber=numberOfForecastsInEnsemble;
alias number = perturbationNumber;
alias number = perturbationNumber;
unsigned[1] oceanAtmosphereCoupling : dump;

View File

@ -1,14 +1,14 @@
#
# Description Octet Code Ksec1 Count
# ----------- ----- ---- ----- -----
#localDefinitionNumber 41 I1 37 -
#class 42 I1 38 -
#type 43 I1 39 -
#stream 44 I2 40 -
#experimentVersionNumber 46 A4 41 -
#number 50 I1 42 -
#total 51 I1 43 -
#spareSetToZero 52 PAD n/a 1
# Description Octet Code Ksec1 Count
# ----------- ----- ---- ----- -----
#localDefinitionNumber 41 I1 37 -
#class 42 I1 38 -
#type 43 I1 39 -
#stream 44 I2 40 -
#experimentVersionNumber 46 A4 41 -
#number 50 I1 42 -
#total 51 I1 43 -
#spareSetToZero 52 PAD n/a 1
#
constant GRIBEXSection1Problem = 52 - section1Length ;

View File

@ -1,36 +1,36 @@
# ECMWF concept type of level
'surface' = {indicatorOfTypeOfLevel=1;}
'cloudBase' = {indicatorOfTypeOfLevel=2;}
'cloudTop' = {indicatorOfTypeOfLevel=3;}
'isothermZero' = {indicatorOfTypeOfLevel=4;}
'adiabaticCondensation' = {indicatorOfTypeOfLevel=5;}
'maxWind' = {indicatorOfTypeOfLevel=6;}
'tropopause' = {indicatorOfTypeOfLevel=7;}
'nominalTop' = {indicatorOfTypeOfLevel=8;}
'seaBottom' = {indicatorOfTypeOfLevel=9;}
'isobaricInhPa' = {indicatorOfTypeOfLevel=100;}
'isobaricInPa' = {indicatorOfTypeOfLevel=210;}
'isobaricLayer' = {indicatorOfTypeOfLevel=101;}
'meanSea' = {indicatorOfTypeOfLevel=102;}
'isobaricLayerHighPrecision' = {indicatorOfTypeOfLevel=121;}
'surface' = {indicatorOfTypeOfLevel=1;}
'cloudBase' = {indicatorOfTypeOfLevel=2;}
'cloudTop' = {indicatorOfTypeOfLevel=3;}
'isothermZero' = {indicatorOfTypeOfLevel=4;}
'adiabaticCondensation' = {indicatorOfTypeOfLevel=5;}
'maxWind' = {indicatorOfTypeOfLevel=6;}
'tropopause' = {indicatorOfTypeOfLevel=7;}
'nominalTop' = {indicatorOfTypeOfLevel=8;}
'seaBottom' = {indicatorOfTypeOfLevel=9;}
'isobaricInhPa' = {indicatorOfTypeOfLevel=100;}
'isobaricInPa' = {indicatorOfTypeOfLevel=210;}
'isobaricLayer' = {indicatorOfTypeOfLevel=101;}
'meanSea' = {indicatorOfTypeOfLevel=102;}
'isobaricLayerHighPrecision' = {indicatorOfTypeOfLevel=121;}
'isobaricLayerMixedPrecision' = {indicatorOfTypeOfLevel=141;}
'heightAboveSea' = {indicatorOfTypeOfLevel=103;}
'heightAboveSeaLayer' = {indicatorOfTypeOfLevel=104;}
'heightAboveSea' = {indicatorOfTypeOfLevel=103;}
'heightAboveSeaLayer' = {indicatorOfTypeOfLevel=104;}
'heightAboveGroundHighPrecision' = {indicatorOfTypeOfLevel=125;}
'heightAboveGround' = {indicatorOfTypeOfLevel=105;}
'heightAboveGroundLayer' = {indicatorOfTypeOfLevel=106;}
'sigma' = {indicatorOfTypeOfLevel=107;}
'sigmaLayer' = {indicatorOfTypeOfLevel=108;}
'heightAboveGround' = {indicatorOfTypeOfLevel=105;}
'heightAboveGroundLayer' = {indicatorOfTypeOfLevel=106;}
'sigma' = {indicatorOfTypeOfLevel=107;}
'sigmaLayer' = {indicatorOfTypeOfLevel=108;}
'sigmaLayerHighPrecision' = {indicatorOfTypeOfLevel=128;}
'hybrid' = {indicatorOfTypeOfLevel=109;}
'hybridLayer' = {indicatorOfTypeOfLevel=110;}
'depthBelowLand' = {indicatorOfTypeOfLevel=111;}
'depthBelowLandLayer' = {indicatorOfTypeOfLevel=112;}
'theta' = {indicatorOfTypeOfLevel=113;}
'thetaLayer' = {indicatorOfTypeOfLevel=114;}
'pressureFromGround' = {indicatorOfTypeOfLevel=115;}
'hybrid' = {indicatorOfTypeOfLevel=109;}
'hybridLayer' = {indicatorOfTypeOfLevel=110;}
'depthBelowLand' = {indicatorOfTypeOfLevel=111;}
'depthBelowLandLayer' = {indicatorOfTypeOfLevel=112;}
'theta' = {indicatorOfTypeOfLevel=113;}
'thetaLayer' = {indicatorOfTypeOfLevel=114;}
'pressureFromGround' = {indicatorOfTypeOfLevel=115;}
'pressureFromGroundLayer' = {indicatorOfTypeOfLevel=116;}
'potentialVorticity' = {indicatorOfTypeOfLevel=117;}
'depthBelowSea' = {indicatorOfTypeOfLevel=160;}
'entireAtmosphere' = {indicatorOfTypeOfLevel=200;}
'entireOcean' = {indicatorOfTypeOfLevel=201;}
'potentialVorticity' = {indicatorOfTypeOfLevel=117;}
'depthBelowSea' = {indicatorOfTypeOfLevel=160;}
'entireAtmosphere' = {indicatorOfTypeOfLevel=200;}
'entireOcean' = {indicatorOfTypeOfLevel=201;}

View File

@ -895,6 +895,15 @@
scaleFactorOfUpperWavePeriodLimit = 0 ;
scaledValueOfUpperWavePeriodLimit = 30 ;
}
#Significant wave height of all waves with period larger than 10s
'sh10' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 3 ;
typeOfWavePeriodInterval = 3 ;
scaleFactorOfLowerWavePeriodLimit = 0 ;
scaledValueOfLowerWavePeriodLimit = 10 ;
}
#Significant wave height of first swell partition
'swh1' = {
discipline = 10 ;
@ -7303,6 +7312,13 @@
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean sea surface height with inverse barometer correction
'avg_zosib' = {
discipline = 10 ;
parameterCategory = 3 ;
parameterNumber = 20 ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean average sea water potential temperature in the upper 300m
'avg_pt300m' = {
discipline = 10 ;
@ -7707,6 +7723,8 @@
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Mass mixing ratio
'mass_mixrat' = {
@ -8016,6 +8034,32 @@
parameterCategory = 20 ;
parameterNumber = 59 ;
}
#Mass mixing ratio from volcanoes
'mass_mixrat_vol' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 2 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Total column vertically-integrated mass density from volcanoes
'tc_mdens_vol' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Dry deposition velocity from volcanoes
'drydep_vel_vol' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 15 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Virtual potential temperature
'vptmp' = {
discipline = 0 ;

View File

@ -1,5 +1,6 @@
# Concept combinationOfAttributesOfTile
'UNDEF' = {attributeOfTile = [0];}
'UNMOD' = {attributeOfTile = [1];}
'SNOW' = {attributeOfTile = [2];}
'FLOOD' = {attributeOfTile = [3];}

View File

@ -1339,3 +1339,15 @@
parameterCategory = 128 ;
parameterNumber = 124 ;
}
#Vertical integral of water vapour
'p55.162' = {
discipline = 192 ;
parameterCategory = 162 ;
parameterNumber = 55 ;
}
#Snow depth
'sdsien' = {
discipline = 192 ;
parameterCategory = 190 ;
parameterNumber = 141 ;
}

View File

@ -1339,3 +1339,15 @@
parameterCategory = 128 ;
parameterNumber = 124 ;
}
#Vertical integral of water vapour
'Vertical integral of water vapour' = {
discipline = 192 ;
parameterCategory = 162 ;
parameterNumber = 55 ;
}
#Snow depth
'Snow depth' = {
discipline = 192 ;
parameterCategory = 190 ;
parameterNumber = 141 ;
}

View File

@ -1339,3 +1339,15 @@
parameterCategory = 128 ;
parameterNumber = 124 ;
}
#Vertical integral of water vapour
'162055' = {
discipline = 192 ;
parameterCategory = 162 ;
parameterNumber = 55 ;
}
#Snow depth
'190141' = {
discipline = 192 ;
parameterCategory = 190 ;
parameterNumber = 141 ;
}

View File

@ -1339,3 +1339,15 @@
parameterCategory = 128 ;
parameterNumber = 124 ;
}
#Vertical integral of water vapour
'viwv' = {
discipline = 192 ;
parameterCategory = 162 ;
parameterNumber = 55 ;
}
#Snow depth
'sdsien' = {
discipline = 192 ;
parameterCategory = 190 ;
parameterNumber = 141 ;
}

View File

@ -1339,3 +1339,15 @@
parameterCategory = 128 ;
parameterNumber = 124 ;
}
#Vertical integral of water vapour
'kg m**-2' = {
discipline = 192 ;
parameterCategory = 162 ;
parameterNumber = 55 ;
}
#Snow depth
'kg m**-2' = {
discipline = 192 ;
parameterCategory = 190 ;
parameterNumber = 141 ;
}

View File

@ -61,6 +61,16 @@
scaledValueOfFirstFixedSurface = 15 ;
scaleFactorOfFirstFixedSurface = 1 ;
}
#2 metre temperature
't2m' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 103 ;
scaledValueOfFirstFixedSurface = 2 ;
scaleFactorOfFirstFixedSurface = 0 ;
typeOfStatisticalProcessing = 0 ;
}
#Surface roughness (climatological)
'sr' = {
discipline = 2 ;

View File

@ -61,6 +61,16 @@
scaledValueOfFirstFixedSurface = 15 ;
scaleFactorOfFirstFixedSurface = 1 ;
}
#2 metre temperature
'2 metre temperature' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 103 ;
scaledValueOfFirstFixedSurface = 2 ;
scaleFactorOfFirstFixedSurface = 0 ;
typeOfStatisticalProcessing = 0 ;
}
#Surface roughness (climatological)
'Surface roughness (climatological)' = {
discipline = 2 ;

View File

@ -61,6 +61,16 @@
scaledValueOfFirstFixedSurface = 15 ;
scaleFactorOfFirstFixedSurface = 1 ;
}
#2 metre temperature
'167' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 103 ;
scaledValueOfFirstFixedSurface = 2 ;
scaleFactorOfFirstFixedSurface = 0 ;
typeOfStatisticalProcessing = 0 ;
}
#Surface roughness (climatological)
'173' = {
discipline = 2 ;

View File

@ -61,6 +61,16 @@
scaledValueOfFirstFixedSurface = 15 ;
scaleFactorOfFirstFixedSurface = 1 ;
}
#2 metre temperature
'2t' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 103 ;
scaledValueOfFirstFixedSurface = 2 ;
scaleFactorOfFirstFixedSurface = 0 ;
typeOfStatisticalProcessing = 0 ;
}
#Surface roughness (climatological)
'sr' = {
discipline = 2 ;

View File

@ -61,6 +61,16 @@
scaledValueOfFirstFixedSurface = 15 ;
scaleFactorOfFirstFixedSurface = 1 ;
}
#2 metre temperature
'K' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 103 ;
scaledValueOfFirstFixedSurface = 2 ;
scaleFactorOfFirstFixedSurface = 0 ;
typeOfStatisticalProcessing = 0 ;
}
#Surface roughness (climatological)
'm' = {
discipline = 2 ;

View File

@ -895,6 +895,15 @@
scaleFactorOfUpperWavePeriodLimit = 0 ;
scaledValueOfUpperWavePeriodLimit = 30 ;
}
#Significant wave height of all waves with period larger than 10s
'Significant wave height of all waves with period larger than 10s' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 3 ;
typeOfWavePeriodInterval = 3 ;
scaleFactorOfLowerWavePeriodLimit = 0 ;
scaledValueOfLowerWavePeriodLimit = 10 ;
}
#Significant wave height of first swell partition
'Significant wave height of first swell partition' = {
discipline = 10 ;
@ -7303,6 +7312,13 @@
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean sea surface height with inverse barometer correction
'Time-mean sea surface height with inverse barometer correction' = {
discipline = 10 ;
parameterCategory = 3 ;
parameterNumber = 20 ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean average sea water potential temperature in the upper 300m
'Time-mean average sea water potential temperature in the upper 300m' = {
discipline = 10 ;
@ -7707,6 +7723,8 @@
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Mass mixing ratio
'Mass mixing ratio' = {
@ -8016,6 +8034,32 @@
parameterCategory = 20 ;
parameterNumber = 59 ;
}
#Mass mixing ratio from volcanoes
'Mass mixing ratio from volcanoes' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 2 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Total column vertically-integrated mass density from volcanoes
'Total column vertically-integrated mass density from volcanoes' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Dry deposition velocity from volcanoes
'Dry deposition velocity from volcanoes' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 15 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Virtual potential temperature
'Virtual potential temperature' = {
discipline = 0 ;

View File

@ -895,6 +895,15 @@
scaleFactorOfUpperWavePeriodLimit = 0 ;
scaledValueOfUpperWavePeriodLimit = 30 ;
}
#Significant wave height of all waves with period larger than 10s
'140120' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 3 ;
typeOfWavePeriodInterval = 3 ;
scaleFactorOfLowerWavePeriodLimit = 0 ;
scaledValueOfLowerWavePeriodLimit = 10 ;
}
#Significant wave height of first swell partition
'140121' = {
discipline = 10 ;
@ -7303,6 +7312,13 @@
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean sea surface height with inverse barometer correction
'263143' = {
discipline = 10 ;
parameterCategory = 3 ;
parameterNumber = 20 ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean average sea water potential temperature in the upper 300m
'263144' = {
discipline = 10 ;
@ -7707,6 +7723,8 @@
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Mass mixing ratio
'402000' = {
@ -8016,6 +8034,32 @@
parameterCategory = 20 ;
parameterNumber = 59 ;
}
#Mass mixing ratio from volcanoes
'454000' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 2 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Total column vertically-integrated mass density from volcanoes
'455000' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Dry deposition velocity from volcanoes
'456000' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 15 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Virtual potential temperature
'3012' = {
discipline = 0 ;

View File

@ -895,6 +895,15 @@
scaleFactorOfUpperWavePeriodLimit = 0 ;
scaledValueOfUpperWavePeriodLimit = 30 ;
}
#Significant wave height of all waves with period larger than 10s
'sh10' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 3 ;
typeOfWavePeriodInterval = 3 ;
scaleFactorOfLowerWavePeriodLimit = 0 ;
scaledValueOfLowerWavePeriodLimit = 10 ;
}
#Significant wave height of first swell partition
'swh1' = {
discipline = 10 ;
@ -7303,6 +7312,13 @@
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean sea surface height with inverse barometer correction
'avg_zosib' = {
discipline = 10 ;
parameterCategory = 3 ;
parameterNumber = 20 ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean average sea water potential temperature in the upper 300m
'avg_pt300m' = {
discipline = 10 ;
@ -7707,6 +7723,8 @@
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Mass mixing ratio
'mass_mixrat' = {
@ -8016,6 +8034,32 @@
parameterCategory = 20 ;
parameterNumber = 59 ;
}
#Mass mixing ratio from volcanoes
'mass_mixrat_vol' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 2 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Total column vertically-integrated mass density from volcanoes
'tc_mdens_vol' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Dry deposition velocity from volcanoes
'drydep_vel_vol' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 15 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Virtual potential temperature
'vptmp' = {
discipline = 0 ;

View File

@ -895,6 +895,15 @@
scaleFactorOfUpperWavePeriodLimit = 0 ;
scaledValueOfUpperWavePeriodLimit = 30 ;
}
#Significant wave height of all waves with period larger than 10s
'm' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 3 ;
typeOfWavePeriodInterval = 3 ;
scaleFactorOfLowerWavePeriodLimit = 0 ;
scaledValueOfLowerWavePeriodLimit = 10 ;
}
#Significant wave height of first swell partition
'm' = {
discipline = 10 ;
@ -7303,6 +7312,13 @@
scaleFactorOfSecondFixedSurface = missing() ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean sea surface height with inverse barometer correction
'm' = {
discipline = 10 ;
parameterCategory = 3 ;
parameterNumber = 20 ;
typeOfStatisticalProcessing = 0 ;
}
#Time-mean average sea water potential temperature in the upper 300m
'K' = {
discipline = 10 ;
@ -7707,6 +7723,8 @@
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
}
#Mass mixing ratio
'kg kg**-1' = {
@ -8016,6 +8034,32 @@
parameterCategory = 20 ;
parameterNumber = 59 ;
}
#Mass mixing ratio from volcanoes
'kg kg**-1' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 2 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Total column vertically-integrated mass density from volcanoes
'kg m**-2' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 8 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Dry deposition velocity from volcanoes
'm s**-1' = {
discipline = 0 ;
parameterCategory = 20 ;
parameterNumber = 15 ;
is_chemical_srcsink = 1 ;
sourceSinkChemicalPhysicalProcess = 7 ;
}
#Virtual potential temperature
'K' = {
discipline = 0 ;

View File

@ -39,14 +39,13 @@ alias ls.CCCC=CCCC;
alias ls.YY=YY;
alias ls.GG=GG;
alias ls.gg=gg;
position endOfHeadersMarker;
position endOfHeadersMarker;
message[4] theMessage;
meta lengthOfHeaders evaluate( endOfHeadersMarker-startOfHeaders);
meta md5Headers md5(startOfHeaders,lengthOfHeaders);
meta lengthOfHeaders evaluate(endOfHeadersMarker-startOfHeaders);
meta md5Headers md5(startOfHeaders, lengthOfHeaders);
ascii[4] endMark;
ascii[4] endMark;
position totalLength;
alias ls.totalLength=totalLength;

View File

@ -46,6 +46,9 @@
45 ml Machine learning
46 d1 Destination Earth
47 o6 ECMWF Ocean ReAnalysis version 6 (EORA6)
48 eh C3S European hydrology
49 gh C3S Global hydrology
50 ci CERISE project
99 te Test
100 at Austria
101 be Belgium

View File

@ -79,7 +79,8 @@ int main(int argc, char** argv)
}
/* write multi-field handle to output file */
codes_grib_multi_handle_write(mh, of);
err = codes_grib_multi_handle_write(mh, of);
if (err) return 1;
fclose(of);
/* release memory */

View File

@ -62,6 +62,8 @@ int main(int argc, char** argv)
/* Can also set to MISSING via codes_set_string */
CODES_CHECK(codes_set_string(h, "scaleFactorOfFirstFixedSurface", "missing", &str_len), 0);
CODES_CHECK(codes_set_string(h, "scaledValueOfFirstFixedSurface", "missing", &str_len), 0);
/* Set a Code Table key to missing via codes_set_string */
CODES_CHECK(codes_set_string(h, "typeOfFirstFixedSurface", "missing", &str_len), 0);
/* see GRIB-490 */
CODES_CHECK(codes_get_long(h, "Ni", &Ni), 0);

View File

@ -20,6 +20,10 @@ if [ -f "${tools_dir}/grib_get" ]; then
[ "$sf" = "MISSING" ]
sf=`${tools_dir}/grib_get -p scaledValueOfFirstFixedSurface $tempGrib`
[ "$sf" = "MISSING" ]
# Code Table key being set to missing
sf=`${tools_dir}/grib_get -p typeOfFirstFixedSurface:i, $tempGrib`
[ "$sf" = "255" ]
fi
rm -f $tempGrib

View File

@ -196,6 +196,7 @@ int main(int argc, char** argv)
/* 255 = Missing (grib2/tables/4/4.5.table) */
CODES_CHECK(codes_set_long(h, "typeOfSecondFixedSurface", 255), 0);
CODES_CHECK(codes_set_missing(h, "typeOfSecondFixedSurface"), 0);
CODES_CHECK(codes_set_missing(h, "scaleFactorOfSecondFixedSurface"), 0);
CODES_CHECK(codes_set_missing(h, "scaledValueOfSecondFixedSurface"), 0);

View File

@ -11,8 +11,10 @@ if( HAVE_BUILD_TOOLS )
codes_ecc-1392
codes_datetime_julian
codes_set_paths
codes_f90_misc
grib_set_pv
grib_set_data
grib_set_data_force
bufr_ecc-1284
bufr_ecc-1019
get_native_type
@ -20,16 +22,23 @@ if( HAVE_BUILD_TOOLS )
list( APPEND tests_extra
grib_index
codes_dump
codes_scan_file
codes_load_file
grib_copy_message
bufr_copy_message
grib_get_keys
grib_get_data
grib_get_data_real4
grib_get_pl
grib_get_pv
grib_keys_iterator
grib_keys_iterator_skip
grib_multi_write
grib_multi
grib_elements
grib_nearest
grib_nearest_single
grib_nearest_four_single
grib_precision
grib_print_data
grib_set_keys
@ -66,7 +75,9 @@ else()
list( APPEND tests_sanity
grib_set_pv
grib_set_data
grib_set_data_force
codes_set_paths
codes_f90_misc
get_native_type
grib_ecc-671 )
list( APPEND tests_extra
@ -76,8 +87,12 @@ else()
grib_get_pl
grib_get_pv
grib_keys_iterator
grib_keys_iterator_skip
grib_multi
grib_nearest
grib_elements
grib_nearest_single
grib_nearest_four_single
grib_precision
grib_print_data
grib_set_missing

View File

@ -0,0 +1,31 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
!
program codes_f90_misc
use eccodes
implicit none
integer :: array_of_error_codes(8), i, code
character(len=64) :: error_message = ''
call codes_gribex_mode_on()
call codes_gribex_mode_off()
call codes_bufr_multi_element_constant_arrays_on()
call codes_bufr_multi_element_constant_arrays_off()
array_of_error_codes = [0, -2, -14, -16, -26, -28, -38, -41]
do i = 1, size(array_of_error_codes)
error_message = ''
code = array_of_error_codes(i)
call codes_get_error_string(code, error_message)
write (*, *) 'error message: <', adjustl(trim(error_message)), '>'
end do
end program

13
examples/F90/codes_f90_misc.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
# export ECCODES_DEBUG=1
${examples_dir}/eccodes_f_codes_f90_misc

View File

@ -0,0 +1,43 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
!
program codes_load_file
use eccodes
implicit none
integer :: ifile, cnt, level, step
integer :: i, igrib, iret
character(len=32) :: infile_name = '../../data/index.grib'
call codes_open_file(ifile, infile_name, 'r')
call codes_any_load_all_from_file(ifile, cnt)
i = 45
call codes_any_new_from_loaded(i, igrib)
call codes_get(igrib, 'level', level)
call codes_get(igrib, 'stepRange', step)
print *, 'Num messages=', cnt
print *, 'Msg ',i,' level=',level, ' step=', step
call codes_release(igrib)
! Invalid msg number
i = 450
call codes_any_new_from_loaded(i, igrib, iret)
if (iret /= GRIB_INVALID_ARGUMENT) then
call codes_check(iret, 'Error', 'codes_any_new_from_loaded should have failed')
else
print *,'Invalid message index returned error (as expected)'
end if
call codes_close_file(ifile)
end program

21
examples/F90/codes_load_file.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
label='eccodes_f_codes_load_file'
temp=temp.$label.txt
# The input file is hard coded => data/index.grib
${examples_dir}/eccodes_f_codes_load_file > $temp
grep -q "Num messages= *384" $temp
grep -q "level= *700 step= *60" $temp
rm -f $temp

View File

@ -0,0 +1,43 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
!
program codes_scan_file
use eccodes
implicit none
integer :: ifile, cnt, level, step
integer :: i, igrib, iret
character(len=32) :: infile_name = '../../data/index.grib'
call codes_open_file(ifile, infile_name, 'r')
call codes_any_scan_file(ifile,cnt)
i = 45
call codes_any_new_from_scanned_file(ifile, i, igrib)
call codes_get(igrib, 'level', level)
call codes_get(igrib, 'stepRange', step)
print *, 'Num messages=', cnt
print *, 'Msg ',i,' level=',level, ' step=', step
call codes_release(igrib)
! Invalid msg number
i = 450
call codes_any_new_from_scanned_file(ifile, i, igrib, iret)
if (iret /= GRIB_INVALID_ARGUMENT) then
call codes_check(iret, 'Error', 'codes_any_new_from_scanned_file should have failed')
else
print *,'Invalid message index returned error (as expected)'
end if
call codes_close_file(ifile)
end program

21
examples/F90/codes_scan_file.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
label='eccodes_f_codes_scan_file'
temp=temp.$label.txt
# The input file is hard coded => data/index.grib
${examples_dir}/eccodes_f_codes_scan_file > $temp
grep -q "Num messages= *384" $temp
grep -q "level= *700 step= *60" $temp
rm -f $temp

View File

@ -0,0 +1,50 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
!
program grib_get_elements
use eccodes
implicit none
integer :: infile, igrib, i
real(4) :: value_real4
real(8) :: value_real8
real(4) :: values_real4(4)
real(8) :: values_real8(4)
integer :: array_of_indexes(4)
call codes_open_file(infile, '../../data/reduced_gaussian_pressure_level.grib1', 'r')
call codes_grib_new_from_file(infile, igrib)
array_of_indexes = [1, 0, 2, 4]
print *,'Values as REAL(4) at specific indexes'
call codes_get_element(igrib, "values", array_of_indexes, values_real4)
do i = 1, 4
print *, array_of_indexes(i), values_real4(i)
end do
print *,'Values as REAL(8) at specific indexes'
call codes_get_element(igrib, "values", array_of_indexes, values_real8)
do i = 1, 4
print *, array_of_indexes(i), values_real8(i)
end do
i = 12
print *,'The Value REAL(4) at index=',i
call codes_get_element(igrib, "values", i, value_real4)
print *, value_real4
print *,'The Value REAL(8) at index=',i
call codes_get_element(igrib, "values", i, value_real8)
print *, value_real8
call codes_release(igrib)
call codes_close_file(infile)
end program

12
examples/F90/grib_elements.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
${examples_dir}/eccodes_f_grib_elements

View File

@ -0,0 +1,76 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
!
!
program get_data_real4
use eccodes
implicit none
integer :: ifile
integer :: iret, i
real(kind=4), dimension(:), allocatable :: lats, lons, values
integer, dimension(:), allocatable :: bitmap
integer(4) :: numberOfPoints
logical :: is_missing_value
integer :: count1 = 0, count2 = 0, bitmapPresent = 0, bmp_len = 0
integer :: igrib ! message identifier
ifile = 5
call codes_open_file(ifile, '../../data/reduced_latlon_surface.grib2', 'r')
! loop on all the messages in the file
do while (.true.)
call codes_grib_new_from_file(ifile, igrib, iret)
if (iret == CODES_END_OF_FILE) exit
count1 = count1 + 1
print *, "===== Message #", count1
call codes_get(igrib, 'numberOfPoints', numberOfPoints)
call codes_get(igrib, 'bitmapPresent', bitmapPresent)
allocate (lats(numberOfPoints))
allocate (lons(numberOfPoints))
allocate (values(numberOfPoints))
if (bitmapPresent == 1) then
! get the bitmap
call codes_get_size(igrib, 'bitmap', bmp_len)
allocate (bitmap(bmp_len))
call codes_get(igrib, 'bitmap', bitmap)
end if
call codes_grib_get_data(igrib, lats, lons, values)
do i = 1, numberOfPoints
! consult bitmap to see if the i'th value is missing
is_missing_value = .false.
if (bitmapPresent == 1 .and. bitmap(i) == 0) then
is_missing_value = .true.
end if
! only print non-missing values
if (.not. is_missing_value) then
print *, lats(i), lons(i), values(i)
count2 = count2 + 1
end if
end do
print *, 'count of non-missing values=', count2
if (count2 /= 214661) then
call codes_check(-2, 'incorrect number of missing', '')
end if
deallocate (lats)
deallocate (lons)
deallocate (values)
call codes_release(igrib)
end do
call codes_close_file(ifile)
end program

View File

@ -0,0 +1,12 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
${examples_dir}/eccodes_f_grib_get_data_real4 > /dev/null

View File

@ -23,7 +23,7 @@ program index
character(len=20) :: oshortName
integer :: shortNameSize, numberSize, levelSize, stepSize
integer :: i, j, k, l
integer :: idx, igrib, count1
integer :: idx, idx1, igrib, count1
character(len=10) :: index_file = 'index.idx'
! uncomment following line to load index from file
@ -107,7 +107,10 @@ program index
! save the index to a file for later reuse
call codes_index_write(idx, index_file)
call codes_index_read(idx1, index_file)
call codes_index_release(idx)
call codes_index_release(idx1)
deallocate (level)
deallocate (shortName)

View File

@ -0,0 +1,57 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
!
program keys_iterator_skip
use eccodes
implicit none
character(len=20) :: name_space
integer :: kiter, ifile, igrib, iret
character(len=256) :: key
character(len=256) :: value
character(len=512) :: all1
integer :: grib_count
call codes_open_file(ifile, &
'../../data/regular_latlon_surface.grib1', 'r')
! Loop on all the messages in a file
grib_count = 0
do while (.true.)
call codes_grib_new_from_file(ifile, igrib, iret)
if (iret == CODES_END_OF_FILE) exit
grib_count = grib_count + 1
write (*, *) '-- GRIB N. ', grib_count, ' --'
! Choose a namespace. E.g. "ls", "time", "parameter", "geography", "statistics"
name_space = 'ls'
call codes_keys_iterator_new(igrib, kiter, name_space)
call codes_skip_computed(kiter)
call codes_skip_coded(kiter)
call codes_skip_duplicates(kiter)
call codes_skip_read_only(kiter)
do
call codes_keys_iterator_next(kiter, iret)
if (iret .ne. CODES_SUCCESS) exit !terminate the loop
call codes_keys_iterator_get_name(kiter, key)
call codes_get(igrib, trim(key), value)
all1 = trim(key)//' = '//trim(value)
write (*, *) trim(all1)
end do
call codes_keys_iterator_delete(kiter)
call codes_release(igrib)
end do
call codes_close_file(ifile)
end program keys_iterator_skip

View File

@ -0,0 +1,12 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
${examples_dir}/eccodes_f_grib_keys_iterator_skip

View File

@ -16,7 +16,7 @@ program multi
use eccodes
implicit none
integer :: iret, counter
integer :: iret, counter=0
integer(kind=4) :: step
integer :: ifile, igrib

View File

@ -0,0 +1,31 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
program find_nearest_4single
use eccodes
implicit none
integer :: infile, i
integer :: igrib
real(8) :: inlat = 5, inlon = 10
real(8) :: outlats(4), outlons(4)
real(8) :: values(4), distances(4)
integer(kind=kindOfInt) :: indexes(4)
call codes_open_file(infile, '../../data/reduced_gaussian_lsm.grib1', 'r')
call codes_grib_new_from_file(infile, igrib)
call codes_grib_find_nearest_four_single(igrib, .true., inlat, inlon, outlats, outlons, values, distances, indexes)
call codes_release(igrib)
call codes_close_file(infile)
print *, ' outlats outlons values distances indexes'
do i = 1, 4
write (*, '(F10.3, F10.3, F10.5, F10.3, I8)') outlats(i), outlons(i), values(i), distances(i), indexes(i)
end do
end program

View File

@ -0,0 +1,12 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
${examples_dir}/eccodes_f_grib_nearest_four_single

View File

@ -0,0 +1,30 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
program find_nearest_single
use eccodes
implicit none
integer :: infile
integer :: igrib
real(8) :: inlat = 5, inlon = 10
real(8) :: outlat, outlon
real(8) :: value, distance
integer(kind=kindOfInt) :: index
call codes_open_file(infile, '../../data/reduced_gaussian_lsm.grib1', 'r')
call codes_grib_new_from_file(infile, igrib)
call codes_grib_find_nearest_single(igrib, .true., inlat, inlon, outlat, outlon, value, distance, index)
call codes_release(igrib)
call codes_close_file(infile)
print *, ' outlat outlon value distance index'
write (*, '(F10.3, F10.3, F10.5, F10.3, I8)') outlat, outlon, value, distance, index
end program find_nearest_single

View File

@ -0,0 +1,12 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
${examples_dir}/eccodes_f_grib_nearest_single

View File

@ -0,0 +1,55 @@
! (C) Copyright 2005- ECMWF.
!
! This software is 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.
!
!
program set_data_force
use eccodes
implicit none
integer :: outfile
integer :: i, igrib, iret, numberOfValues, cnt
real :: d, e
real(4), dimension(:), allocatable :: values_real4
real(8), dimension(:), allocatable :: values_real8
integer, parameter :: max_strsize = 200
character(len=max_strsize) :: outfile_name
call getarg(1, outfile_name)
call codes_open_file(outfile, outfile_name, 'w')
call codes_grib_new_from_samples(igrib, 'regular_ll_pl_grib1')
call codes_get_size(igrib, 'values', numberOfValues)
allocate (values_real4(numberOfValues), stat=iret)
allocate (values_real8(numberOfValues), stat=iret)
d = 10e-8
e = d
cnt = 1
do i = 1, numberOfValues
if (cnt > 100) then
e = e*10
cnt = 1
end if
values_real4(i) = d
values_real8(i) = d
d = d + e
cnt = cnt + 1
end do
call codes_set(igrib, 'bitsPerValue', 16)
call codes_set(igrib, 'bitmapPresent', 1)
! set data values
call codes_set_force(igrib, 'codedValues', values_real4)
call codes_set_force(igrib, 'codedValues', values_real8)
call codes_write(igrib, outfile)
call codes_release(igrib)
deallocate (values_real4)
deallocate (values_real8)
end program set_data_force

View File

@ -0,0 +1,16 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
. ./include.ctest.sh
OUT=temp.f_grib_set_data_force.out.grib
${examples_dir}/eccodes_f_grib_set_data_force $OUT
rm -f $OUT

View File

@ -1,59 +0,0 @@
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
CMAKE_INCLUDE_FILE=include.ctest.sh
if [ -f "$CMAKE_INCLUDE_FILE" ]; then
# This is the config file for Cmake tests
. ./$CMAKE_INCLUDE_FILE
else
set -eax
echo
echo "TEST: $0"
if [ -z "${data_dir}" ]
then
cd ../../
cpath=`pwd`
ECCODES_DEFINITION_PATH=$cpath/definitions
export ECCODES_DEFINITION_PATH
ECCODES_SAMPLES_PATH=$cpath/samples
export ECCODES_SAMPLES_PATH
tools_dir=$cpath/tools
examples_dir=$cpath/examples/F90
data_dir=$cpath/data
samples_dir=$cpath/samples
if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then
tools_dir="valgrind --error-exitcode=1 -q $cpath/tools"
examples_dir="valgrind --error-exitcode=1 -q $cpath/examples/F90"
fi
else
echo "Skipping test $0"
exit
fi
cd "$cpath/examples/F90"
if [ -z "${GRIB_API_INCLUDE}" ]
then
GRIB_API_INCLUDE=`pwd`/src
fi
if [ -z "${GRIB_API_LIB}" ]
then
GRIB_API_LIB=`pwd`/src
fi
# Download the data needed for tests
${data_dir}/download.sh "${data_dir}"
set -u
fi

View File

@ -1,32 +0,0 @@
CMAKE_INCLUDE_FILE=include.ctest.sh
if [ -f "$CMAKE_INCLUDE_FILE" ]; then
# This is the config file for Cmake tests
. ./$CMAKE_INCLUDE_FILE
else
set -eax
echo
echo "TEST: $0"
cpath=$TOPBUILDDIR
ECCODES_DEFINITION_PATH=$cpath/definitions
export ECCODES_DEFINITION_PATH
ECCODES_SAMPLES_PATH=$cpath/samples
export ECCODES_SAMPLES_PATH
tools_dir=$cpath/tools
examples_dir=$cpath/examples/python
data_dir=$cpath/data
examples_src=$examples_dir
PYTHONPATH=$cpath/python:$cpath/python/.libs:$PYTHONPATH
export PYTHONPATH
HAVE_MEMFS=0
ECCODES_ON_WINDOWS=0
# Download the data needed for tests
${data_dir}/download.sh "${data_dir}"
set -u
fi

View File

@ -38,9 +38,6 @@ if( HAVE_FORTRAN )
COMMAND cat ${srcdir}/eccodes_f90_head.f90 ${srcdir}/${_long_int_interface_ec} ${srcdir}/${_sizet_int_interface_ec} ${srcdir}/eccodes_f90_tail.f90 > eccodes_f90.f90
DEPENDS eccodes_f90_head.f90 eccodes_f90_tail.f90 grib_kinds.h ${_long_int_interface_ec} ${_sizet_int_interface_ec} )
#ecbuild_add_library( TARGET eccodes_f77
# SOURCES grib_fortran.c grib_f77.c
# LIBS eccodes )
# Note: $<BUILD_INTERFACE:...> will be present only while building (for the whole bundle),
# whereas $<INSTALL_INTERFACE:...> is only present once you install the package / bundle
@ -82,7 +79,7 @@ if( HAVE_FORTRAN )
ecbuild_add_resources( TARGET fortran_resources
PACK
grib_fortran_prototypes.h grib_api_constants.h grib_api_externals.h
grib_api_constants.h grib_api_externals.h
grib_api_visibility.h grib_types.f90 create_grib_f90.sh
grib_f90.f90.head grib_f90.f90.tail grib_f90_int.f90 grib_f90_long_int.f90
grib_f90_int_size_t.f90 grib_f90_long_size_t.f90

View File

@ -2597,8 +2597,8 @@
real(kind=kindOfDouble), intent(in) :: inlon
real(kind=kindOfDouble), intent(out) :: outlat
real(kind=kindOfDouble), intent(out) :: outlon
real(kind=kindOfDouble), intent(out) :: distance
real(kind=kindOfDouble), intent(out) :: value
real(kind=kindOfDouble), intent(out) :: distance
integer(kind=kindOfInt), intent(out) :: kindex
integer(kind=kindOfInt), optional, intent(out) :: status

View File

@ -5,41 +5,40 @@ void grib_check_fortran_char(char* a) {
*a='f';
}
void grib_check_fortran_char_(char* a) {grib_check_fortran_char(a);}
void grib_check_fortran_char__(char* a) {grib_check_fortran_char(a);}
void check_double(double *x,double *y,char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_double_(double *x,double *y,char* ret) {check_double(x,y,ret);}
void check_double__(double *x,double *y,char* ret) {check_double(x,y,ret);}
void check_float(float *x,float *y,char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_float_(float *x,float *y,char* ret) { check_float(x,y,ret); }
void check_float__(float *x,float *y,char* ret) { check_float(x,y,ret); }
void check_int(int *x,int *y,char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_int_(int *x,int *y,char* ret) { check_int(x,y,ret); }
void check_int__(int *x,int *y,char* ret) { check_int(x,y,ret); }
void check_long(long *x,long *y,char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_long_(long *x,long *y,char* ret) {check_long(x,y,ret);}
void check_long__(long *x,long *y,char* ret) {check_long(x,y,ret);}
void check_size_t(size_t *x,size_t *y,char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_size_t_(size_t *x,size_t *y,char* ret) {check_size_t(x,y,ret);}
void check_size_t__(size_t *x,size_t *y,char* ret) {check_size_t(x,y,ret);}
void check_long_long(long long *x,long long *y,char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_long_long_(long long *x,long long *y,char* ret) {check_long_long(x,y,ret);}
void check_long_long__(long long *x,long long *y,char* ret) {check_long_long(x,y,ret);}

View File

@ -20,6 +20,7 @@ integer, external :: grib_f_skip_computed, &
integer, external :: grib_f_keys_iterator_get_name, &
grib_f_keys_iterator_rewind
integer, external :: grib_f_new_from_message, &
grib_f_new_from_message_int, &
grib_f_new_from_message_copy, &
grib_f_new_from_samples, &
codes_bufr_f_new_from_samples, &

View File

@ -1,510 +0,0 @@
/*
* (C) Copyright 2005- ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
#include "grib_api_internal.h"
#include "grib_fortran_prototypes.h"
int grib_read_file_(int* fid, char* buffer, size_t* nbytes) {
return grib_f_read_file_(fid,buffer,nbytes);
}
int grib_read_file__(int* fid, char* buffer, size_t* nbytes) {
return grib_f_read_file_(fid,buffer,nbytes);
}
int grib_open_file_(int* fid, char* name , char* op, int lname, int lop){
return grib_f_open_file_( fid, name , op, lname, lop);
}
int grib_open_file__(int* fid, char* name , char* op, int lname, int lop){
return grib_f_open_file_( fid, name , op, lname, lop);
}
int grib_close_file_(int* fid){
return grib_f_close_file_(fid);
}
int grib_close_file__(int* fid){
return grib_f_close_file_(fid);
}
int grib_multi_support_on_(){
return grib_f_multi_support_on_();
}
int grib_multi_support_on__(){
return grib_f_multi_support_on_();
}
int grib_multi_support_off_(){
return grib_f_multi_support_off_();
}
int grib_multi_support_off__(){
return grib_f_multi_support_off_();
}
int grib_iterator_new_(int* gid,int* iterid,int* mode) {
return grib_f_iterator_new_(gid,iterid,mode);
}
int grib_iterator_new__(int* gid,int* iterid,int* mode) {
return grib_f_iterator_new_(gid,iterid,mode);
}
int grib_iterator_next_(int* iterid,double* lat,double* lon,double* value) {
return grib_f_iterator_next_(iterid,lat,lon,value);
}
int grib_iterator_next__(int* iterid,double* lat,double* lon,double* value) {
return grib_f_iterator_next_(iterid,lat,lon,value);
}
int grib_iterator_delete_(int* iterid) {
return grib_f_iterator_delete_(iterid);
}
int grib_iterator_delete__(int* iterid) {
return grib_f_iterator_delete_(iterid);
}
int grib_keys_iterator_new__(int* gid,int* iterid,char* name_space,int len) {
return grib_f_keys_iterator_new_(gid,iterid,name_space,len);
}
int grib_keys_iterator_new_(int* gid,int* iterid,char* name_space,int len) {
return grib_f_keys_iterator_new_(gid,iterid,name_space,len);
}
int grib_keys_iterator_next_(int* iterid) {
return grib_f_keys_iterator_next_(iterid);
}
int grib_keys_iterator_next__(int* iterid) {
return grib_f_keys_iterator_next_(iterid);
}
int grib_keys_iterator_delete_(int* iterid) {
return grib_f_keys_iterator_delete_(iterid);
}
int grib_keys_iterator_delete__(int* iterid) {
return grib_f_keys_iterator_delete_(iterid);
}
int grib_gribex_mode_on_() {
grib_gribex_mode_on(0);
return GRIB_SUCCESS;
}
int grib_gribex_mode_on__() {
grib_gribex_mode_on(0);
return GRIB_SUCCESS;
}
int grib_gribex_mode_off_() {
grib_gribex_mode_off(0);
return GRIB_SUCCESS;
}
int grib_gribex_mode_off__() {
grib_gribex_mode_off(0);
return GRIB_SUCCESS;
}
int grib_skip_computed_(int* iterid) {
return grib_skip_computed_(iterid);
}
int grib_skip_computed__(int* iterid) {
return grib_skip_computed_(iterid);
}
int grib_skip_coded_(int* iterid) {
return grib_f_skip_coded_(iterid);
}
int grib_skip_coded__(int* iterid) {
return grib_f_skip_coded_(iterid);
}
int grib_skip_edition_specific_(int* iterid) {
return grib_f_skip_edition_specific_(iterid);
}
int grib_skip_edition_specific__(int* iterid) {
return grib_f_skip_edition_specific_(iterid);
}
int grib_skip_duplicates_(int* iterid) {
return grib_f_skip_duplicates_(iterid);
}
int grib_skip_duplicates__(int* iterid) {
return grib_f_skip_duplicates_(iterid);
}
int grib_skip_read_only_(int* iterid) {
return grib_f_skip_read_only_(iterid);
}
int grib_skip_read_only__(int* iterid) {
return grib_f_skip_read_only_(iterid);
}
int grib_skip_function_(int* iterid) {
return grib_f_skip_function_(iterid);
}
int grib_skip_function__(int* iterid) {
return grib_f_skip_function_(iterid);
}
int grib_keys_iterator_get_name_(int* kiter,char* name,int len) {
return grib_f_keys_iterator_get_name_(kiter,name,len);
}
int grib_keys_iterator_get_name__(int* kiter,char* name,int len) {
return grib_f_keys_iterator_get_name_(kiter,name,len);
}
int grib_keys_iterator_rewind_(int* kiter) {
return grib_f_keys_iterator_rewind_(kiter);
}
int grib_keys_iterator_rewind__(int* kiter) {
return grib_f_keys_iterator_rewind_(kiter);
}
int grib_new_from_message_(int* gid, void* buffer , size_t* bufsize){
return grib_f_new_from_message_(gid, buffer , bufsize);
}
int grib_new_from_message__(int* gid, void* buffer , size_t* bufsize){
return grib_f_new_from_message_(gid, buffer , bufsize);
}
int grib_new_from_message_copy_(int* gid, void* buffer , size_t* bufsize){
return grib_f_new_from_message_copy_(gid, buffer , bufsize);
}
int grib_new_from_message_copy__(int* gid, void* buffer , size_t* bufsize){
return grib_f_new_from_message_copy_(gid, buffer , bufsize);
}
int grib_new_from_samples_(int* gid, char* name , int lname){
return grib_f_new_from_samples_( gid, name , lname);
}
int grib_new_from_samples__(int* gid, char* name , int lname){
return grib_f_new_from_samples_( gid, name , lname);
}
int grib_clone_(int* gidsrc,int* giddest){
return grib_f_clone_(gidsrc, giddest);
}
int grib_clone__(int* gidsrc,int* giddest){
return grib_f_clone_(gidsrc, giddest);
}
int grib_new_from_file_(int* fid, int* gid){
return grib_f_new_from_file_( fid, gid);
}
int grib_new_from_file__(int* fid, int* gid){
return grib_f_new_from_file_( fid, gid);
}
int grib_release_(int* hid){
return grib_f_release_( hid);
}
int grib_release__(int* hid){
return grib_f_release_( hid);
}
int grib_dump_(int* gid){
return grib_f_dump_( gid);
}
int grib_dump__(int* gid){
return grib_f_dump_( gid);
}
int grib_get_error_string_(int* err, char* buf, int len){
return grib_f_get_error_string_(err,buf,len);
}
int grib_get_error_string__(int* err, char* buf, int len){
return grib_f_get_error_string_(err,buf,len);
}
int grib_get_size_(int* gid, char* key, int* val, int len){
return grib_f_get_size_int_( gid, key, val, len);
}
int grib_get_size__(int* gid, char* key, int* val, int len){
return grib_f_get_size_int_( gid, key, val, len);
}
int grib_get_int_(int* gid, char* key, int* val, int len){
return grib_f_get_int_( gid, key, val, len);
}
int grib_get_int__(int* gid, char* key, int* val, int len){
return grib_f_get_int_( gid, key, val, len);
}
int grib_get_int_array_(int* gid, char* key, int*val, int* size, int len){
return grib_f_get_int_array_( gid, key, val, size, len);
}
int grib_get_int_array__(int* gid, char* key, int*val, int* size, int len){
return grib_f_get_int_array_( gid, key, val, size, len);
}
int grib_set_int_array_(int* gid, char* key, int* val, int* size, int len){
return grib_f_set_int_array_( gid, key, val, size, len);
}
int grib_set_int_array__(int* gid, char* key, int* val, int* size, int len){
return grib_f_set_int_array_( gid, key, val, size, len);
}
int grib_set_int_(int* gid, char* key, int* val, int len){
return grib_f_set_int_( gid, key, val, len);
}
int grib_set_int__(int* gid, char* key, int* val, int len){
return grib_f_set_int_( gid, key, val, len);
}
int grib_set_missing_(int* gid, char* key, int len){
return grib_f_set_missing_( gid, key, len);
}
int grib_set_missing__(int* gid, char* key, int len){
return grib_f_set_missing_( gid, key, len);
}
int grib_set_real4_(int* gid, char* key, float* val, int len){
return grib_f_set_real4_( gid, key, val, len);
}
int grib_set_real4__(int* gid, char* key, float* val, int len){
return grib_f_set_real4_( gid, key, val, len);
}
int grib_get_real4_(int* gid, char* key, float* val, int len){
return grib_f_get_real4_( gid, key, val, len);
}
int grib_get_real4__(int* gid, char* key, float* val, int len){
return grib_f_get_real4_( gid, key, val, len);
}
int grib_get_real4_array_(int* gid, char* key, float* val, int* size, int len){
return grib_f_get_real4_array_( gid, key, val, size, len);
}
int grib_get_real4_element_(int* gid, char* key, int* index,float* val, int len){
return grib_f_get_real4_element_( gid, key, index,val, len);
}
int grib_get_real4_element__(int* gid, char* key,int* index, float* val, int len){
return grib_f_get_real4_element_( gid, key, index, val, len);
}
int grib_get_real4_elements__(int* gid, char* key,int* index, float* val,int* len,int size){
return grib_f_get_real4_elements_( gid, key, index, val, len,size);
}
int grib_get_real4_elements_(int* gid, char* key,int* index, float* val,int* len,int size){
return grib_f_get_real4_elements_( gid, key, index, val, len,size);
}
int grib_get_real4_array__(int* gid, char* key, float* val, int* size, int len){
return grib_f_get_real4_array_( gid, key, val, size, len);
}
int grib_set_real4_array_(int* gid, char* key, float*val, int* size, int len){
return grib_f_set_real4_array_( gid, key, val, size, len);
}
int grib_set_real4_array__(int* gid, char* key, float*val, int* size, int len){
return grib_f_set_real4_array_( gid, key, val, size, len);
}
int grib_set_real8_(int* gid, char* key, double* val, int len){
Assert(sizeof(double) == 8);
return grib_f_set_real8_( gid, key, val, len);
}
int grib_set_real8__(int* gid, char* key, double* val, int len){
Assert(sizeof(double) == 8);
return grib_f_set_real8_( gid, key, val, len);
}
int grib_get_real8_(int* gid, char* key, double* val, int len){
Assert(sizeof(double) == 8);
return grib_f_get_real8_( gid, key, val, len);
}
int grib_get_real8__(int* gid, char* key, double* val, int len){
Assert(sizeof(double) == 8);
return grib_f_get_real8_( gid, key, val, len);
}
int grib_get_real8_element_(int* gid, char* key,int* index, double* val, int len){
Assert(sizeof(double) == 8);
return grib_f_get_real8_element_( gid, key, index,val, len);
}
int grib_get_real8_element__(int* gid, char* key,int* index, double* val, int len){
Assert(sizeof(double) == 8);
return grib_f_get_real8_element_( gid, key, index,val, len);
}
int grib_get_real8_elements_(int* gid, char* key, int* index,double* val, int* len,int size){
return grib_f_get_real8_elements_( gid, key, index, val,len,size);
}
int grib_get_real8_elements__(int* gid, char* key, int* index,double* val, int* len,int size){
return grib_f_get_real8_elements_( gid, key, index, val,len,size);
}
int grib_get_real8_array_(int* gid, char* key, double*val, int* size, int len){
Assert(sizeof(double) == 8);
return grib_f_get_real8_array_( gid, key, val, size, len);
}
int grib_get_real8_array__(int* gid, char* key, double*val, int* size, int len){
Assert(sizeof(double) == 8);
return grib_f_get_real8_array_( gid, key, val, size, len);
}
int grib_set_real8_array_(int* gid, char* key, double *val, int* size, int len){
Assert(sizeof(double) == 8);
return grib_f_set_real8_array_( gid, key, val, size, len);
}
int grib_set_real8_array__(int* gid, char* key, double *val, int* size, int len){
Assert(sizeof(double) == 8);
return grib_f_set_real8_array_( gid, key, val, size, len);
}
int grib_get_string_(int* gid, char* key, char* val, int len, int len2){
return grib_f_get_string_( gid, key, val, len, len2);
}
int grib_get_string__(int* gid, char* key, char* val, int len, int len2){
return grib_f_get_string_( gid, key, val, len, len2);
}
int grib_set_string_(int* gid, char* key, char* val, int len, int len2){
return grib_f_set_string_( gid, key, val, len, len2);
}
int grib_set_string__(int* gid, char* key, char* val, int len, int len2){
return grib_f_set_string_( gid, key, val, len, len2);
}
int grib_get_message_size_(int* gid, size_t *len){
return grib_f_get_message_size_( gid, len);
}
int grib_get_message_size__(int* gid, size_t *len){
return grib_f_get_message_size_( gid, len);
}
void grib_check_(int* err){
grib_f_check_(err,"","",0,0);
}
void grib_check__(int* err){
grib_f_check_(err,"","",0,0);
}
int grib_write_(int* gid, int* fid) {
return grib_f_write_(gid,fid);
}
int grib_write__(int* gid, int* fid) {
return grib_f_write_(gid,fid);
}
int grib_multi_write_(int* gid, int* fid) {
return grib_f_multi_write_(gid,fid);
}
int grib_multi_write__(int* gid, int* fid) {
return grib_f_multi_write_(gid,fid);
}
int grib_multi_append_(int* ingid, int* sec,int* mgid) {
return grib_f_multi_append_(ingid,sec,mgid);
}
int grib_multi_append__(int* ingid, int* sec,int* mgid) {
return grib_f_multi_append_(ingid,sec,mgid);
}
int grib_find_nearest_multiple_(int* gid,int* is_lsm,
double* inlats,double* inlons,
double* outlats,double* outlons,
double* values,double* distances,
int* indexes, int* npoints) {
return grib_f_find_nearest_multiple_(gid,is_lsm,
inlats,inlons,outlats,outlons,values,
distances,indexes,npoints);
}
int grib_find_nearest_multiple__(int* gid,int* is_lsm,
double* inlats,double* inlons,
double* outlats,double* outlons,
double* values,double* distances,
int* indexes, int* npoints) {
return grib_f_find_nearest_multiple_(gid,is_lsm,
inlats,inlons,outlats,outlons,values,
distances,indexes,npoints);
}
int grib_find_nearest_single_(int* gid,int* is_lsm,
double* inlats,double* inlons,
double* outlats,double* outlons,
double* values,double* distances,
int* indexes) {
return grib_f_find_nearest_single_(gid,is_lsm,
inlats,inlons,outlats,outlons,values,
distances,indexes);
}
int grib_find_nearest_single__(int* gid,int* is_lsm,
double* inlats,double* inlons,
double* outlats,double* outlons,
double* values,double* distances,
int* indexes) {
return grib_f_find_nearest_single_(gid,is_lsm,
inlats,inlons,outlats,outlons,values,
distances,indexes);
}
int grib_copy_message_(int* gid, void* mess,size_t* len){
return grib_f_copy_message_(gid, mess,len);
}
int grib_copy_message__(int* gid, void* mess,size_t* len){
return grib_f_copy_message_(gid, mess,len);
}

View File

@ -1365,7 +1365,7 @@
if (present(status)) then
status = iret
else
call grib_check(iret, 'new_from_message', '')
call grib_check(iret, 'new_from_message_char', '')
end if
end subroutine grib_new_from_message_char
@ -1394,11 +1394,13 @@
integer(kind=kindOfInt) :: iret
size_bytes = size(message, dim=1)*sizeOfInteger4
iret = grib_f_new_from_message(gribid, message, size_bytes)
! See SUP-3893
!iret = grib_f_new_from_message(gribid, message, size_bytes)
iret = grib_f_new_from_message_int(gribid, message, size_bytes)
if (present(status)) then
status = iret
else
call grib_check(iret, 'new_from_message', '')
call grib_check(iret, 'new_from_message_int4', '')
end if
end subroutine grib_new_from_message_int4
@ -2314,7 +2316,7 @@
if (present(status)) then
status = iret
else
call grib_check(iret, 'get', key)
call grib_check(iret, 'get_real4_elements', key)
end if
end subroutine grib_get_real4_elements
@ -2346,7 +2348,7 @@
if (present(status)) then
status = iret
else
call grib_check(iret, 'get', key)
call grib_check(iret, 'get_real8_elements', key)
end if
end subroutine grib_get_real8_elements
@ -2647,7 +2649,7 @@
if (present(status)) then
status = iret
else
call grib_check(iret, 'set', key)
call grib_check(iret, 'set_force_real4_array', key)
end if
end subroutine grib_set_force_real4_array
@ -2663,12 +2665,12 @@
!> @param value real(8) array value
!> @param status GRIB_SUCCESS if OK, integer value on error
subroutine grib_set_force_real8_array(gribid, key, value, status)
integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key
real(kind=kindOfDouble), dimension(:), intent(in) :: value
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: nb_values
integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key
real(kind=kindOfDouble), dimension(:), intent(in) :: value
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: nb_values
nb_values = size(value)
iret = grib_f_set_force_real8_array(gribid, key, value, nb_values)
@ -2678,7 +2680,7 @@
if (present(status)) then
status = iret
else
call grib_check(iret, 'set', key)
call grib_check(iret, 'set_force_real8_array', key)
end if
end subroutine grib_set_force_real8_array
@ -2694,10 +2696,10 @@
!> @param status GRIB_SUCCESS if OK, integer value on error
subroutine grib_set_string(gribid, key, value, status)
integer(kind=kindOfInt), intent(in) :: gribid
character(len=*), intent(in) :: key
character(len=*), intent(in) :: value
character(len=*), intent(in) :: key
character(len=*), intent(in) :: value
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: iret
iret = grib_f_set_string(gribid, key, value)
if (iret /= 0) then
@ -2720,8 +2722,8 @@
!> @param nbytes size in bytes of the message
!> @param status GRIB_SUCCESS if OK, integer value on error
subroutine grib_get_message_size_int(gribid, nbytes, status)
integer(kind=kindOfInt), intent(in) :: gribid
integer(kind=kindOfInt), intent(out) :: nbytes
integer(kind=kindOfInt), intent(in) :: gribid
integer(kind=kindOfInt), intent(out) :: nbytes
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
integer(kind=kindOfSize_t) :: ibytes
@ -2751,10 +2753,10 @@
!> @param nbytes size in bytes of the message
!> @param status GRIB_SUCCESS if OK, integer value on error
subroutine grib_get_message_size_size_t(gribid, nbytes, status)
integer(kind=kindOfInt), intent(in) :: gribid
integer(kind=kindOfInt), intent(in) :: gribid
integer(kind=kindOfSize_t), intent(out) :: nbytes
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: iret
iret = grib_f_get_message_size(gribid, nbytes)
if (iret /= 0) then
@ -2777,7 +2779,7 @@
!> @param message array containing the coded message to be copied
!> @param status GRIB_SUCCESS if OK, integer value on error
subroutine grib_copy_message(gribid, message, status)
integer(kind=kindOfInt), intent(in) :: gribid
integer(kind=kindOfInt), intent(in) :: gribid
character(len=1), dimension(:), intent(out) :: message
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
@ -2808,7 +2810,6 @@
integer(kind=kindOfInt), intent(in) :: gribid
integer(kind=kindOfInt), intent(in) :: ifile
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
iret = grib_f_write(gribid, ifile)
@ -2832,7 +2833,7 @@
integer(kind=kindOfInt), intent(in) :: multigribid
integer(kind=kindOfInt), intent(in) :: ifile
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
integer(kind=kindOfInt) :: iret
iret = grib_f_multi_write(multigribid, ifile)
if (present(status)) then
@ -2936,13 +2937,13 @@
inlat, inlon, outlat, outlon, &
value, distance, kindex, status)
integer(kind=kindOfInt), intent(in) :: gribid
logical, intent(in) :: is_lsm
logical, intent(in) :: is_lsm
real(kind=kindOfDouble), intent(in) :: inlat
real(kind=kindOfDouble), intent(in) :: inlon
real(kind=kindOfDouble), intent(out) :: outlat
real(kind=kindOfDouble), intent(out) :: outlon
real(kind=kindOfDouble), intent(out) :: distance
real(kind=kindOfDouble), intent(out) :: value
real(kind=kindOfDouble), intent(out) :: distance
integer(kind=kindOfInt), intent(out) :: kindex
integer(kind=kindOfInt), optional, intent(out) :: status
integer(kind=kindOfInt) :: iret
@ -3056,7 +3057,7 @@
if (present(status)) then
status = iret
else
call grib_check(iret, 'grib_gribex_mode_on', '')
call grib_check(iret, 'gribex_mode_on', '')
end if
end subroutine grib_gribex_mode_on
@ -3076,7 +3077,7 @@
if (present(status)) then
status = iret
else
call grib_check(iret, 'grib_gribex_mode_off', '')
call grib_check(iret, 'gribex_mode_off', '')
end if
end subroutine grib_gribex_mode_off

File diff suppressed because it is too large Load Diff

View File

@ -14,45 +14,29 @@
extern "C" {
#endif
void f_sizeof(void *x,void *y, int *size) {
*size=((char*)y)-((char*)x);
}
void f_sizeof_(void *x,void *y, int *size) {
*size=((char*)y)-((char*)x);
}
void f_sizeof__(void *x,void *y, int *size) {
void f_sizeof_(void *x, void *y, int *size) {
*size=((char*)y)-((char*)x);
}
void check_double(double *x,double *y,char* ret) {
void check_double_(double *x, double* y, char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_double_(double *x,double *y,char* ret) {check_double(x,y,ret);}
void check_double__(double *x,double *y,char* ret) {check_double(x,y,ret);}
void check_float(float *x,float *y,char* ret) {
void check_float_(float* x, float* y, char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_float_(float *x,float *y,char* ret) { check_float(x,y,ret); }
void check_float__(float *x,float *y,char* ret) { check_float(x,y,ret); }
void check_int(int *x,int *y,char* ret) {
void check_int_(int* x, int* y, char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_int_(int *x,int *y,char* ret) { check_int(x,y,ret); }
void check_int__(int *x,int *y,char* ret) { check_int(x,y,ret); }
void check_long(long *x,long *y,char* ret) {
void check_long_(long* x, long * y, char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_long_(long *x,long *y,char* ret) {check_long(x,y,ret);}
void check_long__(long *x,long *y,char* ret) {check_long(x,y,ret);}
void check_size_t(size_t *x,size_t *y,char* ret) {
void check_size_t_(size_t* x, size_t* y, char* ret) {
*ret = ((char*)y)-((char*)x) == sizeof(*x) ? 't' : 'f';
}
void check_size_t_(size_t *x,size_t *y,char* ret) {check_size_t(x,y,ret);}
void check_size_t__(size_t *x,size_t *y,char* ret) {check_size_t(x,y,ret);}
#ifdef __cplusplus
}

View File

@ -1,400 +0,0 @@
/*
* (C) Copyright 2005- ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
/* grib_fortran.c */
#ifdef __cplusplus
extern "C" {
#endif
int grib_f_read_any_headers_only_from_file_(int *fid, char *buffer, size_t *nbytes);
int grib_f_read_any_headers_only_from_file__(int *fid, char *buffer, size_t *nbytes);
int grib_f_read_any_headers_only_from_file(int *fid, char *buffer, size_t *nbytes);
int grib_f_read_any_from_file_(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_any_from_file__(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_any_from_file(int *fid, void *buffer, size_t *nbytes);
int grib_f_write_file_(int *fid, void *buffer, size_t *nbytes);
int grib_f_write_file__(int *fid, void *buffer, size_t *nbytes);
int grib_f_write_file(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_file_(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_file__(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_file(int *fid, void *buffer, size_t *nbytes);
int grib_f_open_file_(int *fid, char *name, char *op, int lname, int lop);
int grib_f_open_file__(int *fid, char *name, char *op, int lname, int lop);
int grib_f_open_file(int *fid, char *name, char *op, int lname, int lop);
int grib_f_close_file_(int *fid);
int grib_f_close_file__(int *fid);
int grib_f_close_file(int *fid);
void grib_f_write_on_fail(int *gid);
void grib_f_write_on_fail_(int* gid);
void grib_f_write_on_fail__(int* gid);
int grib_f_multi_support_on_(void);
int grib_f_multi_support_on__(void);
int grib_f_multi_support_on(void);
int grib_f_multi_support_off_(void);
int grib_f_multi_support_off__(void);
int grib_f_multi_support_off(void);
/* GRIB keys iterator */
int grib_f_keys_iterator_new_(int *gid, int *iterid, char *name_space, int len);
int grib_f_keys_iterator_new__(int *gid, int *iterid, char *name_space, int len);
int grib_f_keys_iterator_new(int *gid, int *iterid, char *name_space, int len);
int grib_f_keys_iterator_next_(int *iterid);
int grib_f_keys_iterator_next__(int *iterid);
int grib_f_keys_iterator_next(int *iterid);
int grib_f_keys_iterator_delete_(int *iterid);
int grib_f_keys_iterator_delete__(int *iterid);
int grib_f_keys_iterator_delete(int *iterid);
int grib_f_keys_iterator_get_name_(int *iterid, char *name, int len);
int grib_f_keys_iterator_get_name__(int *kiter, char *name, int len);
int grib_f_keys_iterator_get_name(int *kiter, char *name, int len);
int grib_f_keys_iterator_rewind_(int *kiter);
int grib_f_keys_iterator_rewind__(int *kiter);
int grib_f_keys_iterator_rewind(int *kiter);
/* BUFR keys iterator */
int codes_f_bufr_keys_iterator_new_(int *gid, int *iterid);
int codes_f_bufr_keys_iterator_new__(int *gid, int *iterid);
int codes_f_bufr_keys_iterator_new(int *gid, int *iterid);
int codes_f_bufr_keys_iterator_next_(int *iterid);
int codes_f_bufr_keys_iterator_next__(int *iterid);
int codes_f_bufr_keys_iterator_next(int *iterid);
int codes_f_bufr_keys_iterator_get_name_(int *iterid, char *name, int len);
int codes_f_bufr_keys_iterator_get_name__(int *kiter, char *name, int len);
int codes_f_bufr_keys_iterator_get_name(int *kiter, char *name, int len);
int codes_f_bufr_keys_iterator_rewind_(int *kiter);
int codes_f_bufr_keys_iterator_rewind__(int *kiter);
int codes_f_bufr_keys_iterator_rewind(int *kiter);
int codes_f_bufr_keys_iterator_delete_(int *iterid);
int codes_f_bufr_keys_iterator_delete__(int *iterid);
int codes_f_bufr_keys_iterator_delete(int *iterid);
int grib_f_gribex_mode_on_(void);
int grib_f_gribex_mode_on__(void);
int grib_f_gribex_mode_on(void);
int grib_f_gribex_mode_off_(void);
int grib_f_gribex_mode_off__(void);
int grib_f_gribex_mode_off(void);
int grib_f_skip_computed_(int *iterid);
int grib_f_skip_computed__(int *iterid);
int grib_f_skip_computed(int *iterid);
int grib_f_skip_coded_(int *iterid);
int grib_f_skip_coded__(int *iterid);
int grib_f_skip_coded(int *iterid);
int grib_f_skip_edition_specific_(int *iterid);
int grib_f_skip_edition_specific__(int *iterid);
int grib_f_skip_edition_specific(int *iterid);
int grib_f_skip_duplicates_(int *iterid);
int grib_f_skip_duplicates__(int *iterid);
int grib_f_skip_duplicates(int *iterid);
int grib_f_skip_read_only_(int *iterid);
int grib_f_skip_read_only__(int *iterid);
int grib_f_skip_read_only(int *iterid);
int grib_f_skip_function_(int *iterid);
int grib_f_skip_function__(int *iterid);
int grib_f_skip_function(int *iterid);
int grib_f_new_from_message_(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message__(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message_copy_(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message_copy__(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message_copy(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_samples_(int *gid, char *name, int lname);
int grib_f_new_from_samples__(int *gid, char *name, int lname);
int grib_f_new_from_samples(int *gid, char *name, int lname);
int codes_bufr_f_new_from_samples_(int *gid, char *name, int lname);
int codes_bufr_f_new_from_samples__(int *gid, char *name, int lname);
int codes_bufr_f_new_from_samples(int *gid, char *name, int lname);
int grib_f_clone_(int *gidsrc, int *giddest);
int grib_f_clone__(int *gidsrc, int *giddest);
int grib_f_clone(int *gidsrc, int *giddest);
int grib_f_util_sections_copy_(int *gidfrom, int *gidto, int *what, int *gidout);
int grib_f_util_sections_copy__(int *gidfrom, int *gidto, int *what, int *gidout);
int grib_f_util_sections_copy(int *gidfrom, int *gidto, int *what, int *gidout);
int grib_f_copy_namespace_(int *gidsrc, char *name, int *giddest, int len);
int grib_f_copy_namespace__(int *gidsrc, char *name, int *giddest, int len);
int grib_f_copy_namespace(int *gidsrc, char *name, int *giddest, int len);
int grib_f_copy_key_ (int *gidsrc, char *name, int *giddest, int len);
int grib_f_copy_key__(int *gidsrc, char *name, int *giddest, int len);
int grib_f_copy_key (int *gidsrc, char *name, int *giddest, int len);
int grib_f_count_in_file(int *fid, int *n);
int grib_f_count_in_file_(int *fid, int *n);
int grib_f_count_in_file__(int *fid, int *n);
int any_f_new_from_file_(int *fid, int *gid);
int any_f_new_from_file__(int *fid, int *gid);
int any_f_new_from_file(int *fid, int *gid);
int any_f_scan_file_(int* fid,int* n);
int any_f_scan_file__(int* fid,int* n);
int any_f_scan_file(int* fid,int* n);
int any_f_new_from_scanned_file_(int* fid,int* msgid,int* gid);
int any_f_new_from_scanned_file__(int* fid,int* msgid,int* gid);
int any_f_new_from_scanned_file(int* fid,int* msgid,int* gid);
int any_f_load_all_from_file_(int* fid,int* n);
int any_f_load_all_from_file__(int* fid,int* n);
int any_f_load_all_from_file(int* fid,int* n);
int any_f_new_from_loaded_(int* msgid,int* gid);
int any_f_new_from_loaded__(int* msgid,int* gid);
int any_f_new_from_loaded(int* msgid,int* gid);
int codes_f_clear_loaded_from_file_(void);
int codes_f_clear_loaded_from_file__(void);
int codes_f_clear_loaded_from_file(void);
int grib_f_new_from_file_(int *fid, int *gid);
int grib_f_new_from_file__(int *fid, int *gid);
int grib_f_new_from_file(int *fid, int *gid);
int bufr_f_new_from_file_(int *fid, int *gid);
int bufr_f_new_from_file__(int *fid, int *gid);
int bufr_f_new_from_file(int *fid, int *gid);
int grib_f_headers_only_new_from_file_(int *fid, int *gid);
int grib_f_headers_only_new_from_file__(int *fid, int *gid);
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 *iid, int *gid);
int grib_f_new_from_index(int *iid, int *gid);
int grib_f_index_new_from_file_(char *file, char *keys, int *gid, int lfile, int lkeys);
int grib_f_index_new_from_file__(char *file, char *keys, int *gid, int lfile, int lkeys);
int grib_f_index_new_from_file(char *file, char *keys, int *gid, int lfile, int lkeys);
int grib_f_index_add_file_(int* iid, char* file, int lfile);
int grib_f_index_add_file__(int* iid, char* file, int lfile);
int grib_f_index_add_file(int* iid, char* file, int lfile);
int grib_f_index_read_(char *file, int *gid, int lfile);
int grib_f_index_read__(char *file, int *gid, int lfile);
int grib_f_index_read(char *file, int *gid, int lfile);
int grib_f_index_write_(int *gid, char *file, int lfile);
int grib_f_index_write__(int *gid, char *file, int lfile);
int grib_f_index_write(int *gid, char *file, int lfile);
int grib_f_index_release_(int *hid);
int grib_f_index_release__(int *hid);
int grib_f_index_release(int *hid);
int grib_f_multi_handle_release_(int *hid);
int grib_f_multi_handle_release__(int *hid);
int grib_f_multi_handle_release(int *hid);
int grib_f_release_(int *hid);
int grib_f_release__(int *hid);
int grib_f_release(int *hid);
int grib_f_dump_(int *gid);
int grib_f_dump__(int *gid);
int grib_f_dump(int *gid);
int grib_f_get_api_version_(int* apiVersion,int len);
int grib_f_get_api_version__(int* apiVersion,int len);
int grib_f_get_api_version(int* apiVersion,int len);
int grib_f_get_error_string_(int *err, char *buf, int len);
int grib_f_get_error_string__(int *err, char *buf, int len);
int grib_f_get_error_string(int *err, char *buf, int len);
int grib_f_get_size_int_(int *gid, char *key, int *val, int len);
int grib_f_get_size_int__(int *gid, char *key, int *val, int len);
int grib_f_get_size_int(int *gid, char *key, int *val, int len);
int grib_f_get_size_long_(int *gid, char *key, long *val, int len);
int grib_f_get_size_long__(int *gid, char *key, long *val, int len);
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 *gid, char *key, int *val, int len);
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 *gid, char *key, long *val, int len);
int grib_f_index_get_size_long(int *gid, char *key, long *val, int len);
int grib_f_get_int_(int *gid, char *key, int *val, int len);
int grib_f_get_int__(int *gid, char *key, int *val, int len);
int grib_f_get_int(int *gid, char *key, int *val, int len);
int grib_f_get_long_(int *gid, char *key, long *val, int len);
int grib_f_get_long__(int *gid, char *key, long *val, int len);
int grib_f_get_long(int *gid, char *key, long *val, int len);
int grib_f_get_native_type_(int* gid, char* key, int* val, int len);
int grib_f_get_native_type__(int* gid, char* key, int* val, int len);
int grib_f_get_native_type(int* gid, char* key, int* val, int len);
int grib_f_get_int_array_(int *gid, char *key, int *val, int *size, int len);
int grib_f_get_int_array__(int *gid, char *key, int *val, int *size, int len);
int grib_f_get_int_array(int *gid, char *key, int *val, int *size, int len);
int grib_f_get_long_array_(int *gid, char *key, long *val, int *size, int len);
int grib_f_get_long_array__(int *gid, char *key, long *val, int *size, int len);
int grib_f_get_long_array(int *gid, char *key, long *val, int *size, int len);
int grib_f_get_byte_array_(int* gid, char* key, unsigned char *val, int* size, int len, int lenv);
int grib_f_get_byte_array__(int* gid, char* key, unsigned char *val, int* size, int len, int lenv);
int grib_f_get_byte_array(int* gid, char* key, unsigned char *val, int* size, int len, int lenv);
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 *gid, char *key, char *val, int *eachsize, int *size, int len);
int grib_f_index_get_string(int *gid, char *key, char *val, int *eachsize, int *size, int len);
int grib_f_index_get_long_(int *gid, char *key, long *val, int *size, int len);
int grib_f_index_get_long__(int *gid, char *key, long *val, int *size, int len);
int grib_f_index_get_long(int *gid, char *key, long *val, int *size, int len);
int grib_f_index_get_int_(int *gid, char *key, int *val, int *size, int len);
int grib_f_index_get_int__(int *gid, char *key, int *val, int *size, int len);
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 *gid, char *key, double *val, int *size, int len);
int grib_f_index_get_real8(int *gid, char *key, double *val, int *size, int len);
int grib_f_set_int_array_(int *gid, char *key, int *val, int *size, int len);
int grib_f_set_int_array__(int *gid, char *key, int *val, int *size, int len);
int grib_f_set_int_array(int *gid, char *key, int *val, int *size, int len);
int grib_f_set_long_array_(int *gid, char *key, long *val, int *size, int len);
int grib_f_set_long_array__(int *gid, char *key, long *val, int *size, int len);
int grib_f_set_long_array(int *gid, char *key, long *val, int *size, int len);
int grib_f_set_byte_array_(int* gid, char* key, unsigned char *val, int* size, int len, int lenv);
int grib_f_set_byte_array__(int* gid, char* key, unsigned char *val, int* size, int len, int lenv);
int grib_f_set_byte_array(int* gid, char* key, unsigned char *val, int* size, int len, int lenv);
int grib_f_set_int_(int *gid, char *key, int *val, int len);
int grib_f_set_int__(int *gid, char *key, int *val, int len);
int grib_f_set_int(int *gid, char *key, int *val, int len);
int grib_f_set_long_(int *gid, char *key, long *val, int len);
int grib_f_set_long__(int *gid, char *key, long *val, int len);
int grib_f_set_long(int *gid, char *key, long *val, int len);
int grib_f_set_missing_(int *gid, char *key, int len);
int grib_f_set_missing__(int *gid, char *key, int len);
int grib_f_set_missing(int *gid, char *key, int len);
int grib_f_is_missing_(int *gid, char *key, int *isMissing, int len);
int grib_f_is_missing__(int *gid, char *key, int *isMissing, int len);
int grib_f_is_missing(int *gid, char *key, int *isMissing, int len);
int grib_f_is_defined_(int* gid, char* key,int* isDefined,int len);
int grib_f_is_defined__(int* gid, char* key,int* isDefined,int len);
int grib_f_is_defined(int* gid, char* key,int* isDefined,int len);
int grib_f_set_real4_(int *gid, char *key, float *val, int len);
int grib_f_set_real4__(int *gid, char *key, float *val, int len);
int grib_f_set_real4(int *gid, char *key, float *val, int len);
int grib_f_get_real4_element_(int *gid, char *key, int *index, float *val, int len);
int grib_f_get_real4_element__(int *gid, char *key, int *index, float *val, int len);
int grib_f_get_real4_element(int *gid, char *key, int *index, float *val, int len);
int grib_f_get_real4_elements_(int *gid, char *key, int *index, float *val, int *size, int len);
int grib_f_get_real4_elements__(int *gid, char *key, int *index, float *val, int *len, int size);
int grib_f_get_real4_elements(int *gid, char *key, int *index, float *val, int *len, int size);
int grib_f_get_real4_(int *gid, char *key, float *val, int len);
int grib_f_get_real4__(int *gid, char *key, float *val, int len);
int grib_f_get_real4(int *gid, char *key, float *val, int len);
int grib_f_get_real4_array_(int *gid, char *key, float *val, int *size, int len);
int grib_f_get_real4_array__(int *gid, char *key, float *val, int *size, int len);
int grib_f_get_real4_array(int *gid, char *key, float *val, int *size, int len);
int grib_f_set_real4_array_(int *gid, char *key, float *val, int *size, int len);
int grib_f_set_real4_array__(int *gid, char *key, float *val, int *size, int len);
int grib_f_set_real4_array(int *gid, char *key, float *val, int *size, int len);
int grib_f_set_force_real4_array_(int *gid, char *key, float *val, int *size, int len);
int grib_f_set_force_real4_array__(int *gid, char *key, float *val, int *size, int len);
int grib_f_set_force_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 *gid, char *key, double *val, int len);
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 *gid, char *key, char *val, int len, int vallen);
int grib_f_index_select_string(int *gid, char *key, char *val, int len, int vallen);
int grib_f_index_select_int_(int *gid, char *key, int *val, int len);
int grib_f_index_select_int__(int *gid, char *key, int *val, int len);
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 *gid, char *key, long *val, int len);
int grib_f_index_select_long(int *gid, char *key, long *val, int len);
int grib_f_set_real8_(int *gid, char *key, double *val, int len);
int grib_f_set_real8__(int *gid, char *key, double *val, int len);
int grib_f_set_real8(int *gid, char *key, double *val, int len);
int grib_f_get_real8_(int *gid, char *key, double *val, int len);
int grib_f_get_real8__(int *gid, char *key, double *val, int len);
int grib_f_get_real8(int *gid, char *key, double *val, int len);
int grib_f_get_real8_element_(int *gid, char *key, int *index, double *val, int len);
int grib_f_get_real8_element__(int *gid, char *key, int *index, double *val, int len);
int grib_f_get_real8_element(int *gid, char *key, int *index, double *val, int len);
int grib_f_get_real8_elements_(int *gid, char *key, int *index, double *val, int *size, int len);
int grib_f_get_real8_elements__(int *gid, char *key, int *index, double *val, int *len, int size);
int grib_f_get_real8_elements(int *gid, char *key, int *index, double *val, int *len, int size);
int grib_f_find_nearest_four_single_(int *gid, int *is_lsm, double *inlat, double *inlon, double *outlats, double *outlons, double *values, double *distances, int *indexes);
int grib_f_find_nearest_four_single__(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes);
int grib_f_find_nearest_four_single(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes);
int grib_f_find_nearest_single_(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes);
int grib_f_find_nearest_single__(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes);
int grib_f_find_nearest_single(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes);
int grib_f_find_nearest_multiple_(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes, int *npoints);
int grib_f_find_nearest_multiple__(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes, int *npoints);
int grib_f_find_nearest_multiple(int *gid, int *is_lsm, double *inlats, double *inlons, double *outlats, double *outlons, double *values, double *distances, int *indexes, int *npoints);
int grib_f_get_real8_array_(int *gid, char *key, double *val, int *size, int len);
int grib_f_get_real8_array__(int *gid, char *key, double *val, int *size, int len);
int grib_f_get_real8_array(int *gid, char *key, double *val, int *size, int len);
int grib_f_set_real8_array_(int *gid, char *key, double *val, int *size, int len);
int grib_f_set_real8_array__(int *gid, char *key, double *val, int *size, int len);
int grib_f_set_real8_array(int *gid, char *key, double *val, int *size, int len);
int grib_f_set_force_real8_array_(int *gid, char *key, double *val, int *size, int len);
int grib_f_set_force_real8_array__(int *gid, char *key, double *val, int *size, int len);
int grib_f_set_force_real8_array(int *gid, char *key, double *val, int *size, int len);
int grib_f_get_string_array(int* gid, char* key, char* val,int* nvals,int* slen,int len);
int grib_f_get_string_array_(int* gid, char* key, char* val,int* nvals,int* slen,int len);
int grib_f_get_string_array__(int* gid, char* key, char* val,int* nvals,int* slen,int len);
int grib_f_set_string_array(int* gid, char* key, char* val,int* nvals,int* slen, int len);
int grib_f_set_string_array_(int* gid, char* key, char* val,int* nvals,int* slen, int len);
int grib_f_set_string_array__(int* gid, char* key, char* val,int* nvals,int* slen, int len);
int grib_f_get_string_(int *gid, char *key, char *val, int len, int len2);
int grib_f_get_string__(int *gid, char *key, char *val, int len, int len2);
int grib_f_get_string(int *gid, char *key, char *val, int len, int len2);
int grib_f_set_string_(int *gid, char *key, char *val, int len, int len2);
int grib_f_set_string__(int *gid, char *key, char *val, int len, int len2);
int grib_f_set_string(int *gid, char *key, char *val, int len, int len2);
int grib_f_get_data_real4_(int *gid, float *lats, float *lons, float *values, size_t *size);
int grib_f_get_data_real4__(int *gid, float *lats, float *lons, float *values, size_t *size);
int grib_f_get_data_real4(int *gid, float *lats, float *lons, float *values, size_t *size);
int grib_f_get_data_real8_(int *gid, double *lats, double *lons, double *values, size_t *size);
int grib_f_get_data_real8__(int *gid, double *lats, double *lons, double *values, size_t *size);
int grib_f_get_data_real8(int *gid, double *lats, double *lons, double *values, size_t *size);
int grib_f_get_message_size_(int *gid, size_t *len);
int grib_f_get_message_size__(int *gid, size_t *len);
int grib_f_get_message_size(int *gid, size_t *len);
int grib_f_copy_message_(int *gid, void *mess, size_t *len);
int grib_f_copy_message__(int *gid, void *mess, size_t *len);
int grib_f_copy_message(int *gid, void *mess, size_t *len);
void grib_f_check_(int *err, char *call, char *str, int lencall, int lenstr);
void grib_f_check__(int *err, char *call, char *key, int lencall, int lenkey);
void grib_f_check(int *err, char *call, char *key, int lencall, int lenkey);
int grib_f_write_(int *gid, int *fid);
int grib_f_write__(int *gid, int *fid);
int grib_f_write(int *gid, int *fid);
int grib_f_multi_write_(int *gid, int *fid);
int grib_f_multi_write__(int *gid, int *fid);
int grib_f_multi_write(int *gid, int *fid);
int grib_f_multi_append_(int *ingid, int *sec, int *mgid);
int grib_f_multi_append(int *ingid, int *sec, int *mgid);
int grib_f_multi_append__(int *ingid, int *sec, int *mgid);
int codes_f_bufr_copy_data(int* gid1,int* gid2);
int codes_f_bufr_copy_data_(int* gid1,int* gid2);
int codes_f_bufr_copy_data__(int* gid1,int* gid2);
int codes_f_bufr_multi_element_constant_arrays_on_(void);
int codes_f_bufr_multi_element_constant_arrays_on__(void);
int codes_f_bufr_multi_element_constant_arrays_on(void);
int codes_f_bufr_multi_element_constant_arrays_off_(void);
int codes_f_bufr_multi_element_constant_arrays_off__(void);
int codes_f_bufr_multi_element_constant_arrays_off(void);
int grib_f_set_definitions_path_(char *path, int len);
int grib_f_set_definitions_path__(char *path, int len);
int grib_f_set_definitions_path(char *path, int len);
int grib_f_set_samples_path_(char *path, int len);
int grib_f_set_samples_path__(char *path, int len);
int grib_f_set_samples_path(char *path, int len);
int grib_f_julian_to_datetime(double* jd,long* year,long* month,long* day,long *hour,long *minute,long *second);
int grib_f_julian_to_datetime_(double* jd,long* year,long* month,long* day,long *hour,long *minute,long *second);
int grib_f_julian_to_datetime__(double* jd,long* year,long* month,long* day,long *hour,long *minute,long *second);
int grib_f_datetime_to_julian(long* year,long* month,long* day, long* hour,long* minute,long* second,double* jd);
int grib_f_datetime_to_julian_(long* year,long* month,long* day, long* hour,long* minute,long* second,double* jd);
int grib_f_datetime_to_julian__(long* year,long* month,long* day, long* hour,long* minute,long* second,double* jd);
#ifdef __cplusplus
}
#endif

Binary file not shown.

BIN
samples/hdf5.tmpl Normal file

Binary file not shown.

View File

@ -25,6 +25,7 @@
MEMBERS = char* masterDir
MEMBERS = char* localDir
MEMBERS = char* ecmfDir
MEMBERS = char* full_path
MEMBERS = int nofail
END_CLASS_DEF
@ -56,6 +57,7 @@ typedef struct grib_action_hash_array {
char* masterDir;
char* localDir;
char* ecmfDir;
char* full_path;
int nofail;
} grib_action_hash_array;
@ -159,6 +161,8 @@ grib_action* grib_action_create_hash_array(grib_context* context,
else
a->ecmfDir = NULL;
a->full_path = NULL;
if (defaultkey)
act->defaultkey = grib_context_strdup_persistent(context, defaultkey);
@ -282,6 +286,12 @@ static grib_hash_array_value* get_hash_array_impl(grib_handle* h, grib_action* a
full = grib_context_full_defs_path(context, master);
if (c) {
if (!full) {
grib_context_log(context, GRIB_LOG_ERROR,
"unable to find definition file %s in %s:%s:%s\nDefinition files path=\"%s\"",
self->basename, master, ecmf, local, context->grib_definition_files_path);
return NULL;
}
grib_hash_array_value* last = c;
while (last->next)
last = last->next;
@ -296,6 +306,7 @@ static grib_hash_array_value* get_hash_array_impl(grib_handle* h, grib_action* a
self->basename, master, ecmf, local, context->grib_definition_files_path);
return NULL;
}
self->full_path = full;
grib_context_log(h->context, GRIB_LOG_DEBUG,
"Loading hash_array %s from %s", ((grib_action*)self)->name, full);
@ -324,3 +335,9 @@ grib_hash_array_value* get_hash_array(grib_handle* h, grib_action* a)
GRIB_MUTEX_UNLOCK(&mutex);
return result;
}
const char* get_hash_array_full_path(grib_action* a)
{
grib_action_hash_array* self = (grib_action_hash_array*)a;
return self->full_path;
}

View File

@ -175,6 +175,11 @@ grib_handle* codes_handle_clone(const grib_handle* h)
{
return grib_handle_clone(h);
}
grib_handle* codes_handle_clone_headers_only(const grib_handle* h)
{
return grib_handle_clone_headers_only(h);
}
int codes_handle_delete(grib_handle* h)
{
return grib_handle_delete(h);
@ -461,6 +466,11 @@ void codes_gts_header_off(grib_context* c)
{
grib_gts_header_off(c);
}
void codes_gts_header_on(grib_context* c)
{
grib_gts_header_on(c);
}
void codes_gribex_mode_on(grib_context* c)
{
grib_gribex_mode_on(c);

View File

@ -495,6 +495,7 @@ codes_handle* codes_handle_new_from_samples(codes_context* c, const char* sample
* @return the new handle, NULL if the message is invalid or a problem is encountered
*/
codes_handle* codes_handle_clone(const codes_handle* h);
codes_handle* codes_handle_clone_headers_only(const codes_handle* h);
/**
* Frees a handle, also frees the message if it is not a user message
@ -1527,7 +1528,7 @@ Error codes returned by the eccodes functions.
#define CODES_WRONG_STEP_UNIT GRIB_WRONG_STEP_UNIT
/** Invalid file id */
#define CODES_INVALID_FILE GRIB_INVALID_FILE
/** Invalid grib id */
/** Invalid GRIB id */
#define CODES_INVALID_GRIB GRIB_INVALID_GRIB
/** Invalid index id */
#define CODES_INVALID_INDEX GRIB_INVALID_INDEX

View File

@ -74,6 +74,7 @@ int get_concept_condition_string(grib_handle* h, const char* key, const char* va
/* action_class_hash_array.cc*/
grib_action* grib_action_create_hash_array(grib_context* context, const char* name, grib_hash_array_value* hash_array, const char* basename, const char* name_space, const char* defaultkey, const char* masterDir, const char* localDir, const char* ecmfDir, int flags, int nofail);
grib_hash_array_value* get_hash_array(grib_handle* h, grib_action* a);
const char* get_hash_array_full_path(grib_action* a);
/* action_class_set.cc*/
grib_action* grib_action_create_set(grib_context* context, const char* name, grib_expression* expression, int nofail);
@ -176,9 +177,9 @@ void grib_hash_array_value_delete(grib_context* c, grib_hash_array_value* v);
/* grib_bufr_descriptor.cc*/
bufr_descriptor* grib_bufr_descriptor_new(grib_accessor* tables_accessor, int code, int silent, int* err);
bufr_descriptor* grib_bufr_descriptor_clone(bufr_descriptor* d);
int grib_bufr_descriptor_set_code(grib_accessor* tables_accessor, int code, bufr_descriptor* v);
int grib_bufr_descriptor_set_code(bufr_descriptor* v, int code);
void grib_bufr_descriptor_set_scale(bufr_descriptor* v, long scale);
int grib_bufr_descriptor_can_be_missing(bufr_descriptor* v);
int grib_bufr_descriptor_can_be_missing(const bufr_descriptor* v);
void grib_bufr_descriptor_delete(bufr_descriptor* v);
/* grib_bufr_descriptors_array.cc*/
@ -340,6 +341,9 @@ void grib_smart_table_delete(grib_context* c);
/* grib_accessor_class_codetable.cc*/
void grib_codetable_delete(grib_context* c);
int codes_codetable_get_contents_malloc(const grib_handle* h, const char* key, code_table_entry** entries, size_t* num_entries);
int codes_codetable_check_code_figure(const grib_handle* h, const char* key, long code_figure);
int codes_codetable_check_abbreviation(const grib_handle* h, const char* key, const char* abbreviation);
/* grib_accessor_class_codetable_units.cc*/
@ -1016,8 +1020,6 @@ int wmo_read_any_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_grib_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_bufr_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_gts_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_taf_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_metar_from_file(FILE* f, void* buffer, size_t* len);
int wmo_read_any_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset);
int wmo_read_grib_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset);
int wmo_read_bufr_from_file_fast(FILE* f, size_t* msg_len, off_t* msg_offset);
@ -1144,6 +1146,7 @@ int grib_set_missing(grib_handle* h, const char* name);
int grib_is_missing_long(grib_accessor* a, long x);
int grib_is_missing_double(grib_accessor* a, double x);
int grib_is_missing_string(grib_accessor* a, const unsigned char* x, size_t len);
int grib_accessor_can_be_missing(grib_accessor* a, int* err);
int grib_accessor_is_missing(grib_accessor* a, int* err);
int grib_is_missing(const grib_handle* h, const char* name, int* err);
int grib_is_defined(const grib_handle* h, const char* name);
@ -1157,8 +1160,6 @@ int grib_set_float_array(grib_handle* h, const char* name, const float* val, siz
int grib_set_long_array_internal(grib_handle* h, const char* name, const long* val, size_t length);
int grib_set_long_array(grib_handle* h, const char* name, const long* val, size_t length);
int grib_get_long_internal(grib_handle* h, const char* name, long* val);
int grib_is_in_dump(grib_handle* h, const char* name);
int grib_attributes_count(grib_accessor* a, size_t* size);
int grib_get_long(const grib_handle* h, const char* name, long* val);
int grib_get_double_internal(grib_handle* h, const char* name, double* val);
int grib_get_double(const grib_handle* h, const char* name, double* val);
@ -1196,15 +1197,12 @@ int grib_get_string_array(const grib_handle* h, const char* name, char** val, si
int ecc__grib_get_long_array_internal(const grib_handle* h, grib_accessor* a, long* val, size_t buffer_len, size_t* decoded_length);
int grib_get_long_array_internal(grib_handle* h, const char* name, long* val, size_t* length);
int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_t* length);
grib_key_value_list* grib_key_value_list_clone(grib_context* c, grib_key_value_list* list);
void grib_key_value_list_delete(grib_context* c, grib_key_value_list* kvl);
int grib_get_key_value_list(grib_handle* h, grib_key_value_list* list);
int grib_get_values(grib_handle* h, grib_values* args, size_t count);
int grib_set_values(grib_handle* h, grib_values* args, size_t count);
int grib_get_nearest_smaller_value(grib_handle* h, const char* name, double val, double* nearest);
void grib_print_values(const char* title, grib_values* values);
int grib_values_check(grib_handle* h, grib_values* values, int count);
int grib_key_equal(grib_handle* h1, grib_handle* h2, const char* key, int type, int* err);
int grib_key_equal(const grib_handle* h1, const grib_handle* h2, const char* key, int type, int* err);
int codes_copy_key(grib_handle* h1, grib_handle* h2, const char* key, int type);
int codes_compare_key(grib_handle* h1, grib_handle* h2, const char* key, int compare_flags);

View File

@ -23,7 +23,6 @@
IMPLEMENTS = byte_count; value_count
IMPLEMENTS = byte_offset; unpack_double
IMPLEMENTS = get_native_type
IMPLEMENTS = compare
IMPLEMENTS = pack_long; unpack_double; pack_double
MEMBERS = const char* bufrDataEncodedName
MEMBERS = const char* numberOfSubsetsName
@ -98,7 +97,6 @@ static int value_count(grib_accessor*, long*);
static void destroy(grib_context*, grib_accessor*);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_bufr_data_array
{
@ -194,7 +192,7 @@ static grib_accessor_class _grib_accessor_class_bufr_data_array = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -474,11 +472,6 @@ static long next_offset(grib_accessor* a)
return a->offset;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
return GRIB_NOT_IMPLEMENTED;
}
static int pack_long(grib_accessor* a, const long* val, size_t* len)
{
grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a;

View File

@ -50,7 +50,7 @@ static void thread_init()
CLASS = accessor
SUPER = grib_accessor_class_unsigned
IMPLEMENTS = init;dump;unpack_string;pack_expression;unpack_long
IMPLEMENTS = value_count;pack_string; destroy; get_native_type;
IMPLEMENTS = value_count;pack_string; destroy; get_native_type;pack_missing
MEMBERS = const char* tablename
MEMBERS = const char* masterDir
MEMBERS = const char* localDir
@ -71,6 +71,7 @@ or edit "accessor.class" and rerun ./make_class.pl
*/
static int get_native_type(grib_accessor*);
static int pack_missing(grib_accessor*);
static int pack_string(grib_accessor*, const char*, size_t* len);
static int pack_expression(grib_accessor*, grib_expression*);
static int unpack_long(grib_accessor*, long* val, size_t* len);
@ -115,7 +116,7 @@ static grib_accessor_class _grib_accessor_class_codetable = {
0, /* get offset to bytes */
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* pack_missing */
&pack_missing, /* pack_missing */
0, /* is_missing */
0, /* pack_long */
&unpack_long, /* unpack_long */
@ -221,7 +222,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* params)
p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret);
if (ret != GRIB_SUCCESS) {
grib_context_log(a->context, GRIB_LOG_FATAL,
"unable to evaluate %s as string", a->name);
"Unable to evaluate %s as string", a->name);
}
s_len = strlen(p) + 1;
pack_string(a, p, &s_len);
@ -523,6 +524,94 @@ void grib_codetable_delete(grib_context* c)
}
}
int codes_codetable_get_contents_malloc(const grib_handle* h, const char* key, code_table_entry** entries, size_t* num_entries)
{
long lvalue = 0;
size_t size = 1;
int err = 0;
grib_context* c = h->context;
grib_accessor* aa = grib_find_accessor(h, key);
if (!aa) return GRIB_NOT_FOUND;
if (!STR_EQUAL(aa->cclass->name, "codetable")) {
return GRIB_INVALID_ARGUMENT; // key is not a codetable
}
const grib_accessor_codetable* ca = (const grib_accessor_codetable*)aa; // could be dynamic_cast
// Decode the key itself. This will either fetch it from the cache or place it there
if ((err = grib_unpack_long(aa, &lvalue, &size)) != GRIB_SUCCESS) {
return err;
}
const grib_codetable* table = ca->table;
if (!table) return GRIB_INTERNAL_ERROR;
grib_codetable* cached_table = c->codetable; // Access the codetable cache
while (cached_table) {
if (STR_EQUAL(table->recomposed_name[0], cached_table->recomposed_name[0])) {
// Found a cache entry that matches the recomposed name of ours
*num_entries = cached_table->size;
*entries = (code_table_entry*)calloc(cached_table->size, sizeof(code_table_entry));
if (!*entries) {
return GRIB_OUT_OF_MEMORY;
}
for (size_t i = 0; i < cached_table->size; i++) {
(*entries)[i] = cached_table->entries[i];
}
return GRIB_SUCCESS;
}
cached_table = cached_table->next;
}
return GRIB_CODE_NOT_FOUND_IN_TABLE;
}
int codes_codetable_check_code_figure(const grib_handle* h, const char* key, long code_figure)
{
code_table_entry* entries = NULL;
size_t num_entries = 0;
int err = 0;
err = codes_codetable_get_contents_malloc(h, key, &entries, &num_entries);
if (err) return err;
if (code_figure < 0 || (size_t)code_figure >= num_entries) {
err = GRIB_OUT_OF_RANGE;
goto cleanup;
}
if (entries[code_figure].abbreviation == NULL) {
err = GRIB_INVALID_KEY_VALUE;
goto cleanup;
}
cleanup:
free(entries);
return err;
}
int codes_codetable_check_abbreviation(const grib_handle* h, const char* key, const char* abbreviation)
{
code_table_entry* entries = NULL;
size_t num_entries = 0;
int err = 0;
err = codes_codetable_get_contents_malloc(h, key, &entries, &num_entries);
if (err) return err;
bool found = false;
for (size_t i=0; i<num_entries; ++i) {
const char* abbrev = entries[i].abbreviation;
if (abbrev && STR_EQUAL(abbrev, abbreviation)) {
found = true;
break;
}
}
if (!found) err = GRIB_INVALID_KEY_VALUE;
free(entries);
return err;
}
static void dump(grib_accessor* a, grib_dumper* dumper)
{
grib_accessor_codetable* self = (grib_accessor_codetable*)a;
@ -638,6 +727,12 @@ static bool is_number(const char* s)
return true;
}
static bool strings_equal(const char* s1, const char* s2, bool case_sensitive)
{
if (case_sensitive) return (strcmp(s1, s2) == 0);
return (strcmp_nocase(s1, s2) == 0);
}
static int pack_string(grib_accessor* a, const char* buffer, size_t* len)
{
long lValue = 0;
@ -648,15 +743,15 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len)
return grib_pack_long(a, &lValue, &l);
}
if (STR_EQUAL_NOCASE(buffer, "missing")) {
return pack_missing(a);
}
grib_accessor_codetable* self = (grib_accessor_codetable*)a;
grib_codetable* table;
long i;
grib_codetable* table = NULL;
long i = 0;
size_t size = 1;
typedef int (*cmpproc)(const char*, const char*);
cmpproc cmp = (a->flags & GRIB_ACCESSOR_FLAG_LOWERCASE) ? strcmp_nocase : strcmp;
if (!self->table_loaded) {
self->table = load_table(a); /* may return NULL */
self->table_loaded = 1;
@ -672,10 +767,18 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len)
return err;
}
for (i = 0; i < table->size; i++)
if (table->entries[i].abbreviation)
if (cmp(table->entries[i].abbreviation, buffer) == 0)
// If the key has the "lowercase" flag set, then the string comparison
// should ignore the case
bool case_sensitive = true;
if (a->flags & GRIB_ACCESSOR_FLAG_LOWERCASE) case_sensitive = false;
for (i = 0; i < table->size; i++) {
if (table->entries[i].abbreviation) {
if (strings_equal(table->entries[i].abbreviation, buffer, case_sensitive)) {
return grib_pack_long(a, &i, &size);
}
}
}
if (a->flags & GRIB_ACCESSOR_FLAG_NO_FAIL) {
grib_action* act = (grib_action*)(a->creator);
@ -740,7 +843,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e)
if (strcmp(e->cclass->name, "long") == 0) {
grib_expression_evaluate_long(hand, e, &lval); /* TDOD: check return value */
/*if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %ld\n", a->name,lval);*/
//if (hand->context->debug) printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %ld\n", a->name,lval);
ret = grib_pack_long(a, &lval, &len);
}
else {
@ -748,12 +851,14 @@ static int pack_expression(grib_accessor* a, grib_expression* e)
len = sizeof(tmp);
cval = grib_expression_evaluate_string(hand, e, tmp, &len, &ret);
if (ret != GRIB_SUCCESS) {
grib_context_log(a->context, GRIB_LOG_ERROR, "grib_accessor_codetable.pack_expression: unable to evaluate string %s to be set in %s\n", grib_expression_get_name(e), a->name);
grib_context_log(a->context, GRIB_LOG_ERROR,
"grib_accessor_codetable.%s: Unable to evaluate string %s to be set in %s",
__func__, grib_expression_get_name(e), a->name);
return ret;
}
len = strlen(cval) + 1;
/*if (hand->context->debug)
printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %s\n", a->name, cval);*/
//if (hand->context->debug)
// printf("ECCODES DEBUG grib_accessor_class_codetable::pack_expression %s %s\n", a->name, cval);
ret = grib_pack_string(a, cval, &len);
}
return ret;
@ -824,3 +929,27 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
*len = rlen;
return GRIB_SUCCESS;
}
static int pack_missing(grib_accessor* a)
{
// Many of the code tables do have a 'Missing' entry (all bits = 1)
// So it is more user-friendly to allow setting codetable keys to
// missing. For tables that do not have such an entry, an error is issued
grib_accessor_codetable* self = (grib_accessor_codetable*)a;
grib_handle* h = grib_handle_of_accessor(a);
const long nbytes = a->length;
const long nbits = nbytes*8;
const long maxVal = (1<<nbits) - 1;
int err = codes_codetable_check_code_figure(h, a->name, maxVal);
if (!err) {
size_t l = 1;
return grib_pack_long(a, &maxVal, &l);
}
grib_context_log(a->context, GRIB_LOG_ERROR, "There is no 'missing' entry in Code Table %s (%s)",
self->tablename, grib_get_error_message(err));
return err;
}

View File

@ -446,7 +446,7 @@ static int get_native_type(grib_accessor* a)
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval = 0;
int retval = GRIB_SUCCESS;
double* aval = 0;
double* bval = 0;
@ -475,10 +475,8 @@ static int compare(grib_accessor* a, grib_accessor* b)
grib_unpack_double(b, bval, &blen);
retval = GRIB_SUCCESS;
while (alen != 0) {
if (*bval != *aval)
retval = GRIB_DOUBLE_VALUE_MISMATCH;
alen--;
for (size_t i=0; i<alen && retval == GRIB_SUCCESS; ++i) {
if (aval[i] != bval[i]) retval = GRIB_DOUBLE_VALUE_MISMATCH;
}
grib_context_free(a->context, aval);

View File

@ -108,35 +108,27 @@ grib_accessor_class* grib_accessor_class_data_g2secondary_bitmap = &_grib_access
static void init(grib_accessor* a, const long v, grib_arguments* args)
{
grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a;
self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4);
self->number_of_values = grib_arguments_get_name(grib_handle_of_accessor(a), args, 4);
}
static int value_count(grib_accessor* a, long* len)
{
grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a;
*len = 0;
*len = 0;
return grib_get_long_internal(grib_handle_of_accessor(a), self->number_of_values, len);
}
static int pack_double(grib_accessor* a, const double* val, size_t* len)
{
grib_accessor_data_g2secondary_bitmap* self = (grib_accessor_data_g2secondary_bitmap*)a;
int err = 0;
long primary_len = 0;
long secondary_len = 0;
long primary_len = 0, secondary_len = 0;
double* primary_bitmap = NULL;
double* secondary_bitmap = NULL;
long i = 0;
long j = 0;
long on = 0;
long k;
long m;
double missing_value = 0;
double present_value = 0;
long expand_by = 0;
long i = 0, j = 0, on = 0, k = 0, m = 0;
double missing_value = 0, present_value = 0;
long expand_by = 0;
if (*len == 0)
return GRIB_NO_VALUES;

View File

@ -343,7 +343,7 @@ static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_
*err = GRIB_DECODING_ERROR;
return;
}
grib_bufr_descriptor_set_code(0, (size - 1) * 1000 + 100000, uidx);
grib_bufr_descriptor_set_code(uidx, (size - 1) * 1000 + 100000);
size++;
}
else {
@ -602,7 +602,7 @@ static int expand(grib_accessor* a)
bufr_descriptors_array* unexpanded_copy = NULL;
bufr_descriptors_array* expanded = NULL;
grib_context* c = a->context;
grib_handle* h = grib_handle_of_accessor(a);
const grib_handle* h = grib_handle_of_accessor(a);
int operator206yyy_width = 0; /* width specified by operator 206YYY */
if (!self->do_expand) {
@ -813,7 +813,7 @@ static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len)
char buf[25] = {0,};
long llen = 0;
size_t i = 0, size = 0;
grib_context* c = a->context;
const grib_context* c = a->context;
err = grib_value_count(a, &llen);
if (err) return err;

View File

@ -19,7 +19,6 @@
IMPLEMENTS = unpack_long;pack_long
IMPLEMENTS = init;dump
IMPLEMENTS = get_native_type
IMPLEMENTS = compare
END_CLASS_DEF
*/
@ -39,7 +38,6 @@ static int pack_long(grib_accessor*, const long* val, size_t* len);
static int unpack_long(grib_accessor*, long* val, size_t* len);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_g1_half_byte_codeflag
{
@ -88,7 +86,7 @@ static grib_accessor_class _grib_accessor_class_g1_half_byte_codeflag = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -150,34 +148,3 @@ static int get_native_type(grib_accessor* a)
{
return GRIB_TYPE_LONG;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
long aval = 0;
long bval = 0;
long count = 0;
size_t alen = 0;
size_t blen = 0;
int err = 0;
err = grib_value_count(a, &count);
if (err)
return err;
alen = count;
err = grib_value_count(b, &count);
if (err)
return err;
blen = count;
if (alen != 1 || blen != 1)
return GRIB_COUNT_MISMATCH;
grib_unpack_long(a, &aval, &alen);
grib_unpack_long(b, &bval, &blen);
if (bval != aval)
return GRIB_VALUE_MISMATCH;
return GRIB_SUCCESS;
}

View File

@ -117,8 +117,7 @@ static void init(grib_accessor* a, const long l, grib_arguments* c)
a->flags |= GRIB_ACCESSOR_FLAG_HIDDEN;
self->number_of_elements = 6;
self->v = (double*)grib_context_malloc(a->context,
sizeof(double) * self->number_of_elements);
self->v = (double*)grib_context_malloc(a->context, sizeof(double) * self->number_of_elements);
a->length = 0;
a->dirty = 1;
@ -127,8 +126,8 @@ static void init(grib_accessor* a, const long l, grib_arguments* c)
static int unpack_double(grib_accessor* a, double* val, size_t* len)
{
grib_accessor_g1end_of_interval_monthly* self = (grib_accessor_g1end_of_interval_monthly*)a;
int ret = 0;
char verifyingMonth[7] = {0,};
int ret = 0;
char verifyingMonth[7] = {0,};
size_t slen = 7;
long year = 0, month = 0, date = 0;
const long mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
@ -144,6 +143,9 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
return ret;
date = atoi(verifyingMonth);
if (date < 0) {
return GRIB_INVALID_ARGUMENT;
}
year = date / 100;
month = date - year * 100;
if (month == 2) {
@ -151,9 +153,10 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
days = 29;
}
else
else {
if (month < 1 || month > 12) return GRIB_INVALID_ARGUMENT;
days = mdays[month - 1];
}
self->v[0] = year;
self->v[1] = month;
@ -217,13 +220,11 @@ static int compare(grib_accessor* a, grib_accessor* b)
b->dirty = 1;
a->dirty = 1;
grib_unpack_double(a, aval, &alen);
grib_unpack_double(b, bval, &blen);
err = grib_unpack_double(a, aval, &alen); if(err) return err;
err = grib_unpack_double(b, bval, &blen); if(err) return err;
while (alen != 0) {
if (*bval != *aval)
retval = GRIB_DOUBLE_VALUE_MISMATCH;
alen--;
for(size_t i=0; i<alen && retval == GRIB_SUCCESS; ++i) {
if (aval[i] != bval[i]) retval = GRIB_DOUBLE_VALUE_MISMATCH;
}
grib_context_free(a->context, aval);

View File

@ -484,7 +484,7 @@ static int pack_double_array_as_long(grib_accessor* a, const double* v, size_t*
size_t numBytes = *len * (sizeof(long));
long* lValues = (long*)grib_context_malloc(c, numBytes);
if (!lValues) {
grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %ld bytes\n", numBytes);
grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", numBytes);
return GRIB_OUT_OF_MEMORY;
}
for (i = 0; i < *len; i++)

View File

@ -203,6 +203,11 @@ static grib_hash_array_value* find_hash_value(grib_accessor* a, int* err)
grib_context_log(a->context, GRIB_LOG_ERROR,
"hash_array: no match for %s=%s",
a->creator->name, self->key);
const char* full_path = get_hash_array_full_path(a->creator);
if (full_path) {
grib_context_log(a->context, GRIB_LOG_ERROR, "hash_array: file path = %s", full_path);
}
grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Check the key 'masterTablesVersionNumber'");
return NULL;
}
return ha_ret;

View File

@ -16,7 +16,6 @@
CLASS = accessor
SUPER = grib_accessor_class_gen
IMPLEMENTS = init;dump;get_native_type;unpack_string
IMPLEMENTS = compare
END_CLASS_DEF
*/
@ -35,7 +34,6 @@ static int get_native_type(grib_accessor*);
static int unpack_string(grib_accessor*, char*, size_t* len);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_label
{
@ -84,7 +82,7 @@ static grib_accessor_class _grib_accessor_class_label = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -116,11 +114,6 @@ static int get_native_type(grib_accessor* a)
return GRIB_TYPE_LABEL;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
return GRIB_SUCCESS;
}
static int unpack_string(grib_accessor* a, char* val, size_t* len)
{
size_t vlen = strlen(a->name);

View File

@ -241,10 +241,8 @@ static int compare(grib_accessor* a, grib_accessor* b)
grib_unpack_long(b, bval, &blen);
retval = GRIB_SUCCESS;
while (alen != 0) {
if (*bval != *aval)
retval = GRIB_LONG_VALUE_MISMATCH;
alen--;
for (size_t i=0; i<alen && retval == GRIB_SUCCESS; ++i) {
if (aval[i] != bval[i]) retval = GRIB_LONG_VALUE_MISMATCH;
}
grib_context_free(a->context, aval);
@ -258,7 +256,7 @@ static int pack_string(grib_accessor* a, const char* val, size_t* len)
long v = 0; /* The converted value */
// ECC-1722
if (strcmp_nocase(val, "missing")==0) {
if (STR_EQUAL_NOCASE(val, "missing")) {
return pack_missing(a);
}

View File

@ -8,10 +8,6 @@
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
/**************************************
* Enrico Fucile
**************************************/
#include "grib_api_internal.h"
/*
This is used by make_class.pl
@ -21,7 +17,6 @@
SUPER = grib_accessor_class_bytes
IMPLEMENTS = init;update_size;resize; value_count
IMPLEMENTS = unpack_string; string_length
IMPLEMENTS = compare
END_CLASS_DEF
*/
@ -42,7 +37,6 @@ static int value_count(grib_accessor*, long*);
static void init(grib_accessor*, const long, grib_arguments*);
static void update_size(grib_accessor*, size_t);
static void resize(grib_accessor*,size_t);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_message
{
@ -92,7 +86,7 @@ static grib_accessor_class _grib_accessor_class_message = {
&resize, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -115,12 +109,12 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg)
a->length = grib_handle_of_accessor(a)->buffer->ulength - len - a->offset;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
if (a->length != b->length)
return GRIB_COUNT_MISMATCH;
return GRIB_SUCCESS;
}
// static int compare(grib_accessor* a, grib_accessor* b)
// {
// if (a->length != b->length)
// return GRIB_COUNT_MISMATCH;
// return GRIB_SUCCESS;
// }
static void update_size(grib_accessor* a, size_t new_size)
{

View File

@ -133,6 +133,7 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len)
if (v[i] > 126)
v[i] = 32;
memcpy(val, grib_handle_of_accessor(a)->buffer->data, slen);
val[i] = 0;
*len = slen;

View File

@ -15,14 +15,13 @@
START_CLASS_DEF
CLASS = accessor
SUPER = grib_accessor_class_gen
IMPLEMENTS = unpack_string;pack_string
IMPLEMENTS = unpack_long;pack_long
IMPLEMENTS = unpack_double;pack_double
IMPLEMENTS = unpack_string
IMPLEMENTS = unpack_long
IMPLEMENTS = unpack_double
IMPLEMENTS = init;dump;string_length
IMPLEMENTS = value_count
IMPLEMENTS = next_offset
IMPLEMENTS = get_native_type
IMPLEMENTS = compare
END_CLASS_DEF
*/
@ -38,9 +37,6 @@ or edit "accessor.class" and rerun ./make_class.pl
*/
static int get_native_type(grib_accessor*);
static int pack_double(grib_accessor*, const double* val, size_t* len);
static int pack_long(grib_accessor*, const long* val, size_t* len);
static int pack_string(grib_accessor*, const char*, size_t* len);
static int unpack_double(grib_accessor*, double* val, size_t* len);
static int unpack_long(grib_accessor*, long* val, size_t* len);
static int unpack_string(grib_accessor*, char*, size_t* len);
@ -49,7 +45,6 @@ static long next_offset(grib_accessor*);
static int value_count(grib_accessor*, long*);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_non_alpha
{
@ -79,13 +74,13 @@ static grib_accessor_class _grib_accessor_class_non_alpha = {
0, /* get sub_section */
0, /* pack_missing */
0, /* is_missing */
&pack_long, /* pack_long */
0, /* pack_long */
&unpack_long, /* unpack_long */
&pack_double, /* pack_double */
0, /* pack_double */
0, /* pack_float */
&unpack_double, /* unpack_double */
0, /* unpack_float */
&pack_string, /* pack_string */
0, /* pack_string */
&unpack_string, /* unpack_string */
0, /* pack_string_array */
0, /* unpack_string_array */
@ -98,7 +93,7 @@ static grib_accessor_class _grib_accessor_class_non_alpha = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -171,23 +166,6 @@ static int unpack_string(grib_accessor* a, char* val, size_t* len)
return GRIB_SUCCESS;
}
static int pack_string(grib_accessor* a, const char* val, size_t* len)
{
return GRIB_NOT_IMPLEMENTED;
}
static int pack_long(grib_accessor* a, const long* v, size_t* len)
{
grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as an integer", a->name);
return GRIB_NOT_IMPLEMENTED;
}
static int pack_double(grib_accessor* a, const double* v, size_t* len)
{
grib_context_log(a->context, GRIB_LOG_ERROR, "Should not pack %s as a double", a->name);
return GRIB_NOT_IMPLEMENTED;
}
static int unpack_long(grib_accessor* a, long* v, size_t* len)
{
char val[1024] = {0,};
@ -233,46 +211,6 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len)
return GRIB_NOT_IMPLEMENTED;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval = 0;
char* aval = 0;
char* bval = 0;
int err = 0;
size_t alen = 0;
size_t blen = 0;
long count = 0;
err = grib_value_count(a, &count);
if (err)
return err;
alen = count;
err = grib_value_count(b, &count);
if (err)
return err;
blen = count;
if (alen != blen)
return GRIB_COUNT_MISMATCH;
aval = (char*)grib_context_malloc(a->context, alen * sizeof(char));
bval = (char*)grib_context_malloc(b->context, blen * sizeof(char));
grib_unpack_string(a, aval, &alen);
grib_unpack_string(b, bval, &blen);
retval = GRIB_SUCCESS;
if (strcmp(aval, bval))
retval = GRIB_STRING_VALUE_MISMATCH;
grib_context_free(a->context, aval);
grib_context_free(b->context, bval);
return retval;
}
static long next_offset(grib_accessor* a)
{
return a->offset + a->length;

View File

@ -110,12 +110,14 @@ grib_accessor_class* grib_accessor_class_number_of_points = &_grib_accessor_clas
static void init(grib_accessor* a, const long l, grib_arguments* c)
{
int n = 0;
int n = 0;
grib_handle* hand = grib_handle_of_accessor(a);
grib_accessor_number_of_points* self = (grib_accessor_number_of_points*)a;
self->ni = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++);
self->nj = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++);
self->plpresent = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++);
self->pl = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++);
self->ni = grib_arguments_get_name(hand, c, n++);
self->nj = grib_arguments_get_name(hand, c, n++);
self->plpresent = grib_arguments_get_name(hand, c, n++);
self->pl = grib_arguments_get_name(hand, c, n++);
a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY;
a->flags |= GRIB_ACCESSOR_FLAG_FUNCTION;
a->length = 0;
@ -123,32 +125,41 @@ static void init(grib_accessor* a, const long l, grib_arguments* c)
static int unpack_long(grib_accessor* a, long* val, size_t* len)
{
grib_accessor_number_of_points* self = (grib_accessor_number_of_points*)a;
int ret = GRIB_SUCCESS;
long ni = 0, nj = 0, plpresent = 0;
size_t plsize = 0;
long* pl;
int i;
grib_accessor_number_of_points* self = (grib_accessor_number_of_points*)a;
grib_context* c = a->context;
long* pl = NULL;
int i = 0;
grib_context* c = a->context;
grib_handle* hand = grib_handle_of_accessor(a);
if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->ni, &ni)) != GRIB_SUCCESS)
if ((ret = grib_get_long_internal(hand, self->ni, &ni)) != GRIB_SUCCESS)
return ret;
if ((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->nj, &nj)) != GRIB_SUCCESS)
if ((ret = grib_get_long_internal(hand, self->nj, &nj)) != GRIB_SUCCESS)
return ret;
if (self->plpresent &&
((ret = grib_get_long_internal(grib_handle_of_accessor(a), self->plpresent, &plpresent)) != GRIB_SUCCESS))
((ret = grib_get_long_internal(hand, self->plpresent, &plpresent)) != GRIB_SUCCESS))
return ret;
if (nj == 0)
if (grib_is_missing(hand, self->nj, &ret) && ret == GRIB_SUCCESS) {
grib_context_log(c, GRIB_LOG_ERROR, "grib_accessor_class_number_of_points: Key %s cannot be 'missing'!", self->nj);
return GRIB_GEOCALCULUS_PROBLEM;
}
if (nj == 0) {
grib_context_log(c, GRIB_LOG_ERROR, "grib_accessor_class_number_of_points: Key %s cannot be 0!", self->nj);
return GRIB_GEOCALCULUS_PROBLEM;
}
if (plpresent) {
/*reduced*/
plsize = nj;
pl = (long*)grib_context_malloc(c, sizeof(long) * plsize);
grib_get_long_array_internal(grib_handle_of_accessor(a), self->pl, pl, &plsize);
grib_get_long_array_internal(hand, self->pl, pl, &plsize);
*val = 0;
for (i = 0; i < plsize; i++)
*val += pl[i];

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"
/*
This is used by make_class.pl
@ -23,7 +18,6 @@
IMPLEMENTS = unpack_long
IMPLEMENTS = get_native_type
IMPLEMENTS = init;dump
IMPLEMENTS = compare
END_CLASS_DEF
*/
@ -42,7 +36,6 @@ static int get_native_type(grib_accessor*);
static int unpack_long(grib_accessor*, long* val, size_t* len);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_position
{
@ -91,7 +84,7 @@ static grib_accessor_class _grib_accessor_class_position = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -136,9 +129,9 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
return GRIB_SUCCESS;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
if (a->offset != b->offset)
return GRIB_OFFSET_MISMATCH;
return GRIB_SUCCESS;
}
// static int compare(grib_accessor* a, grib_accessor* b)
// {
// if (a->offset != b->offset)
// return GRIB_OFFSET_MISMATCH;
// return GRIB_SUCCESS;
// }

View File

@ -313,10 +313,9 @@ static int compare(grib_accessor* a, grib_accessor* b)
grib_unpack_double(a, aval, &alen);
grib_unpack_double(b, bval, &blen);
while (alen != 0) {
if (*bval != *aval)
retval = GRIB_DOUBLE_VALUE_MISMATCH;
alen--;
retval = GRIB_SUCCESS;
for (size_t i=0; i<alen && retval == GRIB_SUCCESS; ++i) {
if (aval[i] != bval[i]) retval = GRIB_DOUBLE_VALUE_MISMATCH;
}
grib_context_free(a->context, aval);

View File

@ -266,10 +266,8 @@ static int compare(grib_accessor* a, grib_accessor* b)
grib_unpack_double(b, bval, &blen);
retval = GRIB_SUCCESS;
while (alen != 0) {
if (*bval != *aval)
retval = GRIB_DOUBLE_VALUE_MISMATCH;
alen--;
for (size_t i=0; i<alen && retval == GRIB_SUCCESS; ++i) {
if (aval[i] != bval[i]) retval = GRIB_DOUBLE_VALUE_MISMATCH;
}
grib_context_free(a->context, aval);

View File

@ -22,7 +22,6 @@
IMPLEMENTS = value_count
IMPLEMENTS = next_offset
IMPLEMENTS = get_native_type
IMPLEMENTS = compare
MEMBERS = const char* key
MEMBERS = long start
MEMBERS = size_t length
@ -50,7 +49,6 @@ static long next_offset(grib_accessor*);
static int value_count(grib_accessor*, long*);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_to_double
{
@ -103,7 +101,7 @@ static grib_accessor_class _grib_accessor_class_to_double = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -242,43 +240,3 @@ static long next_offset(grib_accessor* a)
{
return a->offset + a->length;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval = 0;
char* aval = 0;
char* bval = 0;
int err = 0;
size_t alen = 0;
size_t blen = 0;
long count = 0;
err = grib_value_count(a, &count);
if (err)
return err;
alen = count;
err = grib_value_count(b, &count);
if (err)
return err;
blen = count;
if (alen != blen)
return GRIB_COUNT_MISMATCH;
aval = (char*)grib_context_malloc(a->context, alen * sizeof(char));
bval = (char*)grib_context_malloc(b->context, blen * sizeof(char));
grib_unpack_string(a, aval, &alen);
grib_unpack_string(b, bval, &blen);
retval = GRIB_SUCCESS;
if (strcmp(aval, bval))
retval = GRIB_STRING_VALUE_MISMATCH;
grib_context_free(a->context, aval);
grib_context_free(b->context, bval);
return retval;
}

View File

@ -22,7 +22,6 @@
IMPLEMENTS = value_count
IMPLEMENTS = next_offset
IMPLEMENTS = get_native_type
IMPLEMENTS = compare
MEMBERS = const char* key
MEMBERS = long start
MEMBERS = size_t length
@ -52,7 +51,6 @@ static long next_offset(grib_accessor*);
static int value_count(grib_accessor*, long*);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_to_integer
{
@ -104,7 +102,7 @@ static grib_accessor_class _grib_accessor_class_to_integer = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -239,46 +237,6 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len)
return err;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval = 0;
char* aval = 0;
char* bval = 0;
int err = 0;
size_t alen = 0;
size_t blen = 0;
long count = 0;
err = grib_value_count(a, &count);
if (err)
return err;
alen = count;
err = grib_value_count(b, &count);
if (err)
return err;
blen = count;
if (alen != blen)
return GRIB_COUNT_MISMATCH;
aval = (char*)grib_context_malloc(a->context, alen * sizeof(char));
bval = (char*)grib_context_malloc(b->context, blen * sizeof(char));
grib_unpack_string(a, aval, &alen);
grib_unpack_string(b, bval, &blen);
retval = GRIB_SUCCESS;
if (strcmp(aval, bval))
retval = GRIB_STRING_VALUE_MISMATCH;
grib_context_free(a->context, aval);
grib_context_free(b->context, bval);
return retval;
}
static long next_offset(grib_accessor* a)
{
return a->offset + a->length;

View File

@ -22,7 +22,6 @@
IMPLEMENTS = value_count
IMPLEMENTS = next_offset
IMPLEMENTS = get_native_type
IMPLEMENTS = compare
MEMBERS = const char* key
MEMBERS = long start
MEMBERS = size_t length
@ -49,7 +48,6 @@ static long next_offset(grib_accessor*);
static int value_count(grib_accessor*, long*);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_to_string
{
@ -101,7 +99,7 @@ static grib_accessor_class _grib_accessor_class_to_string = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -221,46 +219,6 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len)
return err;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval = 0;
char* aval = 0;
char* bval = 0;
int err = 0;
size_t alen = 0;
size_t blen = 0;
long count = 0;
err = grib_value_count(a, &count);
if (err)
return err;
alen = count;
err = grib_value_count(b, &count);
if (err)
return err;
blen = count;
if (alen != blen)
return GRIB_COUNT_MISMATCH;
aval = (char*)grib_context_malloc(a->context, alen * sizeof(char));
bval = (char*)grib_context_malloc(b->context, blen * sizeof(char));
grib_unpack_string(a, aval, &alen);
grib_unpack_string(b, bval, &blen);
retval = GRIB_SUCCESS;
if (strcmp(aval, bval))
retval = GRIB_STRING_VALUE_MISMATCH;
grib_context_free(a->context, aval);
grib_context_free(b->context, bval);
return retval;
}
static long next_offset(grib_accessor* a)
{
return a->offset + a->length;

View File

@ -19,7 +19,7 @@
IMPLEMENTS = unpack_double;pack_double
IMPLEMENTS = unpack_long;pack_long;destroy
IMPLEMENTS = init;dump;value_count
IMPLEMENTS = compare;get_native_type
IMPLEMENTS = get_native_type
MEMBERS=grib_darray* arr
MEMBERS=int type;
END_CLASS_DEF
@ -45,7 +45,6 @@ static int value_count(grib_accessor*, long*);
static void destroy(grib_context*, grib_accessor*);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*, const long, grib_arguments*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_transient_darray
{
@ -96,7 +95,7 @@ static grib_accessor_class _grib_accessor_class_transient_darray = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
@ -119,23 +118,20 @@ static void init(grib_accessor* a, const long length, grib_arguments* args)
a->length = 0;
}
static void dump(grib_accessor* a, grib_dumper* dumper)
{
/* grib_accessor_transient_darray *self = (grib_accessor_transient_darray*)a; */
grib_dump_double(dumper, a, NULL);
}
static int pack_double(grib_accessor* a, const double* val, size_t* len)
{
grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a;
size_t i;
if (self->arr)
grib_darray_delete(a->context, self->arr);
self->arr = grib_darray_new(a->context, *len, 10);
for (i = 0; i < *len; i++)
for (size_t i = 0; i < *len; i++)
grib_darray_push(a->context, self->arr, val[i]);
return GRIB_SUCCESS;
@ -144,13 +140,12 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
static int pack_long(grib_accessor* a, const long* val, size_t* len)
{
grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a;
size_t i;
if (self->arr)
grib_darray_delete(a->context, self->arr);
self->arr = grib_darray_new(a->context, *len, 10);
for (i = 0; i < *len; i++)
for (size_t i = 0; i < *len; i++)
grib_darray_push(a->context, self->arr, (double)val[i]);
return GRIB_SUCCESS;
@ -159,8 +154,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len)
static int unpack_double(grib_accessor* a, double* val, size_t* len)
{
grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a;
long count = 0;
size_t i;
long count = 0;
value_count(a, &count);
@ -170,17 +164,16 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
}
*len = count;
for (i = 0; i < *len; i++)
for (size_t i = 0; i < *len; i++)
val[i] = self->arr->v[i];
return GRIB_SUCCESS;
}
static int unpack_long(grib_accessor* a, long* val, size_t* len)
{
grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a;
long count = 0;
size_t i;
long count = 0;
value_count(a, &count);
@ -190,14 +183,12 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
}
*len = count;
for (i = 0; i < *len; i++)
for (size_t i = 0; i < *len; i++)
val[i] = (long)self->arr->v[i];
return GRIB_SUCCESS;
}
static void destroy(grib_context* c, grib_accessor* a)
{
grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a;
@ -216,51 +207,8 @@ static int value_count(grib_accessor* a, long* count)
return 0;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval = 0;
double* aval = 0;
double* bval = 0;
size_t alen = 0;
size_t blen = 0;
int err = 0;
long count = 0;
err = grib_value_count(a, &count);
if (err)
return err;
alen = count;
err = grib_value_count(b, &count);
if (err)
return err;
blen = count;
if (alen != blen)
return GRIB_COUNT_MISMATCH;
aval = (double*)grib_context_malloc(a->context, alen * sizeof(double));
bval = (double*)grib_context_malloc(b->context, blen * sizeof(double));
grib_unpack_double(a, aval, &alen);
grib_unpack_double(b, bval, &blen);
retval = GRIB_SUCCESS;
while (alen != 0) {
if (*bval != *aval)
retval = GRIB_DOUBLE_VALUE_MISMATCH;
alen--;
}
grib_context_free(a->context, aval);
grib_context_free(b->context, bval);
return retval;
}
static int get_native_type(grib_accessor* a)
{
grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a;
const grib_accessor_transient_darray* self = (grib_accessor_transient_darray*)a;
return self->type;
}

View File

@ -507,6 +507,7 @@ grib_handle* grib_handle_new_from_samples(grib_context* c, const char* sample_na
* @return the new handle, NULL if the message is invalid or a problem is encountered
*/
grib_handle* grib_handle_clone(const grib_handle* h);
grib_handle* grib_handle_clone_headers_only(const grib_handle* h);
/**
* Frees a handle, also frees the message if it is not a user message
@ -1658,7 +1659,7 @@ Error codes returned by the grib_api functions.
#define GRIB_WRONG_STEP_UNIT -26
/** Invalid file id */
#define GRIB_INVALID_FILE -27
/** Invalid grib id */
/** Invalid GRIB id */
#define GRIB_INVALID_GRIB -28
/** Invalid index id */
#define GRIB_INVALID_INDEX -29

View File

@ -201,6 +201,8 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t* attr, int type);
/* Return true if two strings are equal */
#define STR_EQUAL(a, b) (strcmp((a), (b)) == 0)
/* Return true if two strings are equal, ignoring case */
#define STR_EQUAL_NOCASE(a, b) (strcmp_nocase((a), (b)) == 0)
#include "grib_api.h"
@ -862,6 +864,7 @@ struct grib_handle
/* grib_trie* bufr_elements_table; */
};
/* For GRIB2 multi-field messages */
struct grib_multi_handle
{
grib_context* context; /** < context attached to this handle */
@ -938,7 +941,6 @@ struct grib_accessor_class
};
typedef struct grib_multi_support grib_multi_support;
struct grib_multi_support
{
FILE* file;
@ -948,14 +950,13 @@ struct grib_multi_support
unsigned char* sections[8];
unsigned char* bitmap_section;
size_t bitmap_section_length;
size_t sections_length[9];
size_t sections_length[9]; /* GRIB2 has 9 sections */
int section_number;
grib_multi_support* next;
};
/* Hash_array */
typedef struct grib_hash_array_value grib_hash_array_value;
struct grib_hash_array_value
{
grib_hash_array_value* next;
@ -968,7 +969,6 @@ struct grib_hash_array_value
/* Concepts */
typedef struct grib_concept_condition grib_concept_condition;
struct grib_concept_condition
{
grib_concept_condition* next;
@ -985,7 +985,6 @@ struct grib_concept_value_name
};
typedef struct grib_concept_value grib_concept_value;
struct grib_concept_value
{
grib_concept_value* next;
@ -1415,7 +1414,6 @@ struct cvs_MD5Context
/* --- */
typedef struct grib_rule_entry grib_rule_entry;
struct grib_rule_entry
{
grib_rule_entry* next;
@ -1424,7 +1422,6 @@ struct grib_rule_entry
};
typedef struct grib_rule grib_rule;
struct grib_rule
{
grib_rule* next;
@ -1433,7 +1430,6 @@ struct grib_rule
};
typedef struct grib_case grib_case;
struct grib_case
{
grib_arguments* values;
@ -1530,4 +1526,3 @@ typedef struct j2k_encode_helper
#endif
#endif

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