Skip to content

Commit 79100b4

Browse files
committed
Merge branch 'develop' of github.com:ecmwf/eccodes into develop
2 parents d8a02b0 + c26d468 commit 79100b4

File tree

14 files changed

+387
-65
lines changed

14 files changed

+387
-65
lines changed

definitions/grib2/name.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,27 @@
847847
parameterCategory = 6 ;
848848
parameterNumber = 5 ;
849849
}
850+
#Probability of a tropical storm
851+
'Probability of a tropical storm' = {
852+
discipline = 0 ;
853+
parameterCategory = 191 ;
854+
parameterNumber = 6 ;
855+
probabilityType = 9 ;
856+
}
857+
#Probability of a hurricane
858+
'Probability of a hurricane' = {
859+
discipline = 0 ;
860+
parameterCategory = 191 ;
861+
parameterNumber = 5 ;
862+
probabilityType = 9 ;
863+
}
864+
#Probability of a tropical depression
865+
'Probability of a tropical depression' = {
866+
discipline = 0 ;
867+
parameterCategory = 191 ;
868+
parameterNumber = 7 ;
869+
probabilityType = 9 ;
870+
}
850871
#Total precipitation of at least 25 mm
851872
'Total precipitation of at least 25 mm' = {
852873
discipline = 0 ;

definitions/grib2/name.lte33.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,27 @@
901901
parameterCategory = 6 ;
902902
parameterNumber = 5 ;
903903
}
904+
#Probability of a tropical storm
905+
'Probability of a tropical storm' = {
906+
discipline = 0 ;
907+
parameterCategory = 191 ;
908+
parameterNumber = 6 ;
909+
probabilityType = 9 ;
910+
}
911+
#Probability of a hurricane
912+
'Probability of a hurricane' = {
913+
discipline = 0 ;
914+
parameterCategory = 191 ;
915+
parameterNumber = 5 ;
916+
probabilityType = 9 ;
917+
}
918+
#Probability of a tropical depression
919+
'Probability of a tropical depression' = {
920+
discipline = 0 ;
921+
parameterCategory = 191 ;
922+
parameterNumber = 7 ;
923+
probabilityType = 9 ;
924+
}
904925
#Total precipitation of at least 25 mm
905926
'Total precipitation of at least 25 mm' = {
906927
discipline = 0 ;

definitions/grib2/paramId.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,27 @@
847847
parameterCategory = 6 ;
848848
parameterNumber = 5 ;
849849
}
850+
#Probability of a tropical storm
851+
'131089' = {
852+
discipline = 0 ;
853+
parameterCategory = 191 ;
854+
parameterNumber = 6 ;
855+
probabilityType = 9 ;
856+
}
857+
#Probability of a hurricane
858+
'131090' = {
859+
discipline = 0 ;
860+
parameterCategory = 191 ;
861+
parameterNumber = 5 ;
862+
probabilityType = 9 ;
863+
}
864+
#Probability of a tropical depression
865+
'131091' = {
866+
discipline = 0 ;
867+
parameterCategory = 191 ;
868+
parameterNumber = 7 ;
869+
probabilityType = 9 ;
870+
}
850871
#Total precipitation of at least 25 mm
851872
'131098' = {
852873
discipline = 0 ;

definitions/grib2/paramId.lte33.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,27 @@
901901
parameterCategory = 6 ;
902902
parameterNumber = 5 ;
903903
}
904+
#Probability of a tropical storm
905+
'131089' = {
906+
discipline = 0 ;
907+
parameterCategory = 191 ;
908+
parameterNumber = 6 ;
909+
probabilityType = 9 ;
910+
}
911+
#Probability of a hurricane
912+
'131090' = {
913+
discipline = 0 ;
914+
parameterCategory = 191 ;
915+
parameterNumber = 5 ;
916+
probabilityType = 9 ;
917+
}
918+
#Probability of a tropical depression
919+
'131091' = {
920+
discipline = 0 ;
921+
parameterCategory = 191 ;
922+
parameterNumber = 7 ;
923+
probabilityType = 9 ;
924+
}
904925
#Total precipitation of at least 25 mm
905926
'131098' = {
906927
discipline = 0 ;

definitions/grib2/productDefinitionTemplateConcept.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@
3333
'aerosol_optical_ensemble_instantaneous' = {productDefinitionTemplateNumber=49;}
3434
# 156 Average, accumulation, extreme values or other statistically processed values at a horizontal layer in a continuous or non-continuous time interval for optical properties of aerosol
3535
'aerosol_optical_deterministic_statistically_processed' = {productDefinitionTemplateNumber=156;}
36-
# 157 Individual ensemble forecast, control and perturbed at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for optical properties of aerosol
36+
# 157 Individual ensemble forecast, scontrol and perturbed at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for optical properties of aerosol
3737
'aerosol_optical_ensemble_statistically_processed' = {productDefinitionTemplateNumber=157;}
3838

3939
# 80 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source or sink
4040
'aerosol_optical_srcsink_deterministic_instantaneous' = {productDefinitionTemplateNumber=80;}
4141
# 81 Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer at a point in time for optical properties of aerosol with source or sink
4242
'aerosol_optical_srcsink_ensemble_instantaneous' = {productDefinitionTemplateNumber=81;}
43-
# 158 Average, accumulation, extreme values or other statistically processed values at a continuous or non-continuous time interval for optical properties of aerosol with source or sink
43+
# 158 Average, accumulation, extreme values or other statistically processed values at a continuous or non-continuous time interval for optical properties of aerosol with source or sink
4444
'aerosol_optical_srcsink_deterministic_statistically_processed' = {productDefinitionTemplateNumber=158;}
45-
# 159 Individual ensemble forecast,control and perturbed at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for optical properties of aerosol with source or sink
45+
# 159 Individual ensemble forecast, control and perturbed at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for optical properties of aerosol with source or sink
4646
'aerosol_optical_srcsink_ensemble_statistically_processed' = {productDefinitionTemplateNumber=159;}
4747

4848
# 50 Analysis or forecast at a horizontal level or in a horizontal layer at a point in time for aerosol

definitions/grib2/shortName.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,27 @@
847847
parameterCategory = 6 ;
848848
parameterNumber = 5 ;
849849
}
850+
#Probability of a tropical storm
851+
'pts' = {
852+
discipline = 0 ;
853+
parameterCategory = 191 ;
854+
parameterNumber = 6 ;
855+
probabilityType = 9 ;
856+
}
857+
#Probability of a hurricane
858+
'ph' = {
859+
discipline = 0 ;
860+
parameterCategory = 191 ;
861+
parameterNumber = 5 ;
862+
probabilityType = 9 ;
863+
}
864+
#Probability of a tropical depression
865+
'ptd' = {
866+
discipline = 0 ;
867+
parameterCategory = 191 ;
868+
parameterNumber = 7 ;
869+
probabilityType = 9 ;
870+
}
850871
#Total precipitation of at least 25 mm
851872
'tpg25' = {
852873
discipline = 0 ;

definitions/grib2/shortName.lte33.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,27 @@
901901
parameterCategory = 6 ;
902902
parameterNumber = 5 ;
903903
}
904+
#Probability of a tropical storm
905+
'pts' = {
906+
discipline = 0 ;
907+
parameterCategory = 191 ;
908+
parameterNumber = 6 ;
909+
probabilityType = 9 ;
910+
}
911+
#Probability of a hurricane
912+
'ph' = {
913+
discipline = 0 ;
914+
parameterCategory = 191 ;
915+
parameterNumber = 5 ;
916+
probabilityType = 9 ;
917+
}
918+
#Probability of a tropical depression
919+
'ptd' = {
920+
discipline = 0 ;
921+
parameterCategory = 191 ;
922+
parameterNumber = 7 ;
923+
probabilityType = 9 ;
924+
}
904925
#Total precipitation of at least 25 mm
905926
'tpg25' = {
906927
discipline = 0 ;

definitions/grib2/units.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,27 @@
847847
parameterCategory = 6 ;
848848
parameterNumber = 5 ;
849849
}
850+
#Probability of a tropical storm
851+
'%' = {
852+
discipline = 0 ;
853+
parameterCategory = 191 ;
854+
parameterNumber = 6 ;
855+
probabilityType = 9 ;
856+
}
857+
#Probability of a hurricane
858+
'%' = {
859+
discipline = 0 ;
860+
parameterCategory = 191 ;
861+
parameterNumber = 5 ;
862+
probabilityType = 9 ;
863+
}
864+
#Probability of a tropical depression
865+
'%' = {
866+
discipline = 0 ;
867+
parameterCategory = 191 ;
868+
parameterNumber = 7 ;
869+
probabilityType = 9 ;
870+
}
850871
#Total precipitation of at least 25 mm
851872
'%' = {
852873
discipline = 0 ;

definitions/grib2/units.lte33.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,27 @@
901901
parameterCategory = 6 ;
902902
parameterNumber = 5 ;
903903
}
904+
#Probability of a tropical storm
905+
'%' = {
906+
discipline = 0 ;
907+
parameterCategory = 191 ;
908+
parameterNumber = 6 ;
909+
probabilityType = 9 ;
910+
}
911+
#Probability of a hurricane
912+
'%' = {
913+
discipline = 0 ;
914+
parameterCategory = 191 ;
915+
parameterNumber = 5 ;
916+
probabilityType = 9 ;
917+
}
918+
#Probability of a tropical depression
919+
'%' = {
920+
discipline = 0 ;
921+
parameterCategory = 191 ;
922+
parameterNumber = 7 ;
923+
probabilityType = 9 ;
924+
}
904925
#Total precipitation of at least 25 mm
905926
'%' = {
906927
discipline = 0 ;

src/eccodes/accessor/BufrDataArray.cc

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ int BufrDataArray::decode_string_array(grib_context* c, unsigned char* data, lon
424424
return ret;
425425
}
426426

427-
grib_darray* BufrDataArray::decode_double_array(grib_context* c, unsigned char* data, long* pos,
427+
// numeric (integer or double) or codetable or flagtable array
428+
grib_darray* BufrDataArray::decode_numeric_array(grib_context* c, unsigned char* data, long* pos,
428429
bufr_descriptor* bd, int canBeMissing, int* err)
429430
{
430431
grib_darray* ret = NULL;
@@ -589,7 +590,7 @@ static int descriptor_get_min_max(bufr_descriptor* bd, long width, long referenc
589590
return GRIB_SUCCESS;
590591
}
591592

592-
int BufrDataArray::encode_double_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd,
593+
int BufrDataArray::encode_numeric_array(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd,
593594
grib_darray* dvalues)
594595
{
595596
int err = 0;
@@ -807,7 +808,7 @@ int BufrDataArray::encode_double_array(grib_context* c, grib_buffer* buff, long*
807808
return err;
808809
}
809810

810-
int BufrDataArray::encode_double_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, double value)
811+
int BufrDataArray::encode_numeric_value(grib_context* c, grib_buffer* buff, long* pos, bufr_descriptor* bd, double value)
811812
{
812813
size_t lval;
813814
double maxAllowed, minAllowed;
@@ -888,7 +889,8 @@ char* BufrDataArray::decode_string_value(grib_context* c, unsigned char* data, l
888889
return sval;
889890
}
890891

891-
double BufrDataArray::decode_double_value(grib_context* c, unsigned char* data, long* pos,
892+
// numeric (integer or double) or codetable or flagtable
893+
double BufrDataArray::decode_numeric_value(grib_context* c, unsigned char* data, long* pos,
892894
bufr_descriptor* bd, int canBeMissing,
893895
int* err)
894896
{
@@ -919,7 +921,6 @@ double BufrDataArray::decode_double_value(grib_context* c, unsigned char* data,
919921
return dval;
920922
}
921923

922-
923924
int decode_element(grib_context* c, BufrDataArray* self, int subsetIndex,
924925
grib_buffer* b, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor, long elementIndex,
925926
grib_darray* dval, grib_sarray* sval)
@@ -987,12 +988,12 @@ int decode_element(grib_context* c, BufrDataArray* self, int subsetIndex,
987988
return GRIB_DECODING_ERROR;
988989
}
989990
if (self->compressedData_) {
990-
dar = self->decode_double_array(c, data, pos, bd, self->canBeMissing_[i], &err);
991+
dar = self->decode_numeric_array(c, data, pos, bd, self->canBeMissing_[i], &err);
991992
grib_vdarray_push(self->numericValues_, dar);
992993
}
993994
else {
994995
/* Uncompressed */
995-
cdval = self->decode_double_value(c, data, pos, bd, self->canBeMissing_[i], &err);
996+
cdval = self->decode_numeric_value(c, data, pos, bd, self->canBeMissing_[i], &err);
996997
grib_context_log(c, GRIB_LOG_DEBUG, "BUFR data decoding: \t %s = %g",
997998
bd->shortName, cdval);
998999
grib_darray_push(dval, cdval);
@@ -1001,7 +1002,6 @@ int decode_element(grib_context* c, BufrDataArray* self, int subsetIndex,
10011002
return err;
10021003
}
10031004

1004-
10051005
int decode_replication(grib_context* c, BufrDataArray* self, int subsetIndex, grib_buffer* buff,
10061006
unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions)
10071007
{
@@ -1067,7 +1067,6 @@ int decode_replication(grib_context* c, BufrDataArray* self, int subsetIndex, gr
10671067
return ret;
10681068
}
10691069

1070-
10711070
int BufrDataArray::encode_new_bitmap(grib_context* c, grib_buffer* buff, long* pos, int idx)
10721071
{
10731072
grib_darray* doubleValues = NULL;
@@ -1081,11 +1080,11 @@ int BufrDataArray::encode_new_bitmap(grib_context* c, grib_buffer* buff, long* p
10811080
if (compressedData_) {
10821081
doubleValues = grib_darray_new(1, 1);
10831082
grib_darray_push(doubleValues, cdval);
1084-
err = encode_double_array(c, buff, pos, expanded_->v[idx], doubleValues);
1083+
err = encode_numeric_array(c, buff, pos, expanded_->v[idx], doubleValues);
10851084
grib_darray_delete(doubleValues);
10861085
}
10871086
else {
1088-
err = encode_double_value(c, buff, pos, expanded_->v[idx], cdval);
1087+
err = encode_numeric_value(c, buff, pos, expanded_->v[idx], cdval);
10891088
}
10901089
return err;
10911090
}
@@ -1179,17 +1178,16 @@ int encode_new_element(grib_context* c, BufrDataArray* self, int subsetIndex,
11791178
if (self->compressedData_) {
11801179
grib_darray* doubleValues = grib_darray_new(1, 1);
11811180
grib_darray_push(doubleValues, cdval);
1182-
err = self->encode_double_array(c, buff, pos, bd, doubleValues);
1181+
err = self->encode_numeric_array(c, buff, pos, bd, doubleValues);
11831182
grib_darray_delete(doubleValues);
11841183
}
11851184
else {
1186-
err = self->encode_double_value(c, buff, pos, bd, cdval);
1185+
err = self->encode_numeric_value(c, buff, pos, bd, cdval);
11871186
}
11881187
}
11891188
return err;
11901189
}
11911190

1192-
11931191
int encode_new_replication(grib_context* c, BufrDataArray* self, int subsetIndex,
11941192
grib_buffer* buff, unsigned char* data, long* pos, int i, long elementIndex, grib_darray* dval, long* numberOfRepetitions)
11951193
{
@@ -1253,7 +1251,6 @@ int encode_new_replication(grib_context* c, BufrDataArray* self, int subsetIndex
12531251
return err;
12541252
}
12551253

1256-
12571254
int encode_element(grib_context* c, BufrDataArray* self, int subsetIndex,
12581255
grib_buffer* buff, unsigned char* data, long* pos, int i, bufr_descriptor* descriptor,
12591256
long elementIndex, grib_darray* dval, grib_sarray* sval)
@@ -1300,7 +1297,7 @@ int encode_element(grib_context* c, BufrDataArray* self, int subsetIndex,
13001297
else {
13011298
/* numeric or codetable or flagtable */
13021299
if (self->compressedData_) {
1303-
err = self->encode_double_array(c, buff, pos, bd, self->numericValues_->v[elementIndex]);
1300+
err = self->encode_numeric_array(c, buff, pos, bd, self->numericValues_->v[elementIndex]);
13041301
if (err) {
13051302
grib_darray* varr = self->numericValues_->v[elementIndex];
13061303
grib_context_log(c, GRIB_LOG_ERROR, "Encoding key '%s' ( code=%6.6ld width=%ld scale=%ld reference=%ld )",
@@ -1320,7 +1317,7 @@ int encode_element(grib_context* c, BufrDataArray* self, int subsetIndex,
13201317
grib_context_log(c, GRIB_LOG_ERROR, "Invalid subset index %d (number of subsets=%ld)", subsetIndex, self->numberOfSubsets_);
13211318
return GRIB_INVALID_ARGUMENT;
13221319
}
1323-
err = self->encode_double_value(c, buff, pos, bd, self->numericValues_->v[subsetIndex]->v[elementIndex]);
1320+
err = self->encode_numeric_value(c, buff, pos, bd, self->numericValues_->v[subsetIndex]->v[elementIndex]);
13241321
if (err) {
13251322
grib_context_log(c, GRIB_LOG_ERROR, "Cannot encode %s=%g (subset=%d)", /*subsetIndex starts from 0*/
13261323
bd->shortName, self->numericValues_->v[subsetIndex]->v[elementIndex], subsetIndex + 1);

0 commit comments

Comments
 (0)