mirror of https://github.com/ecmwf/eccodes.git
ECC-320: bufr_dump -Dfilter (part 5)
This commit is contained in:
parent
c9004a56b6
commit
d5540caf51
|
@ -159,12 +159,9 @@ static void dump_values(grib_dumper* d, grib_accessor* a)
|
|||
{
|
||||
grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d;
|
||||
double value; size_t size = 0;
|
||||
double *values=NULL;
|
||||
int err = 0;
|
||||
int i,r,icount;
|
||||
int cols=2;
|
||||
int r=0;
|
||||
long count=0;
|
||||
char* sval;
|
||||
grib_context* c=a->context;
|
||||
grib_handle* h=grib_handle_of_accessor(a);
|
||||
|
||||
|
@ -174,55 +171,26 @@ static void dump_values(grib_dumper* d, grib_accessor* a)
|
|||
if ( (a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) !=0)
|
||||
return;
|
||||
|
||||
if (size>1) {
|
||||
values=(double*)grib_context_malloc_clear(c,sizeof(double)*size);
|
||||
err=grib_unpack_double(a,values,&size);
|
||||
} else {
|
||||
if (size<=1) {
|
||||
err=grib_unpack_double(a,&value,&size);
|
||||
}
|
||||
|
||||
self->empty=0;
|
||||
|
||||
if (size>1) {
|
||||
|
||||
fprintf(self->dumper.out," if(allocated(rvalues)) deallocate(rvalues)\n");
|
||||
fprintf(self->dumper.out," allocate(rvalues(%lu))\n", (unsigned long)size);
|
||||
|
||||
fprintf(self->dumper.out," rvalues=(/");
|
||||
|
||||
icount=0;
|
||||
for (i=0; i<size-1; ++i) {
|
||||
if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;}
|
||||
sval=dval_to_string(c,values[i]);
|
||||
fprintf(self->dumper.out,"%s, ", sval);
|
||||
grib_context_free(c,sval);
|
||||
icount++;
|
||||
}
|
||||
if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;}
|
||||
sval=dval_to_string(c,values[i]);
|
||||
fprintf(self->dumper.out,"%s", sval);
|
||||
grib_context_free(c,sval);
|
||||
|
||||
depth-=2;
|
||||
fprintf(self->dumper.out,"/)\n");
|
||||
grib_context_free(c,values);
|
||||
|
||||
if ((r=compute_key_rank(h,self->keys,a->name))!=0)
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',rvalues)\n",r,a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', rvalues)\n",r,a->name);
|
||||
else
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s',rvalues)\n",a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s', rvalues)\n",a->name);
|
||||
} else {
|
||||
r=compute_key_rank(h,self->keys,a->name);
|
||||
if( !grib_is_missing_double(a,value) ) {
|
||||
|
||||
sval=dval_to_string(c,value);
|
||||
if (r!=0)
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',%s)\n",r,a->name,sval);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', realVal)\n", r, a->name);
|
||||
else
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s',%s)\n",a->name,sval);
|
||||
|
||||
grib_context_free(c,sval);
|
||||
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s', realVal)\n", a->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,8 +218,6 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char*
|
|||
double value; size_t size = 0;
|
||||
double *values=NULL;
|
||||
int err = 0;
|
||||
int i,icount;
|
||||
int cols=2;
|
||||
long count=0;
|
||||
char* sval;
|
||||
grib_context* c=a->context;
|
||||
|
@ -272,39 +238,15 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char*
|
|||
self->empty=0;
|
||||
|
||||
if (size>1) {
|
||||
|
||||
fprintf(self->dumper.out," if(allocated(rvalues)) deallocate(rvalues)\n");
|
||||
fprintf(self->dumper.out," allocate(rvalues(%lu))\n", (unsigned long)size);
|
||||
|
||||
fprintf(self->dumper.out," rvalues=(/");
|
||||
|
||||
icount=0;
|
||||
for (i=0; i<size-1; ++i) {
|
||||
if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;}
|
||||
sval=dval_to_string(c,values[i]);
|
||||
fprintf(self->dumper.out,"%s, ", sval);
|
||||
grib_context_free(c,sval);
|
||||
icount++;
|
||||
}
|
||||
if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;}
|
||||
sval=dval_to_string(c,values[i]);
|
||||
fprintf(self->dumper.out,"%s", sval);
|
||||
grib_context_free(c,sval);
|
||||
|
||||
depth-=2;
|
||||
fprintf(self->dumper.out,"/)\n");
|
||||
grib_context_free(c,values);
|
||||
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s' &\n,rvalues)\n",prefix,a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s->%s', rvalues)\n",prefix,a->name);
|
||||
} else {
|
||||
/* int r=compute_key_rank(h,self->keys,a->name); */
|
||||
if( !grib_is_missing_double(a,value) ) {
|
||||
|
||||
sval=dval_to_string(c,value);
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s' &\n,%s)\n",prefix,a->name,sval);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s->%s', realVal)\n", prefix, a->name);
|
||||
|
||||
grib_context_free(c,sval);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -329,8 +271,7 @@ static void dump_long(grib_dumper* d,grib_accessor* a, const char* comment)
|
|||
long value; size_t size = 0;
|
||||
long *values=NULL;
|
||||
int err = 0;
|
||||
int i,r,icount;
|
||||
int cols=4;
|
||||
int r=0;
|
||||
long count=0;
|
||||
grib_context* c=a->context;
|
||||
grib_handle* h=grib_handle_of_accessor(a);
|
||||
|
@ -369,37 +310,22 @@ static void dump_long(grib_dumper* d,grib_accessor* a, const char* comment)
|
|||
self->empty=0;
|
||||
|
||||
if (size>1) {
|
||||
fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n");
|
||||
fprintf(self->dumper.out," allocate(ivalues(%lu))\n", (unsigned long)size);
|
||||
|
||||
fprintf(self->dumper.out," ivalues=(/");
|
||||
icount=0;
|
||||
for (i=0;i<size-1;i++) {
|
||||
if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;}
|
||||
fprintf(self->dumper.out,"%ld, ",values[i]);
|
||||
icount++;
|
||||
}
|
||||
if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;}
|
||||
fprintf(self->dumper.out,"%ld ",values[i]);
|
||||
|
||||
depth-=2;
|
||||
fprintf(self->dumper.out,"/)\n");
|
||||
fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n");
|
||||
grib_context_free(a->context,values);
|
||||
|
||||
if ((r=compute_key_rank(h,self->keys,a->name))!=0)
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',ivalues)\n",r,a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', ivalues)\n", r,a->name);
|
||||
else
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s',ivalues)\n",a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s', ivalues)\n", a->name);
|
||||
|
||||
} else {
|
||||
r=compute_key_rank(h,self->keys,a->name);
|
||||
if( !grib_is_missing_long(a,value) ) {
|
||||
if (r!=0)
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',",r,a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', intVal)\n", r, a->name);
|
||||
else
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s',",a->name);
|
||||
|
||||
fprintf(self->dumper.out,"%ld)\n",value);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s', intVal)\n", a->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -426,8 +352,6 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr
|
|||
long value; size_t size = 0;
|
||||
long *values=NULL;
|
||||
int err = 0;
|
||||
int i,icount;
|
||||
int cols=4;
|
||||
long count=0;
|
||||
grib_context* c=a->context;
|
||||
|
||||
|
@ -447,30 +371,15 @@ static void dump_long_attribute(grib_dumper* d, grib_accessor* a, const char* pr
|
|||
self->empty=0;
|
||||
|
||||
if (size>1) {
|
||||
fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n");
|
||||
fprintf(self->dumper.out," allocate(ivalues(%lu))\n", (unsigned long)size);
|
||||
|
||||
fprintf(self->dumper.out," ivalues=(/");
|
||||
icount=0;
|
||||
for (i=0;i<size-1;i++) {
|
||||
if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;}
|
||||
fprintf(self->dumper.out,"%ld, ",values[i]);
|
||||
icount++;
|
||||
}
|
||||
if (icount>cols || i==0) {fprintf(self->dumper.out," &\n ");icount=0;}
|
||||
fprintf(self->dumper.out,"%ld ",values[i]);
|
||||
|
||||
depth-=2;
|
||||
fprintf(self->dumper.out,"/)\n");
|
||||
fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n");
|
||||
grib_context_free(a->context,values);
|
||||
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s' &\n,ivalues)\n",prefix,a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s->%s', ivalues)\n", prefix, a->name);
|
||||
|
||||
} else {
|
||||
/* int r=compute_key_rank(h,self->keys,a->name); */
|
||||
if( !grib_is_missing_long(a,value) ) {
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s'&\n,",prefix,a->name);
|
||||
fprintf(self->dumper.out,"%ld)\n",value);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s->%s', intVal)\n", prefix, a->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -511,9 +420,9 @@ static void dump_double(grib_dumper* d, grib_accessor* a, const char* comment)
|
|||
if( !grib_is_missing_double(a,value) ) {
|
||||
sval=dval_to_string(c,value);
|
||||
if (r!=0)
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',%s)\n",r,a->name,sval);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr,'#%d#%s', realVal)\n",r,a->name);
|
||||
else
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s',%s)\n",a->name,sval);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr,'%s', realVal)\n",a->name);
|
||||
|
||||
grib_context_free(c,sval);
|
||||
}
|
||||
|
@ -538,7 +447,7 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm
|
|||
{
|
||||
grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d;
|
||||
char **values;
|
||||
size_t size = 0,i=0;
|
||||
size_t size = 0;
|
||||
grib_context* c=NULL;
|
||||
int err = 0;
|
||||
long count=0;
|
||||
|
@ -560,8 +469,6 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm
|
|||
fprintf(self->dumper.out," if(allocated(svalues)) deallocate(svalues)\n");
|
||||
fprintf(self->dumper.out," allocate(svalues(%lu))\n", (unsigned long)size);
|
||||
|
||||
fprintf(self->dumper.out," svalues=(/");
|
||||
|
||||
self->empty=0;
|
||||
|
||||
values=(char**)grib_context_malloc_clear(c,size*sizeof(char*));
|
||||
|
@ -572,16 +479,11 @@ static void dump_string_array(grib_dumper* d, grib_accessor* a, const char* comm
|
|||
|
||||
err = grib_unpack_string_array(a,values,&size);
|
||||
|
||||
for (i=0;i<size-1;i++) {
|
||||
fprintf(self->dumper.out," \"%s\", &\n",values[i]);
|
||||
}
|
||||
fprintf(self->dumper.out," \"%s\" /)\n",values[i]);
|
||||
|
||||
if (self->isLeaf==0) {
|
||||
if ((r=compute_key_rank(h,self->keys,a->name))!=0)
|
||||
fprintf(self->dumper.out," call codes_set_string_array(ibufr,'#%d#%s',svalues)\n",r,a->name);
|
||||
fprintf(self->dumper.out," call codes_get_string_array(ibufr,'#%d#%s',svalues)\n",r,a->name);
|
||||
else
|
||||
fprintf(self->dumper.out," call codes_set_string_array(ibufr,'%s',svalues)\n",a->name);
|
||||
fprintf(self->dumper.out," call codes_get_string_array(ibufr,'%s',svalues)\n",a->name);
|
||||
}
|
||||
|
||||
if (self->isLeaf==0) {
|
||||
|
@ -639,11 +541,11 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
|
|||
if (self->isLeaf==0) {
|
||||
depth+=2;
|
||||
if (r!=0)
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'#%d#%s',",r,a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '#%d#%s', strVal)\n", r,a->name);
|
||||
else
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s',",a->name);
|
||||
fprintf(self->dumper.out," call codes_get(ibufr, '%s', strVal)\n", a->name);
|
||||
}
|
||||
fprintf(self->dumper.out,"\'%s\')\n",value);
|
||||
/*fprintf(self->dumper.out,"\'%s\')\n",value);*/
|
||||
|
||||
|
||||
if (self->isLeaf==0) {
|
||||
|
@ -675,29 +577,10 @@ static void dump_label(grib_dumper* d, grib_accessor* a, const char* comment)
|
|||
|
||||
static void _dump_long_array(grib_handle* h, FILE* f, const char* key, const char* print_key)
|
||||
{
|
||||
long* val;
|
||||
size_t size=0,i;
|
||||
int cols=9,icount=0;
|
||||
|
||||
size_t size=0;
|
||||
if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return;
|
||||
|
||||
fprintf(f," if(allocated(ivalues)) deallocate(ivalues)\n");
|
||||
fprintf(f," allocate(ivalues(%lu))\n", (unsigned long)size);
|
||||
|
||||
fprintf(f," ivalues=(/ ");
|
||||
|
||||
val=grib_context_malloc_clear(h->context,sizeof(long)*size);
|
||||
grib_get_long_array(h,key,val,&size);
|
||||
for (i=0;i<size-1;i++) {
|
||||
if (icount>cols || i==0) {fprintf(f," &\n ");icount=0;}
|
||||
fprintf(f,"%ld, ",val[i]);
|
||||
icount++;
|
||||
}
|
||||
if (icount>cols) {fprintf(f," &\n ");}
|
||||
fprintf(f,"%ld /)\n",val[size-1]);
|
||||
|
||||
grib_context_free(h->context,val);
|
||||
fprintf(f," call codes_set(ibufr,'%s',ivalues)\n",print_key);
|
||||
fprintf(f," call codes_get(ibufr, '%s', ivalues)\n",print_key);
|
||||
}
|
||||
|
||||
static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accessors* block)
|
||||
|
@ -765,59 +648,51 @@ static void dump_attributes(grib_dumper* d,grib_accessor* a, const char* prefix)
|
|||
static void header(grib_dumper* d, grib_handle* h)
|
||||
{
|
||||
grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d;
|
||||
char sampleName[200]={0};
|
||||
long localSectionPresent,edition,bufrHeaderCentre,isSatellite;
|
||||
long localSectionPresent,edition,bufrHeaderCentre;
|
||||
|
||||
grib_get_long(h,"localSectionPresent",&localSectionPresent);
|
||||
grib_get_long(h,"bufrHeaderCentre",&bufrHeaderCentre);
|
||||
grib_get_long(h,"edition",&edition);
|
||||
|
||||
if (localSectionPresent && bufrHeaderCentre==98 ) {
|
||||
grib_get_long(h,"isSatellite",&isSatellite);
|
||||
if (isSatellite)
|
||||
sprintf(sampleName,"BUFR%ld_local_satellite",edition);
|
||||
else
|
||||
sprintf(sampleName,"BUFR%ld_local",edition);
|
||||
} else {
|
||||
sprintf(sampleName,"BUFR%ld",edition);
|
||||
}
|
||||
|
||||
if (d->count<2) {
|
||||
fprintf(self->dumper.out,"! This program was automatically generated with bufr_dump -Dfortran\n");
|
||||
fprintf(self->dumper.out,"! Using ecCodes version: ");
|
||||
grib_print_api_version(self->dumper.out);
|
||||
fprintf(self->dumper.out, "\n\n");
|
||||
fprintf(self->dumper.out,"program bufr_create_message\n");
|
||||
fprintf(self->dumper.out,"program bufr_decode\n");
|
||||
fprintf(self->dumper.out," use eccodes\n");
|
||||
fprintf(self->dumper.out," implicit none\n");
|
||||
fprintf(self->dumper.out," integer :: iret\n");
|
||||
fprintf(self->dumper.out," integer :: outfile\n");
|
||||
fprintf(self->dumper.out," integer :: ibufr\n");
|
||||
fprintf(self->dumper.out," integer(kind=4), dimension(:), allocatable :: ivalues\n");
|
||||
fprintf(self->dumper.out," integer, parameter :: max_strsize = 100\n");
|
||||
fprintf(self->dumper.out," integer, parameter :: max_strsize = 100\n");
|
||||
fprintf(self->dumper.out," integer :: iret\n");
|
||||
fprintf(self->dumper.out," integer :: ifile\n");
|
||||
fprintf(self->dumper.out," integer :: ibufr\n");
|
||||
fprintf(self->dumper.out," integer(kind=4) :: intVal\n");
|
||||
fprintf(self->dumper.out," real(kind=8) :: realVal\n");
|
||||
fprintf(self->dumper.out," character(len=max_strsize) :: strVal\n");
|
||||
fprintf(self->dumper.out," integer(kind=4), dimension(:), allocatable :: ivalues\n");
|
||||
fprintf(self->dumper.out," character(len=max_strsize) :: infile_name\n");
|
||||
fprintf(self->dumper.out," character(len=max_strsize) , dimension(:),allocatable :: svalues\n");
|
||||
fprintf(self->dumper.out," real(kind=8), dimension(:), allocatable :: rvalues\n");
|
||||
fprintf(self->dumper.out," real(kind=8), dimension(:), allocatable :: rvalues\n\n");
|
||||
|
||||
fprintf(self->dumper.out," call getarg(1, infile_name)\n");
|
||||
fprintf(self->dumper.out," call codes_open_file(ifile, infile_name, 'r')\n\n");
|
||||
}
|
||||
fprintf(self->dumper.out," call codes_bufr_new_from_samples(ibufr,'%s',iret)\n",sampleName);
|
||||
fprintf(self->dumper.out," if (iret/=CODES_SUCCESS) then\n");
|
||||
fprintf(self->dumper.out," print *,'ERROR creating BUFR from %s'\n",sampleName);
|
||||
fprintf(self->dumper.out," stop 1\n");
|
||||
fprintf(self->dumper.out," endif\n");
|
||||
fprintf(self->dumper.out," ! Message number %ld\n ! -----------------\n", d->count);
|
||||
fprintf(self->dumper.out," write(*,*) 'Decoding message number %ld'\n", d->count);
|
||||
fprintf(self->dumper.out," call codes_bufr_new_from_file(ifile, ibufr)\n");
|
||||
fprintf(self->dumper.out," call codes_set(ibufr, 'unpack', 1)\n");
|
||||
}
|
||||
|
||||
static void footer(grib_dumper* d, grib_handle* h)
|
||||
{
|
||||
grib_dumper_bufr_decode_fortran *self = (grib_dumper_bufr_decode_fortran*)d;
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'pack',1)\n");
|
||||
if (d->count==1)
|
||||
/*if (d->count==1)
|
||||
fprintf(self->dumper.out," call codes_open_file(outfile,'outfile.bufr','w')\n");
|
||||
else
|
||||
fprintf(self->dumper.out," call codes_open_file(outfile,'outfile.bufr','a')\n");
|
||||
*/
|
||||
|
||||
fprintf(self->dumper.out," call codes_write(ibufr,outfile)\n");
|
||||
fprintf(self->dumper.out," call codes_close_file(outfile)\n");
|
||||
/*fprintf(self->dumper.out," call codes_close_file(ifile)\n");*/
|
||||
fprintf(self->dumper.out," call codes_release(ibufr)\n");
|
||||
fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n");
|
||||
fprintf(self->dumper.out," if(allocated(rvalues)) deallocate(rvalues)\n");
|
||||
fprintf(self->dumper.out," if(allocated(svalues)) deallocate(svalues)\n");
|
||||
|
||||
}
|
||||
|
|
|
@ -769,7 +769,7 @@ static void header(grib_dumper* d, grib_handle* h)
|
|||
fprintf(self->dumper.out,"import traceback\n");
|
||||
fprintf(self->dumper.out,"import sys\n");
|
||||
fprintf(self->dumper.out,"from eccodes import *\n\n\n");
|
||||
fprintf(self->dumper.out,"def bufr_decode_message():\n");
|
||||
fprintf(self->dumper.out,"def bufr_decode():\n");
|
||||
}
|
||||
fprintf(self->dumper.out," ibufr = codes_bufr_new_from_samples('%s')\n",sampleName);
|
||||
}
|
||||
|
|
|
@ -297,7 +297,6 @@ static void dump_values_attribute(grib_dumper* d, grib_accessor* a, const char*
|
|||
|
||||
fprintf(self->dumper.out," call codes_set(ibufr,'%s->%s' &\n,rvalues)\n",prefix,a->name);
|
||||
} else {
|
||||
/* int r=compute_key_rank(h,self->keys,a->name); */
|
||||
if( !grib_is_missing_double(a,value) ) {
|
||||
|
||||
sval=dval_to_string(c,value);
|
||||
|
@ -787,7 +786,7 @@ static void header(grib_dumper* d, grib_handle* h)
|
|||
fprintf(self->dumper.out,"! Using ecCodes version: ");
|
||||
grib_print_api_version(self->dumper.out);
|
||||
fprintf(self->dumper.out, "\n\n");
|
||||
fprintf(self->dumper.out,"program bufr_create_message\n");
|
||||
fprintf(self->dumper.out,"program bufr_encode\n");
|
||||
fprintf(self->dumper.out," use eccodes\n");
|
||||
fprintf(self->dumper.out," implicit none\n");
|
||||
fprintf(self->dumper.out," integer :: iret\n");
|
||||
|
|
|
@ -769,7 +769,7 @@ static void header(grib_dumper* d, grib_handle* h)
|
|||
fprintf(self->dumper.out,"import traceback\n");
|
||||
fprintf(self->dumper.out,"import sys\n");
|
||||
fprintf(self->dumper.out,"from eccodes import *\n\n\n");
|
||||
fprintf(self->dumper.out,"def bufr_create_message():\n");
|
||||
fprintf(self->dumper.out,"def bufr_encode():\n");
|
||||
}
|
||||
fprintf(self->dumper.out," ibufr = codes_bufr_new_from_samples('%s')\n",sampleName);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue