Merge grib api and eccodes - part 1

This commit is contained in:
Shahram Najm 2014-06-18 17:14:01 +01:00
parent 5f53102b46
commit e9cb722ffc
115 changed files with 9833 additions and 7964 deletions

View File

@ -37,7 +37,7 @@ option( ENABLE_PYTHON "try to build the GRIB_API Python interface" ON )
option( ENABLE_FORTRAN "try to build the GRIB_API Fortran interface" ON )
if( ENABLE_FORTRAN )
ecbuild_enable_fortran( REQUIRED MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/fortran/modules )
ecbuild_enable_fortran( REQUIRED MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/fortran/modules )
endif()
option( ENABLE_MEMORY_MANAGEMENT "enable memory management" OFF )
@ -205,12 +205,12 @@ set( GRIB_API_LIBRARIES grib_api )
get_directory_property( COMPILE_DEFINITIONS GRIB_API_DEFINITIONS )
foreach( _tpl ${GRIB_API_TPLS} )
string( TOUPPER ${_tpl} TPL )
if( ${TPL}_FOUND )
list( APPEND GRIB_API_EXTRA_DEFINITIONS ${${TPL}_DEFINITIONS} )
list( APPEND GRIB_API_EXTRA_INCLUDE_DIRS ${${TPL}_INCLUDE_DIRS} )
list( APPEND GRIB_API_EXTRA_LIBRARIES ${${TPL}_LIBRARIES} )
endif()
string( TOUPPER ${_tpl} TPL )
if( ${TPL}_FOUND )
list( APPEND GRIB_API_EXTRA_DEFINITIONS ${${TPL}_DEFINITIONS} )
list( APPEND GRIB_API_EXTRA_INCLUDE_DIRS ${${TPL}_INCLUDE_DIRS} )
list( APPEND GRIB_API_EXTRA_LIBRARIES ${${TPL}_LIBRARIES} )
endif()
endforeach()
### include directories

View File

@ -76,6 +76,7 @@ EXTRA_DIST = README AUTHORS NOTICE LICENSE ChangeLog version.sh html \
data/scan_y_rotated_ll_8_4_good.dump \
data/scan_y_rotated_ll_8_7_good.dump \
data/tigge_pf_ecmwf.grib2 \
data/tigge_pf_ecmwf.grib2.ref \
data/regular_gaussian_pressure_level.grib1 \
data/regular_gaussian_model_level.grib1 \
data/regular_gaussian_surface.grib1 \
@ -370,6 +371,19 @@ EXTRA_DIST = README AUTHORS NOTICE LICENSE ChangeLog version.sh html \
data/download.sh \
perf/jmeter.awk \
perf/time.sh \
CMakeLists.txt \
project_summary.cmake \
VERSION.cmake \
grib_api_config.h.in \
examples/CMakeLists.txt \
data/CMakeLists.txt \
data/tigge/CMakeLists.txt \
ifs_samples/grib1/CMakeLists.txt \
ifs_samples/grib1_mlgrib2_ieee64/CMakeLists.txt \
ifs_samples/grib1_mlgrib2_ieee32/CMakeLists.txt \
ifs_samples/CMakeLists.txt \
ifs_samples/grib1_mlgrib2/CMakeLists.txt \
samples/CMakeLists.txt \
windows/msvc/grib_api.sln \
windows/msvc/grib_api_lib/grib_api_lib.vcproj \
windows/msvc/grib_dump/grib_dump.vcproj \

View File

@ -22,13 +22,11 @@ set(files_to_download
gen_ext_spd_2.grib
gen_ext_spd_3_boust_bitmap.grib
gen_ext_spd_3.grib
gep10.t12z.pgrb2af78.grib2
gfs.c255.grib2
gts.grib
index.grib
jpeg.grib2
lfpw.grib1
lfpw.grib2
missing_field.grib1
missing.grib2
mixed.grib
@ -103,7 +101,6 @@ endforeach()
LIST(APPEND other_files
60_model_levels
bitmap.diff
filter_rules
ieee_test.good
index.ok
index_f90.ok
@ -111,15 +108,10 @@ LIST(APPEND other_files
list_points
local.good.log
ls.log
mf.rules
multi.ok
multi_level.txt
multi_step.txt
no_bitmap.diff
perf.ksh
read_any.ok
ret.sh
sample_grib.txt
scan_x_regular_gg_5_7_good.dump
scan_x_regular_ll_5_4_good.dump
scan_x_regular_ll_5_7_good.dump
@ -144,6 +136,7 @@ LIST(APPEND other_files
step_grib1.filter
step_grib1.log
typeOfProcessedData.ok
tigge_pf_ecmwf.grib2.ref
)
foreach( file ${other_files} )

View File

@ -1 +1 @@
EXTRA_DIST = CMakeLists.txt

View File

@ -1,6 +1,7 @@
#!/bin/sh
DATA_DIR=$1
VERBOSE=0
# Check if all downloads are already done
DOWNLOADED=${DATA_DIR}/.downloaded
@ -10,6 +11,7 @@ fi
files="
bad.grib
in_copy.grib
budg
constant_field.grib1
constant_width_bitmap.grib
@ -25,13 +27,12 @@ files="
gen_ext_spd_2.grib
gen_ext_spd_3_boust_bitmap.grib
gen_ext_spd_3.grib
gep10.t12z.pgrb2af78.grib2
gfs.c255.grib2
gts.grib
index.grib
grid_ieee.grib
jpeg.grib2
lfpw.grib1
lfpw.grib2
missing_field.grib1
missing.grib2
mixed.grib
@ -336,13 +337,15 @@ files="
download_URL="http://download.ecmwf.org"
cd ${DATA_DIR}
#echo "Downloading data files for testing..."
echo "Downloading data files for testing..."
for f in $files; do
# If we haven't already got the file, download it
if [ ! -f "$f" ]; then
wget --no-verbose -q -O $f ${download_URL}/test-data/grib_api/data/$f
wget -nv -q -O $f ${download_URL}/test-data/grib_api/data/$f
#chmod 444 $f
#echo "Downloaded $f ..."
if [ $VERBOSE -eq 1 ]; then
echo "Downloaded $f ..."
fi
fi
done

View File

@ -521,6 +521,7 @@ dist_definitionsgrib2_DATA = \
grib2/template.4.horizontal.def\
grib2/template.4.parameter.def\
grib2/template.4.parameter_aerosol.def\
grib2/template.4.parameter_aerosol_44.def\
grib2/template.4.parameter_aerosol_optical.def\
grib2/template.4.parameter_chemical.def\
grib2/template.4.parameter_partition.def\
@ -2519,4 +2520,6 @@ dist_definitionstide_DATA = \
tide/section.1.def\
tide/section.4.def
EXTRA_DIST=CMakeLists.txt
include $(DEVEL_RULES)

View File

@ -13,6 +13,11 @@ constant internalVersion=22 : hidden;
constant UseEcmfConventions = 1: hidden;
constant defaultTypeOfLevel="unknown" : hidden;
# GRIBEX special boustrophedonic mode. See GRIB-472
# If the environment variable is not defined, the key will be 0
GRIBEX_boustrophedonic = getenv("GRIB_API_GRIBEX_BOUSTROPHEDONIC","0");
constant zero=0 : hidden;
constant one=1 : hidden;
constant two=1 : hidden;

View File

@ -1,58 +1,60 @@
# This file was automatically generated by ./param.pl
51 51 - Surface geopotential m**2 s**-2
52 52 - Surface pressure Pa
53 53 - Vertical integral of mass of atmosphere kg m**-2
54 54 - Vertical integral of temperature K kg m**-2
55 55 - Vertical integral of water vapour kg m**-2
56 56 - Vertical integral of cloud liquid water kg m**-2
57 57 - Vertical integral of cloud frozen water kg m**-2
58 58 - Vertical integral of ozone kg m**-2
59 59 - Vertical integral of kinetic energy J m**-2
60 60 - Vertical integral of thermal energy J m**-2
61 61 - Vertical integral of potential+internal energy J m**-2
62 62 - Vertical integral of potential+internal+latent energy J m**-2
63 63 - Vertical integral of total energy J m**-2
64 64 - Vertical integral of energy conversion W m**-2
65 65 - Vertical integral of eastward mass flux kg m**-1 s**-1
66 66 - Vertical integral of northward mass flux kg m**-1 s**-1
67 67 - Vertical integral of eastward kinetic energy flux W m**-2
68 68 - Vertical integral of northward kinetic energy flux W m**-2
69 69 - Vertical integral of eastward heat flux W m**-2
70 70 - Vertical integral of northward heat flux W m**-2
71 71 - Vertical integral of eastward water vapour flux kg m**-1 s**-1
72 72 - Vertical integral of northward water vapour flux kg m**-1 s**-1
73 73 - Vertical integral of eastward geopotential flux W m**-2
74 74 - Vertical integral of northward geopotential flux W m**-2
75 75 - Vertical integral of eastward total energy flux W m**-2
76 76 - Vertical integral of northward total energy flux W m**-2
77 77 - Vertical integral of eastward ozone flux kg m**-1 s**-1
78 78 - Vertical integral of northward ozone flux kg m**-1 s**-1
81 81 - Vertical integral of divergence of mass flux kg m**-2 s**-1
82 82 - Vertical integral of divergence of kinetic energy flux W m**-2
83 83 - Vertical integral of divergence of thermal energy flux W m**-2
84 84 - Vertical integral of divergence of moisture flux kg m**-2 s**-1
85 85 - Vertical integral of divergence of geopotential flux W m**-2
86 86 - Vertical integral of divergence of total energy flux W m**-2
87 87 - Vertical integral of divergence of ozone flux kg m**-2 s**-1
51 51 - Surface geopotential (m**2 s**-2)
52 52 SP Surface pressure (Pa)
53 53 - Vertical integral of mass of atmosphere (kg m**-2)
54 54 - Vertical integral of temperature (K kg m**-2)
55 55 - Vertical integral of water vapour (kg m**-2)
56 56 - Vertical integral of cloud liquid water (kg m**-2)
57 57 - Vertical integral of cloud frozen water (kg m**-2)
58 58 - Vertical integral of ozone (kg m**-2)
59 59 - Vertical integral of kinetic energy (J m**-2)
60 60 - Vertical integral of thermal energy (J m**-2)
61 61 - Vertical integral of potential+internal energy (J m**-2)
62 62 - Vertical integral of potential+internal+latent energy (J m**-2)
63 63 - Vertical integral of total energy (J m**-2)
64 64 - Vertical integral of energy conversion (J m**-2)
65 65 - Vertical integral of eastward mass flux (kg m**-1 s**-1)
66 66 - Vertical integral of northward mass flux (kg m**-1 s**-1)
67 67 - Vertical integral of eastward kinetic energy flux (J m**-2)
68 68 - Vertical integral of northward kinetic energy flux (J m**-2)
69 69 - Vertical integral of eastward heat flux (J m**-2)
70 70 - Vertical integral of northward heat flux (J m**-2)
71 71 - Vertical integral of eastward water vapour flux (kg m**-1 s**-1)
72 72 - Vertical integral of northward water vapour flux (kg m**-1 s**-1)
73 73 - Vertical integral of eastward geopotential flux (J m**-2)
74 74 - Vertical integral of northward geopotential flux (J m**-2)
75 75 - Vertical integral of eastward total energy flux (J m**-2)
76 76 - Vertical integral of northward total energy flux (J m**-2)
77 77 - Vertical integral of eastward ozone flux (kg m**-1 s**-1)
78 78 - Vertical integral of northward ozone flux (kg m**-1 s**-1)
79 79 - Vertical integral of divergence of cloud liquid water flux (kg m**-2 s**-1)
80 80 - Vertical integral of divergence of cloud frozen water flux (kg m**-2 s**-1)
81 81 - Vertical integral of divergence of mass flux (kg m**-2 s**-1)
82 82 - Vertical integral of divergence of kinetic energy flux (J m**-2)
83 83 - Vertical integral of divergence of thermal energy flux (J m**-2)
84 84 - Vertical integral of divergence of moisture flux (kg m**-2 s**-1)
85 85 - Vertical integral of divergence of geopotential flux (J m**-2)
86 86 - Vertical integral of divergence of total energy flux (J m**-2)
87 87 - Vertical integral of divergence of ozone flux (kg m**-2 s**-1)
88 88 - Vertical integral of eastward cloud liquid water flux (kg m**-1 s**-1)
89 89 - Vertical integral of northward cloud liquid water flux (kg m**-1 s**-1)
90 90 - Vertical integral of eastward cloud frozen water flux (kg m**-1 s**-1)
91 91 - Vertical integral of northward cloud frozen water flux (kg m**-1 s**-1)
92 92 - Vertical integral of mass tendency (kg m**-2 s**-1)
100 100 - Tendency of short wave radiation K
101 101 - Tendency of long wave radiation K
102 102 - Tendency of clear sky short wave radiation K
103 103 - Tendency of clear sky long wave radiation K
104 104 - Updraught mass flux kg m**-2
105 105 - Downdraught mass flux kg m**-2
106 106 - Updraught detrainment rate kg m**-3
107 107 - Downdraught detrainment rate kg m**-3
108 108 - Total precipitation flux kg m**-2
109 109 - Turbulent diffusion coefficient for heat m**2
110 110 - Tendency of temperature due to physics K
111 111 - Tendency of specific humidity due to physics kg kg**-1
112 112 - Tendency of u component due to physics m s**-1
113 113 - Tendency of v component due to physics m s**-1
100 100 - Tendency of short wave radiation (K)
101 101 - Tendency of long wave radiation (K)
102 102 - Tendency of clear sky short wave radiation (K)
103 103 - Tendency of clear sky long wave radiation (K)
104 104 - Updraught mass flux (kg m**-2)
105 105 - Downdraught mass flux (kg m**-2)
106 106 - Updraught detrainment rate (kg m**-3)
107 107 - Downdraught detrainment rate (kg m**-3)
108 108 - Total precipitation flux (kg m**-2)
109 109 - Turbulent diffusion coefficient for heat (m**2)
110 110 - Tendency of temperature due to physics (K)
111 111 - Tendency of specific humidity due to physics (kg kg**-1)
112 112 - Tendency of u component due to physics (m s**-1)
113 113 - Tendency of v component due to physics (m s**-1)
114 114 UTENDD U-tendency from dynamics (m s**-1)
115 115 VTENDD V-tendency from dynamics (m s**-1)
116 116 TTENDD T-tendency from dynamics (K)
@ -81,31 +83,31 @@
139 139 VTENDCS V-tendency from shallow convection (m s**-1)
140 140 TTENDSC T-tendency from shallow convection (K)
141 141 QTENDSC q-tendency from shallow convection (kg kg**-1)
206 206 - Variance of geopotential m**4 s**-4
207 207 - Covariance of geopotential/temperature m**2 K s**-2
208 208 - Variance of temperature K**2
209 209 - Covariance of geopotential/specific humidity m**2 s**-2
210 210 - Covariance of temperature/specific humidity K
206 206 - Variance of geopotential (m**4 s**-4)
207 207 - Covariance of geopotential/temperature (m**2 K s**-2)
208 208 - Variance of temperature (K**2)
209 209 - Covariance of geopotential/specific humidity (m**2 s**-2)
210 210 - Covariance of temperature/specific humidity (K)
211 211 - Variance of specific humidity
212 212 - Covariance of u component/geopotential M**3 s**-3
213 213 - Covariance of u component/temperature m s**-1 K
214 214 - Covariance of u component/specific humidity m s**-1
215 215 - Variance of u component m**2 s**-2
216 216 - Covariance of v component/geopotential M**3 s**-3
217 217 - Covariance of v component/temperature m s**-1 K
218 218 - Covariance of v component/specific humidity m s**-1
219 219 - Covariance of v component/u component m**2 s**-2
220 220 - Variance of v component m**2 s**-2
221 221 - Covariance of omega/geopotential m**2 Pa s**-3
222 222 - Covariance of omega/temperature Pa s**-1 K
223 223 - Covariance of omega/specific humidity Pa s**-1
224 224 - Covariance of omega/u component m Pa s**-2
225 225 - Covariance of omega/v component m Pa s**-2
226 226 - Variance of omega Pa**2 s**-2
227 227 - Variance of surface pressure Pa**2
229 229 - Variance of relative humidity dimensionless
230 230 - Covariance of u component/ozone m s**-1
231 231 - Covariance of v component/ozone m s**-1
232 232 - Covariance of omega/ozone Pa s**-1
233 233 - Variance of ozone dimensionless
212 212 - Covariance of u component/geopotential (m**3 s**-3)
213 213 - Covariance of u component/temperature (m s**-1 K)
214 214 - Covariance of u component/specific humidity (m s**-1)
215 215 - Variance of u component (m**2 s**-2)
216 216 - Covariance of v component/geopotential (m**3 s**-3)
217 217 - Covariance of v component/temperature (m s**-1 K)
218 218 - Covariance of v component/specific humidity (m s**-1)
219 219 - Covariance of v component/u component (m**2 s**-2)
220 220 - Variance of v component (m**2 s**-2)
221 221 - Covariance of omega/geopotential (m**2 Pa s**-3)
222 222 - Covariance of omega/temperature (Pa s**-1 K)
223 223 - Covariance of omega/specific humidity (Pa s**-1)
224 224 - Covariance of omega/u component (m Pa s**-2)
225 225 - Covariance of omega/v component (m Pa s**-2)
226 226 - Variance of omega (Pa**2 s**-2)
227 227 - Variance of surface pressure (Pa**2)
229 229 - Variance of relative humidity (dimensionless)
230 230 - Covariance of u component/ozone (m s**-1)
231 231 - Covariance of v component/ozone (m s**-1)
232 232 - Covariance of omega/ozone (Pa s**-1)
233 233 - Variance of ozone (dimensionless)
255 255 - Indicates a missing value

View File

@ -1,22 +1,33 @@
# This file was automatically generated by ./param.pl
129 129 Z Geopotential (m**2 s**-2)
130 130 T Temperature (K)
131 131 U U velocity (m s**-1)
132 132 V V velocity (m s**-1)
131 131 U U component of wind (m s**-1)
132 132 V V component of wind (m s**-1)
133 133 Q Specific humidity (kg kg**-1)
135 135 W Vertical velocity (Pa s**-1)
138 138 VO Vorticity (relative) (s**-1)
139 139 STL1 Soil temperature level 1 (K)
140 140 SWL1 Soil wetness level 1 (m)
141 141 SD Snow depth m of water equivalent
140 140 SWL1 Soil wetness level 1 (m of water equivalent)
141 141 SD Snow depth (m of water equivalent)
142 142 LSP Large-scale precipitation (m)
143 143 CP Convective precipitation (m)
146 146 SSHF Surface sensible heat flux (J m**-2)
147 147 SLHF Surface latent heat flux (J m**-2)
149 149 TSW Total soil moisture (m)
151 151 MSL Mean sea level pressure Pa
155 155 D Divergence s**-1
171 171 SWL2 Soil wetness level 2 m
179 179 TTR Top thermal radiation W m-2
184 184 SWL3 Soil wetness level 3 m
201 201 MX2T Maximum temperature at 2 metres K
202 202 MN2T Minimum temperature at 2 metres K
228 228 TP Total precipitation m
151 151 MSL Mean sea level pressure (Pa)
155 155 D Divergence (s**-1)
157 157 R Relative humidity (%)
164 164 TCC Total cloud cover ((0 - 1))
171 171 SWL2 Soil wetness level 2 (m)
176 176 SSR Surface net solar radiation (J m**-2)
177 177 STR Surface net thermal radiation (J m**-2)
179 179 TTR Top net thermal radiation (J m**-2)
180 180 EWSS Eastward turbulent surface stress (N m**-2 s)
181 181 NSSS Northward turbulent surface stress (N m**-2 s)
182 182 E Evaporation (m of water equivalent)
184 184 SWL3 Soil wetness level 3 (m of water equivalent)
185 185 CCC Convective cloud cover ((0 - 1))
201 201 MX2T Maximum temperature at 2 metres since previous post-processing (K)
202 202 MN2T Minimum temperature at 2 metres since previous post-processing (K)
228 228 TP Total precipitation (m)
255 255 - Indicates a missing value

View File

@ -2,9 +2,9 @@
6 6 - Total soil moisture (m)
8 8 SRO Surface runoff (kg m**-2)
9 9 SSRO Sub-surface runoff (kg m**-2)
10 10 - Clear-sky II down surface sw flux
13 13 - Clear-sky II up surface sw flux
25 25 - Visibility at 1.5m
10 10 SSWCSDOWN Clear-sky (II) down surface sw flux (W m**-2)
13 13 SSWCSUP Clear-sky (II) up surface sw flux (W m**-2)
25 25 VIS15 Visibility at 1.5m (m)
31 31 - Fraction of sea-ice in sea (0 - 1)
34 34 - Open-sea surface temperature (K)
39 39 - Volumetric soil water layer 1 (m**3 m**-3)
@ -12,42 +12,43 @@
41 41 - Volumetric soil water layer 3 (m**3 m**-3)
42 42 - Volumetric soil water layer 4 (m**3 m**-3)
49 49 - 10 metre wind gust in the last 24 hours (m s**-1)
50 50 - Minimum temperature at 1.5m since previous post-processing (K)
51 51 - Maximum temperature at 1.5m since previous post-processing (K)
52 52 - Relative humidity at 1.5m
50 50 MN15T Minimum temperature at 1.5m since previous post-processing (K)
51 51 MX15T Maximum temperature at 1.5m since previous post-processing (K)
52 52 RHUM Relative humidity at 1.5m (kg kg**-1)
55 55 - 1.5m temperature - mean in the last 24 hours (K)
83 83 - Net primary productivity (kg C m**-2 s**-1)
85 85 - 10m U wind over land (m s**-1)
86 86 - 10m V wind over land (m s**-1)
87 87 - 1.5m temperature over land (K)
88 88 - 1.5m dewpoint temperature over land (K)
89 89 - Top incoming solar radiation (W m**-2 s)
90 90 - Top outgoing solar radiation (W m**-2 s)
89 89 - Top incoming solar radiation (J m**-2)
90 90 - Top outgoing solar radiation (J m**-2)
94 94 - Mean sea surface temperature (K)
95 95 - 1.5m specific humidity (kg kg**-1)
98 98 - Sea-ice thickness (m)
99 99 - Liquid water potential temperature (K)
110 110 - Ocean ice concentration (0 - 1)
111 111 - Ocean mean ice depth (m)
116 116 - Short wave radiation flux at surface (J m**-2)
117 117 - Short wave radiation flux at top of atmosphere (J m**-2)
137 137 - Total column water vapour (kg m**-2)
116 116 SWRSURF Short wave radiation flux at surface (J m**-2)
117 117 SWRTOP Short wave radiation flux at top of atmosphere (J m**-2)
137 137 TCWVAP Total column water vapour (kg m**-2)
139 139 - Soil temperature layer 1 (K)
142 142 - Large scale rainfall rate
143 143 - Convective rainfall rate
142 142 LSRRATE Large scale rainfall rate (kg m**-2 s**-1)
143 143 CRFRATE Convective rainfall rate (kg m**-2 s**-1)
164 164 - Average potential temperature in upper 293.4m (degrees C)
167 167 - 1.5m temperature (K)
168 168 - 1.5m dewpoint temperature (K)
170 170 - Soil temperature layer 2 (K)
172 172 - Fractional land mask (0 - 1)
175 175 - Average salinity in upper 293.4m psu
172 172 LSM Land-sea mask (0 - 1)
175 175 - Average salinity in upper 293.4m (psu)
183 183 - Soil temperature layer 3 (K)
186 186 - Very low cloud amount
186 186 VLCA Very low cloud amount (0 - 1)
201 201 - 1.5m temperature - maximum in the last 24 hours (K)
202 202 - 1.5m temperature - minimum in the last 24 hours (K)
236 236 - Soil temperature layer 4 (K)
239 239 - Convective snowfall rate
240 240 - Large scale snowfall rate
248 248 - Total cloud amount - random overlap
249 249 - Total cloud amount in lw radiation
255 255 - Indicates a missing value
239 239 CSFRATE Convective snowfall rate (kg m**-2 s**-1)
240 240 LSFRATE Large scale snowfall rate (kg m**-2 s**-1)
248 248 TCCRO Total cloud amount - random overlap (0 - 1)
249 249 TCCLWR Total cloud amount in lw radiation (0 - 1)
255 255 - Indicates a missing value

View File

@ -13,17 +13,17 @@
86 86 - 10m V wind over land (m s**-1)
87 87 - 1.5m temperature over land (K)
88 88 - 1.5m dewpoint temperature over land (K)
89 89 - Top incoming solar radiation (W m**-2 s)
90 90 - Top outgoing solar radiation (W m**-2 s)
89 89 - Top incoming solar radiation (J m**-2)
90 90 - Top outgoing solar radiation (J m**-2)
110 110 - Ocean ice concentration (0 - 1)
111 111 - Ocean mean ice depth (m)
139 139 - Soil temperature layer 1 (K)
164 164 - Average potential temperature in upper 293.4m degrees C
164 164 - Average potential temperature in upper 293.4m (degrees C)
167 167 - 1.5m temperature (K)
168 168 - 1.5m dewpoint temperature (K)
170 170 - Soil temperature layer 2 (K)
172 172 - Fractional land mask (0 - 1)
175 175 - Average salinity in upper 293.4m psu
172 172 lsm Land-sea mask (0 - 1)
175 175 - Average salinity in upper 293.4m (psu)
183 183 - Soil temperature layer 3 (K)
201 201 - 1.5m temperature - maximum in the last 24 hours (K)
202 202 - 1.5m temperature - minimum in the last 24 hours (K)

View File

@ -1,33 +1,33 @@
# This file was automatically generated by ./param.pl
129 129 Z Geopotential m**2 s**-2
130 130 T Temperature K
131 131 U U velocity m s**-1
132 132 V V velocity m s**-1
133 133 Q Specific humidity kg kg**-1
134 134 SP Surface pressure Pa
137 137 TCWV Total column water vapour kg m**-2
138 138 VO Vorticity (relative) s**-1
141 141 SD Snow depth m of water equivalent
142 142 LSP Large-scale precipitation m
143 143 CP Convective precipitation m
144 144 SF Snowfall m of water equivalent
146 146 SSHF Surface sensible heat flux W m**-2 s
147 147 SLHF Surface latent heat flux W m**-2 s
149 149 TSW Total soil wetness m
151 151 MSL Mean sea level pressure Pa
155 155 D Divergence s**-1
129 129 Z Geopotential (m**2 s**-2)
130 130 T Temperature (K)
131 131 U U component of wind (m s**-1)
132 132 V V component of wind (m s**-1)
133 133 Q Specific humidity (kg kg**-1)
134 134 SP Surface pressure (Pa)
137 137 TCWV Total column water vapour (kg m**-2)
138 138 VO Vorticity (relative) (s**-1)
141 141 SD Snow depth (m of water equivalent)
142 142 LSP Large-scale precipitation (m)
143 143 CP Convective precipitation (m)
144 144 SF Snowfall (m of water equivalent)
146 146 SSHF Surface sensible heat flux (J m**-2)
147 147 SLHF Surface latent heat flux (J m**-2)
149 149 TSW Total soil wetness (m)
151 151 MSL Mean sea level pressure (Pa)
155 155 D Divergence (s**-1)
164 164 TCC Total cloud cover (0 - 1)
165 165 10U 10 metre U wind component m s**-1
166 166 10V 10 metre V wind component m s**-1
167 167 2T 2 metre temperature K
168 168 2D 2 metre dewpoint temperature K
165 165 10U 10 metre U wind component (m s**-1)
166 166 10V 10 metre V wind component (m s**-1)
167 167 2T 2 metre temperature (K)
168 168 2D 2 metre dewpoint temperature (K)
172 172 LSM Land-sea mask (0 - 1)
176 176 SSR Surface solar radiation J m**-2 s
177 177 STR Surface thermal radiation J m**-2 s
178 178 TSR Top solar radiation J m**-2 s
179 179 TTR Top thermal radiation J m**-2 s
180 180 EWSS East-West surface stress N m**-2 s
181 181 NSSS North-South surface stress N m**-2 s
182 182 E Evaporation m of water
205 205 RO Runoff m
176 176 SSR Surface net solar radiation (J m**-2)
177 177 STR Surface net thermal radiation (J m**-2)
178 178 TSR Top net solar radiation (J m**-2)
179 179 TTR Top net thermal radiation (J m**-2)
180 180 EWSS Eastward turbulent surface stress (N m**-2 s)
181 181 NSSS Northward turbulent surface stress (N m**-2 s)
182 182 E Evaporation (m of water equivalent)
205 205 RO Runoff (m)
255 255 - Indicates a missing value

View File

@ -1,33 +1,37 @@
# This file was automatically generated by ./param.pl
129 129 Z Geopotential m**2 s**-2
130 130 T Temperature K
131 131 U U velocity m s**-1
132 132 V V velocity m s**-1
133 133 Q Specific humidity kg kg**-1
139 139 STL1 Soil temperature level 1 K
141 141 SD Snow depth m of water
146 146 SSHF Surface sensible heat flux W m**-2 s
147 147 SLHF Surface latent heat flux W m**-2 s
151 151 MSL Mean sea level pressure Pa
129 129 Z Geopotential (m**2 s**-2)
130 130 T Temperature (K)
131 131 U U component of wind (m s**-1)
132 132 V V component of wind (m s**-1)
133 133 Q Specific humidity (kg kg**-1)
134 134 SP Surface pressure (Pa)
138 138 VO Vorticity (relative) (s**-1)
139 139 STL1 Soil temperature level 1 (K)
141 141 SDSIEN Snow depth (kg m**-2)
146 146 SSHF Surface sensible heat flux (J m**-2)
147 147 SLHF Surface latent heat flux (J m**-2)
151 151 MSL Mean sea level pressure (Pa)
155 155 D Divergence (s**-1)
157 157 R Relative humidity (%)
164 164 TCC Total cloud cover (0 - 1)
165 165 10U 10 metre U wind component m s**-1
166 166 10V 10 metre V wind component m s**-1
167 167 2T 2 metre temperature K
168 168 2D 2 metre dewpoint temperature K
169 169 SSRD Downward surface solar radiation W m**-2 s (W m**-2 for monthly means)
170 170 CAP Field capacity ?
171 171 WILT Wilting points ?
165 165 10U 10 metre U wind component (m s**-1)
166 166 10V 10 metre V wind component (m s**-1)
167 167 2T 2 metre temperature (K)
168 168 2D 2 metre dewpoint temperature (K)
169 169 SSRD Surface solar radiation downwards (J m**-2)
170 170 CAP Field capacity (0 - 1)
171 171 WILTSIEN Wilting point (0 - 1)
172 172 LSM Land-sea mask (0 - 1)
173 173 SR Roughness length (0 - 1)
174 174 AL Albedo (0 - 1)
175 175 STRD Downward surface long wave radiation W m**-2 s (W m**-2 for monthly means)
176 176 SSR Surface net solar radiation W m**-2 s (W m**-2 for monthly means)
177 177 STR Surface net long wave radiation W m**-2 s (W m**-2 for monthly means)
178 178 TSR Top net solar radiation W m**-2 s (W m**-2 for monthly means)
179 179 TTR Top net long wave radiation W m**-2 s (W m**-2 for monthly means)
182 182 E Evaporation m (m s**-1 for monthly means)
201 201 MX2T Maximum 2 metre temperature K
202 202 MN2T Minimum 2 metre temperature K
228 228 TP Total precipitation m (m s**-1 for monthly means)
229 229 TSM Total soil moisture m**3 m**-3
255 255 - Indicates a missing value
175 175 STRD Surface thermal radiation downwards (J m**-2)
176 176 SSR Surface net solar radiation (J m**-2)
177 177 STR Surface net thermal radiation (J m**-2)
178 178 TSR Top net solar radiation (J m**-2)
179 179 TTR Top net thermal radiation (J m**-2)
182 182 E Evaporation (m of water equivalent)
201 201 MX2T Maximum temperature at 2 metres since previous post-processing (K)
202 202 MN2T Minimum temperature at 2 metres since previous post-processing (K)
228 228 TP Total precipitation (m)
229 229 TSM Total soil moisture (m**3 m**-3)
255 255 - Indicates a missing value

View File

@ -1,237 +1,236 @@
# This file was automatically generated by ./param.pl
1 1 STRF Stream function m**2 s**-1
2 2 VPOT Velocity potential m**2 s**-1
3 3 PT Potential temperature K
4 4 EQPT Equivalent potential temperature K
5 5 SEPT Saturated equivalent potential temperature K
11 11 UDVW U component of divergent wind m s**-1
12 12 VDVW V component of divergent wind m s**-1
13 13 URTW U component of rotational wind m s**-1
14 14 VRTW V component of rotational wind m s**-1
21 21 UCTP Unbalanced component of temperature K
22 22 UCLN Unbalanced component of logarithm of surface pressure
23 23 UCDV Unbalanced component of divergence s**-1
24 24 - Reserved for future unbalanced components
25 25 - Reserved for future unbalanced components
26 26 CL Lake cover (0 - 1)
27 27 CVL Low vegetation cover (0 - 1)
28 28 CVH High vegetation cover (0 - 1)
29 29 TVL Type of low vegetation
30 30 TVH Type of high vegetation
31 31 CI Sea-ice cover (0 - 1)
32 32 ASN Snow albedo (0 - 1)
33 33 RSN Snow density kg m**-3
34 34 SSTK Sea surface temperature K
35 35 ISTL1 Ice surface temperature layer 1 K
36 36 ISTL2 Ice surface temperature layer 2 K
37 37 ISTL3 Ice surface temperature layer 3 K
38 38 ISTL4 Ice surface temperature layer 4 K
39 39 SWVL1 Volumetric soil water layer 1 m**3 m**-3
40 40 SWVL2 Volumetric soil water layer 2 m**3 m**-3
41 41 SWVL3 Volumetric soil water layer 3 m**3 m**-3
42 42 SWVL4 Volumetric soil water layer 4 m**3 m**-3
43 43 SLT Soil type
44 44 ES Snow evaporation m of water
45 45 SMLT Snowmelt m of water
46 46 SDUR Solar duration s
47 47 DSRP Direct solar radiation w m**-2
48 48 MAGSS Magnitude of surface stress N m**-2 s
49 49 10FG 10 metre wind gust m s**-1
50 50 LSPF Large-scale precipitation fraction s
51 51 MX2T24 Maximum 2 metre temperature K
52 52 MN2T24 Minimum 2 metre temperature K
53 53 MONT Montgomery potential m**2 s**-2
54 54 PRES Pressure Pa
55 55 MEAN2T24 Mean 2 metre temperature in past 24 hours K
56 56 MN2D24 Mean 2 metre dewpoint temperature in past 24 hours K
57 57 UVB Downward UV radiation at the surface w m**-2 s
58 58 PAR Photosynthetically active radiation at the surface w m**-2 s
59 59 CAPE Convective available potential energy J kg**-1
60 60 PV Potential vorticity K m**2 kg**-1 s**-1
61 61 TPO Total precipitation from observations Millimetres*100 + number of stations
62 62 OBCT Observation count
63 63 - Start time for skin temperature difference s
64 64 - Finish time for skin temperature difference s
65 65 - Skin temperature difference K
66 66 - Leaf area index, low vegetation m**2 / m**2
67 67 - Leaf area index, high vegetation m**2 / m**2
68 68 - Minimum stomatal resistance, low vegetation s m**-1
69 69 - Minimum stomatal resistance, high vegetation s m**-1
1 1 STRFDIFF Stream function difference (m**2 s**-1)
2 2 VPOTDIFF Velocity potential difference (m**2 s**-1)
3 3 PTDIFF Potential temperature difference (K)
4 4 EQPTDIFF Equivalent potential temperature difference (K)
5 5 SEPTDIFF Saturated equivalent potential temperature difference (K)
11 11 UDVWDIFF U component of divergent wind difference (m s**-1)
12 12 VDVWDIFF V component of divergent wind difference (m s**-1)
13 13 URTWDIFF U component of rotational wind difference (m s**-1)
14 14 VRTWDIFF V component of rotational wind difference (m s**-1)
21 21 UCTPDIFF Unbalanced component of temperature difference (K)
22 22 UCLNDIFF Unbalanced component of logarithm of surface pressure difference (~)
23 23 UCDVDIFF Unbalanced component of divergence difference (s**-1)
24 24 - Reserved for future unbalanced components (~)
25 25 - Reserved for future unbalanced components (~)
26 26 CLDIFF Lake cover difference (0 - 1)
27 27 CVLDIFF Low vegetation cover difference (0 - 1)
28 28 CVHDIFF High vegetation cover difference (0 - 1)
29 29 TVLDIFF Type of low vegetation difference (~)
30 30 TVHDIFF Type of high vegetation difference (~)
31 31 SICDIFF Sea-ice cover difference (0 - 1)
32 32 ASNDIFF Snow albedo difference (0 - 1)
33 33 RSNDIFF Snow density difference (kg m**-3)
34 34 SSTDIFF Sea surface temperature difference (K)
35 35 ISTL1DIFF Ice surface temperature layer 1 difference (K)
36 36 ISTL2DIFF Ice surface temperature layer 2 difference (K)
37 37 ISTL3DIFF Ice surface temperature layer 3 difference (K)
38 38 ISTL4DIFF Ice surface temperature layer 4 difference (K)
39 39 SWVL1DIFF Volumetric soil water layer 1 difference (m**3 m**-3)
40 40 SWVL2DIFF Volumetric soil water layer 2 difference (m**3 m**-3)
41 41 SWVL3DIFF Volumetric soil water layer 3 difference (m**3 m**-3)
42 42 SWVL4DIFF Volumetric soil water layer 4 difference (m**3 m**-3)
43 43 SLTDIFF Soil type difference (~)
44 44 ESDIFF Snow evaporation difference (kg m**-2)
45 45 SMLTDIFF Snowmelt difference (kg m**-2)
46 46 SDURDIFF Solar duration difference (s)
47 47 DSRPDIFF Direct solar radiation difference (J m**-2)
48 48 MAGSSDIFF Magnitude of surface stress difference (N m**-2 s)
49 49 10FGDIFF 10 metre wind gust difference (m s**-1)
50 50 LSPFDIFF Large-scale precipitation fraction difference (s)
51 51 MX2T24DIFF Maximum 2 metre temperature difference (K)
52 52 MN2T24DIFF Minimum 2 metre temperature difference (K)
53 53 MONTDIFF Montgomery potential difference (m**2 s**-2)
54 54 PRESDIFF Pressure difference (Pa)
55 55 MEAN2T24DIFF Mean 2 metre temperature in the last 24 hours difference (K)
56 56 MN2D24DIFF Mean 2 metre dewpoint temperature in the last 24 hours difference (K)
57 57 UVBDIFF Downward UV radiation at the surface difference (J m**-2)
58 58 PARDIFF Photosynthetically active radiation at the surface difference (J m**-2)
59 59 CAPEDIFF Convective available potential energy difference (J kg**-1)
60 60 PVDIFF Potential vorticity difference (K m**2 kg**-1 s**-1)
61 61 TPODIFF Total precipitation from observations difference (Millimetres*100 + number of stations)
62 62 OBCTDIFF Observation count difference (~)
63 63 - Start time for skin temperature difference (s)
64 64 - Finish time for skin temperature difference (s)
65 65 - Skin temperature difference (K)
66 66 - Leaf area index, low vegetation (m**2 m**-2)
67 67 - Leaf area index, high vegetation (m**2 m**-2)
68 68 - Minimum stomatal resistance, low vegetation (s m**-1)
69 69 - Minimum stomatal resistance, high vegetation (s m**-1)
70 70 - Biome cover, low vegetation (0 - 1)
71 71 - Biome cover, high vegetation (0 - 1)
78 78 - Total column liquid water kg m**-2
79 79 - Total column ice water kg m**-2
80 80 - Experimental product
81 81 - Experimental product
82 82 - Experimental product
83 83 - Experimental product
84 84 - Experimental product
85 85 - Experimental product
86 86 - Experimental product
87 87 - Experimental product
88 88 - Experimental product
89 89 - Experimental product
90 90 - Experimental product
91 91 - Experimental product
92 92 - Experimental product
93 93 - Experimental product
94 94 - Experimental product
95 95 - Experimental product
96 96 - Experimental product
97 97 - Experimental product
98 98 - Experimental product
99 99 - Experimental product
100 100 - Experimental product
101 101 - Experimental product
102 102 - Experimental product
103 103 - Experimental product
104 104 - Experimental product
105 105 - Experimental product
106 106 - Experimental product
107 107 - Experimental product
108 108 - Experimental product
109 109 - Experimental product
110 110 - Experimental product
111 111 - Experimental product
112 112 - Experimental product
113 113 - Experimental product
114 114 - Experimental product
115 115 - Experimental product
116 116 - Experimental product
117 117 - Experimental product
118 118 - Experimental product
119 119 - Experimental product
120 120 - Experimental product
121 121 MX2T6 Maximum temperature at 2 metres K
122 122 MN2T6 Minimum temperature at 2 metres K
123 123 10FG6 10 metre wind gust in the past 6 hours m s**-1
125 125 - Vertically integrated total energy J m**-2
126 126 - Generic parameter for sensitive area prediction Various
127 127 AT Atmospheric tide
128 128 BV Budget values
129 129 Z Geopotential m**2 s**-2
130 130 T Temperature K
131 131 U U velocity m s**-1
132 132 V V velocity m s**-1
133 133 Q Specific humidity kg kg**-1
134 134 SP Surface pressure Pa
135 135 W Vertical velocity Pa s**-1
136 136 TCW Total column water kg m**-2
137 137 TCWV Total column water vapour kg m**-2
138 138 VO Vorticity (relative) s**-1
139 139 STL1 Soil temperature level 1 K
140 140 SWL1 Soil wetness level 1 m of water
141 141 SD Snow depth m of water equivalent
142 142 LSP Stratiform precipitation (Large-scale precipitation) m
143 143 CP Convective precipitation m
144 144 SF Snowfall (convective + stratiform) m of water equivalent
145 145 BLD Boundary layer dissipation W m**-2 s
146 146 SSHF Surface sensible heat flux W m**-2 s
147 147 SLHF Surface latent heat flux W m**-2 s
148 148 CHNK Charnock
149 149 SNR Surface net radiation W m**-2 s
150 150 TNR Top net radiation
151 151 MSL Mean sea level pressure Pa
152 152 LNSP Logarithm of surface pressure
153 153 SWHR Short-wave heating rate K
154 154 LWHR Long-wave heating rate K
155 155 D Divergence s**-1
156 156 GH Height m
157 157 R Relative humidity %
158 158 TSP Tendency of surface pressure Pa s**-1
159 159 BLH Boundary layer height m
160 160 SDOR Standard deviation of orography
161 161 ISOR Anisotropy of sub-gridscale orography
162 162 ANOR Angle of sub-gridscale orography rad
163 163 SLOR Slope of sub-gridscale orography
164 164 TCC Total cloud cover (0 - 1)
165 165 10U 10 metre U wind component m s**-1
166 166 10V 10 metre V wind component m s**-1
167 167 2T 2 metre temperature K
168 168 2D 2 metre dewpoint temperature K
169 169 SSRD Surface solar radiation downwards W m**-2 s
170 170 STL2 Soil temperature level 2 K
171 171 SWL2 Soil wetness level 2 m of water
172 172 LSM Land-sea mask (0 - 1)
173 173 SR Surface roughness m
174 174 AL Albedo (0 - 1)
175 175 STRD Surface thermal radiation downwards W m**-2 s
176 176 SSR Surface solar radiation W m**-2 s
177 177 STR Surface thermal radiation W m**-2 s
178 178 TSR Top solar radiation W m**-2 s
179 179 TTR Top thermal radiation W m**-2 s
180 180 EWSS East-West surface stress N m**-2 s
181 181 NSSS North-South surface stress N m**-2 s
182 182 E Evaporation m of water
183 183 STL3 Soil temperature level 3 K
184 184 SWL3 Soil wetness level 3 m of water
185 185 CCC Convective cloud cover (0 - 1)
186 186 LCC Low cloud cover (0 - 1)
187 187 MCC Medium cloud cover (0 - 1)
188 188 HCC High cloud cover (0 - 1)
189 189 SUND Sunshine duration s
190 190 EWOV East-West component of sub-gridscale orographic variance m**2
191 191 NSOV North-South component of sub-gridscale orographic variance m**2
192 192 NWOV North-West/South-East component of sub-gridscale orographic variance m**2
193 193 NEOV North-East/South-West component of sub-gridscale orographic variance m**2
194 194 BTMP Brightness temperature K
195 195 LGWS Latitudinal component of gravity wave stress N m**-2 s
196 196 MGWS Meridional component of gravity wave stress N m**-2 s
197 197 GWD Gravity wave dissipation W m**-2 s
198 198 SRC Skin reservoir content m of water
199 199 VEG Vegetation fraction (0 - 1)
200 200 VSO Variance of sub-gridscale orography m**2
201 201 MX2T Maximum temperature at 2 metres since previous post-processing K
202 202 MN2T Minimum temperature at 2 metres since previous post-processing K
203 203 O3 Ozone mass mixing ratio kg kg**-1
204 204 PAW Precipitation analysis weights
205 205 RO Runoff m
206 206 TCO3 Total column ozone kg m**-2
207 207 10SI 10 metre wind speed m s**-1
208 208 TSRC Top net solar radiation, clear sky W m**-2 s
209 209 TTRC Top net thermal radiation, clear sky W m**-2 s
210 210 SSRC Surface net solar radiation, clear sky W m**-2 s
211 211 STRC Surface net thermal radiation, clear sky W m**-2 s
212 212 TISR TOA incident solar radiation W m**-2 s
214 214 DHR Diabatic heating by radiation K
215 215 DHVD Diabatic heating by vertical diffusion K
216 216 DHCC Diabatic heating by cumulus convection K
217 217 DHLC Diabatic heating large-scale condensation K
218 218 VDZW Vertical diffusion of zonal wind m s**-1
219 219 VDMW Vertical diffusion of meridional wind m s**-1
220 220 EWGD East-West gravity wave drag tendency m s**-1
221 221 NSGD North-South gravity wave drag tendency m s**-1
222 222 CTZW Convective tendency of zonal wind m s**-1
223 223 CTMW Convective tendency of meridional wind m s**-1
224 224 VDH Vertical diffusion of humidity kg kg**-1
225 225 HTCC Humidity tendency by cumulus convection kg kg**-1
226 226 HTLC Humidity tendency by large-scale condensation kg kg**-1
227 227 CRNH Change from removal of negative humidity kg kg**-1
228 228 TP Total precipitation m
229 229 IEWS Instantaneous X surface stress N m**-2
230 230 INSS Instantaneous Y surface stress N m**-2
231 231 ISHF Instantaneous surface heat flux W m**-2
232 232 IE Instantaneous moisture flux kg m**-2 s
233 233 ASQ Apparent surface humidity kg kg**-1
234 234 LSRH Logarithm of surface roughness length for heat
235 235 SKT Skin temperature K
236 236 STL4 Soil temperature level 4 K
237 237 SWL4 Soil wetness level 4 m
238 238 TSN Temperature of snow layer K
239 239 CSF Convective snowfall m of water equivalent
240 240 LSF Large-scale snowfall m of water equivalent
241 241 ACF Accumulated cloud fraction tendency (-1 to 1)
242 242 ALW Accumulated liquid water tendency (-1 to 1)
243 243 FAL Forecast albedo (0 - 1)
244 244 FSR Forecast surface roughness m
245 245 FLSR Forecast logarithm of surface roughness for heat
246 246 CLWC Cloud liquid water content kg kg**-1
247 247 CIWC Cloud ice water content kg kg**-1
248 248 CC Cloud cover (0 - 1)
249 249 AIW Accumulated ice water tendency (-1 to 1)
250 250 ICE Ice age (0 - 1)
251 251 ATTE Adiabatic tendency of temperature K
252 252 ATHE Adiabatic tendency of humidity kg kg**-1
253 253 ATZE Adiabatic tendency of zonal wind m s**-1
254 254 ATMW Adiabatic tendency of meridional wind m s**-1
255 255 - Indicates a missing value
78 78 - Total column liquid water (kg m**-2)
79 79 - Total column ice water (kg m**-2)
80 80 - Experimental product (~)
81 81 - Experimental product (~)
82 82 - Experimental product (~)
83 83 - Experimental product (~)
84 84 - Experimental product (~)
85 85 - Experimental product (~)
86 86 - Experimental product (~)
87 87 - Experimental product (~)
88 88 - Experimental product (~)
89 89 - Experimental product (~)
90 90 - Experimental product (~)
91 91 - Experimental product (~)
92 92 - Experimental product (~)
93 93 - Experimental product (~)
94 94 - Experimental product (~)
95 95 - Experimental product (~)
96 96 - Experimental product (~)
97 97 - Experimental product (~)
98 98 - Experimental product (~)
99 99 - Experimental product (~)
100 100 - Experimental product (~)
101 101 - Experimental product (~)
102 102 - Experimental product (~)
103 103 - Experimental product (~)
104 104 - Experimental product (~)
105 105 - Experimental product (~)
106 106 - Experimental product (~)
107 107 - Experimental product (~)
108 108 - Experimental product (~)
109 109 - Experimental product (~)
110 110 - Experimental product (~)
111 111 - Experimental product (~)
112 112 - Experimental product (~)
113 113 - Experimental product (~)
114 114 - Experimental product (~)
115 115 - Experimental product (~)
116 116 - Experimental product (~)
117 117 - Experimental product (~)
118 118 - Experimental product (~)
119 119 - Experimental product (~)
120 120 - Experimental product (~)
121 121 MX2T6DIFF Maximum temperature at 2 metres difference (K)
122 122 MN2T6DIFF Minimum temperature at 2 metres difference (K)
123 123 10FG6DIFF 10 metre wind gust in the last 6 hours difference (m s**-1)
125 125 - Vertically integrated total energy (J m**-2)
126 126 - Generic parameter for sensitive area prediction (Various)
127 127 ATDIFF Atmospheric tide difference (~)
128 128 BVDIFF Budget values difference (~)
129 129 ZDIFF Geopotential difference (m**2 s**-2)
130 130 TDIFF Temperature difference (K)
131 131 UDIFF U component of wind difference (m s**-1)
132 132 VDIFF V component of wind difference (m s**-1)
133 133 QDIFF Specific humidity difference (kg kg**-1)
134 134 SPDIFF Surface pressure difference (Pa)
135 135 WDIFF Vertical velocity (pressure) difference (Pa s**-1)
136 136 TCWDIFF Total column water difference (kg m**-2)
137 137 TCWVDIFF Total column water vapour difference (kg m**-2)
138 138 VODIFF Vorticity (relative) difference (s**-1)
139 139 STL1DIFF Soil temperature level 1 difference (K)
140 140 SWL1DIFF Soil wetness level 1 difference (kg m**-2)
141 141 SDDIFF Snow depth difference (m of water equivalent)
142 142 LSPDIFF Stratiform precipitation (Large-scale precipitation) difference (m)
143 143 CPDIFF Convective precipitation difference (m)
144 144 SFDIFF Snowfall (convective + stratiform) difference (m of water equivalent)
145 145 BLDDIFF Boundary layer dissipation difference (J m**-2)
146 146 SSHFDIFF Surface sensible heat flux difference (J m**-2)
147 147 SLHFDIFF Surface latent heat flux difference (J m**-2)
148 148 CHNKDIFF Charnock difference (~)
149 149 SNRDIFF Surface net radiation difference (J m**-2)
150 150 TNRDIFF Top net radiation difference (~)
151 151 MSLDIFF Mean sea level pressure difference (Pa)
152 152 LNSPDIFF Logarithm of surface pressure difference (kg m**-2)
153 153 SWHRDIFF Short-wave heating rate difference (K)
154 154 LWHRDIFF Long-wave heating rate difference (K)
155 155 DDIFF Divergence difference (s**-1)
156 156 GHDIFF Height difference (m)
157 157 RDIFF Relative humidity difference (%)
158 158 TSPDIFF Tendency of surface pressure difference (Pa s**-1)
159 159 BLHDIFF Boundary layer height difference (m)
160 160 SDORDIFF Standard deviation of orography difference (~)
161 161 ISORDIFF Anisotropy of sub-gridscale orography difference (~)
162 162 ANORDIFF Angle of sub-gridscale orography difference (radians)
163 163 SLORDIFF Slope of sub-gridscale orography difference (~)
164 164 TCCDIFF Total cloud cover difference (0 - 1)
165 165 10UDIFF 10 metre U wind component difference (m s**-1)
166 166 10VDIFF 10 metre V wind component difference (m s**-1)
167 167 2TDIFF 2 metre temperature difference (K)
168 168 2DDIFF 2 metre dewpoint temperature difference (K)
169 169 SSRDDIFF Surface solar radiation downwards difference (J m**-2)
170 170 STL2DIFF Soil temperature level 2 difference (K)
171 171 SWL2DIFF Soil wetness level 2 difference (kg m**-2)
172 172 LSMDIFF Land-sea mask difference (0 - 1)
173 173 SRDIFF Surface roughness difference (m)
174 174 ALDIFF Albedo difference (0 - 1)
175 175 STRDDIFF Surface thermal radiation downwards difference (J m**-2)
176 176 SSRDIFF Surface net solar radiation difference (J m**-2)
177 177 STRDIFF Surface net thermal radiation difference (J m**-2)
178 178 TSRDIFF Top net solar radiation difference (J m**-2)
179 179 TTRDIFF Top net thermal radiation difference (J m**-2)
180 180 EWSSDIFF East-West surface stress difference (N m**-2 s)
181 181 NSSSDIFF North-South surface stress difference (N m**-2 s)
182 182 EDIFF Evaporation difference (kg m**-2)
183 183 STL3DIFF Soil temperature level 3 difference (K)
184 184 SWL3DIFF Soil wetness level 3 difference (kg m**-2)
185 185 CCCDIFF Convective cloud cover difference (0 - 1)
186 186 LCCDIFF Low cloud cover difference (0 - 1)
187 187 MCCDIFF Medium cloud cover difference (0 - 1)
188 188 HCCDIFF High cloud cover difference (0 - 1)
189 189 SUNDDIFF Sunshine duration difference (s)
190 190 EWOVDIFF East-West component of sub-gridscale orographic variance difference (m**2)
191 191 NSOVDIFF North-South component of sub-gridscale orographic variance difference (m**2)
192 192 NWOVDIFF North-West/South-East component of sub-gridscale orographic variance difference (m**2)
193 193 NEOVDIFF North-East/South-West component of sub-gridscale orographic variance difference (m**2)
194 194 BTMPDIFF Brightness temperature difference (K)
195 195 LGWSDIFF Longitudinal component of gravity wave stress difference (N m**-2 s)
196 196 MGWSDIFF Meridional component of gravity wave stress difference (N m**-2 s)
197 197 GWDDIFF Gravity wave dissipation difference (J m**-2)
198 198 SRCDIFF Skin reservoir content difference (kg m**-2)
199 199 VEGDIFF Vegetation fraction difference (0 - 1)
200 200 VSODIFF Variance of sub-gridscale orography difference (m**2)
201 201 MX2TDIFF Maximum temperature at 2 metres since previous post-processing difference (K)
202 202 MN2TDIFF Minimum temperature at 2 metres since previous post-processing difference (K)
203 203 O3DIFF Ozone mass mixing ratio difference (kg kg**-1)
204 204 PAWDIFF Precipitation analysis weights difference (~)
205 205 RODIFF Runoff difference (m)
206 206 TCO3DIFF Total column ozone difference (kg m**-2)
207 207 10SIDIFF 10 metre wind speed difference (m s**-1)
208 208 TSRCDIFF Top net solar radiation, clear sky difference (J m**-2)
209 209 TTRCDIFF Top net thermal radiation, clear sky difference (J m**-2)
210 210 SSRCDIFF Surface net solar radiation, clear sky difference (J m**-2)
211 211 STRCDIFF Surface net thermal radiation, clear sky difference (J m**-2)
212 212 TISRDIFF TOA incident solar radiation difference (J m**-2)
214 214 DHRDIFF Diabatic heating by radiation difference (K)
215 215 DHVDDIFF Diabatic heating by vertical diffusion difference (K)
216 216 DHCCDIFF Diabatic heating by cumulus convection difference (K)
217 217 DHLCDIFF Diabatic heating large-scale condensation difference (K)
218 218 VDZWDIFF Vertical diffusion of zonal wind difference (m s**-1)
219 219 VDMWDIFF Vertical diffusion of meridional wind difference (m s**-1)
220 220 EWGDDIFF East-West gravity wave drag tendency difference (m s**-1)
221 221 NSGDDIFF North-South gravity wave drag tendency difference (m s**-1)
222 222 CTZWDIFF Convective tendency of zonal wind difference (m s**-1)
223 223 CTMWDIFF Convective tendency of meridional wind difference (m s**-1)
224 224 VDHDIFF Vertical diffusion of humidity difference (kg kg**-1)
225 225 HTCCDIFF Humidity tendency by cumulus convection difference (kg kg**-1)
226 226 HTLCDIFF Humidity tendency by large-scale condensation difference (kg kg**-1)
227 227 CRNHDIFF Change from removal of negative humidity difference (kg kg**-1)
228 228 TPDIFF Total precipitation difference (m)
229 229 IEWSDIFF Instantaneous X surface stress difference (N m**-2)
230 230 INSSDIFF Instantaneous Y surface stress difference (N m**-2)
231 231 ISHFDIFF Instantaneous surface heat flux difference (J m**-2)
232 232 IEDIFF Instantaneous moisture flux difference (kg m**-2 s)
233 233 ASQDIFF Apparent surface humidity difference (kg kg**-1)
234 234 LSRHDIFF Logarithm of surface roughness length for heat difference (~)
235 235 SKTDIFF Skin temperature difference (K)
236 236 STL4DIFF Soil temperature level 4 difference (K)
237 237 SWL4DIFF Soil wetness level 4 difference (m)
238 238 TSNDIFF Temperature of snow layer difference (K)
239 239 CSFDIFF Convective snowfall difference (m of water equivalent)
240 240 LSFDIFF Large scale snowfall difference (m of water equivalent)
241 241 ACFDIFF Accumulated cloud fraction tendency difference ((-1 to 1))
242 242 ALWDIFF Accumulated liquid water tendency difference ((-1 to 1))
243 243 FALDIFF Forecast albedo difference (0 - 1)
244 244 FSRDIFF Forecast surface roughness difference (m)
245 245 FLSRDIFF Forecast logarithm of surface roughness for heat difference (~)
246 246 CLWCDIFF Specific cloud liquid water content difference (kg kg**-1)
247 247 CIWCDIFF Specific cloud ice water content difference (kg kg**-1)
248 248 CCDIFF Cloud cover difference (0 - 1)
249 249 AIWDIFF Accumulated ice water tendency difference ((-1 to 1))
250 250 ICEDIFF Ice age difference (0 - 1)
251 251 ATTEDIFF Adiabatic tendency of temperature difference (K)
252 252 ATHEDIFF Adiabatic tendency of humidity difference (kg kg**-1)
253 253 ATZEDIFF Adiabatic tendency of zonal wind difference (m s**-1)
254 254 ATMWDIFF Adiabatic tendency of meridional wind difference (m s**-1)

View File

@ -1,33 +1,33 @@
# This file was automatically generated by ./param.pl
1 1 - downward shortwave radiant flux density W m**-2
2 2 - upward shortwave radiant flux density W m**-2
3 3 - downward longwave radiant flux density W m**-2
4 4 - upward longwave radiant flux density W m**-2
5 5 APAB_S downwd photosynthetic active radiant flux density W m**-2
6 6 - net shortwave flux W m**-2
7 7 - net longwave flux W m**-2
8 8 - total net radiative flux density W m**-2
9 9 - downw shortw radiant flux density, cloudfree part W m**-2
10 10 - upw shortw radiant flux density, cloudy part W m**-2
11 11 - downw longw radiant flux density, cloudfree part W m**-2
12 12 - upw longw radiant flux density, cloudy part W m**-2
13 13 SOHR_RAD shortwave radiative heating rate K s**-1
14 14 THHR_RAD longwave radiative heating rate K s**-1
15 15 - total radiative heating rate W m**-2
16 16 - soil heat flux, surface W m**-2
17 17 - soil heat flux, bottom of layer W m**-2
1 1 - downward shortwave radiant flux density (J m**-2)
2 2 - upward shortwave radiant flux density (J m**-2)
3 3 - downward longwave radiant flux density (J m**-2)
4 4 - upward longwave radiant flux density (J m**-2)
5 5 APAB_S downwd photosynthetic active radiant flux density (J m**-2)
6 6 - net shortwave flux (J m**-2)
7 7 - net longwave flux (J m**-2)
8 8 - total net radiative flux density (J m**-2)
9 9 - downw shortw radiant flux density, cloudfree part (J m**-2)
10 10 - upw shortw radiant flux density, cloudy part (J m**-2)
11 11 - downw longw radiant flux density, cloudfree part (J m**-2)
12 12 - upw longw radiant flux density, cloudy part (J m**-2)
13 13 SOHR_RAD shortwave radiative heating rate (K s**-1)
14 14 THHR_RAD longwave radiative heating rate (K s**-1)
15 15 - total radiative heating rate (J m**-2)
16 16 - soil heat flux, surface (J m**-2)
17 17 - soil heat flux, bottom of layer (J m**-2)
29 29 CLC fractional cloud cover (0-1)
30 30 - cloud cover, grid scale (0-1)
31 31 QC specific cloud water content kg kg**-1
32 32 - cloud water content, grid scale, vert integrated kg m**-2
33 33 QI specific cloud ice content, grid scale kg kg**-1
34 34 - cloud ice content, grid scale, vert integrated kg m**-2
35 35 - specific rainwater content, grid scale kg kg**-1
36 36 - specific snow content, grid scale kg kg**-1
37 37 - specific rainwater content, gs, vert. integrated kg m**-2
38 38 - specific snow content, gs, vert. integrated kg m**-2
41 41 TWATER total column water kg m**-2
42 42 - vert. integral of divergence of tot. water content kg m**-2
31 31 QC specific cloud water content (kg kg**-1)
32 32 - cloud water content, grid scale, vert integrated (kg m**-2)
33 33 QI specific cloud ice content, grid scale (kg kg**-1)
34 34 - cloud ice content, grid scale, vert integrated (kg m**-2)
35 35 - specific rainwater content, grid scale (kg kg**-1)
36 36 - specific snow content, grid scale (kg kg**-1)
37 37 - specific rainwater content, gs, vert. integrated (kg m**-2)
38 38 - specific snow content, gs, vert. integrated (kg m**-2)
41 41 TWATER total column water (kg m**-2)
42 42 - vert. integral of divergence of tot. water content (kg m**-2)
50 50 CH_CM_CL cloud covers CH_CM_CL (000...888) (0-1)
51 51 - cloud cover CH (0..8) (0-1)
52 52 - cloud cover CM (0..8) (0-1)
@ -36,43 +36,43 @@
55 55 - fog (0..8) (0-1)
56 56 - fog (0-1)
60 60 - cloud cover, convective cirrus (0-1)
61 61 - specific cloud water content, convective clouds kg kg**-1
62 62 - cloud water content, conv clouds, vert integrated kg m**-2
63 63 - specific cloud ice content, convective clouds kg kg**-1
64 64 - cloud ice content, conv clouds, vert integrated kg m**-2
65 65 - convective mass flux kg s**-1 m**-2
66 66 - updraft velocity, convection m s**-1
67 67 - entrainment parameter, convection m**-1
68 68 HBAS_CON cloud base, convective clouds (above msl) m
69 69 HTOP_CON cloud top, convective clouds (above msl) m
61 61 - specific cloud water content, convective clouds (kg kg**-1)
62 62 - cloud water content, conv clouds, vert integrated (kg m**-2)
63 63 - specific cloud ice content, convective clouds (kg kg**-1)
64 64 - cloud ice content, conv clouds, vert integrated (kg m**-2)
65 65 - convective mass flux (kg s**-1 m**-2)
66 66 - Updraft velocity, convection (m s**-1)
67 67 - entrainment parameter, convection (m**-1)
68 68 HBAS_CON cloud base, convective clouds (above msl) (m)
69 69 HTOP_CON cloud top, convective clouds (above msl) (m)
70 70 - convective layers (00...77) (BKE) (0-1)
71 71 - KO-index (1)
72 72 BAS_CON convection base index (1)
73 73 TOP_CON convection top index (1)
74 74 DT_CON convective temperature tendency K s**-1
75 75 DQV_CON convective tendency of specific humidity s**-1
76 76 - convective tendency of total heat J kg**-1 s**-1
77 77 - convective tendency of total water s**-1
78 78 DU_CON convective momentum tendency (X-component) m s**-2
79 79 DV_CON convective momentum tendency (Y-component) m s**-2
80 80 - convective vorticity tendency s**-2
81 81 - convective divergence tendency s**-2
82 82 HTOP_DC top of dry convection (above msl) m
83 83 - dry convection top index (1)
84 84 HZEROCL height of 0 degree Celsius isotherm above msl m
85 85 SNOWLMT height of snow-fall limit m
99 99 QRS_GSP spec. content of precip. particles kg kg**-1
100 100 PRR_GSP surface precipitation rate, rain, grid scale kg s**-1 m**-2
101 101 PRS_GSP surface precipitation rate, snow, grid scale kg s**-1 m**-2
102 102 RAIN_GSP surface precipitation amount, rain, grid scale kg m**-2
111 111 PRR_CON surface precipitation rate, rain, convective kg s**-1 m**-2
112 112 PRS_CON surface precipitation rate, snow, convective kg s**-1 m**-2
113 113 RAIN_CON surface precipitation amount, rain, convective kg m**-2
139 139 PP deviation of pressure from reference value Pa
150 150 - coefficient of horizontal diffusion m**2 s**-1
187 187 VMAX_10M maximum wind velocity m s**-1
200 200 W_I water content of interception store kg m**-2
203 203 T_SNOW snow temperature K
215 215 T_ICE ice surface temperature K
241 241 CAPE_CON convective available potential energy J kg**-1
71 71 - KO-index (dimensionless)
72 72 BAS_CON convection base index (dimensionless)
73 73 TOP_CON convection top index (dimensionless)
74 74 DT_CON convective temperature tendency (K s**-1)
75 75 DQV_CON convective tendency of specific humidity (s**-1)
76 76 - convective tendency of total heat (J kg**-1 s**-1)
77 77 - convective tendency of total water (s**-1)
78 78 DU_CON convective momentum tendency (X-component) (m s**-2)
79 79 DV_CON convective momentum tendency (Y-component) (m s**-2)
80 80 - convective vorticity tendency (s**-2)
81 81 - convective divergence tendency (s**-2)
82 82 HTOP_DC top of dry convection (above msl) (m)
83 83 - dry convection top index (dimensionless)
84 84 HZEROCL height of 0 degree Celsius isotherm above msl (m)
85 85 SNOWLMT height of snow-fall limit (m)
99 99 QRS_GSP spec. content of precip. particles (kg kg**-1)
100 100 PRR_GSP surface precipitation rate, rain, grid scale (kg s**-1 m**-2)
101 101 PRS_GSP surface precipitation rate, snow, grid scale (kg s**-1 m**-2)
102 102 RAIN_GSP surface precipitation amount, rain, grid scale (kg m**-2)
111 111 PRR_CON surface precipitation rate, rain, convective (kg s**-1 m**-2)
112 112 PRS_CON surface precipitation rate, snow, convective (kg s**-1 m**-2)
113 113 RAIN_CON surface precipitation amount, rain, convective (kg m**-2)
139 139 PP deviation of pressure from reference value (Pa)
150 150 - coefficient of horizontal diffusion (m**2 s**-1)
187 187 VMAX_10M Maximum wind velocity (m s**-1)
200 200 W_I water content of interception store (kg m**-2)
203 203 T_SNOW snow temperature (K)
215 215 T_ICE ice surface temperature (K)
241 241 CAPE_CON convective available potential energy (J kg**-1)
255 255 - Indicates a missing value

View File

@ -1,15 +1,172 @@
# This file was automatically generated by ./param.pl
46 46 AERPR Aerosol precursor mixing ratio kg kg**-1
47 47 AERSM Aerosol small mode mixing ratio kg kg**-1
48 48 AERLG Aerosol large mode mixing ratio kg kg**-1
49 49 AODPR Aerosol precursor optical depth dimensionless
50 50 AODSM Aerosol small mode optical depth dimensionless
51 51 AODLG Aerosol large mode optical depth dimensionless
61 61 CO2 Carbon Dioxide kg kg**-1
62 62 CH4 Methane kg kg**-1
63 63 N2O Nitrous oxide kg kg**-1
121 121 NO2 Nitrogen dioxide kg kg**-1
122 122 SO2 Sulphur dioxide kg kg**-1
123 123 CO Carbon monoxide kg kg**-1
124 124 HCHO Formaldehyde kg kg**-1
203 203 GO3 GEMS Ozone kg kg**-1
1 1 AERMR01DIFF Sea Salt Aerosol (0.03 - 0.5 um) Mixing Ratio (kg kg**-1)
2 2 AERMR02DIFF Sea Salt Aerosol (0.5 - 5 um) Mixing Ratio (kg kg**-1)
3 3 AERMR03DIFF Sea Salt Aerosol (5 - 20 um) Mixing Ratio (kg kg**-1)
4 4 AERMR04DIFF Dust Aerosol (0.03 - 0.55 um) Mixing Ratio (kg kg**-1)
5 5 AERMR05DIFF Dust Aerosol (0.55 - 0.9 um) Mixing Ratio (kg kg**-1)
6 6 AERMR06DIFF Dust Aerosol (0.9 - 20 um) Mixing Ratio (kg kg**-1)
7 7 AERMR07DIFF Hydrophobic Organic Matter Aerosol Mixing Ratio (kg kg**-1)
8 8 AERMR08DIFF Hydrophilic Organic Matter Aerosol Mixing Ratio (kg kg**-1)
9 9 AERMR09DIFF Hydrophobic Black Carbon Aerosol Mixing Ratio (kg kg**-1)
10 10 AERMR10DIFF Hydrophilic Black Carbon Aerosol Mixing Ratio (kg kg**-1)
11 11 AERMR11DIFF Sulphate Aerosol Mixing Ratio (kg kg**-1)
12 12 AERMR12DIFF Aerosol type 12 mixing ratio (kg kg**-1)
13 13 AERMR13DIFF Aerosol type 13 mass mixing ratio (kg kg**-1)
14 14 AERMR14DIFF Aerosol type 14 mass mixing ratio (kg kg**-1)
15 15 AERMR15DIFF Aerosol type 15 mass mixing ratio (kg kg**-1)
16 16 AERGN01DIFF Aerosol type 1 source/gain accumulated (kg m**-2)
17 17 AERGN02DIFF Aerosol type 2 source/gain accumulated (kg m**-2)
18 18 AERGN03DIFF Aerosol type 3 source/gain accumulated (kg m**-2)
19 19 AERGN04DIFF Aerosol type 4 source/gain accumulated (kg m**-2)
20 20 AERGN05DIFF Aerosol type 5 source/gain accumulated (kg m**-2)
21 21 AERGN06DIFF Aerosol type 6 source/gain accumulated (kg m**-2)
22 22 AERGN07DIFF Aerosol type 7 source/gain accumulated (kg m**-2)
23 23 AERGN08DIFF Aerosol type 8 source/gain accumulated (kg m**-2)
24 24 AERGN09DIFF Aerosol type 9 source/gain accumulated (kg m**-2)
25 25 AERGN10DIFF Aerosol type 10 source/gain accumulated (kg m**-2)
26 26 AERGN11DIFF Aerosol type 11 source/gain accumulated (kg m**-2)
27 27 AERGN12DIFF Aerosol type 12 source/gain accumulated (kg m**-2)
28 28 AERPR03DIFF SO4 aerosol precursor mass mixing ratio (kg kg**-1)
29 29 AERWV01DIFF Water vapour mixing ratio for hydrophilic aerosols in mode 1 (kg kg**-1)
30 30 AERWV02DIFF Water vapour mixing ratio for hydrophilic aerosols in mode 2 (kg kg**-1)
31 31 AERLS01DIFF Aerosol type 1 sink/loss accumulated (kg m**-2)
32 32 AERLS02DIFF Aerosol type 2 sink/loss accumulated (kg m**-2)
33 33 AERLS03DIFF Aerosol type 3 sink/loss accumulated (kg m**-2)
34 34 AERLS04DIFF Aerosol type 4 sink/loss accumulated (kg m**-2)
35 35 AERLS05DIFF Aerosol type 5 sink/loss accumulated (kg m**-2)
36 36 AERLS06DIFF Aerosol type 6 sink/loss accumulated (kg m**-2)
37 37 AERLS07DIFF Aerosol type 7 sink/loss accumulated (kg m**-2)
38 38 AERLS08DIFF Aerosol type 8 sink/loss accumulated (kg m**-2)
39 39 AERLS09DIFF Aerosol type 9 sink/loss accumulated (kg m**-2)
40 40 AERLS10DIFF Aerosol type 10 sink/loss accumulated (kg m**-2)
41 41 AERLS11DIFF Aerosol type 11 sink/loss accumulated (kg m**-2)
42 42 AERLS12DIFF Aerosol type 12 sink/loss accumulated (kg m**-2)
43 43 EMDMSDIFF DMS surface emission (kg m**-2 s**-1)
44 44 AERWV03DIFF Water vapour mixing ratio for hydrophilic aerosols in mode 3 (kg kg**-1)
45 45 AERWV04DIFF Water vapour mixing ratio for hydrophilic aerosols in mode 4 (kg kg**-1)
46 46 AERPRDIFF Aerosol precursor mixing ratio (kg kg**-1)
47 47 AERSMDIFF Aerosol small mode mixing ratio (kg kg**-1)
48 48 AERLGDIFF Aerosol large mode mixing ratio (kg kg**-1)
49 49 AODPRDIFF Aerosol precursor optical depth (dimensionless)
50 50 AODSMDIFF Aerosol small mode optical depth (dimensionless)
51 51 AODLGDIFF Aerosol large mode optical depth (dimensionless)
52 52 AERDEPDIFF Dust emission potential (kg s**2 m**-5)
53 53 AERLTSDIFF Lifting threshold speed (m s**-1)
54 54 AERSCCDIFF Soil clay content (%)
55 55 - Experimental product (~)
56 56 - Experimental product (~)
61 61 CO2DIFF Carbon Dioxide (kg kg**-1)
62 62 CH4DIFF Methane (kg kg**-1)
63 63 N2ODIFF Nitrous oxide (kg kg**-1)
64 64 TCCO2DIFF Total column Carbon Dioxide (kg m**-2)
65 65 TCCH4DIFF Total column Methane (kg m**-2)
66 66 TCN2ODIFF Total column Nitrous oxide (kg m**-2)
67 67 CO2OFDIFF Ocean flux of Carbon Dioxide (kg m**-2 s**-1)
68 68 CO2NBFDIFF Natural biosphere flux of Carbon Dioxide (kg m**-2 s**-1)
69 69 CO2APFDIFF Anthropogenic emissions of Carbon Dioxide (kg m**-2 s**-1)
70 70 CH4FDIFF Methane Surface Fluxes (kg m**-2 s**-1)
71 71 KCH4DIFF Methane loss rate due to radical hydroxyl (OH) (s**-1)
80 80 CO2FIREDIFF Wildfire flux of Carbon Dioxide (kg m**-2 s**-1)
81 81 COFIREDIFF Wildfire flux of Carbon Monoxide (kg m**-2 s**-1)
82 82 CH4FIREDIFF Wildfire flux of Methane (kg m**-2 s**-1)
83 83 NMHCFIREDIFF Wildfire flux of Non-Methane Hydro-Carbons (kg m**-2 s**-1)
84 84 H2FIREDIFF Wildfire flux of Hydrogen (kg m**-2 s**-1)
85 85 NOXFIREDIFF Wildfire flux of Nitrogen Oxides NOx (kg m**-2 s**-1)
86 86 N2OFIREDIFF Wildfire flux of Nitrous Oxide (kg m**-2 s**-1)
87 87 PM2P5FIREDIFF Wildfire flux of Particulate Matter PM2.5 (kg m**-2 s**-1)
88 88 TPMFIREDIFF Wildfire flux of Total Particulate Matter (kg m**-2 s**-1)
89 89 TCFIREDIFF Wildfire flux of Total Carbon in Aerosols (kg m**-2 s**-1)
90 90 OCFIREDIFF Wildfire flux of Organic Carbon (kg m**-2 s**-1)
91 91 BCFIREDIFF Wildfire flux of Black Carbon (kg m**-2 s**-1)
92 92 CFIREDIFF Wildfire overall flux of burnt Carbon (kg m**-2 s**-1)
93 93 C4FFIREDIFF Wildfire fraction of C4 plants (dimensionless)
94 94 VEGFIREDIFF Wildfire vegetation map index (dimensionless)
95 95 CCFIREDIFF Wildfire Combustion Completeness (dimensionless)
96 96 FLFIREDIFF Wildfire Fuel Load: Carbon per unit area (kg m**-2)
97 97 OFFIREDIFF Wildfire fraction of area observed (dimensionless)
98 98 OAFIREDIFF Wildfire observed area (m**2)
99 99 FRPFIREDIFF Wildfire radiative power (W m**-2)
100 100 CRFIREDIFF Wildfire combustion rate (kg m**-2 s**-1)
101 101 MAXFRPFIREDIFF Wildfire radiative power maximum (W)
102 102 SO2FIREDIFF Wildfire flux of Sulfur Dioxide (kg m**-2 s**-1)
103 103 CH3OHFIREDIFF Wildfire Flux of Methanol (CH3OH) (kg m**-2 s**-1)
104 104 C2H5OHFIREDIFF Wildfire Flux of Ethanol (C2H5OH) (kg m**-2 s**-1)
105 105 C3H8FIREDIFF Wildfire Flux of Propane (C3H8) (kg m**-2 s**-1)
106 106 C2H4FIREDIFF Wildfire Flux of Ethene (C2H4) (kg m**-2 s**-1)
107 107 C3H6FIREDIFF Wildfire Flux of Propene (C3H6) (kg m**-2 s**-1)
108 108 C5H8FIREDIFF Wildfire Flux of Isoprene (C5H8) (kg m**-2 s**-1)
109 109 TERPENESFIREDIFF Wildfire Flux of Terpenes (C5H8)n (kg m**-2 s**-1)
110 110 TOLUENEFIREDIFF Wildfire Flux of Toluene_lump (C7H8+ C6H6 + C8H10) (kg m**-2 s**-1)
111 111 HIALKENESFIREDIFF Wildfire Flux of Higher Alkenes (CnH2n, C>=4) (kg m**-2 s**-1)
112 112 HIALKANESFIREDIFF Wildfire Flux of Higher Alkanes (CnH2n+2, C>=4) (kg m**-2 s**-1)
113 113 CH2OFIREDIFF Wildfire Flux of Formaldehyde (CH2O) (kg m**-2 s**-1)
114 114 C2H4OFIREDIFF Wildfire Flux of Acetaldehyde (C2H4O) (kg m**-2 s**-1)
115 115 C3H6OFIREDIFF Wildfire Flux of Acetone (C3H6O) (kg m**-2 s**-1)
116 116 NH3FIREDIFF Wildfire Flux of Ammonia (NH3) (kg m**-2 s**-1)
117 117 C2H6SFIREDIFF Wildfire Flux of Dimethyl Sulfide (DMS) (C2H6S) (kg m**-2 s**-1)
118 118 C2H6FIREDIFF Wildfire Flux of Ethane (C2H6) (kg m**-2 s**-1)
119 119 ALEDIFF Altitude of emitter (m above sea level)
120 120 APTDIFF Altitude of plume top (m above sea level)
121 121 NO2DIFF Nitrogen dioxide (kg kg**-1)
122 122 SO2DIFF Sulphur dioxide (kg kg**-1)
123 123 CODIFF Carbon monoxide (kg kg**-1)
124 124 HCHODIFF Formaldehyde (kg kg**-1)
125 125 TCNO2DIFF Total column Nitrogen dioxide (kg m**-2)
126 126 TCSO2DIFF Total column Sulphur dioxide (kg m**-2)
127 127 TCCODIFF Total column Carbon monoxide (kg m**-2)
128 128 TCHCHODIFF Total column Formaldehyde (kg m**-2)
129 129 NOXDIFF Nitrogen Oxides (kg kg**-1)
130 130 TCNOXDIFF Total Column Nitrogen Oxides (kg m**-2)
131 131 GRG1DIFF Reactive tracer 1 mass mixing ratio (kg kg**-1)
132 132 TCGRG1DIFF Total column GRG tracer 1 (kg m**-2)
133 133 GRG2DIFF Reactive tracer 2 mass mixing ratio (kg kg**-1)
134 134 TCGRG2DIFF Total column GRG tracer 2 (kg m**-2)
135 135 GRG3DIFF Reactive tracer 3 mass mixing ratio (kg kg**-1)
136 136 TCGRG3DIFF Total column GRG tracer 3 (kg m**-2)
137 137 GRG4DIFF Reactive tracer 4 mass mixing ratio (kg kg**-1)
138 138 TCGRG4DIFF Total column GRG tracer 4 (kg m**-2)
139 139 GRG5DIFF Reactive tracer 5 mass mixing ratio (kg kg**-1)
140 140 TCGRG5DIFF Total column GRG tracer 5 (kg m**-2)
141 141 GRG6DIFF Reactive tracer 6 mass mixing ratio (kg kg**-1)
142 142 TCGRG6DIFF Total column GRG tracer 6 (kg m**-2)
143 143 GRG7DIFF Reactive tracer 7 mass mixing ratio (kg kg**-1)
144 144 TCGRG7DIFF Total column GRG tracer 7 (kg m**-2)
145 145 GRG8DIFF Reactive tracer 8 mass mixing ratio (kg kg**-1)
146 146 TCGRG8DIFF Total column GRG tracer 8 (kg m**-2)
147 147 GRG9DIFF Reactive tracer 9 mass mixing ratio (kg kg**-1)
148 148 TCGRG9DIFF Total column GRG tracer 9 (kg m**-2)
149 149 GRG10DIFF Reactive tracer 10 mass mixing ratio (kg kg**-1)
150 150 TCGRG10DIFF Total column GRG tracer 10 (kg m**-2)
151 151 SFNOXDIFF Surface flux Nitrogen oxides (kg m**-2 s**-1)
152 152 SFNO2DIFF Surface flux Nitrogen dioxide (kg m**-2 s**-1)
153 153 SFSO2DIFF Surface flux Sulphur dioxide (kg m**-2 s**-1)
154 154 SFCO2DIFF Surface flux Carbon monoxide (kg m**-2 s**-1)
155 155 SFHCHODIFF Surface flux Formaldehyde (kg m**-2 s**-1)
156 156 SFGO3DIFF Surface flux GEMS Ozone (kg m**-2 s**-1)
157 157 SFGR1DIFF Surface flux reactive tracer 1 (kg m**-2 s**-1)
158 158 SFGR2DIFF Surface flux reactive tracer 2 (kg m**-2 s**-1)
159 159 SFGR3DIFF Surface flux reactive tracer 3 (kg m**-2 s**-1)
160 160 SFGR4DIFF Surface flux reactive tracer 4 (kg m**-2 s**-1)
161 161 SFGR5DIFF Surface flux reactive tracer 5 (kg m**-2 s**-1)
162 162 SFGR6DIFF Surface flux reactive tracer 6 (kg m**-2 s**-1)
163 163 SFGR7DIFF Surface flux reactive tracer 7 (kg m**-2 s**-1)
164 164 SFGR8DIFF Surface flux reactive tracer 8 (kg m**-2 s**-1)
165 165 SFGR9DIFF Surface flux reactive tracer 9 (kg m**-2 s**-1)
166 166 SFGR10DIFF Surface flux reactive tracer 10 (kg m**-2 s**-1)
181 181 RADIFF Radon (kg kg**-1)
182 182 SF6DIFF Sulphur Hexafluoride (kg kg**-1)
183 183 TCRADIFF Total column Radon (kg m**-2)
184 184 TCSF6DIFF Total column Sulphur Hexafluoride (kg m**-2)
185 185 SF6APFDIFF Anthropogenic Emissions of Sulphur Hexafluoride (kg m**-2 s**-1)
203 203 GO3DIFF GEMS Ozone (kg kg**-1)
206 206 GTCO3DIFF GEMS Total column ozone (kg m**-2)
207 207 AOD550DIFF Total Aerosol Optical Depth at 550nm (~)
208 208 SSAOD550DIFF Sea Salt Aerosol Optical Depth at 550nm (~)
209 209 DUAOD550DIFF Dust Aerosol Optical Depth at 550nm (~)
210 210 OMAOD550DIFF Organic Matter Aerosol Optical Depth at 550nm (~)
211 211 BCAOD550DIFF Black Carbon Aerosol Optical Depth at 550nm (~)
212 212 SUAOD550DIFF Sulphate Aerosol Optical Depth at 550nm (~)
213 213 AOD469DIFF Total Aerosol Optical Depth at 469nm (~)
214 214 AOD670DIFF Total Aerosol Optical Depth at 670nm (~)
215 215 AOD865DIFF Total Aerosol Optical Depth at 865nm (~)
216 216 AOD1240DIFF Total Aerosol Optical Depth at 1240nm (~)

View File

@ -1,2 +1,2 @@
# This file was automatically generated by ./param.pl
228 228 TPOC Total precipitation observation count dimensionless
228 228 TPOC Total precipitation observation count (dimensionless)

View File

@ -4,7 +4,7 @@
3 3 ZUST Friction velocity (m s**-1)
4 4 MEAN2T Mean temperature at 2 metres (K)
5 5 MEAN10WS Mean of 10 metre wind speed (m s**-1)
6 6 MEANTCC Mean total cloud cover ((0 - 1))
6 6 MEANTCC Mean total cloud cover (0 - 1)
7 7 DL Lake depth (m)
8 8 LMLT Lake mix-layer temperature (K)
9 9 LMLD Lake mix-layer depth (m)
@ -26,6 +26,7 @@
26 26 MX2T3 Maximum temperature at 2 metres in the last 3 hours (K)
27 27 MN2T3 Minimum temperature at 2 metres in the last 3 hours (K)
28 28 10FG3 10 metre wind gust in the last 3 hours (m s**-1)
29 29 I10FG Instantaneous 10 metre wind gust (m s**-1)
39 39 SM Soil Moisture (kg m**-3)
40 40 SWI1 Soil wetness index in layer 1 (dimensionless)
41 41 SWI2 Soil wetness index in layer 2 (dimensionless)
@ -37,12 +38,15 @@
83 83 FCO2NEE Flux of Carbon Dioxide Net Ecosystem Exchange (kg m**-2 s**-1)
84 84 FCO2GPP Flux of Carbon Dioxide Gross Primary Production (kg m**-2 s**-1)
85 85 FCO2REC Flux of Carbon Dioxide Ecosystem Respiration (kg m**-2 s**-1)
88 88 TCSLW Total column supercooled liquid water (kg m**-2)
89 89 TCRW Total column rain water (kg m**-2)
90 90 TCSW Total column snow water (kg m**-2)
91 91 CCF Canopy cover fraction ((0 - 1))
92 92 STF Soil texture fraction ((0 - 1))
91 91 CCF Canopy cover fraction (0 - 1)
92 92 STF Soil texture fraction (0 - 1)
93 93 SWV Volumetric soil moisture (m**3 m**-3)
94 94 IST Ice temperature (K)
121 121 KX K index (K)
123 123 TOTALX Total totals index (K)
129 129 SSRDC Surface solar radiation downward clear-sky (J m**-2)
130 130 STRDC Surface thermal radiation downward clear-sky (J m**-2)
131 131 U10N Neutral wind at 10 m u-component (m s**-1)
@ -50,18 +54,29 @@
134 134 VTNOWD V-tendency from non-orographic wave drag (m s**-2)
136 136 UTNOWD U-tendency from non-orographic wave drag (m s**-2)
139 139 ST Soil Temperature (K)
141 141 SD Snow depth water equivalent (m)
141 141 SD Snow depth water equivalent (kg m**-2)
144 144 SF Snow Fall water equivalent (kg m**-2)
164 164 TCC Total Cloud Cover (%)
170 170 CAP Field capacity (kg m**-3)
171 171 WILT Wilting point (kg m**-3)
217 217 ILSPF Instantaneous large-scale surface precipitation fraction (0 - 1)
218 218 CRR Convective rain rate (kg m**-2 s**-1)
219 219 LSRR Large scale rain rate (kg m**-2 s**-1)
220 220 CSFR Convective snowfall rate water equivalent (kg m**-2 s**-1)
221 221 LSSFR Large scale snowfall rate water equivalent (kg m**-2 s**-1)
222 222 MXTPR3 Maximum total precipitation rate in the last 3 hours (kg m**-2 s**-1)
223 223 MNTPR3 Minimum total precipitation rate in the last 3 hours (kg m**-2 s**-1)
224 224 MXTPR6 Maximum total precipitation rate in the last 6 hours (kg m**-2 s**-1)
225 225 MNTPR6 Minimum total precipitation rate in the last 6 hours (kg m**-2 s**-1)
226 226 MXTPR Maximum total precipitation rate since previous post-processing (kg m**-2 s**-1)
227 227 MNTPR Minimum total precipitation rate since previous post-processing (kg m**-2 s**-1)
228 228 TP Total Precipitation (kg m**-2)
229 229 SMOS_TB_CDFA SMOS first Brightness Temperature Bias Correction parameter (K)
230 230 SMOS_TB_CDFB SMOS second Brightness Temperature Bias Correction parameter (dimensionless)
242 242 FDIF Surface solar radiation diffuse total sky (J m**-2)
243 243 CDIF Surface solar radiation diffuse clear-sky (J m**-2)
244 244 ALDR Surface albedo of direct radiation ((0 - 1))
245 245 ALDF Surface albedo of diffuse radiation ((0 - 1))
244 244 ALDR Surface albedo of direct radiation (0 - 1)
245 245 ALDF Surface albedo of diffuse radiation (0 - 1)
246 246 100U 100 metre U wind component (m s**-1)
247 247 100V 100 metre V wind component (m s**-1)
249 249 100SI 100 metre wind speed (m s**-1)

View File

@ -3,36 +3,36 @@
9 9 SSROVAR Sub-surface runoff (variable resolution) (m)
21 21 FDIRVAR Total sky direct solar radiation at surface (variable resolution) (J m**-2)
22 22 CDIRVAR Clear-sky direct solar radiation at surface (variable resolution) (J m**-2)
44 44 ESVAR Snow evaporation (variable resolution) m of water
45 45 SMLTVAR Snowmelt (variable resolution) m of water
44 44 ESVAR Snow evaporation (variable resolution) (kg m**-2)
45 45 SMLTVAR Snowmelt (variable resolution) (kg m**-2)
46 46 SDURVAR Solar duration (variable resolution) (s)
57 57 UVBVAR Downward UV radiation at the surface (variable resolution) (w m**-2 s)
58 58 PARVAR Photosynthetically active radiation at the surface (variable resolution) (w m**-2 s)
57 57 UVBVAR Downward UV radiation at the surface (variable resolution) (J m**-2)
58 58 PARVAR Photosynthetically active radiation at the surface (variable resolution) (J m**-2)
142 142 LSPVAR Stratiform precipitation (Large-scale precipitation) (variable resolution) (m)
143 143 CPVAR Convective precipitation (variable resolution) (m)
144 144 SFVAR Snowfall (convective + stratiform) (variable resolution) m of water equivalent
145 145 BLDVAR Boundary layer dissipation (variable resolution) (W m**-2 s)
146 146 SSHFVAR Surface sensible heat flux (variable resolution) (W m**-2 s)
147 147 SLHFVAR Surface latent heat flux (variable resolution) (W m**-2 s)
169 169 SSRDVAR Surface solar radiation downwards (variable resolution) (W m**-2 s)
174 174 ALVAR Albedo (variable resolution) ((0 - 1))
175 175 STRDVAR Surface thermal radiation downwards (variable resolution) (W m**-2 s)
176 176 SSRVAR Surface solar radiation (variable resolution) (W m**-2 s)
177 177 STRVAR Surface thermal radiation (variable resolution) (W m**-2 s)
178 178 TSRVAR Top solar radiation (variable resolution) (W m**-2 s)
179 179 TTRVAR Top thermal radiation (variable resolution) (W m**-2 s)
144 144 SFVAR Snowfall (convective + stratiform) (variable resolution) (m of water equivalent)
145 145 BLDVAR Boundary layer dissipation (variable resolution) (J m**-2)
146 146 SSHFVAR Surface sensible heat flux (variable resolution) (J m**-2)
147 147 SLHFVAR Surface latent heat flux (variable resolution) (J m**-2)
169 169 SSRDVAR Surface solar radiation downwards (variable resolution) (J m**-2)
174 174 ALVAR Albedo (variable resolution) (0 - 1)
175 175 STRDVAR Surface thermal radiation downwards (variable resolution) (J m**-2)
176 176 SSRVAR Surface net solar radiation (variable resolution) (J m**-2)
177 177 STRVAR Surface net thermal radiation (variable resolution) (J m**-2)
178 178 TSRVAR Top net solar radiation (variable resolution) (J m**-2)
179 179 TTRVAR Top net thermal radiation (variable resolution) (J m**-2)
180 180 EWSSVAR East-West surface stress (variable resolution) (N m**-2 s)
181 181 NSSSVAR North-South surface stress (variable resolution) (N m**-2 s)
182 182 EVAR Evaporation (variable resolution) m of water
182 182 EVAR Evaporation (variable resolution) (kg m**-2)
189 189 SUNDVAR Sunshine duration (variable resolution) (s)
195 195 LGWSVAR Longitudinal component of gravity wave stress (variable resolution) (N m**-2 s)
196 196 MGWSVAR Meridional component of gravity wave stress (variable resolution) (N m**-2 s)
197 197 GWDVAR Gravity wave dissipation (variable resolution) (W m**-2 s)
198 198 SRCVAR Skin reservoir content (variable resolution) m of water
197 197 GWDVAR Gravity wave dissipation (variable resolution) (J m**-2)
198 198 SRCVAR Skin reservoir content (variable resolution) (kg m**-2)
205 205 ROVAR Runoff (variable resolution) (m)
208 208 TSRCVAR Top net solar radiation, clear sky (variable resolution) (W m**-2 s)
209 209 TTRCVAR Top net thermal radiation, clear sky (variable resolution) (W m**-2 s)
210 210 SSRCVAR Surface net solar radiation, clear sky (variable resolution) (W m**-2 s)
211 211 STRCVAR Surface net thermal radiation, clear sky (variable resolution) (W m**-2 s)
212 212 TISRVAR TOA incident solar radiation (variable resolution) (W m**-2 s)
208 208 TSRCVAR Top net solar radiation, clear sky (variable resolution) (J m**-2)
209 209 TTRCVAR Top net thermal radiation, clear sky (variable resolution) (J m**-2)
210 210 SSRCVAR Surface net solar radiation, clear sky (variable resolution) (J m**-2)
211 211 STRCVAR Surface net thermal radiation, clear sky (variable resolution) (J m**-2)
212 212 TISRVAR TOA incident solar radiation (variable resolution) (J m**-2)
228 228 TPVAR Total precipitation (variable resolution) (m)

View File

@ -7,8 +7,8 @@
5 5 Difference (reference time + P2 minus reference time + P1) product considered valid at reference time + P2
6 6 Average (reference time - P1 to reference time - P2)
7 7 Average (reference time - P1 to reference time + P2)
10 10 P1 occupies octets 19 and 20; product valid at reference time + P1
51 51 Climatological Mean Value:
10 10 P1 occupies octets 19 and 20; product valid at reference time + P1
51 51 Climatological Mean Value:
113 113 Average of N forecasts (or initialized analyses); each product has forecast period of P1 (P1=0 for initialized analyses); products have reference times at intervals of P2, beginning at the given reference time.
114 114 Accumulation of N forecasts (or initialized analyses); each product has forecast period of P1 (P1=0 for initialized analyses); products have reference times at intervals of P2, beginning at the given reference time.
115 115 Average of N forecasts, all with the same reference time; the first has a forecast period of P1, the remaining forecasts follow at intervals of P2.

View File

@ -77,11 +77,21 @@ if(bitmapPresent) {
): read_only;
alias data.packedValues = codedValues;
if (boustrophedonicOrdering) {
meta preBitmapValues data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : read_only;
meta values data_apply_boustrophedonic(preBitmapValues,numberOfRows,numberOfColumns,numberOfPoints,pl) : dump;
} else {
meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump;
if (boustrophedonicOrdering)
{
if (GRIBEX_boustrophedonic)
{
meta preBitmapValues data_apply_boustrophedonic_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor,numberOfRows,numberOfColumns,numberOfPoints): read_only;
}
else
{
meta preBitmapValues data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : read_only;
}
meta values data_apply_boustrophedonic(preBitmapValues,numberOfRows,numberOfColumns,numberOfPoints,pl) : dump;
}
else
{
meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump;
}
} else {
if (boustrophedonicOrdering) {

View File

@ -54,13 +54,24 @@ if(bitmapPresent) {
groupWidth
): read_only;
alias data.packedValues = codedValues;
if (boustrophedonicOrdering) {
meta preBitmapValues data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : read_only;
meta values data_apply_boustrophedonic(preBitmapValues,numberOfRows,numberOfColumns,numberOfPoints,pl) : dump;
} else {
meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump;
}
alias data.packedValues = codedValues;
if (boustrophedonicOrdering)
{
if (GRIBEX_boustrophedonic)
{
meta preBitmapValues data_apply_boustrophedonic_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor,numberOfRows,numberOfColumns,numberOfPoints): read_only;
}
else
{
meta preBitmapValues data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : read_only;
}
meta values data_apply_boustrophedonic(preBitmapValues,numberOfRows,numberOfColumns,numberOfPoints,pl) : dump;
}
else
{
meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump;
}
} else {

View File

@ -54,13 +54,24 @@ if(bitmapPresent) {
groupWidths
): read_only;
alias data.packedValues = codedValues;
if (boustrophedonicOrdering) {
meta preBitmapValues data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : read_only;
meta values data_apply_boustrophedonic(preBitmapValues,numberOfRows,numberOfColumns,numberOfPoints,pl) : dump;
} else {
meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump;
}
alias data.packedValues = codedValues;
if (boustrophedonicOrdering)
{
if (GRIBEX_boustrophedonic)
{
meta preBitmapValues data_apply_boustrophedonic_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor,numberOfRows,numberOfColumns,numberOfPoints): read_only;
}
else
{
meta preBitmapValues data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : read_only;
}
meta values data_apply_boustrophedonic(preBitmapValues,numberOfRows,numberOfColumns,numberOfPoints,pl) : dump;
}
else
{
meta values data_apply_bitmap(codedValues,bitmap,missingValue,binaryScaleFactor) : dump;
}
} else {
if (boustrophedonicOrdering) {

View File

@ -1,4 +1,4 @@
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-02-10 16:05
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-06-11 07:14
#paramId: 500000
#Pressure (S) (not reduced)
'Pressure (S) (not reduced)' = {
@ -262,14 +262,6 @@
indicatorOfParameter = 40 ;
}
#paramId: 500033
#Specific Humidity (S)
'Specific Humidity (S)' = {
table2Version = 2 ;
indicatorOfParameter = 51 ;
indicatorOfTypeOfLevel = 1 ;
}
#paramId: 500034
#Specific Humidity (2m)
'Specific Humidity (2m)' = {
@ -8917,3 +8909,18 @@
indicatorOfParameter = 46 ;
}
#paramId: 503076
#Gravity wave dissipation
'Gravity wave dissipation ' = {
table2Version = 202 ;
indicatorOfParameter = 233 ;
timeRangeIndicator = 3 ;
}
#paramId: 503078
#relative humidity over mixed phase
'relative humidity over mixed phase' = {
table2Version = 250 ;
indicatorOfParameter = 20 ;
}

View File

@ -1,4 +1,4 @@
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE,do not edit! 2014-02-10 16:05
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE,do not edit! 2014-06-11 07:14
#paramId: 500000
#Pressure (S) (not reduced)
'500000' = {
@ -262,14 +262,6 @@
indicatorOfParameter = 40 ;
}
#paramId: 500033
#Specific Humidity (S)
'500033' = {
table2Version = 2 ;
indicatorOfParameter = 51 ;
indicatorOfTypeOfLevel = 1 ;
}
#paramId: 500034
#Specific Humidity (2m)
'500034' = {
@ -8917,3 +8909,18 @@
indicatorOfParameter = 46 ;
}
#paramId: 503076
#Gravity wave dissipation
'503076' = {
table2Version = 202 ;
indicatorOfParameter = 233 ;
timeRangeIndicator = 3 ;
}
#paramId: 503078
#relative humidity over mixed phase
'503078' = {
table2Version = 250 ;
indicatorOfParameter = 20 ;
}

View File

@ -1,4 +1,4 @@
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-02-10 16:05
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-06-11 07:14
#paramId: 500000
#Pressure (S) (not reduced)
'PS' = {
@ -262,14 +262,6 @@
indicatorOfParameter = 40 ;
}
#paramId: 500033
#Specific Humidity (S)
'QV_S' = {
table2Version = 2 ;
indicatorOfParameter = 51 ;
indicatorOfTypeOfLevel = 1 ;
}
#paramId: 500034
#Specific Humidity (2m)
'QV_2M' = {
@ -8917,3 +8909,18 @@
indicatorOfParameter = 46 ;
}
#paramId: 503076
#Gravity wave dissipation
'AVDIS_SSO' = {
table2Version = 202 ;
indicatorOfParameter = 233 ;
timeRangeIndicator = 3 ;
}
#paramId: 503078
#relative humidity over mixed phase
'RH_MIX_EC' = {
table2Version = 250 ;
indicatorOfParameter = 20 ;
}

View File

@ -1,4 +1,4 @@
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-02-10 16:05
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-06-11 07:14
#paramId: 500000
#Pressure (S) (not reduced)
'Pa' = {
@ -262,14 +262,6 @@
indicatorOfParameter = 40 ;
}
#paramId: 500033
#Specific Humidity (S)
'kg kg-1' = {
table2Version = 2 ;
indicatorOfParameter = 51 ;
indicatorOfTypeOfLevel = 1 ;
}
#paramId: 500034
#Specific Humidity (2m)
'kg kg-1' = {
@ -8917,3 +8909,18 @@
indicatorOfParameter = 46 ;
}
#paramId: 503076
#Gravity wave dissipation
'W m-2' = {
table2Version = 202 ;
indicatorOfParameter = 233 ;
timeRangeIndicator = 3 ;
}
#paramId: 503078
#relative humidity over mixed phase
'%' = {
table2Version = 250 ;
indicatorOfParameter = 20 ;
}

View File

@ -68,12 +68,36 @@
scaleFactorOfFirstFixedSurface = 0 ;
scaledValueOfFirstFixedSurface = 10 ;
}
#Relative humidity with respect to water
'rhw' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 93 ;
}
#Relative humidity with respect to ice
'rhi' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 94 ;
}
#Snow albedo
'asn' = {
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 19 ;
}
#Fraction of stratiform precipitation cover
'fspc' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 36 ;
}
#Fraction of convective precipitation cover
'fcpc' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 37 ;
}
#Soil moisture top 20 cm
'sm20' = {
discipline = 2 ;

View File

@ -1,4 +1,4 @@
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-02-10 16:05
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-06-11 07:14
#paramId: 500000
#Pressure (S) (not reduced)
'Pressure (S) (not reduced)' = {
@ -312,16 +312,6 @@
parameterNumber = 9 ;
}
#paramId: 500033
#Specific Humidity (S)
'Specific Humidity (S)' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 1 ;
scaleFactorOfFirstFixedSurface = 0 ;
}
#paramId: 500034
#Specific Humidity (2m)
'Specific Humidity (2m)' = {
@ -1244,6 +1234,70 @@
parameterNumber = 6 ;
}
#paramId: 500185
#Direction of combined wind waves and swell
'Direction of combined wind waves and swell' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 14 ;
}
#paramId: 500187
#Peak period of total swell
'Peak period of total swell' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 36 ;
}
#paramId: 500189
#Peak period of wind waves
'Peak period of wind waves' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 35 ;
}
#paramId: 500190
#Peak wave period
'Peak wave period' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 34 ;
}
#paramId: 500191
#Mean period of combined wind waves and swell
'Mean period of combined wind waves and swell' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 15 ;
}
#paramId: 500192
#Inverse mean wave frequency
'Inverse mean wave frequency' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 25 ;
}
#paramId: 500193
#Mean zero-crossing wave period
'Mean zero-crossing wave period' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 28 ;
}
#paramId: 500194
#Wave directional width
'Wave directional width' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 31 ;
}
#paramId: 500200
#Standard deviation of sub-grid scale orography
'Standard deviation of sub-grid scale orography' = {
@ -1821,16 +1875,6 @@
constituentType = 30175 ;
}
#paramId: 500283
#Gravity wave dissipation (initialisation)
'Gravity wave dissipation (initialisation)' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 23 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 500284
#Gravity wave dissipation (vertical integral)
'Gravity wave dissipation (vertical integral)' = {
@ -3750,6 +3794,14 @@
scaledValueOfFirstFixedSurface = 1 ;
}
#paramId: 502397
#Virtual Temperature
'Virtual Temperature' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#paramId: 502693
#Potential temperature
'Potential temperature' = {
@ -3758,14 +3810,6 @@
parameterNumber = 2 ;
}
#paramId: 502698
#Virtual temperature
'Virtual temperature' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#paramId: 502700
#Boundary layer dissipation
'Boundary layer dissipation' = {
@ -5597,6 +5641,15 @@
typeOfFirstFixedSurface = 1 ;
}
#paramId: 503076
#Gravity wave dissipation
'Gravity wave dissipation ' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 23 ;
typeOfStatisticalProcessing = 0 ;
}
#paramId: 500092
#Solar radiation heating rate
'Solar radiation heating rate' = {
@ -5968,70 +6021,6 @@
parameterNumber = 206 ;
}
#paramId: 500185
#total wave direction
'total wave direction' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 192 ;
}
#paramId: 500187
#wind sea peak period
'wind sea peak period' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 193 ;
}
#paramId: 500189
#swell peak period
'swell peak period' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 194 ;
}
#paramId: 500190
#total wave peak period
'total wave peak period' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 195 ;
}
#paramId: 500191
#total wave mean period
'total wave mean period' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 196 ;
}
#paramId: 500192
#total Tm1 period
'total Tm1 period' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 197 ;
}
#paramId: 500193
#total Tm2 period
'total Tm2 period' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 198 ;
}
#paramId: 500194
#total directional spread
'total directional spread' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 199 ;
}
#paramId: 500195
#analysis error(standard deviation), geopotential(gpm)
'analysis error(standard deviation), geopotential(gpm)' = {
@ -9644,26 +9633,6 @@
typeOfFirstFixedSurface = 1 ;
}
#paramId: 503065
#u-momentum flux due to SSO-effects (initialisation)
'u-momentum flux due to SSO-effects (initialisation)' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 193 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 503066
#v-momentum flux due to SSO-effects (initialisation)
'v-momentum flux due to SSO-effects (initialisation)' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 194 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 503068
#precipitation, qualified,BRD
'precipitation, qualified,BRD' = {
@ -9726,3 +9695,21 @@
parameterNumber = 193 ;
}
#paramId: 503078
#relative humidity over mixed phase
'relative humidity over mixed phase' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 220 ;
}
#paramId: 503079
#soil moisture index (multilayers)
'soil moisture index (multilayers)' = {
discipline = 2 ;
parameterCategory = 3 ;
parameterNumber = 200 ;
typeOfSecondFixedSurface = 106 ;
typeOfFirstFixedSurface = 106 ;
}

View File

@ -1,4 +1,4 @@
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-02-10 16:05
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-06-11 07:14
#paramId: 500000
#Pressure (S) (not reduced)
'500000' = {
@ -312,16 +312,6 @@
parameterNumber = 9 ;
}
#paramId: 500033
#Specific Humidity (S)
'500033' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 1 ;
scaleFactorOfFirstFixedSurface = 0 ;
}
#paramId: 500034
#Specific Humidity (2m)
'500034' = {
@ -1616,67 +1606,67 @@
}
#paramId: 500185
#total wave direction
#Direction of combined wind waves and swell
'500185' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 192 ;
parameterNumber = 14 ;
}
#paramId: 500187
#wind sea peak period
#Peak period of total swell
'500187' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 193 ;
parameterNumber = 36 ;
}
#paramId: 500189
#swell peak period
#Peak period of wind waves
'500189' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 194 ;
parameterNumber = 35 ;
}
#paramId: 500190
#total wave peak period
#Peak wave period
'500190' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 195 ;
parameterNumber = 34 ;
}
#paramId: 500191
#total wave mean period
#Mean period of combined wind waves and swell
'500191' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 196 ;
parameterNumber = 15 ;
}
#paramId: 500192
#total Tm1 period
#Inverse mean wave frequency
'500192' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 197 ;
parameterNumber = 25 ;
}
#paramId: 500193
#total Tm2 period
#Mean zero-crossing wave period
'500193' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 198 ;
parameterNumber = 28 ;
}
#paramId: 500194
#total directional spread
#Wave directional width
'500194' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 199 ;
parameterNumber = 31 ;
}
#paramId: 500195
@ -5243,7 +5233,7 @@
}
#paramId: 500583
#
#Min 2m Temperature (i) Initialisation
'500583' = {
discipline = 0 ;
parameterCategory = 0 ;
@ -5363,7 +5353,7 @@
}
#paramId: 500600
#
#Prob Windboeen > 25 kn
'500600' = {
discipline = 0 ;
parameterCategory = 2 ;
@ -5372,7 +5362,7 @@
}
#paramId: 500601
#
#Prob Windboeen > 27 kn
'500601' = {
discipline = 0 ;
parameterCategory = 2 ;
@ -5381,7 +5371,7 @@
}
#paramId: 500602
#
#Prob Sturmboeen > 33 kn
'500602' = {
discipline = 0 ;
parameterCategory = 2 ;
@ -5390,7 +5380,7 @@
}
#paramId: 500603
#
#Prob Sturmboeen > 40 kn
'500603' = {
discipline = 0 ;
parameterCategory = 2 ;
@ -5399,7 +5389,7 @@
}
#paramId: 500604
#
#Prob Schwere Sturmboeen > 47 kn
'500604' = {
discipline = 0 ;
parameterCategory = 2 ;
@ -5408,7 +5398,7 @@
}
#paramId: 500605
#
#Prob Orkanartige Boeen > 55 kn
'500605' = {
discipline = 0 ;
parameterCategory = 2 ;
@ -5417,7 +5407,7 @@
}
#paramId: 500606
#
#Prob Orkanboeen > 63 kn
'500606' = {
discipline = 0 ;
parameterCategory = 2 ;
@ -5426,7 +5416,7 @@
}
#paramId: 500607
#
#Prob Oberoertliche Orkanboeen > 75 kn
'500607' = {
discipline = 0 ;
parameterCategory = 2 ;
@ -5435,7 +5425,7 @@
}
#paramId: 500608
#
#Prob Starkregen > 10 mm
'500608' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5444,7 +5434,7 @@
}
#paramId: 500609
#
#Prob Heftiger Starkregen > 25 mm
'500609' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5453,7 +5443,7 @@
}
#paramId: 500610
#
#Prob Extrem Heftiger Starkregen > 50 mm
'500610' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5462,7 +5452,7 @@
}
#paramId: 500611
#
#Prob Leichter Schneefall > 0,1 mm
'500611' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5471,7 +5461,7 @@
}
#paramId: 500612
#
#Prob Leichter Schneefall > 0,1 cm
'500612' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5480,7 +5470,7 @@
}
#paramId: 500613
#
#Prob Leichter Schneefall > 0,5 cm
'500613' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5489,7 +5479,7 @@
}
#paramId: 500614
#
#Prob Leichter Schneefall > 1 cm
'500614' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5498,7 +5488,7 @@
}
#paramId: 500615
#
#Prob Schneefall > 5 cm
'500615' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5507,7 +5497,7 @@
}
#paramId: 500616
#
#Prob Starker Schneefall > 10 cm
'500616' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5516,7 +5506,7 @@
}
#paramId: 500617
#
#Prob Extrem starker Schneefall > 25 cm
'500617' = {
discipline = 0 ;
parameterCategory = 1 ;
@ -5525,7 +5515,7 @@
}
#paramId: 500618
#
#Prob Frost
'500618' = {
discipline = 0 ;
parameterCategory = 0 ;
@ -5534,7 +5524,7 @@
}
#paramId: 500619
#
#Prob Strenger Frost
'500619' = {
discipline = 0 ;
parameterCategory = 0 ;
@ -8209,6 +8199,14 @@
parameterNumber = 226 ;
}
#paramId: 502397
#Virtual Temperature
'502397' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#paramId: 502693
#Potential temperature
'502693' = {
@ -8217,14 +8215,6 @@
parameterNumber = 2 ;
}
#paramId: 502698
#Virtual temperature
'502698' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#paramId: 502700
#Boundary layer dissipation
'502700' = {
@ -10235,3 +10225,30 @@
typeOfFirstFixedSurface = 1 ;
}
#paramId: 503076
#Gravity wave dissipation
'503076' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 23 ;
typeOfStatisticalProcessing = 0 ;
}
#paramId: 503078
#relative humidity over mixed phase
'503078' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 220 ;
}
#paramId: 503079
#soil moisture index (multilayers)
'503079' = {
discipline = 2 ;
parameterCategory = 3 ;
parameterNumber = 200 ;
typeOfSecondFixedSurface = 106 ;
typeOfFirstFixedSurface = 106 ;
}

View File

@ -1,4 +1,4 @@
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-02-10 16:05
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-06-11 07:14
#paramId: 500000
#Pressure (S) (not reduced)
'PS' = {
@ -312,16 +312,6 @@
parameterNumber = 9 ;
}
#paramId: 500033
#Specific Humidity (S)
'QV_S' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 1 ;
scaleFactorOfFirstFixedSurface = 0 ;
}
#paramId: 500034
#Specific Humidity (2m)
'QV_2M' = {
@ -1244,6 +1234,70 @@
parameterNumber = 6 ;
}
#paramId: 500185
#Direction of combined wind waves and swell
'MWD' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 14 ;
}
#paramId: 500187
#Peak period of total swell
'PPWW' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 36 ;
}
#paramId: 500189
#Peak period of wind waves
'PPPS' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 35 ;
}
#paramId: 500190
#Peak wave period
'PP1D' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 34 ;
}
#paramId: 500191
#Mean period of combined wind waves and swell
'TM10' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 15 ;
}
#paramId: 500192
#Inverse mean wave frequency
'TM01' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 25 ;
}
#paramId: 500193
#Mean zero-crossing wave period
'TM02' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 28 ;
}
#paramId: 500194
#Wave directional width
'SPRD' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 31 ;
}
#paramId: 500200
#Standard deviation of sub-grid scale orography
'SSO_STDH' = {
@ -1821,16 +1875,6 @@
constituentType = 30175 ;
}
#paramId: 500283
#Gravity wave dissipation (initialisation)
'AVDIS_SSO' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 23 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 500284
#Gravity wave dissipation (vertical integral)
'VDIS_SSO' = {
@ -3750,6 +3794,14 @@
scaledValueOfFirstFixedSurface = 1 ;
}
#paramId: 502397
#Virtual Temperature
'' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#paramId: 502693
#Potential temperature
'PT' = {
@ -3758,14 +3810,6 @@
parameterNumber = 2 ;
}
#paramId: 502698
#Virtual temperature
'VTMP' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#paramId: 502700
#Boundary layer dissipation
'BLD' = {
@ -5597,6 +5641,15 @@
typeOfFirstFixedSurface = 1 ;
}
#paramId: 503076
#Gravity wave dissipation
'AVDIS_SSO' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 23 ;
typeOfStatisticalProcessing = 0 ;
}
#paramId: 500092
#Solar radiation heating rate
'SOHR_RAD' = {
@ -5968,70 +6021,6 @@
parameterNumber = 206 ;
}
#paramId: 500185
#total wave direction
'MWD' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 192 ;
}
#paramId: 500187
#wind sea peak period
'PPWW' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 193 ;
}
#paramId: 500189
#swell peak period
'PPPS' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 194 ;
}
#paramId: 500190
#total wave peak period
'PP1D' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 195 ;
}
#paramId: 500191
#total wave mean period
'TM10' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 196 ;
}
#paramId: 500192
#total Tm1 period
'TM01' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 197 ;
}
#paramId: 500193
#total Tm2 period
'TM02' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 198 ;
}
#paramId: 500194
#total directional spread
'SPRD' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 199 ;
}
#paramId: 500195
#analysis error(standard deviation), geopotential(gpm)
'ANA_ERR_FI' = {
@ -9644,26 +9633,6 @@
typeOfFirstFixedSurface = 1 ;
}
#paramId: 503065
#u-momentum flux due to SSO-effects (initialisation)
'AUSTR_SSO' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 193 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 503066
#v-momentum flux due to SSO-effects (initialisation)
'AVSTR_SSO' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 194 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 503068
#precipitation, qualified,BRD
'RADAR_RQ' = {
@ -9726,3 +9695,21 @@
parameterNumber = 193 ;
}
#paramId: 503078
#relative humidity over mixed phase
'RH_MIX_EC' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 220 ;
}
#paramId: 503079
#soil moisture index (multilayers)
'SMI' = {
discipline = 2 ;
parameterCategory = 3 ;
parameterNumber = 200 ;
typeOfSecondFixedSurface = 106 ;
typeOfFirstFixedSurface = 106 ;
}

View File

@ -1,4 +1,4 @@
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-02-10 16:05
# Automatically generated by get_definitions.sql from database PRJ_TDCFDOKU.GRIB_PARAMETER@MIRAKEL.DWD.DE, do not edit! 2014-06-11 07:14
#paramId: 500000
#Pressure (S) (not reduced)
'Pa' = {
@ -312,16 +312,6 @@
parameterNumber = 9 ;
}
#paramId: 500033
#Specific Humidity (S)
'kg kg-1' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 1 ;
scaleFactorOfFirstFixedSurface = 0 ;
}
#paramId: 500034
#Specific Humidity (2m)
'kg kg-1' = {
@ -1244,6 +1234,70 @@
parameterNumber = 6 ;
}
#paramId: 500185
#Direction of combined wind waves and swell
'degree true' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 14 ;
}
#paramId: 500187
#Peak period of total swell
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 36 ;
}
#paramId: 500189
#Peak period of wind waves
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 35 ;
}
#paramId: 500190
#Peak wave period
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 34 ;
}
#paramId: 500191
#Mean period of combined wind waves and swell
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 15 ;
}
#paramId: 500192
#Inverse mean wave frequency
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 25 ;
}
#paramId: 500193
#Mean zero-crossing wave period
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 28 ;
}
#paramId: 500194
#Wave directional width
'degree true' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 31 ;
}
#paramId: 500200
#Standard deviation of sub-grid scale orography
'm' = {
@ -1821,16 +1875,6 @@
constituentType = 30175 ;
}
#paramId: 500283
#Gravity wave dissipation (initialisation)
'W m-2' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 23 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 500284
#Gravity wave dissipation (vertical integral)
'W m-2' = {
@ -3750,6 +3794,14 @@
scaledValueOfFirstFixedSurface = 1 ;
}
#paramId: 502397
#Virtual Temperature
'K' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#paramId: 502693
#Potential temperature
'K' = {
@ -3758,14 +3810,6 @@
parameterNumber = 2 ;
}
#paramId: 502698
#Virtual temperature
'K' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#paramId: 502700
#Boundary layer dissipation
'' = {
@ -5597,6 +5641,15 @@
typeOfFirstFixedSurface = 1 ;
}
#paramId: 503076
#Gravity wave dissipation
'W m-2' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 23 ;
typeOfStatisticalProcessing = 0 ;
}
#paramId: 500092
#Solar radiation heating rate
'K s-1' = {
@ -5968,70 +6021,6 @@
parameterNumber = 206 ;
}
#paramId: 500185
#total wave direction
'degree true' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 192 ;
}
#paramId: 500187
#wind sea peak period
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 193 ;
}
#paramId: 500189
#swell peak period
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 194 ;
}
#paramId: 500190
#total wave peak period
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 195 ;
}
#paramId: 500191
#total wave mean period
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 196 ;
}
#paramId: 500192
#total Tm1 period
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 197 ;
}
#paramId: 500193
#total Tm2 period
's' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 198 ;
}
#paramId: 500194
#total directional spread
'degree true' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 199 ;
}
#paramId: 500195
#analysis error(standard deviation), geopotential(gpm)
'gpm' = {
@ -9644,26 +9633,6 @@
typeOfFirstFixedSurface = 1 ;
}
#paramId: 503065
#u-momentum flux due to SSO-effects (initialisation)
'N m-2' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 193 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 503066
#v-momentum flux due to SSO-effects (initialisation)
'N m-2' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 194 ;
typeOfStatisticalProcessing = 0 ;
typeOfGeneratingProcess = 1 ;
}
#paramId: 503068
#precipitation, qualified,BRD
'kg m-2' = {
@ -9726,3 +9695,21 @@
parameterNumber = 193 ;
}
#paramId: 503078
#relative humidity over mixed phase
'%' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 220 ;
}
#paramId: 503079
#soil moisture index (multilayers)
'1' = {
discipline = 2 ;
parameterCategory = 3 ;
parameterNumber = 200 ;
typeOfSecondFixedSurface = 106 ;
typeOfFirstFixedSurface = 106 ;
}

View File

@ -68,12 +68,36 @@
scaleFactorOfFirstFixedSurface = 0 ;
typeOfStatisticalProcessing = 2 ;
}
#Relative humidity with respect to water
'Relative humidity with respect to water' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 93 ;
}
#Relative humidity with respect to ice
'Relative humidity with respect to ice' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 94 ;
}
#Snow albedo
'Snow albedo' = {
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 19 ;
}
#Fraction of stratiform precipitation cover
'Fraction of stratiform precipitation cover' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 36 ;
}
#Fraction of convective precipitation cover
'Fraction of convective precipitation cover' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 37 ;
}
#Soil moisture top 20 cm
'Soil moisture top 20 cm' = {
discipline = 2 ;

View File

@ -68,12 +68,36 @@
scaleFactorOfFirstFixedSurface = 0 ;
scaledValueOfFirstFixedSurface = 10 ;
}
#Relative humidity with respect to water
'228030' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 93 ;
}
#Relative humidity with respect to ice
'228031' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 94 ;
}
#Snow albedo
'228032' = {
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 19 ;
}
#Fraction of stratiform precipitation cover
'228033' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 36 ;
}
#Fraction of convective precipitation cover
'228034' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 37 ;
}
#Soil moisture top 20 cm
'228086' = {
discipline = 2 ;

View File

@ -68,12 +68,36 @@
scaledValueOfFirstFixedSurface = 10 ;
typeOfStatisticalProcessing = 2 ;
}
#Relative humidity with respect to water
'rhw' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 93 ;
}
#Relative humidity with respect to ice
'rhi' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 94 ;
}
#Snow albedo
'asn' = {
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 19 ;
}
#Fraction of stratiform precipitation cover
'fspc' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 36 ;
}
#Fraction of convective precipitation cover
'fcpc' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 37 ;
}
#Soil moisture top 20 cm
'sm20' = {
discipline = 2 ;

View File

@ -1,10 +1,15 @@
# Code table 4.201 - Precipitation type
0 0 Reserved
1 1 Rain
2 2 Thunderstorm
3 3 Freezing rain
4 4 Mixed/ice
5 5 Snow
# 6-191 Reserved
0 0 Reserved
1 1 Rain
2 2 Thunderstorm
3 3 Freezing rain
4 4 Mixed/ice
5 5 Snow
6 6 Wet snow
7 7 Mixture of rain and snow
8 8 Ice pellets
9 9 Graupel
10 10 Hail
# 11-191 Reserved
# 192-254 Reserved for local use
255 255 Missing

View File

@ -7,7 +7,6 @@
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
# TEMPLATE 3.100, Triangular grid based on an icosahedron (see Attachment I.2-GRIB-Att.)
# n2 - exponent of 2 for the number of intervals on main triangle sides
@ -25,14 +24,15 @@ alias numberOfDiamonds=nd;
# Latitude of the pole point of the icosahedron on the sphere
signed[4] latitudeOfThePolePoint : dump ;
meta geography.latitudeOfThePolePointInDegrees scale(latitudeOfThePolePoint,one,grib2divider,truncateDegrees) : dump;
# Longitude of the pole point of the icosahedron on the sphere
unsigned[4] longitudeOfThePolePoint : dump ;
meta longitudeOfThePolePointInDegrees g2lon(longitudeOfThePolePoint);
meta geography.longitudeOfThePolePointInDegrees g2lon(longitudeOfThePolePoint);
# Longitude of the centre line of the first diamond of the icosahedron on the sphere
unsigned[4] longitudeOfFirstDiamondCenterLine : dump ;
meta longitudeOfFirstDiamondCenterLineInDegrees g2lon(longitudeOfFirstDiamondCenterLine);
meta geography.longitudeOfFirstDiamondCenterLineInDegrees g2lon(longitudeOfFirstDiamondCenterLine);
# Grid point position
codetable[1] gridPointPosition ('3.8.table',masterDir,localDir);

View File

@ -9,6 +9,8 @@
# TEMPLATE 4.44, Analysis or forecast at a horizontal level or in a horizontal layer at a point in time
include "template.4.parameter_aerosol.def";
# GRIB-530: Special case for aerosol thanks to WMO error
include "template.4.parameter_aerosol_44.def";
include "template.4.point_in_time.def";
include "template.4.horizontal.def";

View File

@ -68,12 +68,36 @@
scaleFactorOfFirstFixedSurface = 0 ;
typeOfStatisticalProcessing = 2 ;
}
#Relative humidity with respect to water
'%' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 93 ;
}
#Relative humidity with respect to ice
'%' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 94 ;
}
#Snow albedo
'%' = {
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 19 ;
}
#Fraction of stratiform precipitation cover
'Proportion' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 36 ;
}
#Fraction of convective precipitation cover
'Proportion' = {
discipline = 0 ;
parameterCategory = 6 ;
parameterNumber = 37 ;
}
#Soil moisture top 20 cm
'kg m**-3' = {
discipline = 2 ;

View File

@ -8,6 +8,7 @@ foreach my $d ( sort @sub )
{
process($d) unless $d =~ /bufr/;
}
print "EXTRA_DIST=CMakeLists.txt\n\n";
print "include \$(DEVEL_RULES)\n";
sub navigate {

View File

@ -30,6 +30,7 @@ list( APPEND test_bins
iterator_bitmap
large_grib1
clone
check_gaussian_grid
)
foreach( tool ${test_bins} )
ecbuild_add_executable( TARGET ${tool}

View File

@ -6,7 +6,8 @@ TESTS = iterator.sh get.sh print_data.sh set.sh keys_iterator.sh multi.sh multi_
noinst_PROGRAMS = nearest set_bitmap iterator get print_data set set_missing keys_iterator \
set_data mars_param values_check box multi multi2 multi_write precision \
set_pv list sections_copy large_grib1 get_data iterator_bitmap clone
set_pv list sections_copy large_grib1 get_data iterator_bitmap clone new_sample \
check_gaussian_grid
bin_PROGRAMS = points
box_SOURCES = box.c
@ -32,11 +33,13 @@ sections_copy_SOURCES = sections_copy.c
large_grib1_SOURCES = large_grib1.c
get_data_SOURCES = get_data.c
clone_SOURCES = clone.c
new_sample_SOURCES = new_sample.c
check_gaussian_grid_SOURCES = check_gaussian_grid.c
INCLUDES = -I$(top_builddir)/src
LDADD = $(top_builddir)/src/libgrib_api.la
DEPENDENCIES = $(LDADD)
EXTRA_DIST =$(TESTS) include.sh
EXTRA_DIST =$(TESTS) include.sh CMakeLists.txt include.ctest.sh.in

View File

@ -10,7 +10,8 @@
#include "grib_api.h"
int main(int argc, char* argv[]) {
int main(int argc, char* argv[])
{
FILE* f;
int err=0;
char infile[]="../../data/reduced_gaussian_model_level.grib1";

View File

@ -0,0 +1,184 @@
/*
* Copyright 2005-2014 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
/*
*
* Description: Check the geometry of a global GRIB field
* with a Gaussian Grid (reduced or regular)
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdarg.h>
#include "grib_api.h"
#define STR_EQUAL(s1, s2) (strcmp((s1), (s2)) == 0)
int DBL_EQUAL(double d1, double d2, double tolerance)
{
return fabs(d1-d2) <= tolerance;
}
void usage(const char* prog)
{
printf("usage: %s file\n",prog);
exit(1);
}
void error(const char* fmt, ...)
{
char msg[1024];
va_list list;
va_start(list,fmt);
vsprintf(msg, fmt, list);
va_end(list);
fprintf(stderr,msg);
exit(1);
}
double get_precision(long edition)
{
if (edition == 1) return 1.0/1000.0; /* milli degrees */
if (edition == 2) return 1.0/1000000.0; /* micro degrees */
assert(!"Invalid edition");
return 0.0;
}
int main(int argc, char** argv)
{
int err = 0, msg_num = 0;
FILE* in = NULL;
char* filename = NULL;
grib_handle *h = NULL;
if (argc != 2) {
usage(argv[0]);
return 1;
}
filename = argv[1];
in = fopen(filename,"r");
if(!in) {
error("ERROR: unable to open input file %s\n",filename);
}
while ((h = grib_handle_new_from_file(0,in,&err)) != NULL ) {
int is_reduced = 0, is_regular = 0, grid_ok = 0;
long edition = 0, N = 0, Nj = 0, numberOfDataPoints;
size_t len = 0, numberOfValues = 0;
double *lats = NULL;
long *pl = NULL;
char gridType[32] = {0,};
double angular_tolerance, lat1, lon1, lat2, lon2, expected_lon2;
double iDirectionIncrementInDegrees;
if (err != GRIB_SUCCESS) GRIB_CHECK(err,0);
++msg_num;
printf("Processing GRIB message #%d\n", msg_num);
len = 32;
GRIB_CHECK(grib_get_string(h,"gridType",gridType,&len),0);
is_regular = STR_EQUAL(gridType, "regular_gg");
is_reduced = STR_EQUAL(gridType, "reduced_gg");
grid_ok = is_regular || is_reduced;
if( !grid_ok ) {
error("ERROR: gridType should be Reduced or Regular Gaussian Grid!\n");
}
GRIB_CHECK(grib_get_long(h,"edition",&edition),0);
GRIB_CHECK(grib_get_long(h,"N",&N),0);
GRIB_CHECK(grib_get_long(h,"Nj",&Nj),0);
GRIB_CHECK(grib_get_long(h,"numberOfDataPoints",&numberOfDataPoints),0);
GRIB_CHECK(grib_get_double(h,"latitudeOfFirstGridPointInDegrees", &lat1),0);
GRIB_CHECK(grib_get_double(h,"longitudeOfFirstGridPointInDegrees",&lon1),0);
GRIB_CHECK(grib_get_double(h,"latitudeOfLastGridPointInDegrees", &lat2),0);
GRIB_CHECK(grib_get_double(h,"longitudeOfLastGridPointInDegrees", &lon2),0);
GRIB_CHECK(grib_get_double(h,"iDirectionIncrementInDegrees",&iDirectionIncrementInDegrees),0);
angular_tolerance = get_precision(edition);
if ( Nj != 2*N ) {
error("ERROR: Nj is %ld but should be 2*N (%ld)!\n", Nj, 2*N);
}
if (is_reduced) {
int pl_sum = 0;
size_t i = 0, pl_len = 0;
int is_missing = grib_is_missing(h, "Ni", &err);
assert(err == GRIB_SUCCESS);
if (!is_missing) {
error("ERROR: Ni should be missing!\n");
}
GRIB_CHECK(grib_get_size(h, "pl", &pl_len),0);
if (pl_len != 2*N) {
error("ERROR: Length of pl array is %ld but should be 2*N (%ld)!\n", pl_len, 2*N);
}
pl = malloc(pl_len*sizeof(long));
assert(pl);
GRIB_CHECK(grib_get_long_array(h, "pl", pl, &pl_len),0);
/* Check pl is symmetric */
for(i=0; i<pl_len/2; ++i) {
const long pl_start = pl[i];
const long pl_end = pl[pl_len-1-i];
if ( pl_start != pl_end ) {
error("ERROR: pl array is not symmetric: pl[%ld]=%ld, pl[%ld]=%ld!\n",
i, pl_start, pl_len-1-i, pl_end);
}
}
/* Check sum of pl array and total number of points */
for(i=0; i<pl_len; ++i) {
pl_sum += pl[i];
}
if (pl_sum != numberOfDataPoints) {
error("ERROR: Sum of pl array %ld does not match numberOfDataPoints %ld!\n", pl_sum, numberOfDataPoints);
}
free(pl);
}
if (lon1 != 0) {
error("ERROR: latitudeOfFirstGridPointInDegrees=%f but should be 0!\n", lon1);
}
expected_lon2 = 360.0 - 90.0/N;
if (fabs(lon2 - expected_lon2) > angular_tolerance) {
error("ERROR: longitudeOfLastGridPointInDegrees=%f but should be %f!\n", lon2, expected_lon2);
}
/* Check first and last latitudes */
if (lat1 != -lat2) {
error("First latitude must be = last latitude but opposite in sign: lat1=%f, lat2=%f\n",
lat1, lat2);
}
lats = (double*)malloc(sizeof(double)*Nj);
GRIB_CHECK(grib_get_gaussian_latitudes(N,lats), 0);
if (!DBL_EQUAL(lats[0], lat1, angular_tolerance)) {
error("First latitude %f must be %f\n", lat1, lats[0]);
}
if (!DBL_EQUAL(lats[Nj-1], lat2, angular_tolerance)) {
error("Last latitude %f must be %f\n", lat2, lats[Nj-1]);
}
GRIB_CHECK(grib_get_size(h, "values", &numberOfValues),0);
if (numberOfValues != numberOfDataPoints) {
error("Number of data points %d different from number of values %d\n",
numberOfDataPoints, numberOfValues);
}
free(lats);
grib_handle_delete(h);
}
fclose(in);
printf("\nFile %s OK\n", filename);
return 0;
}

View File

@ -42,6 +42,8 @@ int main(int argc, char *argv[])
if (!in || !out) {
perror("ERROR: unable to open files");
fclose(out);
fclose(in);
return 1;
}

View File

@ -22,60 +22,61 @@
#include "grib_api.h"
void usage(char* prog) {
printf("Usage: %s order_by grib_file grib_file ...\n",prog);
exit(1);
printf("Usage: %s order_by grib_file grib_file ...\n",prog);
exit(1);
}
int main(int argc, char** argv) {
int err = 0;
long step,levelType;
char** filenames;
size_t nkeys,nfiles;
int i=0;
char* keys[]={"step","date","param","levelType"};
grib_fieldset* set;
grib_handle* h;
char param[20]={0,};
char date[10]={0,};
size_t datelen=10;
size_t len=20;
char* order_by=0;
int main(int argc, char** argv)
{
int err = 0;
long step,levelType;
char** filenames;
size_t nkeys,nfiles;
int i=0;
char* keys[]={"step","date","param","levelType"};
grib_fieldset* set;
grib_handle* h;
char param[20]={0,};
char date[10]={0,};
size_t datelen=10;
size_t len=20;
char* order_by=0;
if (argc != 3) usage(argv[0]);
if (argc != 3) usage(argv[0]);
nkeys=sizeof(keys)/sizeof(*keys);
order_by=strdup(argv[1]);
nkeys=sizeof(keys)/sizeof(*keys);
order_by=strdup(argv[1]);
nfiles=argc-2;
filenames=(char**)malloc(sizeof(char*)*nfiles);
for (i=0;i<nfiles;i++)
filenames[i]=(char*)strdup(argv[i+2]);
nfiles=argc-2;
filenames=(char**)malloc(sizeof(char*)*nfiles);
for (i=0;i<nfiles;i++)
filenames[i]=(char*)strdup(argv[i+2]);
set=grib_fieldset_new_from_files(0,filenames,nfiles,keys,nkeys,0,0,&err);
GRIB_CHECK(err,0);
set=grib_fieldset_new_from_files(0,filenames,nfiles,keys,nkeys,0,0,&err);
GRIB_CHECK(err,0);
/* not jet implemented */
/* err=grib_fieldset_apply_where(set,"(centre=='ecmf') && number==1 || step==6 "); */
/* GRIB_CHECK(err,0); */
/* not jet implemented */
/* err=grib_fieldset_apply_where(set,"(centre=='ecmf') && number==1 || step==6 "); */
/* GRIB_CHECK(err,0); */
grib_fieldset_apply_order_by(set,order_by);
GRIB_CHECK(err,0);
grib_fieldset_apply_order_by(set,order_by);
GRIB_CHECK(err,0);
printf("\nordering by %s\n",order_by);
printf("\n%d fields in the fieldset\n",grib_fieldset_count(set));
printf("step,date,levelType,levelType\n");
while ((h=grib_fieldset_next_handle(set,&err))!=NULL) {
GRIB_CHECK(grib_get_long(h,"step",&step),0);
GRIB_CHECK(grib_get_string(h,"date",date,&datelen),0);
GRIB_CHECK(grib_get_string(h,"param",param,&len),0);
GRIB_CHECK(grib_get_long(h,"levelType",&levelType),0);
printf("\nordering by %s\n",order_by);
printf("\n%d fields in the fieldset\n",grib_fieldset_count(set));
printf("step,date,levelType,levelType\n");
while ((h=grib_fieldset_next_handle(set,&err))!=NULL) {
GRIB_CHECK(grib_get_long(h,"step",&step),0);
GRIB_CHECK(grib_get_string(h,"date",date,&datelen),0);
GRIB_CHECK(grib_get_string(h,"param",param,&len),0);
GRIB_CHECK(grib_get_long(h,"levelType",&levelType),0);
printf("%ld %s %ld %s\n",step,date,levelType,param);
printf("%ld %s %ld %s\n",step,date,levelType,param);
grib_handle_delete(h);
}
grib_fieldset_delete(set);
grib_handle_delete(h);
}
grib_fieldset_delete(set);
grib_handle_delete(h);
return 0;
return 0;
}

View File

@ -19,7 +19,8 @@
#include <assert.h>
#include "grib_api.h"
int main(int argc, char** argv) {
int main(int argc, char** argv)
{
int err = 0;
double *values = NULL;
size_t values_len= 0;
@ -118,7 +119,6 @@ int main(int argc, char** argv) {
}
grib_handle_delete(h);
fclose(in);
return 0;
}

View File

@ -54,11 +54,14 @@ int main (int argc, char **argv)
lons = (double *) malloc (numberOfPoints * sizeof (double));
if (!lons) {
printf ("unable to allocate %ld bytes\n", (long) (numberOfPoints * sizeof (double)));
free (lats);
return 1;
}
values = (double *) malloc (numberOfPoints * sizeof (double));
if (!values) {
printf ("unable to allocate %ld bytes\n", (long) (numberOfPoints * sizeof (double)));
free (lats);
free (lons);
return 1;
}

View File

@ -25,49 +25,50 @@
#include "grib_api.h"
void usage(char* prog) {
printf("usage: %s filename\n",prog);
exit(1);
void usage(const char* prog) {
printf("usage: %s filename\n",prog);
exit(1);
}
int main(int argc, char** argv) {
int err = 0,i;
double *values = NULL;
double max,min,average;
size_t values_len= 0;
int main(int argc, char** argv)
{
int err = 0,i;
double *values = NULL;
double max,min,average;
size_t values_len= 0;
FILE* in = NULL;
char* filename ;
grib_handle *h = NULL;
FILE* in = NULL;
char* filename ;
grib_handle *h = NULL;
if (argc<2) usage(argv[0]);
filename=argv[1];
if (argc<2) usage(argv[0]);
filename=argv[1];
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",filename);
return 1;
}
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",filename);
return 1;
}
/* create new handle from a message in a file*/
while((h = grib_handle_new_from_file(0,f,&err)) != NULL) {
/* create new handle from a message in a file*/
while((h = grib_handle_new_from_file(0,f,&err)) != NULL) {
/* get the size of the values array*/
GRIB_CHECK(grib_get_size(h,"values",&values_len),0);
/* get the size of the values array*/
GRIB_CHECK(grib_get_size(h,"values",&values_len),0);
values = malloc(values_len*sizeof(double));
values = malloc(values_len*sizeof(double));
/* get data values*/
GRIB_CHECK(grib_get_double_array(h,"values",values,&values_len),0);
/* get data values*/
GRIB_CHECK(grib_get_double_array(h,"values",values,&values_len),0);
for(i = 0; i < values_len; i++)
printf("%d %.10e\n",i+1,values[i]);
for(i = 0; i < values_len; i++)
printf("%d %.10e\n",i+1,values[i]);
free(values);
free(values);
grib_handle_delete(h);
}
grib_handle_delete(h);
}
fclose(in);
return 0;
fclose(in);
return 0;
}

View File

@ -21,6 +21,7 @@ else
then
cd ../../
cpath=`pwd`
proj_dir=$cpath
GRIB_DEFINITION_PATH=$cpath/definitions
export GRIB_DEFINITION_PATH
GRIB_SAMPLES_PATH=$cpath/samples

View File

@ -21,66 +21,66 @@
#include "grib_api.h"
void usage(char* prog) {
printf("Usage: %s grib_file\n",prog);
exit(1);
void usage(const char* prog) {
printf("Usage: %s grib_file\n",prog);
exit(1);
}
int main(int argc, char** argv) {
FILE* in = NULL;
int err = 0;
double lat,lon,value,missingValue=0;
int n=0;
char* filename = NULL;
int main(int argc, char** argv)
{
FILE* in = NULL;
int err = 0;
double lat,lon,value,missingValue=0;
int n=0;
char* filename = NULL;
/* Message handle. Required in all the grib_api calls acting on a message.*/
grib_handle *h = NULL;
/* Iterator on lat/lon/values.*/
grib_iterator* iter=NULL;
if (argc != 2) usage(argv[0]);
/* Message handle. Required in all the grib_api calls acting on a message.*/
grib_handle *h = NULL;
/* Iterator on lat/lon/values.*/
grib_iterator* iter=NULL;
filename=strdup(argv[1]);
if (argc != 2) usage(argv[0]);
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",filename);
return 1;
}
filename=argv[1];
/* Loop on all the messages in a file.*/
while ((h = grib_handle_new_from_file(0,in,&err)) != NULL ) {
/* Check of errors after reading a message. */
if (err != GRIB_SUCCESS) GRIB_CHECK(err,0);
/* Get the double representing the missing value in the field. */
GRIB_CHECK(grib_get_double(h,"missingValue",&missingValue),0);
/* A new iterator on lat/lon/values is created from the message handle h. */
iter=grib_iterator_new(h,0,&err);
if (err != GRIB_SUCCESS) GRIB_CHECK(err,0);
n = 0;
/* Loop on all the lat/lon/values. */
while(grib_iterator_next(iter,&lat,&lon,&value)) {
/* You can now print lat and lon, */
printf("- %d - lat=%f lon=%f value=",n,lat,lon);
/* decide what to print if a missing value is found. */
if (value == missingValue ) printf("missing\n");
/* and print the value if is not missing. */
else printf("%f\n",value);
n++;
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open file %s\n", filename);
return 1;
}
/* At the end the iterator is deleted to free memory. */
grib_iterator_delete(iter);
/* Loop on all the messages in a file.*/
while ((h = grib_handle_new_from_file(0,in,&err)) != NULL ) {
/* Check of errors after reading a message. */
if (err != GRIB_SUCCESS) GRIB_CHECK(err,0);
/* At the end the grib_handle is deleted to free memory. */
grib_handle_delete(h);
}
/* Get the double representing the missing value in the field. */
GRIB_CHECK(grib_get_double(h,"missingValue",&missingValue),0);
/* A new iterator on lat/lon/values is created from the message handle h. */
iter=grib_iterator_new(h,0,&err);
if (err != GRIB_SUCCESS) GRIB_CHECK(err,0);
fclose(in);
n = 0;
/* Loop on all the lat/lon/values. */
while(grib_iterator_next(iter,&lat,&lon,&value)) {
/* You can now print lat and lon, */
printf("- %d - lat=%f lon=%f value=",n,lat,lon);
/* decide what to print if a missing value is found. */
if (value == missingValue ) printf("missing\n");
/* and print the value if is not missing. */
else printf("%f\n",value);
n++;
}
return 0;
/* At the end the iterator is deleted to free memory. */
grib_iterator_delete(iter);
/* At the end the grib_handle is deleted to free memory. */
grib_handle_delete(h);
}
fclose(in);
return 0;
}

View File

@ -41,7 +41,7 @@ int main(int argc, char** argv)
grib_iterator* iter=NULL;
if (argc != 2) usage(argv[0]);
filename=strdup(argv[1]);
filename=argv[1];
in = fopen(filename,"r");
if(!in) {
fprintf(stderr, "ERROR: unable to open file %s\n",filename);

View File

@ -20,82 +20,83 @@
#include "grib_api.h"
int main(int argc, char** argv) {
int err = 0;
int main(int argc, char** argv)
{
int err = 0;
size_t i = 0;
size_t count;
size_t size;
size_t i = 0;
size_t count;
size_t size;
long numberOfContributingSpectralBands;
long values[1024];
long new_values[1024];
long numberOfContributingSpectralBands;
long values[1024];
long new_values[1024];
FILE* in = NULL;
char* filename = "../../data/satellite.grib";
grib_handle *h = NULL;
FILE* in = NULL;
char* filename = "../../data/satellite.grib";
grib_handle *h = NULL;
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open input file %s\n",filename);
return 1;
}
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open input file %s\n",filename);
return 1;
}
/* create new handle from a message in a file*/
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",filename);
}
GRIB_CHECK(grib_get_long(h,"numberOfContributingSpectralBands",&numberOfContributingSpectralBands),0);
assert(numberOfContributingSpectralBands == 3);
/* create new handle from a message in a file*/
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",filename);
}
/* Shrink NB to 2 */
numberOfContributingSpectralBands = 2;
GRIB_CHECK(grib_set_long(h,"numberOfContributingSpectralBands",numberOfContributingSpectralBands),0);
GRIB_CHECK(grib_get_long(h,"numberOfContributingSpectralBands",&numberOfContributingSpectralBands),0);
assert(numberOfContributingSpectralBands == 3);
/* Expand NB to 9 */
numberOfContributingSpectralBands = 9;
GRIB_CHECK(grib_set_long(h,"numberOfContributingSpectralBands",numberOfContributingSpectralBands),0);
/* Shrink NB to 2 */
numberOfContributingSpectralBands = 2;
GRIB_CHECK(grib_set_long(h,"numberOfContributingSpectralBands",numberOfContributingSpectralBands),0);
/* get as a long*/
GRIB_CHECK(grib_get_long(h,"numberOfContributingSpectralBands",&numberOfContributingSpectralBands),0);
printf("numberOfContributingSpectralBands=%ld\n",numberOfContributingSpectralBands);
/* Expand NB to 9 */
numberOfContributingSpectralBands = 9;
GRIB_CHECK(grib_set_long(h,"numberOfContributingSpectralBands",numberOfContributingSpectralBands),0);
/* get as a long*/
GRIB_CHECK(grib_get_size(h,"scaledValueOfCentralWaveNumber",&count),0);
printf("count=%ld\n",(long)count);
/* get as a long*/
GRIB_CHECK(grib_get_long(h,"numberOfContributingSpectralBands",&numberOfContributingSpectralBands),0);
printf("numberOfContributingSpectralBands=%ld\n",numberOfContributingSpectralBands);
assert(count < sizeof(values)/sizeof(values[0]));
/* get as a long*/
GRIB_CHECK(grib_get_size(h,"scaledValueOfCentralWaveNumber",&count),0);
printf("count=%ld\n",(long)count);
size = count;
GRIB_CHECK(grib_get_long_array(h,"scaledValueOfCentralWaveNumber",values,&size),0);
assert(size == count);
assert(count < sizeof(values)/sizeof(values[0]));
for(i=0;i<count;i++) {
printf("scaledValueOfCentralWaveNumber %lu = %ld\n",(unsigned long)i,values[i]);
if (i == 0) assert( values[i] == 26870 );
if (i == 1) assert( values[i] == 9272 );
}
size = count;
GRIB_CHECK(grib_get_long_array(h,"scaledValueOfCentralWaveNumber",values,&size),0);
assert(size == count);
for(i=0;i<count;i++)
values[i] = i+1000;
for(i=0;i<count;i++) {
printf("scaledValueOfCentralWaveNumber %lu = %ld\n",(unsigned long)i,values[i]);
if (i == 0) assert( values[i] == 26870 );
if (i == 1) assert( values[i] == 9272 );
}
size = count;
/* size--; */
GRIB_CHECK(grib_set_long_array(h,"scaledValueOfCentralWaveNumber",values,size),0);
assert(size == count);
/* check what we set */
GRIB_CHECK(grib_get_long_array(h,"scaledValueOfCentralWaveNumber",new_values,&size),0);
assert(size == count);
for(i=0;i<count;i++) {
printf("Now scaledValueOfCentralWaveNumber %lu = %ld\n",(unsigned long)i,new_values[i]);
assert( new_values[i] == (i+1000) );
}
for(i=0;i<count;i++)
values[i] = i+1000;
grib_handle_delete(h);
size = count;
/* size--; */
GRIB_CHECK(grib_set_long_array(h,"scaledValueOfCentralWaveNumber",values,size),0);
assert(size == count);
fclose(in);
return 0;
/* check what we set */
GRIB_CHECK(grib_get_long_array(h,"scaledValueOfCentralWaveNumber",new_values,&size),0);
assert(size == count);
for(i=0;i<count;i++) {
printf("Now scaledValueOfCentralWaveNumber %lu = %ld\n",(unsigned long)i,new_values[i]);
assert( new_values[i] == (i+1000) );
}
grib_handle_delete(h);
fclose(in);
return 0;
}

View File

@ -19,32 +19,33 @@
#include "grib_api.h"
int main(int argc, char** argv) {
grib_string_list* list;
grib_string_list* list2;
int main(int argc, char** argv)
{
grib_string_list* list;
grib_string_list* list2;
list=grib_util_get_param_id("11.2");
printf("mars.param=11.2 -> paramId= ");
while (list) {
printf("%s ",list->value);
list2=grib_util_get_param_id("130.128");
printf("mars.param=11.2 -> paramId= ");
while (list2) {
printf("%s ",list2->value);
list2=list2->next;
}
list=list->next;
}
printf("\n");
printf("\n");
list=grib_util_get_param_id("11.2");
printf("mars.param=11.2 -> paramId= ");
while (list) {
printf("%s ",list->value);
list2=grib_util_get_param_id("130.128");
printf("mars.param=11.2 -> paramId= ");
while (list2) {
printf("%s ",list2->value);
list2=list2->next;
}
list=list->next;
}
printf("\n");
printf("\n");
printf("paramId=130 -> mars.param= ");
list=grib_util_get_mars_param("130");
while (list) {
printf("paramId=130 -> mars.param= ");
list=grib_util_get_mars_param("130");
while (list) {
printf("%s ",list->value);
list=list->next;
}
printf("\n");
printf("\n");
return 0;
return 0;
}

View File

@ -23,46 +23,47 @@
#include "grib_api.h"
int main(int argc, char** argv) {
int err = 0;
long parameterCategory=0,parameterNumber=0,discipline=0;
FILE* in = NULL;
char* filename = "../../data/multi.grib2";
grib_handle *h = NULL;
int main(int argc, char** argv)
{
int err = 0;
long parameterCategory=0,parameterNumber=0,discipline=0;
FILE* in = NULL;
char* filename = "../../data/multi.grib2";
grib_handle *h = NULL;
/* turn on support for multi fields messages */
grib_multi_support_on(0);
/* turn on support for multi fields messages */
grib_multi_support_on(0);
/* turn off support for multi fields messages */
/* grib_multi_support_off(0); */
/* turn off support for multi fields messages */
/* grib_multi_support_off(0); */
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",filename);
return 1;
}
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",filename);
return 1;
}
while ((h = grib_handle_new_from_file(0,in,&err)) != NULL ) {
while ((h = grib_handle_new_from_file(0,in,&err)) != NULL ) {
GRIB_CHECK(err,0);
GRIB_CHECK(err,0);
GRIB_CHECK(grib_get_long(h,"discipline",&discipline),0);
printf("discipline=%ld\n",discipline);
GRIB_CHECK(grib_get_long(h,"discipline",&discipline),0);
printf("discipline=%ld\n",discipline);
GRIB_CHECK(grib_get_long(h,"parameterCategory",&parameterCategory),0);
printf("parameterCategory=%ld\n",parameterCategory);
GRIB_CHECK(grib_get_long(h,"parameterCategory",&parameterCategory),0);
printf("parameterCategory=%ld\n",parameterCategory);
GRIB_CHECK(grib_get_long(h,"parameterNumber",&parameterNumber),0);
printf("parameterNumber=%ld\n",parameterNumber);
GRIB_CHECK(grib_get_long(h,"parameterNumber",&parameterNumber),0);
printf("parameterNumber=%ld\n",parameterNumber);
if ( discipline == 0 && parameterCategory==2) {
if (parameterNumber == 2) printf("-------- u -------\n");
if (parameterNumber == 3) printf("-------- v -------\n");
}
grib_handle_delete(h);
}
if ( discipline == 0 && parameterCategory==2) {
if (parameterNumber == 2) printf("-------- u -------\n");
if (parameterNumber == 3) printf("-------- v -------\n");
}
grib_handle_delete(h);
}
fclose(in);
return 0;
fclose(in);
return 0;
}

View File

@ -27,47 +27,48 @@ const int NUM_FIELDS = 4;
const int COUNT = 20;
const char* file_path = "../../data/multi_created.grib2";
int main(int argc, char** argv) {
int i;
int main(int argc, char** argv)
{
int i;
/* turn on support for multi fields messages */
grib_multi_support_on(0);
/* turn on support for multi fields messages */
grib_multi_support_on(0);
for(i=1; i<COUNT; ++i) {
printf("Pass %d: \n",i);
read_data(NUM_FIELDS);
}
return 0;
for(i=1; i<COUNT; ++i) {
printf("Pass %d: \n",i);
read_data(NUM_FIELDS);
}
return 0;
}
void read_data(int num_msgs)
{
int err = 0,i;
FILE* fp = NULL;
long stepRange = 0;
grib_handle *h = NULL;
int err = 0,i;
FILE* fp = NULL;
long stepRange = 0;
grib_handle *h = NULL;
fp = fopen(file_path, "r");
if(!fp) {
fprintf(stderr, "ERROR: unable to open grib file %s\n", file_path);
exit(1);
}
printf("Opened GRIB file %s: \n", file_path);
for(i=0; i<num_msgs; ++i) {
h = grib_handle_new_from_file(0, fp, &err);
GRIB_CHECK(err, 0);
GRIB_CHECK( grib_get_long(h, "stepRange", &stepRange), 0);
printf("%d : stepRange=%ld\n", i, stepRange);
grib_handle_delete(h);
/* These tests make sure we always start from 1st field of the grib msg */
/* and not where we left off last time */
if (i == 0) assert(stepRange == 0); /* 1st field */
if (i == 1) assert(stepRange == 12); /* 2nd field */
if (i == 2) assert(stepRange == 24); /* 3rd field */
if (i == 3) assert(stepRange == 36); /* 4th field */
}
/* Must reset this file pointer for the next round */
grib_multi_support_reset_file(grib_context_get_default(), fp);
fclose(fp);
fp = fopen(file_path, "r");
if(!fp) {
fprintf(stderr, "ERROR: unable to open grib file %s\n", file_path);
exit(1);
}
printf("Opened GRIB file %s: \n", file_path);
for(i=0; i<num_msgs; ++i) {
h = grib_handle_new_from_file(0, fp, &err);
GRIB_CHECK(err, 0);
GRIB_CHECK( grib_get_long(h, "stepRange", &stepRange), 0);
printf("%d : stepRange=%ld\n", i, stepRange);
grib_handle_delete(h);
/* These tests make sure we always start from 1st field of the grib msg */
/* and not where we left off last time */
if (i == 0) assert(stepRange == 0); /* 1st field */
if (i == 1) assert(stepRange == 12); /* 2nd field */
if (i == 2) assert(stepRange == 24); /* 3rd field */
if (i == 3) assert(stepRange == 36); /* 4th field */
}
/* Must reset this file pointer for the next round */
grib_multi_support_reset_file(grib_context_get_default(), fp);
fclose(fp);
}

View File

@ -19,72 +19,73 @@
#include <assert.h>
#include "grib_api.h"
void usage(char* prog) {
printf("usage: %s in.grib out.grib\n",prog);
exit(1);
void usage(const char* prog) {
printf("usage: %s in.grib out.grib\n",prog);
exit(1);
}
int main(int argc, char** argv) {
int err = 0;
FILE* in = NULL;
FILE* of = NULL;
long edition, step;
char* filename=NULL;
char* ofilename=NULL;
grib_handle *h = NULL;
grib_multi_handle *mh=NULL;
const int start_section = 4; /* Grib2 Product Definition Section */
int main(int argc, char** argv)
{
int err = 0;
FILE* in = NULL;
FILE* of = NULL;
long edition, step;
char* filename=NULL;
char* ofilename=NULL;
grib_handle *h = NULL;
grib_multi_handle *mh=NULL;
const int start_section = 4; /* Grib2 Product Definition Section */
if (argc < 3) usage(argv[0]);
filename=argv[1];
ofilename=argv[2];
if (argc < 3) usage(argv[0]);
filename=argv[1];
ofilename=argv[2];
/* open input file */
in = fopen(filename,"r");
if(!in) {
fprintf(stderr, "ERROR: unable to open input file %s\n",filename);
return 1;
}
/* open input file */
in = fopen(filename,"r");
if(!in) {
fprintf(stderr, "ERROR: unable to open input file %s\n",filename);
return 1;
}
/* new grib handle from input file */
h = grib_handle_new_from_file(0,in,&err);
GRIB_CHECK(err,0);
GRIB_CHECK(grib_get_long(h,"edition",&edition),0);
if (edition != 2) {
fprintf(stderr, "ERROR: Input grib must be edition 2 for multi fields\n");
exit(1);
}
/* create a new empty multi field handle */
mh=grib_multi_handle_new(0);
if (!mh) {
fprintf(stderr,"ERROR: Unable to create multi field handle\n");
exit(1);
}
/* new grib handle from input file */
h = grib_handle_new_from_file(0,in,&err);
GRIB_CHECK(err,0);
GRIB_CHECK(grib_get_long(h,"edition",&edition),0);
if (edition != 2) {
fprintf(stderr, "ERROR: Input grib must be edition 2 for multi fields\n");
exit(1);
}
for (step=12;step<=120;step+=12) {
/* set step */
grib_set_long(h,"step",step);
/* append h to mh repeating from section 4 */
/* i.e. starting from section 4 all the sections to the end of the message will be copied */
grib_multi_handle_append(h, start_section, mh);
}
/* create a new empty multi field handle */
mh=grib_multi_handle_new(0);
if (!mh) {
fprintf(stderr,"ERROR: Unable to create multi field handle\n");
exit(1);
}
/* open output file */
of=fopen(ofilename,"w");
if(!of) {
fprintf(stderr, "ERROR: unable to open output file %s\n",ofilename);
exit(1);
}
for (step=12;step<=120;step+=12) {
/* set step */
grib_set_long(h,"step",step);
/* append h to mh repeating from section 4 */
/* i.e. starting from section 4 all the sections to the end of the message will be copied */
grib_multi_handle_append(h, start_section, mh);
}
/* write multi fields handle to output file */
grib_multi_handle_write(mh,of);
fclose(of);
/* open output file */
of=fopen(ofilename,"w");
if(!of) {
fprintf(stderr, "ERROR: unable to open output file %s\n",ofilename);
exit(1);
}
/* release memory */
grib_handle_delete(h);
grib_multi_handle_delete(mh);
/* write multi fields handle to output file */
grib_multi_handle_write(mh,of);
fclose(of);
fclose(in);
return 0;
/* release memory */
grib_handle_delete(h);
grib_multi_handle_delete(mh);
fclose(in);
return 0;
}

View File

@ -20,70 +20,71 @@
#include "grib_api.h"
void usage(char* prog) {
printf("Usage: %s grib_file grib_file ...\n",prog);
exit(1);
void usage(const char* prog) {
printf("Usage: %s grib_file grib_file ...\n",prog);
exit(1);
}
int main(int argc, char** argv) {
int err = 0;
long step=0;
size_t nfiles;
int i=0;
grib_fieldset* set=NULL;
grib_handle* h=NULL;
char param[20]={0,};
size_t len=20;
double lats[4]={0,};
double lons[4]={0,};
double values[4]={0,};
double distances[4]={0,};
int indexes[4]={0,};
char* order_by="param,step";
int main(int argc, char** argv)
{
int err = 0;
long step=0;
size_t nfiles;
int i=0;
grib_fieldset* set=NULL;
grib_handle* h=NULL;
char param[20]={0,};
size_t len=20;
double lats[4]={0,};
double lons[4]={0,};
double values[4]={0,};
double distances[4]={0,};
int indexes[4]={0,};
char* order_by="param,step";
size_t size=4;
double lat=-40,lon=15;
int mode=0;
int count;
char** filenames;
grib_nearest* nearest=NULL;
size_t size=4;
double lat=-40,lon=15;
int mode=0;
int count;
char** filenames;
grib_nearest* nearest=NULL;
if (argc < 2) usage(argv[0]);
if (argc < 2) usage(argv[0]);
nfiles=argc-1;
filenames=(char**)malloc(sizeof(char*)*nfiles);
for (i=0;i<nfiles;i++)
filenames[i]=(char*)strdup(argv[i+1]);
nfiles=argc-1;
filenames=(char**)malloc(sizeof(char*)*nfiles);
for (i=0;i<nfiles;i++)
filenames[i]=(char*)strdup(argv[i+1]);
set=grib_fieldset_new_from_files(0,filenames,nfiles,0,0,0,order_by,&err);
GRIB_CHECK(err,0);
printf("\nordering by %s\n",order_by);
printf("\n%d fields in the fieldset\n",grib_fieldset_count(set));
printf("n,step,param\n");
mode=GRIB_NEAREST_SAME_GRID | GRIB_NEAREST_SAME_POINT;
count=1;
while ((h=grib_fieldset_next_handle(set,&err))!=NULL) {
GRIB_CHECK(grib_get_long(h,"step",&step),0);
len=20;
GRIB_CHECK(grib_get_string(h,"param",param,&len),0);
printf("%d %ld %s ",count,step,param);
if (!nearest) nearest=grib_nearest_new(h,&err);
set=grib_fieldset_new_from_files(0,filenames,nfiles,0,0,0,order_by,&err);
GRIB_CHECK(err,0);
GRIB_CHECK(grib_nearest_find(nearest,h,lat,lon,mode,lats,lons,values,distances,indexes,&size),0);
for (i=0;i<4;i++) printf("%d %.2f %.2f %g %g - ",
(int)indexes[i],lats[i],lons[i],distances[i],values[i]);
printf("\n");
grib_handle_delete(h);
count++;
}
printf("\nordering by %s\n",order_by);
printf("\n%d fields in the fieldset\n",grib_fieldset_count(set));
printf("n,step,param\n");
if (nearest) grib_nearest_delete(nearest);
mode=GRIB_NEAREST_SAME_GRID | GRIB_NEAREST_SAME_POINT;
count=1;
while ((h=grib_fieldset_next_handle(set,&err))!=NULL) {
GRIB_CHECK(grib_get_long(h,"step",&step),0);
len=20;
GRIB_CHECK(grib_get_string(h,"param",param,&len),0);
if (set) grib_fieldset_delete(set);
printf("%d %ld %s ",count,step,param);
if (!nearest) nearest=grib_nearest_new(h,&err);
GRIB_CHECK(err,0);
GRIB_CHECK(grib_nearest_find(nearest,h,lat,lon,mode,lats,lons,values,distances,indexes,&size),0);
for (i=0;i<4;i++) printf("%d %.2f %.2f %g %g - ",
(int)indexes[i],lats[i],lons[i],distances[i],values[i]);
printf("\n");
return 0;
grib_handle_delete(h);
count++;
}
if (nearest) grib_nearest_delete(nearest);
if (set) grib_fieldset_delete(set);
return 0;
}

View File

@ -19,12 +19,13 @@
#include "grib_api.h"
void usage(char* prog) {
void usage(const char* prog) {
printf("Usage: %s latlon_file grib_orography grib_file grib_file ...\n",prog);
exit(1);
}
int main(int argc, char** argv) {
int main(int argc, char** argv)
{
FILE* fin=0;
int ret=0;
char* fname=0;

View File

@ -38,7 +38,7 @@ int main(int argc, char** argv)
const void* buffer = NULL;
double* values1=NULL;
double* values2=NULL;
double maxa=0,a=0;
double maxa=0;
double maxv=0,minv=0;
double maxr=0,r=0;
long decimalPrecision;
@ -54,6 +54,7 @@ int main(int argc, char** argv)
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open output file %s\n",outfile);
fclose(in);
return 1;
}
@ -94,7 +95,7 @@ int main(int argc, char** argv)
maxv=values2[0];
minv=maxv;
for (i=0;i<size;i++) {
a=fabs(values2[i]-values1[i]);
double a=fabs(values2[i]-values1[i]);
if ( values2[i] > maxv ) maxv=values2[i];
if ( values2[i] < minv ) minv=values2[i];
if ( values2[i] !=0 ) r=fabs((values2[i]-values1[i])/values2[i]);

View File

@ -19,60 +19,61 @@
#include "grib_api.h"
void usage(char* prog) {
printf("usage: %s filename\n",prog);
exit(1);
void usage(const char* prog) {
printf("usage: %s filename\n",prog);
exit(1);
}
int main(int argc, char** argv) {
int err = 0,i;
double *values = NULL;
double max,min,average;
size_t values_len= 0;
int main(int argc, char** argv)
{
int err = 0,i;
double *values = NULL;
double max,min,average;
size_t values_len= 0;
FILE* in = NULL;
char* filename ;
grib_handle *h = NULL;
FILE* in = NULL;
char* filename ;
grib_handle *h = NULL;
if (argc<2) usage(argv[0]);
filename=argv[1];
if (argc<2) usage(argv[0]);
filename=argv[1];
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",filename);
return 1;
}
in = fopen(filename,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",filename);
return 1;
}
/* create new handle from a message in a file*/
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",filename);
}
/* create new handle from a message in a file*/
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",filename);
}
/* get the size of the values array*/
GRIB_CHECK(grib_get_size(h,"values",&values_len),0);
/* get the size of the values array*/
GRIB_CHECK(grib_get_size(h,"values",&values_len),0);
values = malloc(values_len*sizeof(double));
values = malloc(values_len*sizeof(double));
/* get data values*/
GRIB_CHECK(grib_get_double_array(h,"values",values,&values_len),0);
/* get data values*/
GRIB_CHECK(grib_get_double_array(h,"values",values,&values_len),0);
for(i = 0; i < values_len; i++)
printf("%d %.10e\n",i+1,values[i]);
for(i = 0; i < values_len; i++)
printf("%d %.10e\n",i+1,values[i]);
free(values);
free(values);
GRIB_CHECK(grib_get_double(h,"max",&max),0);
GRIB_CHECK(grib_get_double(h,"min",&min),0);
GRIB_CHECK(grib_get_double(h,"average",&average),0);
GRIB_CHECK(grib_get_double(h,"max",&max),0);
GRIB_CHECK(grib_get_double(h,"min",&min),0);
GRIB_CHECK(grib_get_double(h,"average",&average),0);
printf("%d values found in %s\n",(int)values_len,filename);
printf("max=%.10e min=%.10e average=%.10e\n",max,min,average);
printf("%d values found in %s\n",(int)values_len,filename);
printf("max=%.10e min=%.10e average=%.10e\n",max,min,average);
grib_handle_delete(h);
grib_handle_delete(h);
fclose(in);
return 0;
fclose(in);
return 0;
}

View File

@ -8,54 +8,98 @@
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
#include "grib_api.h"
#include <ctype.h>
void usage(char* prog) {
printf("usage: %s in1.grib in2.grib out.grib\n",prog);
printf("in1.grib\t The grib in whose sections we are interested, i.e. the source of the sections (read-only)\n");
printf("in2.grib\t The input grib (read-only)\n");
printf("out.grib\t The output file\n");
exit(1);
printf("usage: %s in1.grib in2.grib what out.grib\n",prog);
printf("in1.grib The grib in whose sections we are interested, i.e. the source of the sections (read-only)\n");
printf("in2.grib The input grib (read-only)\n");
printf("what The section(s) to copy: p(Product), g(Grid), l(Local), d(Data), b(Bitmap)\n");
printf("out.grib The output file\n");
exit(1);
}
int main ( int argc, char* argv[]) {
grib_handle *hfrom,*hto,*h;
FILE *in;
char *in_name,*in_name1,*out_name;
int err=0;
int what=0;
int main ( int argc, char* argv[])
{
grib_handle *hfrom,*hto,*h;
FILE *in;
char *in_name1, *in_name2, *what_str, *out_name;
int i, err=0, what=0;
if (argc<4) usage(argv[0]);
if (argc<5) usage(argv[0]);
in_name=argv[1];
in_name1=argv[2];
out_name=argv[3];
in_name1=argv[1];
in_name2=argv[2];
what_str=argv[3];
out_name=argv[4];
in=fopen(in_name,"r");
if (!in) {
perror(in_name);
exit(1);
}
in=fopen(in_name1,"r");
if (!in) {
perror(in_name1);
exit(1);
}
hfrom=grib_handle_new_from_file(0,in,&err);
GRIB_CHECK(err,0);
fclose(in);
hfrom=grib_handle_new_from_file(0,in,&err);
GRIB_CHECK(err,0);
fclose(in);
in=fopen(in_name1,"r");
if (!in) {
perror(in_name1);
exit(1);
}
in=fopen(in_name2,"r");
if (!in) {
perror(in_name2);
exit(1);
}
hto=grib_handle_new_from_file(0,in,&err);
GRIB_CHECK(err,0);
fclose(in);
hto=grib_handle_new_from_file(0,in,&err);
GRIB_CHECK(err,0);
fclose(in);
/*what=GRIB_SECTION_PRODUCT | GRIB_SECTION_LOCAL;*/
what=GRIB_SECTION_GRID;
h=grib_util_sections_copy(hfrom,hto,what,&err);
GRIB_CHECK(err,0);
/* The sections for the "what" argument are:
* GRIB_SECTION_PRODUCT
* GRIB_SECTION_GRID
* GRIB_SECTION_LOCAL
* GRIB_SECTION_DATA
* GRIB_SECTION_BITMAP
* One can bitwise-OR them to have more than one section copied
* E.g. what = GRIB_SECTION_PRODUCT | GRIB_SECTION_LOCAL;
*/
for(i=0; i<strlen(what_str); ++i) {
if (what_str[i] == 'p') {
printf("Copying the PRODUCT section\n");
what |= GRIB_SECTION_PRODUCT;
}
else if (what_str[i] == 'g') {
printf("Copying the GRID section\n");
what |= GRIB_SECTION_GRID;
}
else if (what_str[i] == 'l') {
printf("Copying the LOCAL section\n");
what |= GRIB_SECTION_LOCAL;
}
else if (what_str[i] == 'd') {
printf("Copying the DATA section\n");
what |= GRIB_SECTION_DATA;
}
else if (what_str[i] == 'b') {
printf("Copying the BITMAP section\n");
what |= GRIB_SECTION_BITMAP;
}
else if (isspace(what_str[i]) || what_str[i] == ',') {
/* Ignore spaces and comma separator */
}
else {
fprintf(stderr,"Invalid option: '%c'. Ignoring.\n",
what_str[i]);
}
}
h=grib_util_sections_copy(hfrom,hto,what,&err);
GRIB_CHECK(err,0);
err=grib_write_message(h,out_name,"w");
err=grib_write_message(h,out_name,"w");
return err;
grib_handle_delete(hfrom);
grib_handle_delete(hto);
grib_handle_delete(h);
return err;
}

View File

@ -13,17 +13,41 @@ REGUL_GRID_FILE=${proj_dir}/samples/regular_ll_sfc_grib2.tmpl
GAUSS_GRID_FILE=${proj_dir}/samples/reduced_gg_pl_640_grib2.tmpl
OUTPUT=temp.sections.grib
${examples_dir}sections_copy $REGUL_GRID_FILE $GAUSS_GRID_FILE $OUTPUT
# Now the output should have a regular grid i.e. gridDefinitionTemplateNumber==0
##################
# Copy the GRID section from REGUL_GRID_FILE
${examples_dir}sections_copy $REGUL_GRID_FILE $GAUSS_GRID_FILE g $OUTPUT >/dev/null
# Now the output should have a regular grid
# but its date should be the same as the Gaussian grid sample
grid_tmpl=`${tools_dir}grib_get -p gridDefinitionTemplateNumber,date $OUTPUT`
[ "$grid_tmpl" = "0 20100912" ]
grid_tmpl=`${tools_dir}grib_get -p gridType,date $OUTPUT`
[ "$grid_tmpl" = "regular_ll 20100912" ]
${examples_dir}sections_copy $GAUSS_GRID_FILE $REGUL_GRID_FILE $OUTPUT
# Now the output should have a reduced gaussian grid i.e. gridDefinitionTemplateNumber==40
# but its date should be the same as the Regular grid sample
grid_tmpl=`${tools_dir}grib_get -p gridDefinitionTemplateNumber,date $OUTPUT`
[ "$grid_tmpl" = "40 20070323" ]
##################
# Copy the GRID section from GAUSS_GRID_FILE
${examples_dir}sections_copy $GAUSS_GRID_FILE $REGUL_GRID_FILE g $OUTPUT >/dev/null
# Now the output should have a gaussian grid
# but its date should be the same as the regular grid
grid_tmpl=`${tools_dir}grib_get -p gridType,date $OUTPUT`
[ "$grid_tmpl" = "reduced_gg 20070323" ]
##################
# Copy both the PRODUCT and GRID sections from REGUL_GRID_FILE
${examples_dir}sections_copy $REGUL_GRID_FILE $GAUSS_GRID_FILE gp $OUTPUT >/dev/null
# Now the output should have a regular grid
# and its date should be the same as the regular latlon
grid_tmpl=`${tools_dir}grib_get -p gridType,date $OUTPUT`
[ "$grid_tmpl" = "regular_ll 20070323" ]
##################
# Copy all sections from REGUL_GRID_FILE (use commas)
${examples_dir}sections_copy $REGUL_GRID_FILE $GAUSS_GRID_FILE p,l,g,d,b $OUTPUT >/dev/null
# Now the output should be identical to the regular grib
${tools_dir}grib_compare $REGUL_GRID_FILE $OUTPUT
rm -f $OUTPUT

View File

@ -19,71 +19,71 @@
#include "grib_api.h"
int main(int argc, char** argv) {
int err = 0;
long centre=80;
long long_value=0;
char string_value[100];
size_t len = sizeof(string_value)/sizeof(char);
size_t size=0;
int main(int argc, char** argv)
{
int err = 0;
long centre=80;
long long_value=0;
char string_value[100];
size_t len = sizeof(string_value)/sizeof(char);
size_t size=0;
FILE* in = NULL;
char* infile = "../../data/regular_latlon_surface.grib1";
FILE* out = NULL;
char* outfile = "out.grib1";
grib_handle *h = NULL;
const void* buffer = NULL;
size_t str_len = 0; /* See the call to grib_set_string later */
FILE* in = NULL;
char* infile = "../../data/regular_latlon_surface.grib1";
FILE* out = NULL;
char* outfile = "out.grib1";
grib_handle *h = NULL;
const void* buffer = NULL;
size_t str_len = 0; /* See the call to grib_set_string later */
in = fopen(infile,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",infile);
return 1;
}
in = fopen(infile,"r");
if(!in) {
printf("ERROR: unable to open file %s\n",infile);
return 1;
}
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open file %s\n",outfile);
return 1;
}
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open file %s\n",outfile);
fclose(in);
return 1;
}
/* create a new handle from a message in a file */
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",infile);
}
/* create a new handle from a message in a file */
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",infile);
}
/* set centre as a long */
GRIB_CHECK(grib_set_long(h,"centre",centre),0);
/* set paramId and shortName - normally you would do one or the other */
GRIB_CHECK(grib_set_long(h,"paramId", 500004),0);
/* the value of str_len is not used, it can be anything! */
GRIB_CHECK(grib_set_string(h,"shortName", "fis", &str_len),0);
/* set centre as a long */
GRIB_CHECK(grib_set_long(h,"centre",centre),0);
/* get centre as a long */
GRIB_CHECK(grib_get_long(h,"centre",&long_value),0);
printf("centre long value=%ld\n",long_value);
/* set paramId and shortName - normally you would do one or the other */
GRIB_CHECK(grib_set_long(h,"paramId", 500004),0);
/* the value of str_len is not used, it can be anything! */
GRIB_CHECK(grib_set_string(h,"shortName", "fis", &str_len),0);
/* get centre as a string */
GRIB_CHECK(grib_get_string(h,"centre",string_value,&len),0);
printf("centre string value=%s\n",string_value);
/* get centre as a long */
GRIB_CHECK(grib_get_long(h,"centre",&long_value),0);
printf("centre long value=%ld\n",long_value);
/* get the coded message in a buffer */
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
/* get centre as a string */
GRIB_CHECK(grib_get_string(h,"centre",string_value,&len),0);
printf("centre string value=%s\n",string_value);
/* write the buffer in a file*/
if(fwrite(buffer,1,size,out) != size)
{
perror(argv[1]);
exit(1);
}
/* get the coded message in a buffer */
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
/* delete handle */
grib_handle_delete(h);
/* write the buffer in a file*/
if(fwrite(buffer,1,size,out) != size)
{
perror(argv[1]);
exit(1);
}
fclose(in);
fclose(out);
grib_handle_delete(h);
fclose(in);
fclose(out);
return 0;
return 0;
}

View File

@ -21,70 +21,72 @@
#include "grib_api.h"
int main(int argc, char** argv) {
int err = 0;
size_t size=0;
int main(int argc, char** argv)
{
int err = 0;
size_t size=0;
FILE* in = NULL;
char* infile = "../../data/regular_latlon_surface.grib1";
FILE* out = NULL;
char* outfile = "out.grib1";
grib_handle *h = NULL;
const void* buffer = NULL;
size_t values_len;
double* values;
double missing=9999;
int i=0;
FILE* in = NULL;
char* infile = "../../data/regular_latlon_surface.grib1";
FILE* out = NULL;
char* outfile = "out.grib1";
grib_handle *h = NULL;
const void* buffer = NULL;
size_t values_len;
double* values;
double missing=9999;
int i=0;
in = fopen(infile,"r");
if(!in) {
printf("ERROR: unable to open input file %s\n",infile);
return 1;
}
in = fopen(infile,"r");
if(!in) {
printf("ERROR: unable to open input file %s\n",infile);
return 1;
}
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open output file %s\n",outfile);
return 1;
}
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open output file %s\n",outfile);
fclose(in);
return 1;
}
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",infile);
}
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",infile);
}
GRIB_CHECK(grib_set_double(h,"missingValue",missing),0);
GRIB_CHECK(grib_set_double(h,"missingValue",missing),0);
/* get the size of the values array*/
GRIB_CHECK(grib_get_size(h,"values",&values_len),0);
/* get the size of the values array*/
GRIB_CHECK(grib_get_size(h,"values",&values_len),0);
values = malloc(values_len*sizeof(double));
values = malloc(values_len*sizeof(double));
/* get data values*/
GRIB_CHECK(grib_get_double_array(h,"values",values,&values_len),0);
/* get data values*/
GRIB_CHECK(grib_get_double_array(h,"values",values,&values_len),0);
GRIB_CHECK(grib_set_long(h,"bitmapPresent",1),0);
GRIB_CHECK(grib_set_long(h,"bitmapPresent",1),0);
for(i = 0; i < 10; i++)
values[i]=missing;
for(i = 0; i < 10; i++)
values[i]=missing;
GRIB_CHECK(grib_set_double_array(h,"values",values,values_len),0);
GRIB_CHECK(grib_set_double_array(h,"values",values,values_len),0);
/* get the coded message in a buffer */
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
/* get the coded message in a buffer */
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
/* write the buffer in a file*/
if(fwrite(buffer,1,size,out) != size)
{
perror(outfile);
exit(1);
}
/* write the buffer in a file*/
if(fwrite(buffer,1,size,out) != size)
{
perror(outfile);
exit(1);
}
/* delete handle */
grib_handle_delete(h);
/* delete handle */
grib_handle_delete(h);
fclose(in);
fclose(out);
fclose(in);
fclose(out);
return 0;
return 0;
}

View File

@ -19,7 +19,7 @@
#include "grib_api.h"
void usage(char* prog)
void usage(const char* prog)
{
printf("usage: %s out.grib\n",prog);
exit(1);
@ -32,6 +32,9 @@ int main(int argc, char** argv)
size_t values_len= 0;
/* Note: the full name of the sample file is "regular_ll_pl_grib1.tmpl" */
/* Sample files are stored in the samples directory (use grib_info to */
/* see where that is). The default sample path can be changed by */
/* setting the environment variable GRIB_SAMPLES_PATH */
const char* sample_filename = "regular_ll_pl_grib1";
grib_handle *h = NULL;
double d,e;

View File

@ -19,64 +19,66 @@
#include <assert.h>
#include "grib_api.h"
int main(int argc, char** argv) {
int err = 0, is_missing = 0;
int main(int argc, char** argv)
{
int err = 0, is_missing = 0;
FILE* in = NULL;
char* infile = "../../data/reduced_gaussian_pressure_level.grib2";
FILE* out = NULL;
char* outfile = "out_surface_level.grib2";
grib_handle *h = NULL;
const void* buffer = NULL;
size_t size=0;
char str[]="sfc";
size_t str_len=3;
long Ni = 0;
FILE* in = NULL;
char* infile = "../../data/reduced_gaussian_pressure_level.grib2";
FILE* out = NULL;
char* outfile = "out_surface_level.grib2";
grib_handle *h = NULL;
const void* buffer = NULL;
size_t size=0;
char str[]="sfc";
size_t str_len=3;
long Ni = 0;
in = fopen(infile,"r");
if(!in) {
printf("ERROR: unable to open input file %s\n",infile);
return 1;
}
in = fopen(infile,"r");
if(!in) {
printf("ERROR: unable to open input file %s\n",infile);
return 1;
}
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open output file %s\n",outfile);
return 1;
}
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open output file %s\n",outfile);
fclose(in);
return 1;
}
/* create a new handle from a message in a file */
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",infile);
}
/* create a new handle from a message in a file */
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",infile);
}
GRIB_CHECK(grib_set_string(h,"typeOfFirstFixedSurface",str,&str_len),0);
GRIB_CHECK(grib_set_missing(h,"scaleFactorOfFirstFixedSurface"),0);
GRIB_CHECK(grib_set_missing(h,"scaledValueOfFirstFixedSurface"),0);
/* See GRIB-490 */
GRIB_CHECK(grib_get_long(h,"Ni",&Ni),0);
is_missing = grib_is_missing(h, "Ni", &err);
GRIB_CHECK(err,0);
assert(is_missing == 1);
GRIB_CHECK(grib_set_long(h,"Ni", Ni),0);
GRIB_CHECK(grib_set_string(h,"typeOfFirstFixedSurface",str,&str_len),0);
GRIB_CHECK(grib_set_missing(h,"scaleFactorOfFirstFixedSurface"),0);
GRIB_CHECK(grib_set_missing(h,"scaledValueOfFirstFixedSurface"),0);
/* get the coded message in a buffer */
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
/* See GRIB-490 */
GRIB_CHECK(grib_get_long(h,"Ni",&Ni),0);
is_missing = grib_is_missing(h, "Ni", &err);
GRIB_CHECK(err,0);
assert(is_missing == 1);
GRIB_CHECK(grib_set_long(h,"Ni", Ni),0);
/* write the buffer in a file*/
if(fwrite(buffer,1,size,out) != size)
{
perror(argv[1]);
exit(1);
}
/* get the coded message in a buffer */
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
/* delete handle */
grib_handle_delete(h);
/* write the buffer in a file*/
if(fwrite(buffer,1,size,out) != size)
{
perror(argv[1]);
exit(1);
}
fclose(in);
fclose(out);
/* delete handle */
grib_handle_delete(h);
return 0;
fclose(in);
fclose(out);
return 0;
}

View File

@ -19,58 +19,58 @@
#include "grib_api.h"
int main(int argc, char** argv) {
int err = 0;
long PVPresent=1;
size_t size=0;
double pv[4]={1,2,3,4};
size_t pvsize=4;
int main(int argc, char** argv)
{
int err = 0;
long PVPresent=1;
size_t size=0;
double pv[4]={1,2,3,4};
size_t pvsize=4;
FILE* in = NULL;
char* infile = "../../data/regular_latlon_surface.grib1";
FILE* out = NULL;
char* outfile = "out.grib1";
grib_handle *h = NULL;
const void* buffer = NULL;
FILE* in = NULL;
char* infile = "../../data/regular_latlon_surface.grib1";
FILE* out = NULL;
char* outfile = "out.grib1";
grib_handle *h = NULL;
const void* buffer = NULL;
in = fopen(infile,"r");
if(!in) {
printf("ERROR: unable to open input file %s\n",infile);
return 1;
}
in = fopen(infile,"r");
if(!in) {
printf("ERROR: unable to open input file %s\n",infile);
return 1;
}
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open output file %s\n",outfile);
return 1;
}
out = fopen(outfile,"w");
if(!out) {
printf("ERROR: unable to open output file %s\n",outfile);
fclose(in);
return 1;
}
/* create a new handle from a message in a file */
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",infile);
}
/* create a new handle from a message in a file */
h = grib_handle_new_from_file(0,in,&err);
if (h == NULL) {
printf("Error: unable to create handle from file %s\n",infile);
}
GRIB_CHECK(grib_set_long(h,"PVPresent",PVPresent),0);
GRIB_CHECK(grib_set_long(h,"PVPresent",PVPresent),0);
GRIB_CHECK(grib_set_double_array(h,"pv",pv,pvsize),0);
GRIB_CHECK(grib_set_double_array(h,"pv",pv,pvsize),0);
/* get the coded message in a buffer */
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
/* get the coded message in a buffer */
GRIB_CHECK(grib_get_message(h,&buffer,&size),0);
/* write the buffer in a file*/
if(fwrite(buffer,1,size,out) != size)
{
perror(argv[1]);
exit(1);
}
/* write the buffer in a file*/
if(fwrite(buffer,1,size,out) != size)
{
perror(argv[1]);
exit(1);
}
/* delete handle */
grib_handle_delete(h);
grib_handle_delete(h);
fclose(in);
fclose(out);
fclose(in);
fclose(out);
return 0;
return 0;
}

View File

@ -9,7 +9,8 @@
*/
#include "grib_api.h"
int main(int argc, char* argv[]) {
int main(int argc, char* argv[])
{
FILE* f;
int err=0;
char infile[]="../../data/reduced_gaussian_model_level.grib1";

View File

@ -46,7 +46,7 @@ foreach( tool ${tests} )
ecbuild_add_executable( TARGET f_${tool}
NOINSTALL
SOURCES ${tool}.f90
CONDITION ENABLE_FORTRAN
CONDITION ENABLE_FORTRAN
LINKER_LANGUAGE Fortran
LIBS grib_api_f90 grib_api
)
@ -64,21 +64,21 @@ endforeach()
ecbuild_add_executable( TARGET f_new_from_file
NOINSTALL
SOURCES new_from_file.f90
CONDITION ENABLE_FORTRAN
CONDITION ENABLE_FORTRAN
LINKER_LANGUAGE Fortran
LIBS grib_api_f90 grib_api
)
ecbuild_add_executable( TARGET f_copy_namespace
NOINSTALL
SOURCES copy_namespace.f90
CONDITION ENABLE_FORTRAN
CONDITION ENABLE_FORTRAN
LINKER_LANGUAGE Fortran
LIBS grib_api_f90 grib_api
)
ecbuild_add_executable( TARGET f_set_gvc
NOINSTALL
SOURCES set_gvc.f90
CONDITION ENABLE_FORTRAN
CONDITION ENABLE_FORTRAN
LINKER_LANGUAGE Fortran
LIBS grib_api_f90 grib_api
)

View File

@ -42,5 +42,5 @@ AM_FCFLAGS = $(F90_MODULE_FLAG)$(top_builddir)/fortran
LDADD = $(top_builddir)/fortran/libgrib_api_f90.la $(top_builddir)/src/libgrib_api.la
DEPENDENCIES = $(LDADD)
EXTRA_DIST =$(TESTS) include.sh
EXTRA_DIST =$(TESTS) include.sh CMakeLists.txt include.ctest.sh.in

View File

@ -33,5 +33,5 @@ INCLUDES = -I$(top_builddir)/src
LDADD = $(top_builddir)/src/libgrib_api.la
DEPENDENCIES = $(LDADD)
EXTRA_DIST =$(TESTS) include.sh
EXTRA_DIST =$(TESTS) include.sh CMakeLists.txt

View File

@ -15,5 +15,6 @@ LDADD = $(top_builddir)/src/libgrib_api.la
DEPENDENCIES = $(LDADD)
EXTRA_DIST = $(TESTS) include.sh clone.py count_messages.py get.py index.py iterator.py keys_iterator.py multi_write.py \
nearest.py print_data.py samples.py set.py set_missing.py binary_message.py set_pv.py set_bitmap.py
nearest.py print_data.py samples.py set.py set_missing.py binary_message.py set_pv.py set_bitmap.py \
CMakeLists.txt include.ctest.sh.in
endif

View File

@ -1,5 +1,5 @@
if( ENABLE_FORTRAN )
set( srcdir ${CMAKE_CURRENT_SOURCE_DIR} )
set( bindir ${CMAKE_CURRENT_BINARY_DIR} )

View File

@ -36,7 +36,8 @@ EXTRA_DIST= grib_fortran_prototypes.h grib_api_constants.h grib_api_externals.h
grib_api_visibility.h grib_types.f90 create_grib_f90.sh \
grib_f90_head.f90 grib_f90_tail.f90 grib_f90_int.f90 grib_f90_long_int.f90 \
grib_f90_int_size_t.f90 grib_f90_long_size_t.f90 \
same_int_long.f90 same_int_size_t.f90 grib_fortran_kinds.c
same_int_long.f90 same_int_size_t.f90 grib_fortran_kinds.c \
CMakeLists.txt
grib_f90.f90: grib_f90_head.f90 grib_f90_tail.f90 grib_f90_int.f90 grib_f90_long_int.f90 grib_f90_int_size_t.f90 grib_f90_long_size_t.f90 same_int_long same_int_size_t grib_kinds.h
./create_grib_f90.sh

View File

@ -23,6 +23,8 @@ nodist_grib1_DATA = \
reduced_gg_ml_grib2.tmpl \
reduced_gg_pl_1024_grib1.tmpl \
reduced_gg_pl_1024_grib2.tmpl \
reduced_gg_pl_1280_grib1.tmpl \
reduced_gg_pl_1280_grib2.tmpl \
reduced_gg_pl_128_grib1.tmpl \
reduced_gg_pl_128_grib2.tmpl \
reduced_gg_pl_160_grib1.tmpl \
@ -114,6 +116,12 @@ reduced_gg_pl_1024_grib1.tmpl: ../../samples/reduced_gg_pl_1024_grib1.tmpl
reduced_gg_pl_1024_grib2.tmpl: ../../samples/reduced_gg_pl_1024_grib2.tmpl
cp -f ../../samples/reduced_gg_pl_1024_grib2.tmpl .
reduced_gg_pl_1280_grib1.tmpl: ../../samples/reduced_gg_pl_1280_grib1.tmpl
cp -f ../../samples/reduced_gg_pl_1280_grib1.tmpl .
reduced_gg_pl_1280_grib2.tmpl: ../../samples/reduced_gg_pl_1280_grib2.tmpl
cp -f ../../samples/reduced_gg_pl_1280_grib2.tmpl .
reduced_gg_pl_128_grib1.tmpl: ../../samples/reduced_gg_pl_128_grib1.tmpl
cp -f ../../samples/reduced_gg_pl_128_grib1.tmpl .

View File

@ -23,6 +23,8 @@ nodist_grib1_mlgrib2_DATA = \
reduced_gg_ml_grib2.tmpl \
reduced_gg_pl_1024_grib1.tmpl \
reduced_gg_pl_1024_grib2.tmpl \
reduced_gg_pl_1280_grib1.tmpl \
reduced_gg_pl_1280_grib2.tmpl \
reduced_gg_pl_128_grib1.tmpl \
reduced_gg_pl_128_grib2.tmpl \
reduced_gg_pl_160_grib1.tmpl \
@ -114,6 +116,12 @@ reduced_gg_pl_1024_grib1.tmpl: ../../samples/reduced_gg_pl_1024_grib1.tmpl
reduced_gg_pl_1024_grib2.tmpl: ../../samples/reduced_gg_pl_1024_grib2.tmpl
cp -f ../../samples/reduced_gg_pl_1024_grib2.tmpl .
reduced_gg_pl_1280_grib1.tmpl: ../../samples/reduced_gg_pl_1280_grib1.tmpl
cp -f ../../samples/reduced_gg_pl_1280_grib1.tmpl .
reduced_gg_pl_1280_grib2.tmpl: ../../samples/reduced_gg_pl_1280_grib2.tmpl
cp -f ../../samples/reduced_gg_pl_1280_grib2.tmpl .
reduced_gg_pl_128_grib1.tmpl: ../../samples/reduced_gg_pl_128_grib1.tmpl
cp -f ../../samples/reduced_gg_pl_128_grib1.tmpl .

View File

@ -22,6 +22,8 @@ nodist_grib1_mlgrib2_ieee32_DATA = \
reduced_gg_ml_grib2.tmpl \
reduced_gg_pl_1024_grib1.tmpl \
reduced_gg_pl_1024_grib2.tmpl \
reduced_gg_pl_1280_grib1.tmpl \
reduced_gg_pl_1280_grib2.tmpl \
reduced_gg_pl_128_grib1.tmpl \
reduced_gg_pl_128_grib2.tmpl \
reduced_gg_pl_160_grib1.tmpl \
@ -110,6 +112,12 @@ reduced_gg_pl_1024_grib1.tmpl: ../../samples/reduced_gg_pl_1024_grib1.tmpl
reduced_gg_pl_1024_grib2.tmpl: ../../samples/reduced_gg_pl_1024_grib2.tmpl
cp -f ../../samples/reduced_gg_pl_1024_grib2.tmpl .
reduced_gg_pl_1280_grib1.tmpl: ../../samples/reduced_gg_pl_1280_grib1.tmpl
cp -f ../../samples/reduced_gg_pl_1280_grib1.tmpl .
reduced_gg_pl_1280_grib2.tmpl: ../../samples/reduced_gg_pl_1280_grib2.tmpl
cp -f ../../samples/reduced_gg_pl_1280_grib2.tmpl .
reduced_gg_pl_128_grib1.tmpl: ../../samples/reduced_gg_pl_128_grib1.tmpl
cp -f ../../samples/reduced_gg_pl_128_grib1.tmpl .

View File

@ -23,6 +23,8 @@ nodist_grib1_mlgrib2_ieee64_DATA = \
reduced_gg_ml_grib2.tmpl \
reduced_gg_pl_1024_grib1.tmpl \
reduced_gg_pl_1024_grib2.tmpl \
reduced_gg_pl_1280_grib1.tmpl \
reduced_gg_pl_1280_grib2.tmpl \
reduced_gg_pl_128_grib1.tmpl \
reduced_gg_pl_128_grib2.tmpl \
reduced_gg_pl_160_grib1.tmpl \
@ -114,6 +116,12 @@ reduced_gg_pl_1024_grib1.tmpl: ../../samples/reduced_gg_pl_1024_grib1.tmpl
reduced_gg_pl_1024_grib2.tmpl: ../../samples/reduced_gg_pl_1024_grib2.tmpl
cp -f ../../samples/reduced_gg_pl_1024_grib2.tmpl .
reduced_gg_pl_1280_grib1.tmpl: ../../samples/reduced_gg_pl_1280_grib1.tmpl
cp -f ../../samples/reduced_gg_pl_1280_grib1.tmpl .
reduced_gg_pl_1280_grib2.tmpl: ../../samples/reduced_gg_pl_1280_grib2.tmpl
cp -f ../../samples/reduced_gg_pl_1280_grib2.tmpl .
reduced_gg_pl_128_grib1.tmpl: ../../samples/reduced_gg_pl_128_grib1.tmpl
cp -f ../../samples/reduced_gg_pl_128_grib1.tmpl .

View File

@ -30,7 +30,8 @@ EXTRA_DIST = grib_interface.h \
swig_wrap_array.c \
swig_wrap_numpy.c \
swig_wrap_array.py \
swig_wrap_numpy.py
swig_wrap_numpy.py \
CMakeLists.txt
# What else I want installed
pkgpyexec_DATA = \
@ -69,7 +70,8 @@ EXTRA_DIST = setup.py.in \
swig_wrap_array.c \
swig_wrap_numpy.c \
swig_wrap_array.py \
swig_wrap_numpy.py
swig_wrap_numpy.py \
CMakeLists.txt
# What I want installed
pdir = $(libdir)/python$(PYTHON_VERSION)/site-packages/grib_api

View File

@ -53,6 +53,8 @@ dist_samples_DATA = \
reduced_gg_pl_640_grib2.tmpl \
reduced_gg_pl_1024_grib1.tmpl \
reduced_gg_pl_1024_grib2.tmpl \
reduced_gg_pl_1280_grib1.tmpl \
reduced_gg_pl_1280_grib2.tmpl \
reduced_gg_pl_2000_grib1.tmpl \
reduced_gg_pl_2000_grib2.tmpl \
reduced_gg_pl_80_grib1.tmpl \

View File

@ -163,6 +163,7 @@ list( APPEND grib_api_srcs
grib_accessor_class_g2grid.c
grib_accessor_class_data_apply_bitmap.c
grib_accessor_class_data_apply_boustrophedonic.c
grib_accessor_class_data_apply_boustrophedonic_bitmap.c
grib_accessor_class_data_secondary_bitmap.c
grib_accessor_class_data_g1secondary_bitmap.c
grib_accessor_class_data_g2secondary_bitmap.c
@ -280,7 +281,6 @@ list( APPEND grib_api_srcs
grib_accessor_class.h
grib_accessor_factory.h
grib_api.h
grib_api_fortran.h
grib_api_internal.h
grib_api_prototypes.h
grib_box_class.h
@ -295,9 +295,6 @@ list( APPEND grib_api_srcs
grib_nearest_factory.h
grib_templates.h
grib_yacc.h
jgribapi_GribFile.h
jgribapi_GribHandle.h
jgribapi_GribIterator.h
md5.h
md5.c
# Ship our generated lex/yacc C files

View File

@ -177,6 +177,7 @@ libgrib_api_la_prototypes= \
grib_accessor_class_g2grid.c \
grib_accessor_class_data_apply_bitmap.c \
grib_accessor_class_data_apply_boustrophedonic.c \
grib_accessor_class_data_apply_boustrophedonic_bitmap.c \
grib_accessor_class_data_secondary_bitmap.c \
grib_accessor_class_data_g1secondary_bitmap.c \
grib_accessor_class_data_g2secondary_bitmap.c \
@ -334,7 +335,8 @@ EXTRA_DIST= dummy.am griby.y gribl.l grib_accessor_classes_hash.c \
grib_bits_fast_big_endian_vector.c grib_bits_any_endian_vector.c \
grib_bits_fast_big_endian_simple.c grib_bits_any_endian_simple.c \
grib_bits_fast_big_endian_omp.c grib_bits_any_endian_omp.c \
encode_double_array.c grib_bits_ibmpow.c grib_bits_ibmpow_opt.c minmax_val.c
encode_double_array.c grib_bits_ibmpow.c grib_bits_ibmpow_opt.c minmax_val.c \
CMakeLists.txt grib_api_version.c.in
include $(DEVEL_RULES)

View File

@ -25,6 +25,7 @@ extern grib_accessor_class* grib_accessor_class_data_2order_packing;
extern grib_accessor_class* grib_accessor_class_data_2order_packing_count;
extern grib_accessor_class* grib_accessor_class_data_apply_bitmap;
extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic;
extern grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap;
extern grib_accessor_class* grib_accessor_class_data_apply_gdsnotpresent;
extern grib_accessor_class* grib_accessor_class_data_complex_packing;
extern grib_accessor_class* grib_accessor_class_data_constant_field;

View File

@ -155,7 +155,6 @@ static void dump(grib_accessor* a, grib_dumper* dumper)
grib_dump_values(dumper,a);
}
static int value_count(grib_accessor* a,long* count)
{
grib_accessor_data_apply_bitmap *self =(grib_accessor_data_apply_bitmap*)a;
@ -172,8 +171,7 @@ static int value_count(grib_accessor* a,long* count)
return ret;
}
static int unpack_double(grib_accessor* a, double* val, size_t *len)
static int unpack_double(grib_accessor* a, double* val, size_t *len)
{
grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a;
@ -183,9 +181,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
long nn=0;
int err=0;
size_t coded_n_vals = 0;
double* coded_vals = NULL;
double missing_value = 0;
err=grib_value_count(a,&nn);
@ -201,8 +197,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
if((err = grib_get_double_internal(a->parent->h,self->missing_value,&missing_value))
!= GRIB_SUCCESS) return err;
if(*len < n_vals)
{
if(*len < n_vals) {
*len = n_vals;
return GRIB_ARRAY_TOO_SMALL;
}
@ -230,7 +225,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
}
grib_context_log(a->parent->h->context, GRIB_LOG_DEBUG,
"grib_accessor_data_simple_packing_bitmap : unpack_double : creating %s, %d values",
"grib_accessor_class_data_apply_bitmap: unpack_double : creating %s, %d values",
a->name, n_vals);
for(i=0;i < n_vals;i++)
@ -245,7 +240,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
{
grib_context_free(a->parent->h->context,coded_vals);
grib_context_log(a->parent->h->context, GRIB_LOG_ERROR,
"grib_accessor_data_simple_packing_bitmap [%s]:"
"grib_accessor_class_data_apply_bitmap [%s]:"
" unpack_double : number of coded values does not match bitmap %ld %ld",
a->name,coded_n_vals,n_vals);
@ -260,7 +255,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t *len)
return err;
}
static int unpack_double_element(grib_accessor* a, size_t idx,double* val)
static int unpack_double_element(grib_accessor* a, size_t idx,double* val)
{
grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a;
int err = 0,i=0;
@ -297,7 +292,6 @@ static int unpack_double_element(grib_accessor* a, size_t idx,double* val)
grib_context_free(a->parent->h->context,bvals);
return grib_get_double_element_internal(a->parent->h,self->coded_values,cidx,val);
}
static int pack_double(grib_accessor* a, const double* val, size_t *len)
@ -357,7 +351,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len)
return err;
}
static int get_native_type(grib_accessor* a)
static int get_native_type(grib_accessor* a)
{
/* grib_accessor_data_apply_bitmap* self = (grib_accessor_data_apply_bitmap*)a;
return grib_accessor_get_native_type(grib_find_accessor(a->parent->h,self->coded_values));*/

View File

@ -136,199 +136,195 @@ static void init_class(grib_accessor_class* c)
static void init(grib_accessor* a,const long v, grib_arguments* args)
{
int n=0;
grib_accessor_data_apply_boustrophedonic *self =(grib_accessor_data_apply_boustrophedonic*)a;
int n=0;
grib_accessor_data_apply_boustrophedonic *self =(grib_accessor_data_apply_boustrophedonic*)a;
self->values = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfRows = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfColumns = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfPoints = grib_arguments_get_name(a->parent->h,args,n++);
self->pl = grib_arguments_get_name(a->parent->h,args,n++);
self->values = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfRows = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfColumns = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfPoints = grib_arguments_get_name(a->parent->h,args,n++);
self->pl = grib_arguments_get_name(a->parent->h,args,n++);
a->length = 0;
a->length = 0;
}
static void dump(grib_accessor* a, grib_dumper* dumper)
{
grib_dump_values(dumper,a);
grib_dump_values(dumper,a);
}
static int value_count(grib_accessor* a, long* numberOfPoints)
{
grib_accessor_data_apply_boustrophedonic *self =(grib_accessor_data_apply_boustrophedonic*)a;
int ret=0;
grib_accessor_data_apply_boustrophedonic *self =(grib_accessor_data_apply_boustrophedonic*)a;
int ret=0;
*numberOfPoints=0;
ret=grib_get_long_internal(a->parent->h,self->numberOfPoints,numberOfPoints);
return ret;
*numberOfPoints=0;
ret=grib_get_long_internal(a->parent->h,self->numberOfPoints,numberOfPoints);
return ret;
}
static int unpack_double(grib_accessor* a, double* val, size_t *len)
static int unpack_double(grib_accessor* a, double* val, size_t *len)
{
grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a;
size_t plSize=0;
long *pl=0;
double *values=0;
double *pvalues=0;
double *pval=0;
size_t valuesSize=0;
long i,j;
int ret;
long numberOfPoints,numberOfRows,numberOfColumns;
grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a;
size_t plSize=0;
long *pl=0;
double *values=0;
double *pvalues=0;
double *pval=0;
size_t valuesSize=0;
long i,j;
int ret;
long numberOfPoints,numberOfRows,numberOfColumns;
ret=grib_get_long_internal(a->parent->h,self->numberOfPoints,&numberOfPoints);
if (ret) return ret;
ret=grib_get_long_internal(a->parent->h,self->numberOfPoints,&numberOfPoints);
if (ret) return ret;
if(*len < numberOfPoints) {
*len = numberOfPoints;
return GRIB_ARRAY_TOO_SMALL;
}
if(*len < numberOfPoints) {
*len = numberOfPoints;
return GRIB_ARRAY_TOO_SMALL;
}
ret=grib_get_size(a->parent->h,self->values,&valuesSize);
if (ret) return ret;
ret=grib_get_size(a->parent->h,self->values,&valuesSize);
if (ret) return ret;
/* constant field */
if (valuesSize==0) return 0;
/* constant field */
if (valuesSize==0) return 0;
if (valuesSize!=numberOfPoints) {
grib_context_log(a->parent->h->context,GRIB_LOG_ERROR,"boustrophedonic ordering error: ( %s=%ld ) != (sizeOf(%s)=%ld)",
self->numberOfPoints,numberOfPoints,self->values,(long)valuesSize);
return GRIB_DECODING_ERROR;
}
if (valuesSize!=numberOfPoints) {
grib_context_log(a->parent->h->context,GRIB_LOG_ERROR,"boustrophedonic ordering error: ( %s=%ld ) != (sizeOf(%s)=%ld)",
self->numberOfPoints,numberOfPoints,self->values,(long)valuesSize);
return GRIB_DECODING_ERROR;
}
values=grib_context_malloc_clear(a->parent->h->context,sizeof(double)*numberOfPoints);
ret=grib_get_double_array_internal(a->parent->h,self->values,values,&valuesSize);
if (ret) return ret;
values=grib_context_malloc_clear(a->parent->h->context,sizeof(double)*numberOfPoints);
ret=grib_get_double_array_internal(a->parent->h,self->values,values,&valuesSize);
if (ret) return ret;
pvalues=values;
pval=val;
pvalues=values;
pval=val;
ret=grib_get_long_internal(a->parent->h,self->numberOfRows,&numberOfRows);
if (ret) return ret;
ret=grib_get_long_internal(a->parent->h,self->numberOfRows,&numberOfRows);
if (ret) return ret;
ret=grib_get_long_internal(a->parent->h,self->numberOfColumns,&numberOfColumns);
if (ret) return ret;
ret=grib_get_long_internal(a->parent->h,self->numberOfColumns,&numberOfColumns);
if (ret) return ret;
if (grib_get_size(a->parent->h,self->pl,&plSize) == GRIB_SUCCESS) {
Assert(plSize==numberOfRows);
pl=grib_context_malloc_clear(a->parent->h->context,sizeof(long)*plSize);
ret=grib_get_long_array_internal(a->parent->h,self->pl,pl,&plSize);
if (ret) return ret;
if (grib_get_size(a->parent->h,self->pl,&plSize) == GRIB_SUCCESS) {
Assert(plSize==numberOfRows);
pl=grib_context_malloc_clear(a->parent->h->context,sizeof(long)*plSize);
ret=grib_get_long_array_internal(a->parent->h,self->pl,pl,&plSize);
if (ret) return ret;
for (j=0;j<numberOfRows;j++) {
if (j%2) {
pval+=pl[j];
for (i=0;i<pl[j];i++) *(pval--)=*(pvalues++);
pval+=pl[j];
} else {
for (i=0;i<pl[j];i++) *(pval++)=*(pvalues++);
}
}
for (j=0;j<numberOfRows;j++) {
if (j%2) {
pval+=pl[j];
for (i=0;i<pl[j];i++) *(pval--)=*(pvalues++);
pval+=pl[j];
} else {
for (i=0;i<pl[j];i++) *(pval++)=*(pvalues++);
}
}
grib_context_free(a->parent->h->context,pl);
grib_context_free(a->parent->h->context,pl);
} else {
} else {
for (j=0;j<numberOfRows;j++) {
if (j%2) {
pval+=numberOfColumns-1;
for (i=0;i<numberOfColumns;i++) *(pval--)=*(pvalues++);
pval+=numberOfColumns+1;
} else {
for (i=0;i<numberOfColumns;i++) *(pval++)=*(pvalues++);
}
}
for (j=0;j<numberOfRows;j++) {
if (j%2) {
pval+=numberOfColumns-1;
for (i=0;i<numberOfColumns;i++) *(pval--)=*(pvalues++);
pval+=numberOfColumns+1;
} else {
for (i=0;i<numberOfColumns;i++) *(pval++)=*(pvalues++);
}
}
}
}
grib_context_free(a->parent->h->context,values);
grib_context_free(a->parent->h->context,values);
return GRIB_SUCCESS;
return GRIB_SUCCESS;
}
static int unpack_double_element(grib_accessor* a, size_t idx,double* val)
static int unpack_double_element(grib_accessor* a, size_t idx,double* val)
{
return GRIB_NOT_IMPLEMENTED;
return GRIB_NOT_IMPLEMENTED;
}
static int pack_double(grib_accessor* a, const double* val, size_t *len)
{
grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a;
size_t plSize=0;
long *pl=0;
double *values=0;
double *pvalues=0;
double *pval=0;
size_t valuesSize=0;
long i,j;
int ret;
long numberOfPoints,numberOfRows,numberOfColumns;
grib_accessor_data_apply_boustrophedonic* self = (grib_accessor_data_apply_boustrophedonic*)a;
size_t plSize=0;
long *pl=0;
double *values=0;
double *pvalues=0;
double *pval=0;
size_t valuesSize=0;
long i,j;
int ret;
long numberOfPoints,numberOfRows,numberOfColumns;
ret=grib_get_long_internal(a->parent->h,self->numberOfPoints,&numberOfPoints);
if (ret) return ret;
ret=grib_get_long_internal(a->parent->h,self->numberOfPoints,&numberOfPoints);
if (ret) return ret;
if(*len < numberOfPoints) {
*len = numberOfPoints;
return GRIB_ARRAY_TOO_SMALL;
}
if(*len < numberOfPoints) {
*len = numberOfPoints;
return GRIB_ARRAY_TOO_SMALL;
}
valuesSize=numberOfPoints;
valuesSize=numberOfPoints;
values=grib_context_malloc_clear(a->parent->h->context,sizeof(double)*numberOfPoints);
values=grib_context_malloc_clear(a->parent->h->context,sizeof(double)*numberOfPoints);
pvalues=values;
pval=(double*)val;
pvalues=values;
pval=(double*)val;
ret=grib_get_long_internal(a->parent->h,self->numberOfRows,&numberOfRows);
if (ret) return ret;
ret=grib_get_long_internal(a->parent->h,self->numberOfRows,&numberOfRows);
if (ret) return ret;
ret=grib_get_long_internal(a->parent->h,self->numberOfColumns,&numberOfColumns);
if (ret) return ret;
ret=grib_get_long_internal(a->parent->h,self->numberOfColumns,&numberOfColumns);
if (ret) return ret;
if (grib_get_size(a->parent->h,self->pl,&plSize) == GRIB_SUCCESS) {
Assert(plSize==numberOfRows);
pl=grib_context_malloc_clear(a->parent->h->context,sizeof(long)*plSize);
ret=grib_get_long_array_internal(a->parent->h,self->pl,pl,&plSize);
if (ret) return ret;
if (grib_get_size(a->parent->h,self->pl,&plSize) == GRIB_SUCCESS) {
Assert(plSize==numberOfRows);
pl=grib_context_malloc_clear(a->parent->h->context,sizeof(long)*plSize);
ret=grib_get_long_array_internal(a->parent->h,self->pl,pl,&plSize);
if (ret) return ret;
for (j=0;j<numberOfRows;j++) {
if (j%2) {
pvalues+=pl[j];
for (i=0;i<pl[j] ;i++) { *(--pvalues)=*(pval++); }
pvalues+=pl[j];
} else {
for (i=0;i<pl[j];i++) *(pvalues++)=*(pval++);
}
}
for (j=0;j<numberOfRows;j++) {
if (j%2) {
pvalues+=pl[j];
for (i=0;i<pl[j] ;i++) { *(--pvalues)=*(pval++); }
pvalues+=pl[j];
} else {
for (i=0;i<pl[j];i++) *(pvalues++)=*(pval++);
}
}
grib_context_free(a->parent->h->context,pl);
grib_context_free(a->parent->h->context,pl);
} else {
} else {
for (j=0;j<numberOfRows;j++) {
if (j%2) {
pvalues+=numberOfColumns;
for (i=0;i<numberOfColumns;i++) *(--pvalues)=*(pval++);
pvalues+=numberOfColumns;
} else {
for (i=0;i<numberOfColumns;i++) *(pvalues++)=*(pval++);
}
}
for (j=0;j<numberOfRows;j++) {
if (j%2) {
pvalues+=numberOfColumns;
for (i=0;i<numberOfColumns;i++) *(--pvalues)=*(pval++);
pvalues+=numberOfColumns;
} else {
for (i=0;i<numberOfColumns;i++) *(pvalues++)=*(pval++);
}
}
}
ret=grib_set_double_array_internal(a->parent->h,self->values,values,valuesSize);
if (ret) return ret;
}
ret=grib_set_double_array_internal(a->parent->h,self->values,values,valuesSize);
if (ret) return ret;
grib_context_free(a->parent->h->context,values);
grib_context_free(a->parent->h->context,values);
return ret;
return ret;
}
static int get_native_type(grib_accessor* a)
static int get_native_type(grib_accessor* a)
{
return GRIB_TYPE_DOUBLE;
return GRIB_TYPE_DOUBLE;
}

View File

@ -0,0 +1,432 @@
/*
* Copyright 2005-2014 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
#include "grib_api_internal.h"
/*
This is used by make_class.pl
START_CLASS_DEF
CLASS = accessor
SUPER = grib_accessor_class_gen
IMPLEMENTS = init
IMPLEMENTS = unpack_double;unpack_double_element
IMPLEMENTS = pack_double
IMPLEMENTS = value_count
IMPLEMENTS = dump;get_native_type
MEMBERS=const char* coded_values
MEMBERS=const char* bitmap
MEMBERS=const char* missing_value
MEMBERS=const char* binary_scale_factor
MEMBERS=const char* numberOfRows
MEMBERS=const char* numberOfColumns
MEMBERS=const char* numberOfPoints
END_CLASS_DEF
*/
/* START_CLASS_IMP */
/*
Don't edit anything between START_CLASS_IMP and END_CLASS_IMP
Instead edit values between START_CLASS_DEF and END_CLASS_DEF
or edit "accessor.class" and rerun ./make_class.pl
*/
static int get_native_type(grib_accessor*);
static int pack_double(grib_accessor*, const double* val,size_t *len);
static int unpack_double(grib_accessor*, double* val,size_t *len);
static int value_count(grib_accessor*,long*);
static void dump(grib_accessor*, grib_dumper*);
static void init(grib_accessor*,const long, grib_arguments* );
static void init_class(grib_accessor_class*);
static int unpack_double_element(grib_accessor*,size_t i, double* val);
typedef struct grib_accessor_data_apply_boustrophedonic_bitmap {
grib_accessor att;
/* Members defined in gen */
/* Members defined in data_apply_boustrophedonic_bitmap */
const char* coded_values;
const char* bitmap;
const char* missing_value;
const char* binary_scale_factor;
const char* numberOfRows;
const char* numberOfColumns;
const char* numberOfPoints;
} grib_accessor_data_apply_boustrophedonic_bitmap;
extern grib_accessor_class* grib_accessor_class_gen;
static grib_accessor_class _grib_accessor_class_data_apply_boustrophedonic_bitmap = {
&grib_accessor_class_gen, /* super */
"data_apply_boustrophedonic_bitmap", /* name */
sizeof(grib_accessor_data_apply_boustrophedonic_bitmap), /* size */
0, /* inited */
&init_class, /* init_class */
&init, /* init */
0, /* post_init */
0, /* free mem */
&dump, /* describes himself */
0, /* get length of section */
0, /* get length of string */
&value_count, /* get number of values */
0, /* get number of bytes */
0, /* get offset to bytes */
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
&pack_double, /* grib_pack procedures double */
&unpack_double, /* grib_unpack procedures double */
0, /* grib_pack procedures string */
0, /* grib_unpack procedures string */
0, /* grib_pack procedures bytes */
0, /* grib_unpack procedures bytes */
0, /* pack_expression */
0, /* notify_change */
0, /* update_size */
0, /* preferred_size */
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
0, /* compare vs. another accessor */
&unpack_double_element, /* unpack only ith value */
0, /* unpack a subarray */
0, /* clear */
};
grib_accessor_class* grib_accessor_class_data_apply_boustrophedonic_bitmap = &_grib_accessor_class_data_apply_boustrophedonic_bitmap;
static void init_class(grib_accessor_class* c)
{
c->next_offset = (*(c->super))->next_offset;
c->string_length = (*(c->super))->string_length;
c->byte_count = (*(c->super))->byte_count;
c->byte_offset = (*(c->super))->byte_offset;
c->sub_section = (*(c->super))->sub_section;
c->pack_missing = (*(c->super))->pack_missing;
c->is_missing = (*(c->super))->is_missing;
c->pack_long = (*(c->super))->pack_long;
c->unpack_long = (*(c->super))->unpack_long;
c->pack_string = (*(c->super))->pack_string;
c->unpack_string = (*(c->super))->unpack_string;
c->pack_bytes = (*(c->super))->pack_bytes;
c->unpack_bytes = (*(c->super))->unpack_bytes;
c->pack_expression = (*(c->super))->pack_expression;
c->notify_change = (*(c->super))->notify_change;
c->update_size = (*(c->super))->update_size;
c->preferred_size = (*(c->super))->preferred_size;
c->resize = (*(c->super))->resize;
c->nearest_smaller_value = (*(c->super))->nearest_smaller_value;
c->next = (*(c->super))->next;
c->compare = (*(c->super))->compare;
c->unpack_double_subarray = (*(c->super))->unpack_double_subarray;
c->clear = (*(c->super))->clear;
}
/* END_CLASS_IMP */
static void init(grib_accessor* a,const long v, grib_arguments* args)
{
int n=0;
grib_accessor_data_apply_boustrophedonic_bitmap *self =(grib_accessor_data_apply_boustrophedonic_bitmap*)a;
self->coded_values = grib_arguments_get_name(a->parent->h,args,n++);
self->bitmap = grib_arguments_get_name(a->parent->h,args,n++);
self->missing_value = grib_arguments_get_name(a->parent->h,args,n++);
self->binary_scale_factor = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfRows = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfColumns = grib_arguments_get_name(a->parent->h,args,n++);
self->numberOfPoints = grib_arguments_get_name(a->parent->h,args,n++);
a->length = 0;
}
static void dump(grib_accessor* a, grib_dumper* dumper)
{
grib_dump_values(dumper,a);
}
static int value_count(grib_accessor* a,long* count)
{
grib_accessor_data_apply_boustrophedonic_bitmap *self =(grib_accessor_data_apply_boustrophedonic_bitmap*)a;
size_t len = 0;
int ret = 0;
/* This accessor is for data with a bitmap after all */
Assert(grib_find_accessor(a->parent->h, self->bitmap));
ret = grib_get_size(a->parent->h, self->bitmap, &len);
*count=len;
return ret;
}
static int unpack_double(grib_accessor* a, double* val, size_t *len)
{
grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a;
size_t i = 0, j = 0, n_vals = 0, irow = 0;
long nn=0;
int err=0;
size_t coded_n_vals = 0;
double* coded_vals = NULL;
double missing_value = 0;
long numberOfPoints, numberOfRows, numberOfColumns;
err=grib_value_count(a,&nn);
n_vals=nn;
if (err) return err;
err=grib_get_long_internal(a->parent->h,self->numberOfRows,&numberOfRows);
if (err) return err;
err=grib_get_long_internal(a->parent->h,self->numberOfColumns,&numberOfColumns);
if (err) return err;
err=grib_get_long_internal(a->parent->h,self->numberOfPoints,&numberOfPoints);
if (err) return err;
Assert(nn == numberOfPoints);
if(!grib_find_accessor(a->parent->h,self->bitmap))
return grib_get_double_array_internal(a->parent->h,self->coded_values,val,len);
if((err = grib_get_size(a->parent->h,self->coded_values,&coded_n_vals)) != GRIB_SUCCESS)
return err;
if((err = grib_get_double_internal(a->parent->h,self->missing_value,&missing_value))
!= GRIB_SUCCESS) return err;
if(*len < n_vals) {
*len = n_vals;
return GRIB_ARRAY_TOO_SMALL;
}
if (coded_n_vals==0) {
for(i=0;i < n_vals;i++)
val[i] = missing_value;
*len=n_vals;
return GRIB_SUCCESS;
}
if((err = grib_get_double_array_internal(a->parent->h,self->bitmap,val,&n_vals))
!= GRIB_SUCCESS)
return err;
coded_vals = grib_context_malloc(a->parent->h->context,coded_n_vals*sizeof(double));
if(coded_vals == NULL) return GRIB_OUT_OF_MEMORY;
if((err = grib_get_double_array_internal(a->parent->h,self->coded_values,coded_vals,&coded_n_vals))
!= GRIB_SUCCESS)
{
grib_context_free(a->parent->h->context,coded_vals);
return err;
}
grib_context_log(a->parent->h->context, GRIB_LOG_DEBUG,
"grib_accessor_class_data_apply_boustrophedonic_bitmap: unpack_double : creating %s, %d values",
a->name, n_vals);
/* Boustrophedonic ordering (See GRIB-472):
* Values on even rank lines (the initial line scanned having rank 1) are swapped
*/
for(irow=0; irow<numberOfRows; ++irow)
{
if (irow%2)
{
/* Reverse bitmap entries */
size_t k = 0;
size_t start = irow*numberOfColumns;
size_t end = start + numberOfColumns - 1;
size_t mid = (numberOfColumns - 1)/2;
for(k=0; k<mid; ++k)
{
/* Swap value at either end */
double temp = val[start+k];
val[start+k] = val[end-k];
val[end-k] = temp;
}
}
}
for(i=0;i < n_vals;i++)
{
if(val[i] == 0 ){
val[i] = missing_value;
}
else
{
val[i] = coded_vals[j++];
if(j>coded_n_vals)
{
grib_context_free(a->parent->h->context,coded_vals);
grib_context_log(a->parent->h->context, GRIB_LOG_ERROR,
"grib_accessor_class_data_apply_boustrophedonic_bitmap [%s]:"
" unpack_double : number of coded values does not match bitmap %ld %ld",
a->name,coded_n_vals,n_vals);
return GRIB_ARRAY_TOO_SMALL;
}
}
}
*len = n_vals;
grib_context_free(a->parent->h->context,coded_vals);
return err;
}
static int unpack_double_element(grib_accessor* a, size_t idx,double* val)
{
grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a;
int err = 0,i=0;
size_t cidx=0;
double missing_value = 0;
double* bvals=NULL;
size_t n_vals = 0;
long nn=0;
err=grib_value_count(a,&nn);
n_vals=nn;
if (err) return err;
if(!grib_find_accessor(a->parent->h,self->bitmap))
return grib_get_double_element_internal(a->parent->h,self->coded_values,idx,val);
if((err = grib_get_double_internal(a->parent->h,self->missing_value,&missing_value)) != GRIB_SUCCESS)
return err;
if((err = grib_get_double_element_internal(a->parent->h,self->bitmap,idx,val)) != GRIB_SUCCESS)
return err;
if (*val == 0) {*val=missing_value;return GRIB_SUCCESS;}
bvals = grib_context_malloc(a->parent->h->context,n_vals*sizeof(double));
if(bvals == NULL) return GRIB_OUT_OF_MEMORY;
if((err = grib_get_double_array_internal(a->parent->h,self->bitmap,bvals,&n_vals)) != GRIB_SUCCESS)
return err;
cidx=0;
for (i=0;i<idx;i++) {cidx+=bvals[i];}
grib_context_free(a->parent->h->context,bvals);
return grib_get_double_element_internal(a->parent->h,self->coded_values,cidx,val);
}
static int pack_double(grib_accessor* a, const double* val, size_t *len)
{
grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a;
int err = 0;
size_t bmaplen = *len;
size_t irow = 0;
long coded_n_vals = 0;
double* coded_vals = NULL;
double *values=0;
long i = 0;
long j = 0;
long numberOfPoints, numberOfRows, numberOfColumns;
double missing_value = 0;
if (*len ==0) return GRIB_NO_VALUES;
if(!grib_find_accessor(a->parent->h,self->bitmap)){
err = grib_set_double_array_internal(a->parent->h,self->coded_values,val,*len);
/*printf("SETTING TOTAL number_of_data_points %s %ld\n",self->number_of_data_points,*len);*/
/*if(self->number_of_data_points)
grib_set_long_internal(a->parent->h,self->number_of_data_points,*len);*/
return err;
}
if((err = grib_get_double_internal(a->parent->h,self->missing_value,&missing_value)) != GRIB_SUCCESS)
return err;
err=grib_get_long_internal(a->parent->h,self->numberOfRows, &numberOfRows);
if (err) return err;
err=grib_get_long_internal(a->parent->h,self->numberOfColumns, &numberOfColumns);
if (err) return err;
err=grib_get_long_internal(a->parent->h,self->numberOfPoints,&numberOfPoints);
if (err) return err;
Assert(numberOfPoints == bmaplen);
/* Create a copy of the incoming 'val' array because we're going to change it */
values = grib_context_malloc_clear(a->parent->h->context, sizeof(double)*numberOfPoints);
if (!values) return GRIB_OUT_OF_MEMORY;
for(i=0; i<numberOfPoints; ++i) {
values[i] = val[i];
}
/* Boustrophedonic ordering must be applied to the bitmap (See GRIB-472) */
for(irow=0; irow<numberOfRows; ++irow)
{
if (irow%2)
{
size_t k = 0;
size_t start = irow*numberOfColumns;
size_t end = start + numberOfColumns - 1;
size_t mid = (numberOfColumns - 1)/2;
for(k=0; k<mid; ++k)
{
double temp = values[start+k];
values[start+k] = values[end-k];
values[end-k] = temp;
}
}
}
/* Now set the bitmap based on the array with the boustrophedonic ordering */
if((err = grib_set_double_array_internal(a->parent->h,self->bitmap,values,bmaplen)) != GRIB_SUCCESS)
return err;
grib_context_free(a->parent->h->context,values);
coded_n_vals = *len;
if(coded_n_vals < 1){
err = grib_set_double_array_internal(a->parent->h,self->coded_values,NULL,0);
return err;
}
coded_vals = grib_context_malloc_clear(a->parent->h->context,coded_n_vals*sizeof(double));
if(!coded_vals) return GRIB_OUT_OF_MEMORY;
for(i=0; i<*len ; i++)
{
/* To set the coded values, look at 'val' (the original array) */
/* NOT 'values' (bitmap) which we swapped about */
if(val[i] != missing_value) {
coded_vals[j++] = val[i];
}
}
err = grib_set_double_array_internal(a->parent->h,self->coded_values,coded_vals,j);
if (j==0) {
/*if (self->number_of_values)
err=grib_set_long_internal(a->parent->h,self->number_of_values,0);*/
if (self->binary_scale_factor)
err=grib_set_long_internal(a->parent->h,self->binary_scale_factor,0);
}
grib_context_free(a->parent->h->context,coded_vals);
return err;
}
static int get_native_type(grib_accessor* a)
{
/* grib_accessor_data_apply_boustrophedonic_bitmap* self = (grib_accessor_data_apply_boustrophedonic_bitmap*)a;
return grib_accessor_get_native_type(grib_find_accessor(a->parent->h,self->coded_values));*/
return GRIB_TYPE_DOUBLE;
}

View File

@ -19,6 +19,7 @@
IMPLEMENTS = init
IMPLEMENTS = pack_double
IMPLEMENTS = unpack_double
IMPLEMENTS = unpack_double_element
IMPLEMENTS = value_count
IMPLEMENTS = destroy
MEMBERS=const char* half_byte
@ -67,6 +68,7 @@ static int value_count(grib_accessor*,long*);
static void destroy(grib_context*,grib_accessor*);
static void init(grib_accessor*,const long, grib_arguments* );
static void init_class(grib_accessor_class*);
static int unpack_double_element(grib_accessor*,size_t i, double* val);
typedef struct grib_accessor_data_g1second_order_general_extended_packing {
grib_accessor att;
@ -151,7 +153,7 @@ static grib_accessor_class _grib_accessor_class_data_g1second_order_general_exte
0, /* nearest_smaller_value */
0, /* next accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value */
&unpack_double_element, /* unpack only ith value */
0, /* unpack a subarray */
0, /* clear */
};
@ -185,7 +187,6 @@ static void init_class(grib_accessor_class* c)
c->nearest_smaller_value = (*(c->super))->nearest_smaller_value;
c->next = (*(c->super))->next;
c->compare = (*(c->super))->compare;
c->unpack_double_element = (*(c->super))->unpack_double_element;
c->unpack_double_subarray = (*(c->super))->unpack_double_subarray;
c->clear = (*(c->super))->clear;
}
@ -204,10 +205,15 @@ static unsigned long nbits[32]={
0x40000000, 0x80000000
};
GRIB_INLINE static long number_of_bits(unsigned long x) {
static long number_of_bits(unsigned long x) {
unsigned long *n=nbits;
const int count = sizeof(nbits)/sizeof(nbits[0]);
long i=0;
while (x>=*n) {n++;i++;}
while (x>=*n) {
n++;
i++;
Assert(i<count);
}
return i;
}
@ -278,6 +284,24 @@ static int value_count(grib_accessor* a,long* count)
return err;
}
static int unpack_double_element(grib_accessor* a, size_t idx, double* val)
{
size_t size;
double* values;
int err=0;
err=grib_get_size(a->parent->h,"values",&size);
if (err) return err;
if (idx > size) return GRIB_INVALID_NEAREST;
values=grib_context_malloc_clear(a->parent->h->context,size*sizeof(double));
err=grib_get_double_array(a->parent->h,"values",values,&size);
if (err) return err;
*val=values[idx];
grib_context_free(a->parent->h->context,values);
return err;
}
static int unpack_double(grib_accessor* a, double* values, size_t *len)
{
grib_accessor_data_g1second_order_general_extended_packing* self = (grib_accessor_data_g1second_order_general_extended_packing*)a;

View File

@ -167,7 +167,6 @@ static void init(grib_accessor* a,const long v, grib_arguments* args)
self->decimal_scale_factor = grib_arguments_get_name(a->parent->h,args,self->carg++);
a->flags |= GRIB_ACCESSOR_FLAG_DATA;
self->dirty=1;
}
static unsigned long nbits[32]={
@ -179,14 +178,22 @@ static unsigned long nbits[32]={
0x40000000, 0x80000000
};
GRIB_INLINE static long number_of_bits(unsigned long x) {
static int number_of_bits(unsigned long x, long* result)
{
int err = 0;
const int count = sizeof(nbits)/sizeof(nbits[0]);
unsigned long *n=nbits;
long i=0;
while (x>=*n) {n++;i++;}
return i;
*result=0;
while (x >= *n) {
n++;
(*result)++;
if (*result >= count) {
return GRIB_ENCODING_ERROR;
}
}
return GRIB_SUCCESS;
}
static int value_count(grib_accessor* a,long* number_of_values)
{
grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a;
@ -195,7 +202,7 @@ static int value_count(grib_accessor* a,long* number_of_values)
return grib_get_long_internal(a->parent->h,self->number_of_values,number_of_values);
}
static int unpack_double_element(grib_accessor* a, size_t idx, double* val)
static int unpack_double_element(grib_accessor* a, size_t idx, double* val)
{
grib_accessor_data_simple_packing* self = (grib_accessor_data_simple_packing*)a;
@ -281,7 +288,6 @@ static int unpack_double_element(grib_accessor* a, size_t idx, double* val)
lvalue |= buf[o++] ;
}
*val = (double) (((lvalue*s)+reference_value)*d);
}
return err;
@ -303,7 +309,6 @@ static int _unpack_double(grib_accessor* a, double* val, size_t *len,unsigned c
double units_factor=1.0;
double units_bias=0.0;
if(*len < n_vals)
{
*len = (long) n_vals;
@ -571,7 +576,14 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len)
max*=decimal;
/* bits_per_value=(long)ceil(log((double)(imax-imin+1))/log(2.0)); */
bits_per_value=number_of_bits((unsigned long)fabs(max-min));
/* See GRIB-540 for why we use ceil */
err = number_of_bits( (unsigned long)ceil(fabs(max-min)), &bits_per_value );
if (err) {
grib_context_log(a->parent->h->context,GRIB_LOG_ERROR,
"Range of values too large. Try a smaller value for decimal precision (less than %d)",
decimal_scale_factor);
return err;
}
/*printf("bits_per_value=%ld\n",bits_per_value);*/
if((err = grib_set_long_internal(a->parent->h,self->bits_per_value, bits_per_value)) !=
GRIB_SUCCESS)
@ -649,6 +661,5 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len)
!= GRIB_SUCCESS)
return err;
return GRIB_SUCCESS;
}

View File

@ -268,7 +268,7 @@ int grib_g1_step_get_steps(grib_accessor* a,long* start,long* theEnd)
if (u2s1[unit] == u2s[step_unit] || (*start==0 && *theEnd==0) ) return 0;
newstart = (*start) * u2s1[unit];
newend = (*theEnd) * u2s1[unit];
newend = (*theEnd) * u2s1[unit];
if (newstart<0 || newend<0) {
factor=60;
@ -286,7 +286,7 @@ int grib_g1_step_get_steps(grib_accessor* a,long* start,long* theEnd)
return GRIB_DECODING_ERROR;
} else {
*start = newstart/u2sf_step_unit;
*theEnd = newend/u2sf_step_unit;
*theEnd = newend/u2sf_step_unit;
}
return 0;
@ -348,10 +348,10 @@ static int unpack_string(grib_accessor* a, char* val, size_t *len)
}
else if(
(strcmp(stepType,"accum") == 0) ||
(strcmp(stepType,"avg") == 0) ||
(strcmp(stepType,"min") == 0) ||
(strcmp(stepType,"max") == 0) ||
(strcmp(stepType,"rms") == 0) ||
(strcmp(stepType,"avg") == 0) ||
(strcmp(stepType,"min") == 0) ||
(strcmp(stepType,"max") == 0) ||
(strcmp(stepType,"rms") == 0) ||
(strcmp(stepType,"diff") == 0) ||
(strcmp(stepType,"avgas") == 0) ||
(strcmp(stepType,"avgad") == 0) ||

View File

@ -181,8 +181,8 @@ static int unpack_long(grib_accessor* a, long* val, size_t *len)
if((ret = grib_get_long_internal(a->parent->h, self->subdivision,&subdivision)) != GRIB_SUCCESS)
return ret;
if ((basic_angle!=0 && basic_angle!=GRIB_MISSING_LONG) ||
( subdivision !=0 && subdivision == GRIB_MISSING_LONG)) {
if ( (basic_angle !=0 && basic_angle != GRIB_MISSING_LONG) ||
( subdivision !=0 && subdivision != GRIB_MISSING_LONG) ) {
*val=0;
return ret;
}

View File

@ -135,93 +135,98 @@ static void init_class(grib_accessor_class* c)
/* END_CLASS_IMP */
static unsigned long nbits[32]={
0x1, 0x2, 0x4, 0x8, 0x10, 0x20,
0x40, 0x80, 0x100, 0x200, 0x400, 0x800,
0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000,
0x40000, 0x80000, 0x100000, 0x200000, 0x400000, 0x800000,
0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000, 0x20000000,
0x40000000, 0x80000000
0x1, 0x2, 0x4, 0x8, 0x10, 0x20,
0x40, 0x80, 0x100, 0x200, 0x400, 0x800,
0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000,
0x40000, 0x80000, 0x100000, 0x200000, 0x400000, 0x800000,
0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000, 0x20000000,
0x40000000, 0x80000000
};
GRIB_INLINE static long number_of_bits(unsigned long x) {
static long number_of_bits(unsigned long x) {
unsigned long *n=nbits;
const int count = sizeof(nbits)/sizeof(nbits[0]);
long i=0;
while (x>=*n) {n++;i++;}
while (x>=*n) {
n++;
i++;
Assert(i<count);
}
return i;
}
static void init(grib_accessor* a,const long l, grib_arguments* c)
{
int n=0;
grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a;
self->values = grib_arguments_get_name(a->parent->h,c,n++);
self->binaryScaleFactor = grib_arguments_get_name(a->parent->h,c,n++);
self->decimalScaleFactor = grib_arguments_get_name(a->parent->h,c,n++);
self->bitsPerValue=0;
a->length=0;
int n=0;
grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a;
self->values = grib_arguments_get_name(a->parent->h,c,n++);
self->binaryScaleFactor = grib_arguments_get_name(a->parent->h,c,n++);
self->decimalScaleFactor = grib_arguments_get_name(a->parent->h,c,n++);
self->bitsPerValue=0;
a->length=0;
}
static int pack_long(grib_accessor* a, const long* val,size_t *len)
{
grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a;
self->bitsPerValue=(long)*val;
*len=1;
grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a;
self->bitsPerValue=(long)*val;
*len=1;
return 0;
return 0;
}
static int unpack_long(grib_accessor* a, long* val, size_t *len)
{
int ret=GRIB_SUCCESS;
size_t size=0;
size_t i;
double max,min,d,b;
double *values=0;
long binaryScaleFactor,decimalScaleFactor;
int ret=GRIB_SUCCESS;
size_t size=0;
size_t i;
double max,min,d,b;
double *values=0;
long binaryScaleFactor,decimalScaleFactor;
grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a;
if (self->bitsPerValue) {
*val=self->bitsPerValue;
return GRIB_SUCCESS;
}
grib_accessor_second_order_bits_per_value* self = (grib_accessor_second_order_bits_per_value*)a;
if (self->bitsPerValue) {
*val=self->bitsPerValue;
return GRIB_SUCCESS;
}
if((ret = grib_get_size(a->parent->h, self->values,&size)) != GRIB_SUCCESS) {
*val=self->bitsPerValue;
return GRIB_SUCCESS;
}
if((ret = grib_get_size(a->parent->h, self->values,&size)) != GRIB_SUCCESS) {
*val=self->bitsPerValue;
return GRIB_SUCCESS;
}
if((ret = grib_get_long(a->parent->h, self->binaryScaleFactor,&binaryScaleFactor)) != GRIB_SUCCESS)
return ret;
if((ret = grib_get_long_internal(a->parent->h, self->decimalScaleFactor,&decimalScaleFactor)) != GRIB_SUCCESS)
return ret;
values=grib_context_malloc_clear(a->parent->h->context,sizeof(double)*size);
if (!values) {
grib_context_log(a->parent->h->context,GRIB_LOG_FATAL,"%s unable to allocate %ld bytes",
a->name,(long)size);
return GRIB_OUT_OF_MEMORY;
}
if((ret = grib_get_double_array_internal(a->parent->h, self->values,values,&size)) != GRIB_SUCCESS)
return ret;
max=values[0];
min=max;
for (i=1;i<size;i++) {
if (max<values[i]) max=values[i];
if (min>values[i]) min=values[i];
}
d=grib_power(decimalScaleFactor,10);
b=grib_power(-binaryScaleFactor,2);
/* self->bitsPerValue=(long)ceil(log((double)((max-min)*d+1))/log(2.0))-binaryScaleFactor; */
/* See GRIB-540 for why we use ceil */
self->bitsPerValue=number_of_bits( (unsigned long)ceil((fabs(max-min)*b*d)) );
*val=self->bitsPerValue;
grib_context_free(a->parent->h->context,values);
if((ret = grib_get_long(a->parent->h, self->binaryScaleFactor,&binaryScaleFactor)) != GRIB_SUCCESS)
return ret;
if((ret = grib_get_long_internal(a->parent->h, self->decimalScaleFactor,&decimalScaleFactor)) != GRIB_SUCCESS)
return ret;
values=grib_context_malloc_clear(a->parent->h->context,sizeof(double)*size);
if (!values) {
grib_context_log(a->parent->h->context,GRIB_LOG_FATAL,"%s unable to allocate %ld bytes",
a->name,(long)size);
return GRIB_OUT_OF_MEMORY;
}
if((ret = grib_get_double_array_internal(a->parent->h, self->values,values,&size)) != GRIB_SUCCESS)
return ret;
max=values[0];
min=max;
for (i=1;i<size;i++) {
if (max<values[i]) max=values[i];
if (min>values[i]) min=values[i];
}
d=grib_power(decimalScaleFactor,10);
b=grib_power(-binaryScaleFactor,2);
/* self->bitsPerValue=(long)ceil(log((double)((max-min)*d+1))/log(2.0))-binaryScaleFactor; */
self->bitsPerValue=number_of_bits((unsigned long)(fabs(max-min)*b*d));
*val=self->bitsPerValue;
grib_context_free(a->parent->h->context,values);
return ret;
}

View File

@ -265,18 +265,18 @@ static int compare(grib_accessor* a, grib_accessor* b)
double *aval=0;
double *bval=0;
size_t alen = 0;
size_t blen = 0;
int err=0;
long count=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(a,&count);
if (err) return err;
alen=count;
err=grib_value_count(b,&count);
if (err) return err;
blen=count;
err=grib_value_count(b,&count);
if (err) return err;
blen=count;
if (alen != blen) return GRIB_COUNT_MISMATCH;

View File

@ -25,6 +25,7 @@
{ "data_2order_packing_count", &grib_accessor_class_data_2order_packing_count, },
{ "data_apply_bitmap", &grib_accessor_class_data_apply_bitmap, },
{ "data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic, },
{ "data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap, },
{ "data_apply_gdsnotpresent", &grib_accessor_class_data_apply_gdsnotpresent, },
{ "data_complex_packing", &grib_accessor_class_data_complex_packing, },
{ "data_constant_field", &grib_accessor_class_data_constant_field, },

View File

@ -1196,6 +1196,8 @@ void grib_multi_support_off(grib_context* c);
* @param f : the file pointer
*/
void grib_multi_support_reset_file(grib_context* c, FILE* f);
char* grib_samples_path(const grib_context *c);
/*! @} */
/**
@ -1242,7 +1244,6 @@ grib_keys_iterator* grib_keys_iterator_new(grib_handle* h,unsigned long filter_f
int grib_keys_iterator_next(grib_keys_iterator *kiter);
/*! get the key name from the iterator
* @param kiter : valid grib_keys_iterator
* @return key name

View File

@ -271,7 +271,7 @@ typedef int (*accessor_clear_proc) (grib_accessor*);
typedef void (*accessor_init_class_proc) (grib_accessor_class*);
typedef int (*accessor_compare_proc) (grib_accessor*, grib_accessor*);
typedef size_t (*accessor_string_proc) (grib_accessor*);
typedef size_t (*accessor_string_proc) (grib_accessor*);
typedef int (*accessor_value_with_ret_proc) (grib_accessor*,long*);
typedef long (*accessor_value_proc) (grib_accessor*);
typedef void (*accessor_dump_proc) (grib_accessor*, grib_dumper*);

View File

@ -429,6 +429,7 @@ second_order_packed *grib_get_second_order_groups(grib_context *c, const unsigne
/* grib_accessor_class_data_apply_bitmap.c */
/* grib_accessor_class_data_apply_boustrophedonic.c */
/* grib_accessor_class_data_apply_boustrophedonic_bitmap.c */
/* grib_accessor_class_data_secondary_bitmap.c */

View File

@ -230,6 +230,9 @@ void grib_print_api_version(FILE* out)
GRIB_API_MAJOR_VERSION,
GRIB_API_MINOR_VERSION,
GRIB_API_REVISION_VERSION);
if (GRIB_API_MAJOR_VERSION < 1) {
printf(" PRE-RELEASE");
}
}
static grib_context default_grib_context = {
@ -581,6 +584,12 @@ char *grib_context_full_defs_path(grib_context* c,const char* basename)
return NULL;
}
char* grib_samples_path(const grib_context *c)
{
if (!c) c=grib_context_get_default();
return c->grib_samples_path;
}
void grib_context_free(const grib_context* c, void* p)
{
if (!c) c=grib_context_get_default();

View File

@ -35,7 +35,7 @@ void grib_check(const char* call,const char* file,int line,int e,const char* ms
}
}
void grib_fail(const char* expr,const char* file,int line) {
void grib_fail(const char* expr,const char* file,int line) {
fprintf(stderr,"%s at line %d: assertion failure Assert(%s)\n",file,line,expr);
abort();
}

File diff suppressed because it is too large Load Diff

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