diff --git a/examples/F90/grib_get_keys.f90 b/examples/F90/grib_get_keys.f90 index b7db43204..5a20b8179 100644 --- a/examples/F90/grib_get_keys.f90 +++ b/examples/F90/grib_get_keys.f90 @@ -26,7 +26,7 @@ program grib_get_keys real, dimension(:), allocatable :: values integer :: numberOfValues real :: average, min_val, max_val - integer :: is_missing + integer :: is_missing, is_defined character(len=10) :: open_mode = 'r' call codes_open_file(ifile, '../../data/reduced_latlon_surface.grib1', open_mode) @@ -38,9 +38,14 @@ program grib_get_keys call codes_grib_new_from_file(ifile, igrib, iret) if (iret == CODES_END_OF_FILE) exit LOOP + ! check key is defined + is_defined = 0 + call codes_is_defined(igrib, 'Ni', is_defined) + write (*, *) 'Key Ni is defined? ', is_defined + ! check if the value of the key is MISSING - is_missing = 0; - call codes_is_missing(igrib, 'Ni', is_missing); + is_missing = 0 + call codes_is_missing(igrib, 'Ni', is_missing) if (is_missing /= 1) then ! key value is not missing so get as an integer call codes_get(igrib, 'Ni', numberOfPointsAlongAParallel) diff --git a/examples/F90/grib_get_keys.sh b/examples/F90/grib_get_keys.sh index 6d7ba8346..0e2eb35c2 100755 --- a/examples/F90/grib_get_keys.sh +++ b/examples/F90/grib_get_keys.sh @@ -9,4 +9,4 @@ . ./include.ctest.sh -${examples_dir}/eccodes_f_grib_get_keys > /dev/null +${examples_dir}/eccodes_f_grib_get_keys