F90 codes_dump for GRIB and BUFR (debugging aid)

This commit is contained in:
Shahram Najm 2015-11-10 11:21:44 +00:00
parent eabfbaec9e
commit 5d58da9af0
3 changed files with 22 additions and 3 deletions

View File

@ -34,9 +34,11 @@ character(len=9) :: typicalDate
do while (iret/=CODES_END_OF_FILE)
! For debugging
call codes_dump(ibufr)
! get and print some keys form the BUFR header
write(*,*) 'message: ',count
call codes_dump(ibufr)
! we need to instruct ecCodes to expand all the descriptors
! i.e. unpack the data values

View File

@ -39,7 +39,9 @@ program grib_get_keys
LOOP: DO WHILE (iret /= CODES_END_OF_FILE)
call grib_dump(igrib)
! For debugging
call grib_dump(igrib)
!check if the value of the key is MISSING
is_missing=0;
call codes_is_missing(igrib,'Ni',is_missing);

View File

@ -1590,13 +1590,28 @@ int grib_f_release(int* hid){
}
/*****************************************************************************/
static void do_the_dump(grib_handle* h)
{
if (h->product_kind == PRODUCT_GRIB)
{
const int dump_flags = GRIB_DUMP_FLAG_VALUES
| GRIB_DUMP_FLAG_READ_ONLY
| GRIB_DUMP_FLAG_ALIASES
| GRIB_DUMP_FLAG_TYPE;
grib_dump_content(h,stdout,"debug", dump_flags, NULL);
}
else
{
grib_dump_content(h,stdout,"wmo",0,NULL);
}
}
int grib_f_dump_(int* gid){
grib_handle *h = get_handle(*gid);
if(!h)
return GRIB_INVALID_GRIB;
else
grib_dump_content(h,stdout,"wmo",0,NULL);
do_the_dump(h);
return GRIB_SUCCESS;
}