mirror of https://github.com/ecmwf/eccodes.git
Examples: Fortran dump both GRIB and BUFR
This commit is contained in:
parent
08989dde14
commit
cf3ea9b924
|
@ -10,22 +10,25 @@
|
|||
program grib_dump_test
|
||||
use eccodes
|
||||
implicit none
|
||||
integer :: ifile
|
||||
integer :: iret
|
||||
integer :: count1 = 0
|
||||
integer :: msgid
|
||||
integer :: ifile, iret, msgid
|
||||
integer :: product_kind
|
||||
character(len=10) :: product_string
|
||||
character(len=100) :: infile_name
|
||||
|
||||
call getarg(1, infile_name)
|
||||
call getarg(1, product_string)
|
||||
product_kind = CODES_PRODUCT_GRIB
|
||||
if (product_string == "bufr") product_kind = CODES_PRODUCT_BUFR
|
||||
|
||||
call getarg(2, infile_name)
|
||||
|
||||
call codes_open_file(ifile, infile_name, 'r')
|
||||
|
||||
print *, "===== FILE:", infile_name
|
||||
do while (.true.)
|
||||
call codes_any_new_from_file(ifile, msgid, iret)
|
||||
call codes_new_from_file(ifile, msgid, product_kind, iret)
|
||||
!call codes_any_new_from_file(ifile, msgid, iret)
|
||||
if (iret == CODES_END_OF_FILE) exit
|
||||
|
||||
count1 = count1 + 1
|
||||
print *, "===== Message #", count1
|
||||
|
||||
call codes_dump(msgid)
|
||||
|
||||
call codes_release(msgid)
|
||||
|
|
|
@ -9,5 +9,5 @@
|
|||
|
||||
. ./include.ctest.sh
|
||||
|
||||
${examples_dir}/eccodes_f_codes_dump ${data_dir}/sample.grib2
|
||||
${examples_dir}/eccodes_f_codes_dump ${data_dir}/bufr/airs_57.bufr
|
||||
${examples_dir}/eccodes_f_codes_dump grib ${data_dir}/sample.grib2
|
||||
${examples_dir}/eccodes_f_codes_dump bufr ${data_dir}/bufr/airs_57.bufr
|
||||
|
|
Loading…
Reference in New Issue