Merge branch 'develop' of ssh://software.ecmwf.int:7999/eccodes/eccodes into develop

This commit is contained in:
Enrico Fucile 2015-10-15 15:36:23 +01:00
commit 369fc35677
6 changed files with 30 additions and 30 deletions

View File

@ -252,7 +252,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t *len)
buflen = 32*(sub_k+1)*(sub_k+2)+(*len-(sub_k+1)*(sub_k+2))*bits_per_value+18*8;
half_byte = seclen*8-buflen;
if (a->parent->h->context->debug==-1) {
printf("GRIB_API DEBUG: half_byte=%ld\n",half_byte);
printf("ECCODES DEBUG: half_byte=%ld\n",half_byte);
}
ret = grib_set_long_internal(a->parent->h,self->half_byte, half_byte);

View File

@ -184,13 +184,13 @@ static void default_log(const grib_context* c, int level, const char* mess)
{
if (!c) c=grib_context_get_default();
if(level == GRIB_LOG_ERROR) {
fprintf(c->log_stream, "GRIB_API ERROR : %s\n", mess);
fprintf(c->log_stream, "ECCODES ERROR : %s\n", mess);
/*Assert(1==0);*/
}
if(level == GRIB_LOG_FATAL) fprintf(c->log_stream, "GRIB_API ERROR : %s\n", mess);
if(level == GRIB_LOG_DEBUG && c->debug>0) fprintf(c->log_stream, "GRIB_API DEBUG : %s\n", mess);
if(level == GRIB_LOG_WARNING) fprintf(c->log_stream, "GRIB_API WARNING : %s\n", mess);
if(level == GRIB_LOG_INFO) fprintf(c->log_stream, "GRIB_API INFO : %s\n", mess);
if(level == GRIB_LOG_FATAL) fprintf(c->log_stream, "ECCODES ERROR : %s\n", mess);
if(level == GRIB_LOG_DEBUG && c->debug>0) fprintf(c->log_stream, "ECCODES DEBUG : %s\n", mess);
if(level == GRIB_LOG_WARNING) fprintf(c->log_stream, "ECCODES WARNING : %s\n", mess);
if(level == GRIB_LOG_INFO) fprintf(c->log_stream, "ECCODES INFO : %s\n", mess);
if(level == GRIB_LOG_FATAL) { Assert(0);}

View File

@ -239,7 +239,7 @@ grib_handle* grib_handle_new_from_samples ( grib_context* c, const char* name )
if(g) return g;
*/
if (c->debug) {
printf("GRIB_API DEBUG: grib_handle_new_from_samples '%s'\n", name);
printf("ECCODES DEBUG: grib_handle_new_from_samples '%s'\n", name);
}
g=grib_external_template ( c,name );

View File

@ -49,7 +49,7 @@ static grib_handle* try_template(grib_context* c,const char* dir,const char* nam
sprintf(path,"%s/%s.tmpl",dir,name);
if (c->debug==-1) {
printf("GRIB_API DEBUG: try_template path='%s'\n", path);
printf("ECCODES DEBUG: try_template path='%s'\n", path);
}
if(access(path,F_OK) == 0)

View File

@ -333,17 +333,17 @@ static grib_trie* init_list(const char* name) {
static void print_values(grib_context* c, const grib_util_grid_spec* spec, const double* data_values,size_t data_values_count,const grib_values *values,int count)
{
int i;
printf("GRIB_API DEBUG grib_util grib_set_values: setting %d values \n",count);
printf("ECCODES DEBUG grib_util grib_set_values: setting %d values \n",count);
for(i = 0; i < count ; i++)
{
switch(values[i].type)
{
case GRIB_TYPE_LONG: printf("GRIB_API DEBUG grib_util: => %s = %ld;\n"
case GRIB_TYPE_LONG: printf("ECCODES DEBUG grib_util: => %s = %ld;\n"
,values[i].name,(long)values[i].long_value); break;
case GRIB_TYPE_DOUBLE: printf("GRIB_API DEBUG grib_util: => %s = %.16e;\n"
case GRIB_TYPE_DOUBLE: printf("ECCODES DEBUG grib_util: => %s = %.16e;\n"
,values[i].name,values[i].double_value); break;
case GRIB_TYPE_STRING: printf("GRIB_API DEBUG grib_util: => %s = \"%s\";\n"
case GRIB_TYPE_STRING: printf("ECCODES DEBUG grib_util: => %s = \"%s\";\n"
,values[i].name,values[i].string_value); break;
}
}
@ -427,9 +427,9 @@ grib_handle* grib_util_set_spec(grib_handle* h,
grib_get_long(h,"bitsPerValue",&input_bits_per_value);
grib_get_long(h,"decimalScaleFactor",&input_decimal_scale_factor);
if (h->context->debug==-1) {
printf("GRIB_API DEBUG grib_util: input_packing_type = %s\n",input_packing_type);
printf("GRIB_API DEBUG grib_util: input_bits_per_value = %ld\n",input_bits_per_value);
printf("GRIB_API DEBUG grib_util: input_decimal_scale_factor = %ld\n",input_decimal_scale_factor);
printf("ECCODES DEBUG grib_util: input_packing_type = %s\n",input_packing_type);
printf("ECCODES DEBUG grib_util: input_bits_per_value = %ld\n",input_bits_per_value);
printf("ECCODES DEBUG grib_util: input_decimal_scale_factor = %ld\n",input_decimal_scale_factor);
}
if (flags & GRIB_UTIL_SET_SPEC_FLAGS_ONLY_PACKING) {
@ -515,9 +515,9 @@ grib_handle* grib_util_set_spec(grib_handle* h,
}
if (h->context->debug==-1) {
int j=0;
printf("GRIB_API DEBUG grib_util: grib_set_double_array\n");
for (j=0;j<20;j++) printf("GRIB_API DEBUG grib_util %g\n",data_values[j]);
printf("GRIB_API DEBUG grib_util: data_values_count=%d \n",(int)data_values_count);
printf("ECCODES DEBUG grib_util: grib_set_double_array\n");
for (j=0;j<20;j++) printf("ECCODES DEBUG grib_util %g\n",data_values[j]);
printf("ECCODES DEBUG grib_util: data_values_count=%d \n",(int)data_values_count);
}
if((*err = grib_set_double_array(h,"values",data_values,data_values_count)) != 0)
@ -525,7 +525,7 @@ grib_handle* grib_util_set_spec(grib_handle* h,
goto cleanup;
}
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_util: done grib_set_double_array \n");
printf("ECCODES DEBUG grib_util: done grib_set_double_array \n");
/* convert to second_order if not constant field */
@ -1036,7 +1036,7 @@ grib_handle* grib_util_set_spec(grib_handle* h,
grib_set_long(outh,"edition", packing_spec->editionNumber);
if (h->context->debug==-1)
printf("GRIB_API DEBUG: grib_util_set_spec end\n");
printf("ECCODES DEBUG: grib_util_set_spec end\n");
return outh;

View File

@ -62,7 +62,7 @@ int grib_set_long_internal(grib_handle* h, const char* name, long val) {
a = grib_find_accessor(h, name);
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_set_long_internal %s=%ld\n",name,(long)val);
printf("ECCODES DEBUG grib_set_long_internal %s=%ld\n",name,(long)val);
if(a){
ret = grib_pack_long(a, &val, &l);
@ -87,7 +87,7 @@ int grib_set_long(grib_handle* h, const char* name, long val) {
a = grib_find_accessor(h, name);
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_set_long %s=%ld\n",name,(long)val);
printf("ECCODES DEBUG grib_set_long %s=%ld\n",name,(long)val);
if(a){
if(a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY)
@ -110,7 +110,7 @@ int grib_set_double_internal(grib_handle* h, const char* name, double val) {
a = grib_find_accessor(h, name);
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_set_double_internal %s=%g\n",name,val);
printf("ECCODES DEBUG grib_set_double_internal %s=%g\n",name,val);
if(a){
ret = grib_pack_double(a, &val, &l);
@ -300,7 +300,7 @@ int grib_set_double(grib_handle* h, const char* name, double val) {
a = grib_find_accessor(h, name);
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_set_double %s=%g\n",name,val);
printf("ECCODES DEBUG grib_set_double %s=%g\n",name,val);
if(a){
@ -325,7 +325,7 @@ int grib_set_string_internal(grib_handle* h, const char* name,
a = grib_find_accessor(h, name);
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_set_string_internal %s=%s\n",name,val);
printf("ECCODES DEBUG grib_set_string_internal %s=%s\n",name,val);
if(a){
ret = grib_pack_string(a, val, length);
@ -361,7 +361,7 @@ int grib_set_string(grib_handle* h, const char* name, const char* val, size_t *l
a = grib_find_accessor(h, name);
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_set_string %s=%s\n",name,val);
printf("ECCODES DEBUG grib_set_string %s=%s\n",name,val);
if(a)
{
@ -619,7 +619,7 @@ int grib_set_double_array_internal(grib_handle* h, const char* name, const doubl
int ret=0;
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_set_double_array_internal key=%s %ld values\n",name, (long)length);
printf("ECCODES DEBUG grib_set_double_array_internal key=%s %ld values\n",name, (long)length);
if (length==0) {
grib_accessor* a = grib_find_accessor(h, name);
@ -631,7 +631,7 @@ int grib_set_double_array_internal(grib_handle* h, const char* name, const doubl
if (ret!=GRIB_SUCCESS)
grib_context_log(h->context,GRIB_LOG_ERROR,"unable to set double array %s (%s)",
name,grib_get_error_message(ret));
/*if (h->context->debug==-1) printf("GRIB_API DEBUG grib_set_double_array_internal key=%s --DONE\n",name);*/
/*if (h->context->debug==-1) printf("ECCODES DEBUG grib_set_double_array_internal key=%s --DONE\n",name);*/
return ret;
}
@ -641,7 +641,7 @@ static int __grib_set_double_array(grib_handle* h, const char* name, const doubl
int constant,i;
if (h->context->debug==-1)
printf("GRIB_API DEBUG grib_set_double_array key=%s %ld values\n",name,(long)length);
printf("ECCODES DEBUG grib_set_double_array key=%s %ld values\n",name,(long)length);
if (length==0) {
grib_accessor* a = grib_find_accessor(h, name);
@ -683,7 +683,7 @@ static int __grib_set_double_array(grib_handle* h, const char* name, const doubl
) {
slen=11; /*length of 'grid_simple' */
if (h->context->debug == -1)
printf("GRIB_API DEBUG grib_set_double_array forcing grid_simple\n");
printf("ECCODES DEBUG grib_set_double_array forcing grid_simple\n");
grib_set_string(h,"packingType","grid_simple",&slen);
}
}