mirror of https://github.com/ecmwf/eccodes.git
Add assertion and clean up indents
This commit is contained in:
parent
3d6ebcfaf3
commit
6c03d54a38
|
@ -9,10 +9,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**************************************
|
/**************************************
|
||||||
* Enrico Fucile
|
* This pertains to GRIB edition 2
|
||||||
**************************************/
|
**************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "grib_api_internal.h"
|
#include "grib_api_internal.h"
|
||||||
/*
|
/*
|
||||||
This is used by make_class.pl
|
This is used by make_class.pl
|
||||||
|
@ -162,17 +161,15 @@ static void init(grib_accessor* a,const long l, grib_arguments* c)
|
||||||
self->eps = grib_arguments_get_name(a->parent->h,c,n++);
|
self->eps = grib_arguments_get_name(a->parent->h,c,n++);
|
||||||
self->stepType = grib_arguments_get_name(a->parent->h,c,n++);
|
self->stepType = grib_arguments_get_name(a->parent->h,c,n++);
|
||||||
self->derivedForecast = grib_arguments_get_name(a->parent->h,c,n++);
|
self->derivedForecast = grib_arguments_get_name(a->parent->h,c,n++);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int unpack_long (grib_accessor* a, long* val, size_t *len)
|
static int unpack_long(grib_accessor* a, long* val, size_t *len)
|
||||||
{
|
{
|
||||||
grib_accessor_local_definition* self = (grib_accessor_local_definition*)a;
|
grib_accessor_local_definition* self = (grib_accessor_local_definition*)a;
|
||||||
|
|
||||||
return grib_get_long(a->parent->h, self->grib2LocalSectionNumber,val);
|
return grib_get_long(a->parent->h, self->grib2LocalSectionNumber,val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int pack_long(grib_accessor* a, const long* val, size_t *len)
|
static int pack_long(grib_accessor* a, const long* val, size_t *len)
|
||||||
{
|
{
|
||||||
grib_accessor_local_definition* self = (grib_accessor_local_definition*)a;
|
grib_accessor_local_definition* self = (grib_accessor_local_definition*)a;
|
||||||
|
@ -190,6 +187,11 @@ static int pack_long(grib_accessor* a, const long* val, size_t *len)
|
||||||
int isInstant=0;
|
int isInstant=0;
|
||||||
int tooEarly=0;
|
int tooEarly=0;
|
||||||
long derivedForecast=-1;
|
long derivedForecast=-1;
|
||||||
|
long editionNumber = 0;
|
||||||
|
|
||||||
|
if (grib_get_long(a->parent->h, "editionNumber", &editionNumber)==GRIB_SUCCESS) {
|
||||||
|
Assert(editionNumber == 2);
|
||||||
|
}
|
||||||
|
|
||||||
if (grib_get_long(a->parent->h, self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber)!=GRIB_SUCCESS)
|
if (grib_get_long(a->parent->h, self->productDefinitionTemplateNumber,&productDefinitionTemplateNumber)!=GRIB_SUCCESS)
|
||||||
tooEarly=1;
|
tooEarly=1;
|
||||||
|
|
|
@ -153,16 +153,16 @@ static void dump_values(grib_dumper* d,grib_accessor* a)
|
||||||
if (values[i] == missing_value)
|
if (values[i] == missing_value)
|
||||||
fprintf(self->dumper.out, "%s, ", "null");
|
fprintf(self->dumper.out, "%s, ", "null");
|
||||||
else
|
else
|
||||||
fprintf(self->dumper.out,"%g, ",values[i]);
|
fprintf(self->dumper.out, "%g, ", values[i]);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (count>cols) fprintf(self->dumper.out,"\n%-*s",tab," ");
|
if (count>cols) fprintf(self->dumper.out,"\n%-*s",tab," ");
|
||||||
if (values[i] == missing_value)
|
if (values[i] == missing_value)
|
||||||
fprintf(self->dumper.out, "%s ","null");
|
fprintf(self->dumper.out, "%s ","null");
|
||||||
else
|
else
|
||||||
fprintf(self->dumper.out,"%g ",values[i]);
|
fprintf(self->dumper.out, "%g ",values[i]);
|
||||||
if (more)
|
if (more)
|
||||||
fprintf(self->dumper.out,"\n%-*s... %ld more values",tab," ",more);
|
fprintf(self->dumper.out, "\n%-*s... %ld more values", tab, " ", more);
|
||||||
|
|
||||||
tab=lens+mydepth+5;
|
tab=lens+mydepth+5;
|
||||||
fprintf(self->dumper.out,"\n%-*s] ",tab," ");
|
fprintf(self->dumper.out,"\n%-*s] ",tab," ");
|
||||||
|
|
|
@ -21,7 +21,7 @@ int grib_nearest_find(
|
||||||
double inlat, double inlon,
|
double inlat, double inlon,
|
||||||
unsigned long flags,
|
unsigned long flags,
|
||||||
double* outlats,double* outlons,
|
double* outlats,double* outlons,
|
||||||
double* values,double* distances, int* indexes, size_t *len)
|
double* values, double* distances, int* indexes, size_t *len)
|
||||||
{
|
{
|
||||||
grib_nearest_class *c = nearest->cclass;
|
grib_nearest_class *c = nearest->cclass;
|
||||||
Assert( flags <= (GRIB_NEAREST_SAME_GRID|GRIB_NEAREST_SAME_DATA|GRIB_NEAREST_SAME_POINT) );
|
Assert( flags <= (GRIB_NEAREST_SAME_GRID|GRIB_NEAREST_SAME_DATA|GRIB_NEAREST_SAME_POINT) );
|
||||||
|
|
Loading…
Reference in New Issue