mirror of https://github.com/ecmwf/eccodes.git
Merge branch 'develop' into bugfix/Tigge_S2S_Uerra__marsKeys
This commit is contained in:
commit
586002e473
|
@ -1,2 +1,3 @@
|
||||||
SET(ENABLE_EXTRA_TESTS ON CACHE BOOL "Enable extra tests")
|
SET(ENABLE_EXTRA_TESTS ON CACHE BOOL "Enable extra tests")
|
||||||
SET(ENABLE_ECCODES_THREADS ON CACHE BOOL "Enable POSIX threads")
|
SET(ENABLE_ECCODES_THREADS ON CACHE BOOL "Enable POSIX threads")
|
||||||
|
SET(ENABLE_MEMFS ON CACHE BOOL "Enable MEMFS")
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# All python tests fail due to error loading the SWIG generated extension module
|
# All python tests fail due to error loading the SWIG generated extension module
|
||||||
SET( ENABLE_PYTHON OFF CACHE BOOL "Disable Python")
|
SET( ENABLE_PYTHON2 OFF CACHE BOOL "Disable Python")
|
||||||
|
|
|
@ -5,3 +5,5 @@
|
||||||
|
|
||||||
# All python tests fails due to error loading the shared python lib: undefined symbol: __tsan_init
|
# All python tests fails due to error loading the shared python lib: undefined symbol: __tsan_init
|
||||||
#SET( ENABLE_PYTHON OFF CACHE BOOL "Disable Python")
|
#SET( ENABLE_PYTHON OFF CACHE BOOL "Disable Python")
|
||||||
|
|
||||||
|
SET(ENABLE_MEMFS ON CACHE BOOL "Enable MEMFS")
|
||||||
|
|
12
data/ls.log
12
data/ls.log
|
@ -75,17 +75,17 @@ index=1290
|
||||||
index=1171
|
index=1171
|
||||||
index=1170
|
index=1170
|
||||||
reduced_gaussian_sub_area.grib1
|
reduced_gaussian_sub_area.grib1
|
||||||
#3
|
#1
|
||||||
index=19985
|
|
||||||
index=19984
|
|
||||||
index=19665
|
index=19665
|
||||||
|
index=19985
|
||||||
index=19664
|
index=19664
|
||||||
|
index=19984
|
||||||
reduced_gaussian_sub_area.grib2
|
reduced_gaussian_sub_area.grib2
|
||||||
#3
|
#1
|
||||||
index=19985
|
|
||||||
index=19984
|
|
||||||
index=19665
|
index=19665
|
||||||
|
index=19985
|
||||||
index=19664
|
index=19664
|
||||||
|
index=19984
|
||||||
reduced_gaussian_surface.grib1
|
reduced_gaussian_surface.grib1
|
||||||
#4
|
#4
|
||||||
index=1291
|
index=1291
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Usage:
|
# Usage:
|
||||||
# create_legacy_def.sh $paramId
|
# create_legacy_def.sh $paramId $paramId...
|
||||||
#
|
#
|
||||||
# This script will insert the local ECMWF GRIB2 representation
|
# This script will insert the local ECMWF GRIB2 representation
|
||||||
# for that paramId into the files:
|
# for each paramId into the files:
|
||||||
# definitions/grib2/localConcepts/ecmf/paramId.legacy.def
|
# definitions/grib2/localConcepts/ecmf/paramId.legacy.def
|
||||||
# definitions/grib2/localConcepts/ecmf/shortName.legacy.def
|
# definitions/grib2/localConcepts/ecmf/shortName.legacy.def
|
||||||
# etc
|
# etc
|
||||||
|
@ -22,7 +22,13 @@ set -eu
|
||||||
# The parameterNumber = $paramId - parameterCategory*1000
|
# The parameterNumber = $paramId - parameterCategory*1000
|
||||||
#
|
#
|
||||||
|
|
||||||
pid=$1
|
if [ $# -eq 0 ]; then
|
||||||
|
echo "Usage: $0 pid1 pid2 ..." 2>&1
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Input list of paramId values
|
||||||
|
pids="$@"
|
||||||
|
|
||||||
sample2=samples/GRIB2.tmpl
|
sample2=samples/GRIB2.tmpl
|
||||||
temp=$TMPDIR/temp.create_legacy_def.grib
|
temp=$TMPDIR/temp.create_legacy_def.grib
|
||||||
|
@ -49,23 +55,38 @@ output_def()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
grib_set -s paramId=$pid $sample2 $temp
|
count=0
|
||||||
name=$(grib_get -p name $temp)
|
for pid in $pids; do
|
||||||
shortName=$(grib_get -p shortName $temp)
|
echo "Doing $pid..."
|
||||||
units=$(grib_get -p units $temp)
|
set +e
|
||||||
cfName=$(grib_get -p cfName $temp)
|
grib_set -s paramId=$pid $sample2 $temp 2>/dev/null
|
||||||
cfVarName=$(grib_get -p cfVarName $temp)
|
status=$?
|
||||||
|
set -e
|
||||||
|
if [ $status -ne 0 ]; then
|
||||||
|
grib_set -s stepType=accum,paramId=$pid $sample2 $temp
|
||||||
|
fi
|
||||||
|
name=$(grib_get -p name $temp)
|
||||||
|
shortName=$(grib_get -p shortName $temp)
|
||||||
|
units=$(grib_get -p units $temp)
|
||||||
|
cfName=$(grib_get -p cfName $temp)
|
||||||
|
cfVarName=$(grib_get -p cfVarName $temp)
|
||||||
|
count=$((count+1))
|
||||||
|
|
||||||
dis=192
|
dis=192
|
||||||
cat=$((pid/1000))
|
cat=$((pid/1000))
|
||||||
num=$((pid - cat*1000))
|
num=$((pid - cat*1000))
|
||||||
|
|
||||||
output_def "$name" "$pid" $dis $cat $num >> $defs/paramId.legacy.def
|
output_def "$name" "$pid" $dis $cat $num >> $defs/paramId.legacy.def
|
||||||
output_def "$name" "$name" $dis $cat $num >> $defs/name.legacy.def
|
output_def "$name" "$name" $dis $cat $num >> $defs/name.legacy.def
|
||||||
output_def "$name" "$shortName" $dis $cat $num >> $defs/shortName.legacy.def
|
output_def "$name" "$shortName" $dis $cat $num >> $defs/shortName.legacy.def
|
||||||
output_def "$name" "$units" $dis $cat $num >> $defs/units.legacy.def
|
output_def "$name" "$units" $dis $cat $num >> $defs/units.legacy.def
|
||||||
output_def "$name" "$cfVarName" $dis $cat $num >> $defs/cfVarName.legacy.def
|
output_def "$name" "$cfVarName" $dis $cat $num >> $defs/cfVarName.legacy.def
|
||||||
output_def "$name" "$cfName" $dis $cat $num >> $defs/cfName.legacy.def
|
output_def "$name" "$cfName" $dis $cat $num >> $defs/cfName.legacy.def
|
||||||
|
|
||||||
echo "Files updated. Check directory $defs"
|
done
|
||||||
|
|
||||||
|
echo "Number of legacy parameters added: $count"
|
||||||
|
if [ $count -gt 0 ]; then
|
||||||
|
echo "Files updated. Check directory $defs"
|
||||||
|
fi
|
||||||
rm -f $temp
|
rm -f $temp
|
||||||
|
|
|
@ -93,6 +93,8 @@ concept stepType {
|
||||||
"ratio" = {selectStepTemplateInterval=1; stepTypeInternal="ratio";}
|
"ratio" = {selectStepTemplateInterval=1; stepTypeInternal="ratio";}
|
||||||
"stdanom" = {selectStepTemplateInterval=1; stepTypeInternal="stdanom";}
|
"stdanom" = {selectStepTemplateInterval=1; stepTypeInternal="stdanom";}
|
||||||
"sum" = {selectStepTemplateInterval=1; stepTypeInternal="sum";}
|
"sum" = {selectStepTemplateInterval=1; stepTypeInternal="sum";}
|
||||||
|
"severity" = {selectStepTemplateInterval=1; stepTypeInternal="severity";}
|
||||||
|
"mode" = {selectStepTemplateInterval=1; stepTypeInternal="mode";}
|
||||||
}
|
}
|
||||||
|
|
||||||
# 0=atmospheric chemical constituents
|
# 0=atmospheric chemical constituents
|
||||||
|
|
|
@ -68,6 +68,8 @@ if (numberOfTimeRange == 1 || numberOfTimeRange == 2) {
|
||||||
"ratio" = {typeOfStatisticalProcessing=9;}
|
"ratio" = {typeOfStatisticalProcessing=9;}
|
||||||
"stdanom" = {typeOfStatisticalProcessing=10;}
|
"stdanom" = {typeOfStatisticalProcessing=10;}
|
||||||
"sum" = {typeOfStatisticalProcessing=11;}
|
"sum" = {typeOfStatisticalProcessing=11;}
|
||||||
|
"severity" = {typeOfStatisticalProcessing=100;}
|
||||||
|
"mode" = {typeOfStatisticalProcessing=101;}
|
||||||
}
|
}
|
||||||
meta startStep step_in_units(forecastTime,indicatorOfUnitOfTimeRange,stepUnits,
|
meta startStep step_in_units(forecastTime,indicatorOfUnitOfTimeRange,stepUnits,
|
||||||
indicatorOfUnitForTimeRange,lengthOfTimeRange) : no_copy;
|
indicatorOfUnitForTimeRange,lengthOfTimeRange) : no_copy;
|
||||||
|
|
2
memfs.py
2
memfs.py
|
@ -66,7 +66,7 @@ print("MEMFS: Starting")
|
||||||
|
|
||||||
# Exclude experimental features e.g. GRIB3 and TAF
|
# Exclude experimental features e.g. GRIB3 and TAF
|
||||||
# The BUFR codetables is not used in the engine
|
# The BUFR codetables is not used in the engine
|
||||||
EXCLUDED = ["grib3", "codetables", "taf", "stations", "grib1_mlgrib2_ieee32"]
|
EXCLUDED = ["grib3", "codetables", "taf", "metar", "stations", "grib1_mlgrib2_ieee32"]
|
||||||
|
|
||||||
EXCLUDE = {
|
EXCLUDE = {
|
||||||
None: [],
|
None: [],
|
||||||
|
|
|
@ -224,7 +224,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
|
||||||
size_t n_vals = 0;
|
size_t n_vals = 0;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
unsigned char* decoded = NULL;
|
unsigned char* decoded = NULL;
|
||||||
unsigned char* p = NULL;
|
/*unsigned char* p = NULL;*/
|
||||||
long pos = 0;
|
long pos = 0;
|
||||||
long nn = 0;
|
long nn = 0;
|
||||||
|
|
||||||
|
@ -310,11 +310,14 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
|
||||||
|
|
||||||
/* printf("bscale=%g dscale=%g reference_value=%g\n",bscale,dscale,reference_value); */
|
/* printf("bscale=%g dscale=%g reference_value=%g\n",bscale,dscale,reference_value); */
|
||||||
pos = 0;
|
pos = 0;
|
||||||
p = decoded;
|
#if 0
|
||||||
|
p = decoded;
|
||||||
for (i = 0; i < n_vals; i++) {
|
for (i = 0; i < n_vals; i++) {
|
||||||
val[i] = (double)(((grib_decode_unsigned_long(p, &pos, bits8) * bscale) + reference_value) * dscale);
|
val[i] = (double)(((grib_decode_unsigned_long(p, &pos, bits8) * bscale) + reference_value) * dscale);
|
||||||
}
|
}
|
||||||
/*-------------------------------------------*/
|
#endif
|
||||||
|
/* ECC-1427: Performance improvement */
|
||||||
|
grib_decode_double_array(decoded, &pos, bits8 , reference_value, bscale, dscale, n_vals, val);
|
||||||
*len = n_vals;
|
*len = n_vals;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
|
@ -342,10 +342,7 @@ int grib_nearest_find_generic(
|
||||||
double lat1 = 0, lat2 = 0; /* inlat will be between these */
|
double lat1 = 0, lat2 = 0; /* inlat will be between these */
|
||||||
const double LAT_DELTA = 10.0; /* in degrees */
|
const double LAT_DELTA = 10.0; /* in degrees */
|
||||||
|
|
||||||
if (grib_is_missing(h, Ni_keyname, &ret)) {
|
/* Note: If this is being called for a REDUCED grid, its Ni will be missing */
|
||||||
grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", Ni_keyname);
|
|
||||||
return ret ? ret : GRIB_GEOCALCULUS_PROBLEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (grib_is_missing(h, Nj_keyname, &ret)) {
|
if (grib_is_missing(h, Nj_keyname, &ret)) {
|
||||||
grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", Nj_keyname);
|
grib_context_log(h->context, GRIB_LOG_DEBUG, "Key '%s' is missing", Nj_keyname);
|
||||||
|
|
|
@ -130,17 +130,60 @@ static int init(grib_nearest* nearest, grib_handle* h, grib_arguments* args)
|
||||||
|
|
||||||
typedef void (*get_reduced_row_proc)(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last);
|
typedef void (*get_reduced_row_proc)(long pl, double lon_first, double lon_last, long* npoints, long* ilon_first, long* ilon_last);
|
||||||
|
|
||||||
|
static int find_global(grib_nearest* nearest, grib_handle* h,
|
||||||
|
double inlat, double inlon, unsigned long flags,
|
||||||
|
double* outlats, double* outlons, double* values,
|
||||||
|
double* distances, int* indexes, size_t* len);
|
||||||
|
|
||||||
static int is_legacy(grib_handle* h)
|
static int is_legacy(grib_handle* h)
|
||||||
{
|
{
|
||||||
long is_legacy = 0;
|
long is_legacy = 0;
|
||||||
return (grib_get_long(h, "legacyGaussSubarea", &is_legacy) == GRIB_SUCCESS && is_legacy == 1);
|
return (grib_get_long(h, "legacyGaussSubarea", &is_legacy) == GRIB_SUCCESS && is_legacy == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Old implementation in src/deprecated/grib_nearest_class_reduced.old */
|
|
||||||
static int find(grib_nearest* nearest, grib_handle* h,
|
static int find(grib_nearest* nearest, grib_handle* h,
|
||||||
double inlat, double inlon, unsigned long flags,
|
double inlat, double inlon, unsigned long flags,
|
||||||
double* outlats, double* outlons, double* values,
|
double* outlats, double* outlons, double* values,
|
||||||
double* distances, int* indexes, size_t* len)
|
double* distances, int* indexes, size_t* len)
|
||||||
|
{
|
||||||
|
int err = 0;
|
||||||
|
grib_nearest_reduced* self = (grib_nearest_reduced*)nearest;
|
||||||
|
|
||||||
|
if (self->global) {
|
||||||
|
err = find_global(nearest, h,
|
||||||
|
inlat, inlon, flags,
|
||||||
|
outlats, outlons, values,
|
||||||
|
distances, indexes, len);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* ECC-762, ECC-1432: Use brute force generic algorithm
|
||||||
|
* for reduced grid subareas. Review in the future
|
||||||
|
*/
|
||||||
|
int lons_count = 0; /*dummy*/
|
||||||
|
|
||||||
|
err = grib_nearest_find_generic(
|
||||||
|
nearest, h, inlat, inlon, flags,
|
||||||
|
self->values_key,
|
||||||
|
"Ni",
|
||||||
|
self->Nj,
|
||||||
|
&(self->lats),
|
||||||
|
&(self->lats_count),
|
||||||
|
&(self->lons),
|
||||||
|
&(lons_count),
|
||||||
|
&(self->distances),
|
||||||
|
outlats, outlons,
|
||||||
|
values, distances, indexes, len);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Old implementation in src/deprecated/grib_nearest_class_reduced.old */
|
||||||
|
static int find_global(grib_nearest* nearest, grib_handle* h,
|
||||||
|
double inlat, double inlon, unsigned long flags,
|
||||||
|
double* outlats, double* outlons, double* values,
|
||||||
|
double* distances, int* indexes, size_t* len)
|
||||||
{
|
{
|
||||||
grib_nearest_reduced* self = (grib_nearest_reduced*)nearest;
|
grib_nearest_reduced* self = (grib_nearest_reduced*)nearest;
|
||||||
int ret = 0, kk = 0, ii = 0, jj = 0;
|
int ret = 0, kk = 0, ii = 0, jj = 0;
|
||||||
|
|
|
@ -1477,8 +1477,17 @@ grib_handle* grib_util_set_spec2(grib_handle* h,
|
||||||
switch (packing_spec->accuracy) {
|
switch (packing_spec->accuracy) {
|
||||||
case GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT: {
|
case GRIB_UTIL_ACCURACY_SAME_BITS_PER_VALUES_AS_INPUT: {
|
||||||
long bitsPerValue = 0;
|
long bitsPerValue = 0;
|
||||||
Assert(grib_get_long(h, "bitsPerValue", &bitsPerValue) == 0);
|
if ((packing_spec->packing_type == GRIB_UTIL_PACKING_TYPE_GRID_SIMPLE ||
|
||||||
SET_LONG_VALUE("bitsPerValue", bitsPerValue);
|
packing_spec->packing_type == GRIB_UTIL_PACKING_TYPE_CCSDS) &&
|
||||||
|
strcmp(input_packing_type, "grid_ieee")==0)
|
||||||
|
{
|
||||||
|
SET_LONG_VALUE("bitsPerValue", 32);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Assert(grib_get_long(h, "bitsPerValue", &bitsPerValue) == 0);
|
||||||
|
SET_LONG_VALUE("bitsPerValue", bitsPerValue);
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES:
|
case GRIB_UTIL_ACCURACY_USE_PROVIDED_BITS_PER_VALUES:
|
||||||
|
|
|
@ -62,7 +62,8 @@ endforeach()
|
||||||
if( HAVE_BUILD_TOOLS )
|
if( HAVE_BUILD_TOOLS )
|
||||||
|
|
||||||
# These tests do not require any data downloads
|
# These tests do not require any data downloads
|
||||||
list(APPEND tests_no_data_reqd
|
# and are generally quick
|
||||||
|
list(APPEND tests_basic
|
||||||
unit_tests
|
unit_tests
|
||||||
julian
|
julian
|
||||||
grib_dump_samples
|
grib_dump_samples
|
||||||
|
@ -112,12 +113,9 @@ if( HAVE_BUILD_TOOLS )
|
||||||
bufr_ecc-359
|
bufr_ecc-359
|
||||||
bufr_ecc-517
|
bufr_ecc-517
|
||||||
bufr_rdbSubTypes
|
bufr_rdbSubTypes
|
||||||
bufr_templates
|
|
||||||
grib_efas
|
grib_efas
|
||||||
grib_sh_imag
|
grib_sh_imag
|
||||||
grib_sh_spectral_complex
|
grib_sh_spectral_complex
|
||||||
pseudo_diag
|
|
||||||
wrap
|
|
||||||
grib_levtype
|
grib_levtype
|
||||||
grib_typeOfLevel
|
grib_typeOfLevel
|
||||||
grib_grid_unstructured
|
grib_grid_unstructured
|
||||||
|
@ -127,14 +125,16 @@ if( HAVE_BUILD_TOOLS )
|
||||||
grib_g1day_of_the_year_date
|
grib_g1day_of_the_year_date
|
||||||
grib_g1fcperiod)
|
grib_g1fcperiod)
|
||||||
|
|
||||||
# These tests do require data downloads
|
# These tests require data downloads
|
||||||
list(APPEND tests_data_reqd
|
# and/or take much longer
|
||||||
|
list(APPEND tests_extra
|
||||||
grib_data_quality_checks
|
grib_data_quality_checks
|
||||||
grib_bpv_limit
|
grib_bpv_limit
|
||||||
grib_complex
|
grib_complex
|
||||||
grib_double_cmp
|
grib_double_cmp
|
||||||
grib_change_packing
|
grib_change_packing
|
||||||
grib_grid_space_view
|
grib_grid_space_view
|
||||||
|
bufr_templates
|
||||||
bufr_dump_data
|
bufr_dump_data
|
||||||
bufr_dump_descriptors
|
bufr_dump_descriptors
|
||||||
bufr_dump_subset
|
bufr_dump_subset
|
||||||
|
@ -201,6 +201,8 @@ if( HAVE_BUILD_TOOLS )
|
||||||
gts_ls
|
gts_ls
|
||||||
gts_count
|
gts_count
|
||||||
gts_compare
|
gts_compare
|
||||||
|
wrap
|
||||||
|
pseudo_diag
|
||||||
metar_ls
|
metar_ls
|
||||||
metar_get
|
metar_get
|
||||||
metar_dump
|
metar_dump
|
||||||
|
@ -265,21 +267,21 @@ if( HAVE_BUILD_TOOLS )
|
||||||
grib_mars_keys)
|
grib_mars_keys)
|
||||||
|
|
||||||
if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS )
|
if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS )
|
||||||
list(APPEND tests_data_reqd bufr_dump_encode_fortran)
|
list(APPEND tests_extra bufr_dump_encode_fortran)
|
||||||
list(APPEND tests_data_reqd bufr_dump_decode_fortran)
|
list(APPEND tests_extra bufr_dump_decode_fortran)
|
||||||
endif()
|
endif()
|
||||||
if( ENABLE_EXTRA_TESTS )
|
if( ENABLE_EXTRA_TESTS )
|
||||||
list(APPEND tests_data_reqd grib_util_set_spec)
|
list(APPEND tests_extra grib_util_set_spec)
|
||||||
list(APPEND tests_data_reqd grib_padding)
|
list(APPEND tests_extra grib_padding)
|
||||||
list(APPEND tests_data_reqd grib_tigge_conversions1)
|
list(APPEND tests_extra grib_tigge_conversions1)
|
||||||
list(APPEND tests_data_reqd grib_tigge_conversions2)
|
list(APPEND tests_extra grib_tigge_conversions2)
|
||||||
list(APPEND tests_data_reqd bufr_dump_encode_C)
|
list(APPEND tests_extra bufr_dump_encode_C)
|
||||||
list(APPEND tests_data_reqd bufr_dump_decode_C)
|
list(APPEND tests_extra bufr_dump_decode_C)
|
||||||
list(APPEND tests_no_data_reqd list_codetable_flagtable_keys)
|
list(APPEND tests_extra list_codetable_flagtable_keys)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# These tests do not require any data downloads
|
# These tests do not require any data downloads
|
||||||
foreach( test ${tests_no_data_reqd} )
|
foreach( test ${tests_basic} )
|
||||||
ecbuild_add_test( TARGET eccodes_t_${test}
|
ecbuild_add_test( TARGET eccodes_t_${test}
|
||||||
TYPE SCRIPT
|
TYPE SCRIPT
|
||||||
LABELS "sanity"
|
LABELS "sanity"
|
||||||
|
@ -294,7 +296,7 @@ if( HAVE_BUILD_TOOLS )
|
||||||
# Note: making the test dependent on the grib files (with DEPENDS)
|
# Note: making the test dependent on the grib files (with DEPENDS)
|
||||||
# means they will be downloaded at "make" time
|
# means they will be downloaded at "make" time
|
||||||
# rather than when you do "ctest". Use TEST_DEPENDS instead
|
# rather than when you do "ctest". Use TEST_DEPENDS instead
|
||||||
foreach( test ${tests_data_reqd} )
|
foreach( test ${tests_extra} )
|
||||||
ecbuild_add_test( TARGET eccodes_t_${test}
|
ecbuild_add_test( TARGET eccodes_t_${test}
|
||||||
TYPE SCRIPT
|
TYPE SCRIPT
|
||||||
CONDITION ENABLE_EXTRA_TESTS
|
CONDITION ENABLE_EXTRA_TESTS
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
cd ${data_dir}/bufr
|
cd ${data_dir}/bufr
|
||||||
|
|
||||||
# Define a common label for all the tmp files
|
# Define a common label for all the tmp files
|
||||||
label="bufr_change_edition"
|
label="bufr_change_edition_test"
|
||||||
|
|
||||||
fBufrTmp=${label}".bufr.tmp"
|
fBufrTmp=${label}".bufr.tmp"
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="bufr_indexing"
|
label="bufr_indexing_test"
|
||||||
tempIndex=temp.$label.$$.idx
|
tempIndex=temp.$label.$$.idx
|
||||||
tempOut=temp.$label.$$.out
|
tempOut=temp.$label.$$.out
|
||||||
tempRef=temp.$label.$$.ref
|
tempRef=temp.$label.$$.ref
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
pwd
|
pwd
|
||||||
# Define a common label for all the tmp files
|
# Define a common label for all the tmp files
|
||||||
label="codes_split_file"
|
label="codes_split_file_test"
|
||||||
temp=$label.temp.grib
|
temp=$label.temp.grib
|
||||||
|
|
||||||
# Do all the work in a temporary directory
|
# Do all the work in a temporary directory
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
label="grib1to3"
|
label="grib1to3_test"
|
||||||
temp=temp.$label.grib3
|
temp=temp.$label.grib3
|
||||||
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
||||||
${tools_dir}/grib_set -s editionNumber=3 $sample_g1 $temp
|
${tools_dir}/grib_set -s editionNumber=3 $sample_g1 $temp
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
label="grib2_templates"
|
label="grib2_templates_test"
|
||||||
|
|
||||||
temp1=temp1.$label.grib2
|
temp1=temp1.$label.grib2
|
||||||
temp2=temp2.$label.grib2
|
temp2=temp2.$label.grib2
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
|
|
||||||
label="grib2_version"
|
label="grib2_version_test"
|
||||||
if [ ! -d "$ECCODES_DEFINITION_PATH" ]; then
|
if [ ! -d "$ECCODES_DEFINITION_PATH" ]; then
|
||||||
echo "Test $0 disabled. No definitions directory"
|
echo "Test $0 disabled. No definitions directory"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
label="grib2to3"
|
label="grib2to3_test"
|
||||||
temp=temp.$label.grib3
|
temp=temp.$label.grib3
|
||||||
sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||||
${tools_dir}/grib_set -s editionNumber=3 $sample_g2 $temp
|
${tools_dir}/grib_set -s editionNumber=3 $sample_g2 $temp
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
label="grib3_templates"
|
label="grib3_templates_test"
|
||||||
temp1=temp1.$label.grib3
|
temp1=temp1.$label.grib3
|
||||||
temp2=temp2.$label.grib3
|
temp2=temp2.$label.grib3
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_change_scanning"
|
label="grib_change_scanning_test"
|
||||||
|
|
||||||
editions="1 2"
|
editions="1 2"
|
||||||
gridTypes="regular_ll rotated_ll"
|
gridTypes="regular_ll rotated_ll"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_check_gaussian_grids"
|
label="grib_check_gaussian_grids_test"
|
||||||
temp=temp.$label.grib
|
temp=temp.$label.grib
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_complex"
|
label="grib_complex_test"
|
||||||
temp=${label}".grib.tmp"
|
temp=${label}".grib.tmp"
|
||||||
temp1=${label}".1.tmp"
|
temp1=${label}".1.tmp"
|
||||||
temp2=${label}".2.tmp"
|
temp2=${label}".2.tmp"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Tests for data quality checks
|
# Tests for data quality checks
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
label="grib_data_quality"
|
label="grib_data_quality_test"
|
||||||
tempOut=temp.1.${label}.out
|
tempOut=temp.1.${label}.out
|
||||||
temp2=temp.2.${label}.out
|
temp2=temp.2.${label}.out
|
||||||
tempErr=temp.${label}.err
|
tempErr=temp.${label}.err
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
label="grib_dump_debug"
|
label="grib_dump_debug_test"
|
||||||
temp=temp.$label.txt
|
temp=temp.$label.txt
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_dump_json"
|
label="grib_dump_json_test"
|
||||||
temp=${label}".temp.json"
|
temp=${label}".temp.json"
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_efas"
|
label="grib_efas_test"
|
||||||
sample=temp.sample.$label.grib
|
sample=temp.sample.$label.grib
|
||||||
temp1=temp1.$label.grib
|
temp1=temp1.$label.grib
|
||||||
temp2=temp2.$label.grib
|
temp2=temp2.$label.grib
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_g1fcperiod"
|
label="grib_g1fcperiod_test"
|
||||||
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
||||||
temp=temp.$label.grib
|
temp=temp.$label.grib
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_g1monthlydate"
|
label="grib_g1monthlydate_test"
|
||||||
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
||||||
temp=temp.$label.grib
|
temp=temp.$label.grib
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_grid_unstructured"
|
label="grib_grid_unstructured_test"
|
||||||
|
|
||||||
# Only relevant for GRIB2
|
# Only relevant for GRIB2
|
||||||
sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_indexing"
|
label="grib_indexing_test"
|
||||||
temp=temp.$label.index.out
|
temp=temp.$label.index.out
|
||||||
infile=${data_dir}/index.grib
|
infile=${data_dir}/index.grib
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_lam_bf"
|
label="grib_lam_bf_test"
|
||||||
temp=temp.$label.txt
|
temp=temp.$label.txt
|
||||||
|
|
||||||
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
|
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_lam_gp"
|
label="grib_lam_gp_test"
|
||||||
temp=temp.$label.txt
|
temp=temp.$label.txt
|
||||||
|
|
||||||
dump_and_check()
|
dump_and_check()
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
set -u
|
set -u
|
||||||
label="grib_levtype"
|
label="grib_levtype_test"
|
||||||
|
|
||||||
if [ ! -d "$ECCODES_DEFINITION_PATH" ]; then
|
if [ ! -d "$ECCODES_DEFINITION_PATH" ]; then
|
||||||
echo "Test $0 disabled. No definitions directory"
|
echo "Test $0 disabled. No definitions directory"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_mars_keys"
|
label="grib_mars_keys_test"
|
||||||
tempOut=temp.${label}.out
|
tempOut=temp.${label}.out
|
||||||
tempGrib=temp.${label}.grib
|
tempGrib=temp.${label}.grib
|
||||||
tempRef=temp.${label}.ref
|
tempRef=temp.${label}.ref
|
||||||
|
|
|
@ -119,6 +119,22 @@ ${tools_dir}/grib_ls -l 0,0,1 $tempGrib > $temp
|
||||||
grep -q "Grid Point chosen #2 index=480 " $temp
|
grep -q "Grid Point chosen #2 index=480 " $temp
|
||||||
|
|
||||||
|
|
||||||
|
# Subarea: Reduced Gaussian grid
|
||||||
|
# ------------------------------
|
||||||
|
input_grb=${data_dir}/reduced_gaussian_sub_area.grib1
|
||||||
|
${tools_dir}/grib_get -F%3.6g -l 89.656,220,1 $input_grb > $temp
|
||||||
|
grep -q "274.038" $temp
|
||||||
|
${tools_dir}/grib_ls -l 89.656,220,1 $input_grb > $temp
|
||||||
|
grep -q "Grid Point chosen #1 index=0 " $temp
|
||||||
|
|
||||||
|
${tools_dir}/grib_ls -l 0.225,399.6,1 $input_grb > $temp
|
||||||
|
grep -q "Grid Point chosen #1 index=53563 " $temp
|
||||||
|
|
||||||
|
${tools_dir}/grib_get -F%3.6g -l 11.91,366.3,1 $input_grb > $temp
|
||||||
|
grep -q "299.632" $temp
|
||||||
|
${tools_dir}/grib_ls -l 11.91,366.3,1 $input_grb > $temp
|
||||||
|
grep -q "Grid Point chosen #1 index=43089 " $temp
|
||||||
|
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
rm -f $temp $tempRef $tempGrib
|
rm -f $temp $tempRef $tempGrib
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
label="grib_packing_order"
|
label="grib_packing_order_test"
|
||||||
temp=${label}".grib.tmp"
|
temp=${label}".grib.tmp"
|
||||||
temp_simple1=${label}".simple1.tmp"
|
temp_simple1=${label}".simple1.tmp"
|
||||||
temp_simple2=${label}".simple2.tmp"
|
temp_simple2=${label}".simple2.tmp"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
label="grib_png"
|
label="grib_png_test"
|
||||||
temp=${label}".grib.tmp"
|
temp=${label}".grib.tmp"
|
||||||
temp1=${label}".1.tmp"
|
temp1=${label}".1.tmp"
|
||||||
temp2=${label}".2.tmp"
|
temp2=${label}".2.tmp"
|
||||||
|
|
|
@ -62,6 +62,7 @@ diff ${data_dir}/step_grib1.log ${templog}
|
||||||
rm -f ${templog}
|
rm -f ${templog}
|
||||||
|
|
||||||
# GRIB-180
|
# GRIB-180
|
||||||
|
# ------------
|
||||||
# Set PDT 4.8 where you can find the EndOfOverallTimeInterval keys
|
# Set PDT 4.8 where you can find the EndOfOverallTimeInterval keys
|
||||||
grib2File=${data_dir}/reduced_latlon_surface_constant.grib2
|
grib2File=${data_dir}/reduced_latlon_surface_constant.grib2
|
||||||
${tools_dir}/grib_set -sproductDefinitionTemplateNumber=8 $grib2File ${grib2File}.p8tmp
|
${tools_dir}/grib_set -sproductDefinitionTemplateNumber=8 $grib2File ${grib2File}.p8tmp
|
||||||
|
@ -81,6 +82,7 @@ hourEnd=$1; dayEnd=$2
|
||||||
|
|
||||||
|
|
||||||
# ECC-134 case-sensitivity
|
# ECC-134 case-sensitivity
|
||||||
|
# --------------------------
|
||||||
grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
|
||||||
grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||||
temp=temp.step.$$.grib
|
temp=temp.step.$$.grib
|
||||||
|
@ -93,6 +95,7 @@ unit=`${tools_dir}/grib_get -p indicatorOfUnitOfTimeRange $temp`
|
||||||
[ "$unit" = "3" ]
|
[ "$unit" = "3" ]
|
||||||
|
|
||||||
# m is for Minute (code 0)
|
# m is for Minute (code 0)
|
||||||
|
# -------------------------
|
||||||
${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=m $grib1_sample $temp
|
${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=m $grib1_sample $temp
|
||||||
unit=`${tools_dir}/grib_get -p unitOfTimeRange $temp`
|
unit=`${tools_dir}/grib_get -p unitOfTimeRange $temp`
|
||||||
[ "$unit" = "0" ]
|
[ "$unit" = "0" ]
|
||||||
|
@ -101,9 +104,18 @@ unit=`${tools_dir}/grib_get -p indicatorOfUnitOfTimeRange $temp`
|
||||||
[ "$unit" = "0" ]
|
[ "$unit" = "0" ]
|
||||||
|
|
||||||
# ECC-457
|
# ECC-457
|
||||||
|
# ---------
|
||||||
input=${data_dir}/tp_ecmwf.grib
|
input=${data_dir}/tp_ecmwf.grib
|
||||||
stepRange=`${tools_dir}/grib_get -w count=1 -p stepRange,startStep,endStep,stepType $input`
|
stepRange=`${tools_dir}/grib_get -w count=1 -p stepRange,startStep,endStep,stepType $input`
|
||||||
[ "$stepRange" = "12 12 12 instant" ]
|
[ "$stepRange" = "12 12 12 instant" ]
|
||||||
|
|
||||||
|
# ECC-1430: stepType: 'severity' and 'mode'
|
||||||
|
# -----------------------------------------
|
||||||
|
${tools_dir}/grib_set -s stepType=severity,paramId=260318 $grib2_sample $temp
|
||||||
|
grib_check_key_equals $temp productDefinitionTemplateNumber,typeOfStatisticalProcessing '8 100'
|
||||||
|
${tools_dir}/grib_set -s stepType=mode,paramId=260320 $grib2_sample $temp
|
||||||
|
grib_check_key_equals $temp productDefinitionTemplateNumber,typeOfStatisticalProcessing '8 101'
|
||||||
|
|
||||||
|
# Clean up
|
||||||
rm -f $temp
|
rm -f $temp
|
||||||
rm -f $grib2File.p8tmp ${grib2File}.tmp x.grib
|
rm -f $grib2File.p8tmp ${grib2File}.tmp x.grib
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
label="grib_tigge_conv1"
|
label="grib_tigge_conv1_test"
|
||||||
dir="${data_dir}/tigge"
|
dir="${data_dir}/tigge"
|
||||||
temp1="temp.${label}.grib1_"
|
temp1="temp.${label}.grib1_"
|
||||||
temp2="temp.${label}.grib2_"
|
temp2="temp.${label}.grib2_"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
|
||||||
label="grib_tigge_conv2"
|
label="grib_tigge_conv2_test"
|
||||||
dir="${data_dir}/tigge"
|
dir="${data_dir}/tigge"
|
||||||
temp1="temp.${label}.grib1_"
|
temp1="temp.${label}.grib1_"
|
||||||
temp2="temp.${label}.grib2_"
|
temp2="temp.${label}.grib2_"
|
||||||
|
|
|
@ -144,7 +144,7 @@ static int process_file(const char* filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lon1 != 0) {
|
if (lon1 != 0) {
|
||||||
error(filename, msg_num, "latitudeOfFirstGridPointInDegrees=%f but should be 0\n", lon1);
|
error(filename, msg_num, "longitudeOfFirstGridPointInDegrees=%f but should be 0\n", lon1);
|
||||||
}
|
}
|
||||||
expected_lon2 = 360.0 - 360.0 / (4 * N);
|
expected_lon2 = 360.0 - 360.0 / (4 * N);
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ static grib_options_help grib_options_help_list[] = {
|
||||||
{ "T:", "T | B | M | A", "Message type. T->GTS, B->BUFR, M->METAR (Experimental), A->Any (Experimental).\n\t\t\t\tThe input file is interpreted according to the message type.\n" },
|
{ "T:", "T | B | M | A", "Message type. T->GTS, B->BUFR, M->METAR (Experimental), A->Any (Experimental).\n\t\t\t\tThe input file is interpreted according to the message type.\n" },
|
||||||
{ "V", 0, "Version.\n" },
|
{ "V", 0, "Version.\n" },
|
||||||
{ "W:", "width", "\n\t\tMinimum width of each column in output. Default is 10.\n" },
|
{ "W:", "width", "\n\t\tMinimum width of each column in output. Default is 10.\n" },
|
||||||
{ "X:", "offset", "\n\t\tInput file offset in bytes. Processing of the input file will start from \"offset\".\n" },
|
{ "X:", "offset", "\n\t\tInput file offset in bytes. Processing of the input file will start from the given offset.\n" },
|
||||||
{ "x", 0, "Fast parsing option, only headers are loaded.\n" },
|
{ "x", 0, "Fast parsing option, only headers are loaded.\n" },
|
||||||
{ "k:", "key1,key2,...",
|
{ "k:", "key1,key2,...",
|
||||||
"\n\t\tSpecify a list of keys to index on. By default the input files are indexed on the MARS keys."
|
"\n\t\tSpecify a list of keys to index on. By default the input files are indexed on the MARS keys."
|
||||||
|
|
Loading…
Reference in New Issue