From 3b86b179c47f32a479b156e03e8fe4740dcd730a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 13 Jan 2024 17:14:08 +0000 Subject: [PATCH] Examples: Fortran --- examples/F90/bufr_copy_message.f90 | 4 ++-- examples/F90/grib_count_messages.f90 | 11 +++++------ examples/F90/grib_get_keys.f90 | 4 ++-- examples/F90/grib_print_data_static.f90 | 4 ++-- examples/F90/grib_set_missing.f90 | 4 ++-- examples/F90/set_missing_fortran.f90 | 4 ++-- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/examples/F90/bufr_copy_message.f90 b/examples/F90/bufr_copy_message.f90 index 2fcbd2fe2..f2cbfcf3f 100644 --- a/examples/F90/bufr_copy_message.f90 +++ b/examples/F90/bufr_copy_message.f90 @@ -10,7 +10,7 @@ ! Description: How to copy a BUFR message in memory ! ! -program copy +program bufr_copy_message use eccodes implicit none integer :: err, sub_centre @@ -50,4 +50,4 @@ program copy call codes_close_file(outfile) deallocate (message) -end program copy +end program diff --git a/examples/F90/grib_count_messages.f90 b/examples/F90/grib_count_messages.f90 index 512b5ce5c..e4ae30210 100644 --- a/examples/F90/grib_count_messages.f90 +++ b/examples/F90/grib_count_messages.f90 @@ -9,7 +9,7 @@ ! Description: Count messages before processing ! ! -program get +program grib_count_messages use eccodes implicit none @@ -17,7 +17,7 @@ program get integer :: iret integer :: n integer :: i - integer, dimension(:), allocatable :: igrib + integer, dimension(:), allocatable :: igrib real :: latitudeOfFirstPointInDegrees real :: longitudeOfFirstPointInDegrees real :: latitudeOfLastPointInDegrees @@ -25,11 +25,10 @@ program get integer :: numberOfPointsAlongAParallel integer :: numberOfPointsAlongAMeridian real, dimension(:), allocatable :: values - integer :: numberOfValues + integer(8) :: numberOfValues real :: average, min_val, max_val - call codes_open_file(ifile, & - '../../data/tigge_pf_ecmwf.grib2', 'r') + call codes_open_file(ifile, '../../data/tigge_pf_ecmwf.grib2', 'r') ! count the messages in the file call codes_count_in_file(ifile, n) @@ -106,4 +105,4 @@ program get deallocate (igrib) -end program get +end program diff --git a/examples/F90/grib_get_keys.f90 b/examples/F90/grib_get_keys.f90 index 5a20b8179..7eae46d03 100644 --- a/examples/F90/grib_get_keys.f90 +++ b/examples/F90/grib_get_keys.f90 @@ -21,8 +21,8 @@ program grib_get_keys real :: longitudeOfFirstPointInDegrees real :: latitudeOfLastPointInDegrees real :: longitudeOfLastPointInDegrees - integer :: numberOfPointsAlongAParallel - integer :: numberOfPointsAlongAMeridian + integer(4) :: numberOfPointsAlongAParallel + integer(8) :: numberOfPointsAlongAMeridian real, dimension(:), allocatable :: values integer :: numberOfValues real :: average, min_val, max_val diff --git a/examples/F90/grib_print_data_static.f90 b/examples/F90/grib_print_data_static.f90 index d7e9d4b37..17a96d325 100644 --- a/examples/F90/grib_print_data_static.f90 +++ b/examples/F90/grib_print_data_static.f90 @@ -12,7 +12,7 @@ ! rather than the new ALLOCATABLE array ! ! -program print_data +program print_data_static use grib_api implicit none integer :: ifile @@ -55,4 +55,4 @@ program print_data call grib_release(igrib) call grib_close_file(ifile) -end program print_data +end program diff --git a/examples/F90/grib_set_missing.f90 b/examples/F90/grib_set_missing.f90 index 7c0887571..44160fbee 100644 --- a/examples/F90/grib_set_missing.f90 +++ b/examples/F90/grib_set_missing.f90 @@ -11,7 +11,7 @@ ! ! ! -program set +program set_missing use eccodes implicit none integer :: infile, outfile @@ -48,4 +48,4 @@ program set call codes_close_file(infile) call codes_close_file(outfile) -end program set +end program diff --git a/examples/F90/set_missing_fortran.f90 b/examples/F90/set_missing_fortran.f90 index d0ae2403b..093092aa4 100644 --- a/examples/F90/set_missing_fortran.f90 +++ b/examples/F90/set_missing_fortran.f90 @@ -9,7 +9,7 @@ ! Description: how to set key values. ! ! -program set +program set_missing_fortran use eccodes implicit none integer :: infile, outfile @@ -40,4 +40,4 @@ program set call codes_close_file(outfile) -end program set +end program