mirror of https://github.com/ecmwf/eccodes.git
Fortran API: formatting (https://github.com/pseewald/fprettify)
This commit is contained in:
parent
b62e22fef9
commit
de42c8f6a5
|
@ -17,13 +17,12 @@ module eccodes
|
|||
include "eccodes_visibility.h"
|
||||
include "eccodes_settings.h"
|
||||
|
||||
real(8), parameter,public :: CODES_MISSING_DOUBLE = -1.D+100
|
||||
integer(4), parameter,public :: CODES_MISSING_LONG = 2147483647
|
||||
|
||||
integer, parameter,public :: CODES_PRODUCT_ANY = 0
|
||||
integer, parameter,public :: CODES_PRODUCT_GRIB = 1
|
||||
integer, parameter,public :: CODES_PRODUCT_BUFR = 2
|
||||
real(8), parameter, public :: CODES_MISSING_DOUBLE = -1.D+100
|
||||
integer(4), parameter, public :: CODES_MISSING_LONG = 2147483647
|
||||
|
||||
integer, parameter, public :: CODES_PRODUCT_ANY = 0
|
||||
integer, parameter, public :: CODES_PRODUCT_GRIB = 1
|
||||
integer, parameter, public :: CODES_PRODUCT_BUFR = 2
|
||||
|
||||
!> Create a new message in memory from an integer or character array containting the coded message.
|
||||
!>
|
||||
|
@ -42,8 +41,8 @@ module eccodes
|
|||
!> @param message array containing the coded message
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_new_from_message
|
||||
module procedure codes_new_from_message_int4
|
||||
module procedure codes_new_from_message_char
|
||||
module procedure codes_new_from_message_int4
|
||||
module procedure codes_new_from_message_char
|
||||
end interface codes_new_from_message
|
||||
|
||||
!> Get a value of specified index from an array key.
|
||||
|
@ -70,9 +69,9 @@ module eccodes
|
|||
!> @param[out] status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_get_element
|
||||
module procedure codes_get_real4_element, &
|
||||
codes_get_real8_element, &
|
||||
codes_get_real4_elements, &
|
||||
codes_get_real8_elements
|
||||
codes_get_real8_element, &
|
||||
codes_get_real4_elements, &
|
||||
codes_get_real8_elements
|
||||
end interface codes_get_element
|
||||
|
||||
!> Find the nearest point/points of a given latitude/longitude point.
|
||||
|
@ -113,8 +112,8 @@ module eccodes
|
|||
!> @param[out] status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_grib_find_nearest
|
||||
module procedure codes_grib_find_nearest_single, &
|
||||
codes_grib_find_nearest_four_single, &
|
||||
codes_grib_find_nearest_multiple
|
||||
codes_grib_find_nearest_four_single, &
|
||||
codes_grib_find_nearest_multiple
|
||||
end interface codes_grib_find_nearest
|
||||
|
||||
!> Get latitude/longitude and data values.
|
||||
|
@ -136,5 +135,5 @@ module eccodes
|
|||
!> @param[out] values data values array with dimension "size"
|
||||
interface codes_grib_get_data
|
||||
module procedure codes_grib_get_data_real4, &
|
||||
codes_grib_get_data_real8
|
||||
codes_grib_get_data_real8
|
||||
end interface codes_grib_get_data
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
||||
! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
|
||||
|
||||
!> Get the distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||
!>
|
||||
!>
|
||||
|
@ -22,8 +21,8 @@
|
|||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_index_get
|
||||
module procedure codes_index_get_int, &
|
||||
codes_index_get_string, &
|
||||
codes_index_get_real8
|
||||
codes_index_get_string, &
|
||||
codes_index_get_real8
|
||||
end interface codes_index_get
|
||||
|
||||
!> Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||
|
@ -40,7 +39,7 @@
|
|||
!> @param size number of distinct values of the key in the index
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_index_get_size
|
||||
module procedure codes_index_get_size_int
|
||||
module procedure codes_index_get_size_int
|
||||
end interface codes_index_get_size
|
||||
|
||||
!> Select the message subset with key==value.
|
||||
|
@ -58,8 +57,8 @@
|
|||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_index_select
|
||||
module procedure codes_index_select_int, &
|
||||
codes_index_select_string, &
|
||||
codes_index_select_real8
|
||||
codes_index_select_string, &
|
||||
codes_index_select_real8
|
||||
end interface codes_index_select
|
||||
|
||||
!> Get the value for a key from a message.
|
||||
|
@ -96,16 +95,15 @@
|
|||
!> @param[out] status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_get
|
||||
module procedure codes_get_int, &
|
||||
codes_get_real4, &
|
||||
codes_get_real8, &
|
||||
codes_get_string, &
|
||||
codes_get_byte_array, &
|
||||
codes_get_int_array, &
|
||||
codes_get_real4_array, &
|
||||
codes_get_real8_array
|
||||
codes_get_real4, &
|
||||
codes_get_real8, &
|
||||
codes_get_string, &
|
||||
codes_get_byte_array, &
|
||||
codes_get_int_array, &
|
||||
codes_get_real4_array, &
|
||||
codes_get_real8_array
|
||||
end interface codes_get
|
||||
|
||||
|
||||
!> Get the size of an array key.
|
||||
!>
|
||||
!> To get the size of a key representing an array.
|
||||
|
@ -119,7 +117,7 @@
|
|||
!> @param size size of the array key
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_get_size
|
||||
module procedure codes_get_size_int
|
||||
module procedure codes_get_size_int
|
||||
end interface codes_get_size
|
||||
|
||||
!> Set the value for a key in a message.
|
||||
|
@ -147,17 +145,17 @@
|
|||
!> @param[out] status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_set
|
||||
module procedure codes_set_int, &
|
||||
codes_set_real4, &
|
||||
codes_set_real8, &
|
||||
codes_set_string, &
|
||||
codes_set_int_array, &
|
||||
codes_set_byte_array, &
|
||||
codes_set_real4_array, &
|
||||
codes_set_real8_array
|
||||
codes_set_real4, &
|
||||
codes_set_real8, &
|
||||
codes_set_string, &
|
||||
codes_set_int_array, &
|
||||
codes_set_byte_array, &
|
||||
codes_set_real4_array, &
|
||||
codes_set_real8_array
|
||||
end interface codes_set
|
||||
|
||||
interface codes_set_force
|
||||
module procedure codes_set_force_real4_array, &
|
||||
codes_set_force_real8_array
|
||||
codes_set_force_real8_array
|
||||
end interface codes_set_force
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
!> @param nbytes number of bytes to be read
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_read_from_file
|
||||
module procedure codes_read_from_file_int4
|
||||
module procedure codes_read_from_file_char
|
||||
module procedure codes_read_from_file_int4
|
||||
module procedure codes_read_from_file_char
|
||||
end interface codes_read_from_file
|
||||
|
||||
!> Reads nbytes bytes into the buffer from a file opened with codes_open_file.
|
||||
|
@ -32,10 +32,10 @@
|
|||
!> @param nbytes number of bytes to be read
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_read_bytes
|
||||
module procedure codes_read_bytes_int4
|
||||
module procedure codes_read_bytes_char
|
||||
module procedure codes_read_bytes_real8
|
||||
module procedure codes_read_bytes_real4
|
||||
module procedure codes_read_bytes_int4
|
||||
module procedure codes_read_bytes_char
|
||||
module procedure codes_read_bytes_real8
|
||||
module procedure codes_read_bytes_real4
|
||||
end interface codes_read_bytes
|
||||
|
||||
!> Write nbytes bytes from the buffer in a file opened with codes_open_file.
|
||||
|
@ -49,10 +49,10 @@
|
|||
!> @param nbytes number of bytes to be written
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_write_bytes
|
||||
module procedure codes_write_bytes_int4
|
||||
module procedure codes_write_bytes_char
|
||||
module procedure codes_write_bytes_real8
|
||||
module procedure codes_write_bytes_real4
|
||||
module procedure codes_write_bytes_int4
|
||||
module procedure codes_write_bytes_char
|
||||
module procedure codes_write_bytes_real8
|
||||
module procedure codes_write_bytes_real4
|
||||
end interface codes_write_bytes
|
||||
|
||||
!> Get the size of a coded message.
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
||||
! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
|
||||
|
||||
!> Get the distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||
!>
|
||||
!>
|
||||
|
@ -22,9 +21,9 @@
|
|||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_index_get
|
||||
module procedure codes_index_get_int, &
|
||||
codes_index_get_long, &
|
||||
codes_index_get_string, &
|
||||
codes_index_get_real8
|
||||
codes_index_get_long, &
|
||||
codes_index_get_string, &
|
||||
codes_index_get_real8
|
||||
end interface codes_index_get
|
||||
|
||||
!> Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||
|
@ -41,7 +40,7 @@
|
|||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_index_get_size
|
||||
module procedure codes_index_get_size_int, &
|
||||
codes_index_get_size_long
|
||||
codes_index_get_size_long
|
||||
end interface codes_index_get_size
|
||||
|
||||
!> Select the message subset with key==value.
|
||||
|
@ -59,9 +58,9 @@
|
|||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_index_select
|
||||
module procedure codes_index_select_int, &
|
||||
codes_index_select_long, &
|
||||
codes_index_select_string, &
|
||||
codes_index_select_real8
|
||||
codes_index_select_long, &
|
||||
codes_index_select_string, &
|
||||
codes_index_select_real8
|
||||
end interface codes_index_select
|
||||
|
||||
!> Get the value for a key from a message.
|
||||
|
@ -96,14 +95,14 @@
|
|||
!> @param[out] status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_get
|
||||
module procedure codes_get_int, &
|
||||
codes_get_long, &
|
||||
codes_get_real4, &
|
||||
codes_get_real8, &
|
||||
codes_get_string, &
|
||||
codes_get_byte_array, &
|
||||
codes_get_int_array, &
|
||||
codes_get_real4_array, &
|
||||
codes_get_real8_array
|
||||
codes_get_long, &
|
||||
codes_get_real4, &
|
||||
codes_get_real8, &
|
||||
codes_get_string, &
|
||||
codes_get_byte_array, &
|
||||
codes_get_int_array, &
|
||||
codes_get_real4_array, &
|
||||
codes_get_real8_array
|
||||
end interface codes_get
|
||||
|
||||
!> Get the size of an array key.
|
||||
|
@ -119,8 +118,8 @@
|
|||
!> @param size size of the array key
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_get_size
|
||||
module procedure codes_get_size_int, &
|
||||
codes_get_size_long
|
||||
module procedure codes_get_size_int, &
|
||||
codes_get_size_long
|
||||
end interface codes_get_size
|
||||
|
||||
!> Set the value for a key in a message.
|
||||
|
@ -148,19 +147,19 @@
|
|||
!> @param[out] status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_set
|
||||
module procedure codes_set_int, &
|
||||
codes_set_long, &
|
||||
codes_set_real4, &
|
||||
codes_set_real8, &
|
||||
codes_set_string, &
|
||||
codes_set_int_array, &
|
||||
codes_set_long_array, &
|
||||
codes_set_byte_array, &
|
||||
codes_set_real4_array, &
|
||||
codes_set_real8_array
|
||||
codes_set_long, &
|
||||
codes_set_real4, &
|
||||
codes_set_real8, &
|
||||
codes_set_string, &
|
||||
codes_set_int_array, &
|
||||
codes_set_long_array, &
|
||||
codes_set_byte_array, &
|
||||
codes_set_real4_array, &
|
||||
codes_set_real8_array
|
||||
end interface codes_set
|
||||
|
||||
interface codes_set_force
|
||||
module procedure codes_set_force_real4_array, &
|
||||
codes_set_force_real8_array
|
||||
codes_set_force_real8_array
|
||||
end interface codes_set_force
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
!> @param nbytes number of bytes to be read
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_read_from_file
|
||||
module procedure codes_read_from_file_int4
|
||||
module procedure codes_read_from_file_int4_size_t
|
||||
module procedure codes_read_from_file_char
|
||||
module procedure codes_read_from_file_char_size_t
|
||||
module procedure codes_read_from_file_int4
|
||||
module procedure codes_read_from_file_int4_size_t
|
||||
module procedure codes_read_from_file_char
|
||||
module procedure codes_read_from_file_char_size_t
|
||||
end interface codes_read_from_file
|
||||
|
||||
!> Reads nbytes bytes into the buffer from a file opened with codes_open_file.
|
||||
|
@ -34,14 +34,14 @@
|
|||
!> @param nbytes number of bytes to be read
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_read_bytes
|
||||
module procedure codes_read_bytes_int4
|
||||
module procedure codes_read_bytes_int4_size_t
|
||||
module procedure codes_read_bytes_char
|
||||
module procedure codes_read_bytes_char_size_t
|
||||
module procedure codes_read_bytes_real8
|
||||
module procedure codes_read_bytes_real8_size_t
|
||||
module procedure codes_read_bytes_real4
|
||||
module procedure codes_read_bytes_real4_size_t
|
||||
module procedure codes_read_bytes_int4
|
||||
module procedure codes_read_bytes_int4_size_t
|
||||
module procedure codes_read_bytes_char
|
||||
module procedure codes_read_bytes_char_size_t
|
||||
module procedure codes_read_bytes_real8
|
||||
module procedure codes_read_bytes_real8_size_t
|
||||
module procedure codes_read_bytes_real4
|
||||
module procedure codes_read_bytes_real4_size_t
|
||||
end interface codes_read_bytes
|
||||
|
||||
!> Write nbytes bytes from the buffer in a file opened with codes_open_file.
|
||||
|
@ -55,14 +55,14 @@
|
|||
!> @param nbytes number of bytes to be written
|
||||
!> @param status CODES_SUCCESS if OK, integer value on error
|
||||
interface codes_write_bytes
|
||||
module procedure codes_write_bytes_int4
|
||||
module procedure codes_write_bytes_int4_size_t
|
||||
module procedure codes_write_bytes_char
|
||||
module procedure codes_write_bytes_char_size_t
|
||||
module procedure codes_write_bytes_real8
|
||||
module procedure codes_write_bytes_real8_size_t
|
||||
module procedure codes_write_bytes_real4
|
||||
module procedure codes_write_bytes_real4_size_t
|
||||
module procedure codes_write_bytes_int4
|
||||
module procedure codes_write_bytes_int4_size_t
|
||||
module procedure codes_write_bytes_char
|
||||
module procedure codes_write_bytes_char_size_t
|
||||
module procedure codes_write_bytes_real8
|
||||
module procedure codes_write_bytes_real8_size_t
|
||||
module procedure codes_write_bytes_real4
|
||||
module procedure codes_write_bytes_real4_size_t
|
||||
end interface codes_write_bytes
|
||||
|
||||
!> Get the size of a coded message.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4,25 +4,25 @@ integer function kind_of_long_long
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_long_long=-1
|
||||
kind_of_long_long = -1
|
||||
|
||||
call check_long_long(x2(0),x2(1),ret)
|
||||
call check_long_long(x2(0), x2(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long_long=2
|
||||
return
|
||||
endif
|
||||
kind_of_long_long = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_long_long(x4(0),x4(1),ret)
|
||||
call check_long_long(x4(0), x4(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long_long=4
|
||||
return
|
||||
endif
|
||||
kind_of_long_long = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_long_long(x8(0),x8(1),ret)
|
||||
call check_long_long(x8(0), x8(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long_long=8
|
||||
return
|
||||
endif
|
||||
kind_of_long_long = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_long_long
|
||||
|
||||
|
@ -32,25 +32,25 @@ integer function kind_of_size_t
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_size_t=-1
|
||||
kind_of_size_t = -1
|
||||
|
||||
call check_size_t(x2(0),x2(1),ret)
|
||||
call check_size_t(x2(0), x2(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=2
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_size_t(x4(0),x4(1),ret)
|
||||
call check_size_t(x4(0), x4(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=4
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_size_t(x8(0),x8(1),ret)
|
||||
call check_size_t(x8(0), x8(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=8
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_size_t
|
||||
|
||||
|
@ -60,25 +60,25 @@ integer function kind_of_long
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_long=-1
|
||||
kind_of_long = -1
|
||||
|
||||
call check_long(x2(0),x2(1),ret)
|
||||
call check_long(x2(0), x2(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=2
|
||||
return
|
||||
endif
|
||||
kind_of_long = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_long(x4(0),x4(1),ret)
|
||||
call check_long(x4(0), x4(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=4
|
||||
return
|
||||
endif
|
||||
kind_of_long = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_long(x8(0),x8(1),ret)
|
||||
call check_long(x8(0), x8(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=8
|
||||
return
|
||||
endif
|
||||
kind_of_long = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_long
|
||||
|
||||
|
@ -88,25 +88,25 @@ integer function kind_of_int
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_int=-1
|
||||
kind_of_int = -1
|
||||
|
||||
call check_int(x2(0),x2(1),ret)
|
||||
call check_int(x2(0), x2(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=2
|
||||
return
|
||||
endif
|
||||
kind_of_int = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_int(x4(0),x4(1),ret)
|
||||
call check_int(x4(0), x4(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=4
|
||||
return
|
||||
endif
|
||||
kind_of_int = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_int(x8(0),x8(1),ret)
|
||||
call check_int(x8(0), x8(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=8
|
||||
return
|
||||
endif
|
||||
kind_of_int = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_int
|
||||
|
||||
|
@ -115,19 +115,19 @@ integer function kind_of_float
|
|||
real(8), dimension(2) :: x8 = (/1., 2./)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_float=-1
|
||||
kind_of_float = -1
|
||||
|
||||
call check_float(x4(0),x4(1),ret)
|
||||
call check_float(x4(0), x4(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_float=4
|
||||
return
|
||||
endif
|
||||
kind_of_float = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_float(x8(0),x8(1),ret)
|
||||
call check_float(x8(0), x8(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_float=8
|
||||
return
|
||||
endif
|
||||
kind_of_float = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_float
|
||||
|
||||
|
@ -136,30 +136,30 @@ integer function kind_of_double
|
|||
real(8), dimension(2) :: real8 = (/1., 2./)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_double=-1
|
||||
kind_of_double = -1
|
||||
|
||||
call check_double(real4(0),real4(1),ret)
|
||||
call check_double(real4(0), real4(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_double=4
|
||||
return
|
||||
endif
|
||||
kind_of_double = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_double(real8(0),real8(1),ret)
|
||||
call check_double(real8(0), real8(1), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_double=8
|
||||
return
|
||||
endif
|
||||
kind_of_double = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_double
|
||||
|
||||
program test
|
||||
|
||||
print *,'kind_of_double=',kind_of_double()
|
||||
print *,'kind_of_float=',kind_of_float()
|
||||
print *,'kind_of_int=',kind_of_int()
|
||||
print *,'kind_of_long=',kind_of_long()
|
||||
print *,'kind_of_size_t=',kind_of_size_t()
|
||||
print *,'kind_of_long_long=',kind_of_long_long()
|
||||
print *, 'kind_of_double=', kind_of_double()
|
||||
print *, 'kind_of_float=', kind_of_float()
|
||||
print *, 'kind_of_int=', kind_of_int()
|
||||
print *, 'kind_of_long=', kind_of_long()
|
||||
print *, 'kind_of_size_t=', kind_of_size_t()
|
||||
print *, 'kind_of_long_long=', kind_of_long_long()
|
||||
|
||||
end program test
|
||||
|
||||
|
|
|
@ -18,9 +18,8 @@ module grib_api
|
|||
include "grib_api_externals.h"
|
||||
include "grib_api_visibility.h"
|
||||
|
||||
real(8), parameter,public :: GRIB_MISSING_DOUBLE = -1.D+100
|
||||
integer(4), parameter,public :: GRIB_MISSING_LONG = 2147483647
|
||||
|
||||
real(8), parameter, public :: GRIB_MISSING_DOUBLE = -1.D+100
|
||||
integer(4), parameter, public :: GRIB_MISSING_LONG = 2147483647
|
||||
|
||||
!> Create a new message in memory from an integer or character array containting the coded message.
|
||||
!>
|
||||
|
@ -39,8 +38,8 @@ module grib_api
|
|||
!> @param message array containing the coded message
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_new_from_message
|
||||
module procedure grib_new_from_message_int4
|
||||
module procedure grib_new_from_message_char
|
||||
module procedure grib_new_from_message_int4
|
||||
module procedure grib_new_from_message_char
|
||||
end interface grib_new_from_message
|
||||
|
||||
!> Get a value of specified index from an array key.
|
||||
|
@ -67,9 +66,9 @@ module grib_api
|
|||
!> @param[out] status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_get_element
|
||||
module procedure grib_get_real4_element, &
|
||||
grib_get_real8_element, &
|
||||
grib_get_real4_elements, &
|
||||
grib_get_real8_elements
|
||||
grib_get_real8_element, &
|
||||
grib_get_real4_elements, &
|
||||
grib_get_real8_elements
|
||||
end interface grib_get_element
|
||||
|
||||
!> Find the nearest point/points of a given latitude/longitude point.
|
||||
|
@ -110,8 +109,8 @@ module grib_api
|
|||
!> @param[out] status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_find_nearest
|
||||
module procedure grib_find_nearest_single, &
|
||||
grib_find_nearest_four_single, &
|
||||
grib_find_nearest_multiple
|
||||
grib_find_nearest_four_single, &
|
||||
grib_find_nearest_multiple
|
||||
end interface grib_find_nearest
|
||||
|
||||
!> Get latitude/longitude and data values.
|
||||
|
@ -134,6 +133,6 @@ module grib_api
|
|||
!> @param[out] status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_get_data
|
||||
module procedure grib_get_data_real4, &
|
||||
grib_get_data_real8
|
||||
grib_get_data_real8
|
||||
end interface grib_get_data
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
||||
! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
|
||||
|
||||
!> Get the distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||
!>
|
||||
!>
|
||||
|
@ -22,8 +21,8 @@
|
|||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_index_get
|
||||
module procedure grib_index_get_int, &
|
||||
grib_index_get_string, &
|
||||
grib_index_get_real8
|
||||
grib_index_get_string, &
|
||||
grib_index_get_real8
|
||||
end interface grib_index_get
|
||||
|
||||
!> Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||
|
@ -40,7 +39,7 @@
|
|||
!> @param size number of distinct values of the key in the index
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_index_get_size
|
||||
module procedure grib_index_get_size_int
|
||||
module procedure grib_index_get_size_int
|
||||
end interface grib_index_get_size
|
||||
|
||||
!> Select the message subset with key==value.
|
||||
|
@ -58,8 +57,8 @@
|
|||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_index_select
|
||||
module procedure grib_index_select_int, &
|
||||
grib_index_select_string, &
|
||||
grib_index_select_real8
|
||||
grib_index_select_string, &
|
||||
grib_index_select_real8
|
||||
end interface grib_index_select
|
||||
|
||||
!> Get the value for a key from a message.
|
||||
|
@ -94,16 +93,15 @@
|
|||
!> @param[out] status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_get
|
||||
module procedure grib_get_int, &
|
||||
grib_get_real4, &
|
||||
grib_get_real8, &
|
||||
grib_get_string, &
|
||||
grib_get_int_array, &
|
||||
grib_get_byte_array, &
|
||||
grib_get_real4_array, &
|
||||
grib_get_real8_array
|
||||
grib_get_real4, &
|
||||
grib_get_real8, &
|
||||
grib_get_string, &
|
||||
grib_get_int_array, &
|
||||
grib_get_byte_array, &
|
||||
grib_get_real4_array, &
|
||||
grib_get_real8_array
|
||||
end interface grib_get
|
||||
|
||||
|
||||
!> Get the size of an array key.
|
||||
!>
|
||||
!> To get the size of a key representing an array.
|
||||
|
@ -117,7 +115,7 @@
|
|||
!> @param size size of the array key
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_get_size
|
||||
module procedure grib_get_size_int
|
||||
module procedure grib_get_size_int
|
||||
end interface grib_get_size
|
||||
|
||||
!> Set the value for a key in a message.
|
||||
|
@ -145,16 +143,16 @@
|
|||
!> @param[out] status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_set
|
||||
module procedure grib_set_int, &
|
||||
grib_set_real4, &
|
||||
grib_set_real8, &
|
||||
grib_set_string, &
|
||||
grib_set_int_array, &
|
||||
grib_set_byte_array, &
|
||||
grib_set_real4_array, &
|
||||
grib_set_real8_array
|
||||
grib_set_real4, &
|
||||
grib_set_real8, &
|
||||
grib_set_string, &
|
||||
grib_set_int_array, &
|
||||
grib_set_byte_array, &
|
||||
grib_set_real4_array, &
|
||||
grib_set_real8_array
|
||||
end interface grib_set
|
||||
|
||||
interface grib_set_force
|
||||
module procedure grib_set_force_real4_array, &
|
||||
grib_set_force_real8_array
|
||||
grib_set_force_real8_array
|
||||
end interface grib_set_force
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
!> @param nbytes number of bytes to be read
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_read_from_file
|
||||
module procedure grib_read_from_file_int4
|
||||
module procedure grib_read_from_file_char
|
||||
module procedure grib_read_from_file_int4
|
||||
module procedure grib_read_from_file_char
|
||||
end interface grib_read_from_file
|
||||
|
||||
!> Reads nbytes bytes into the buffer from a file opened with grib_open_file.
|
||||
|
@ -34,10 +34,10 @@
|
|||
!> @param nbytes number of bytes to be read
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_read_bytes
|
||||
module procedure grib_read_bytes_int4
|
||||
module procedure grib_read_bytes_char
|
||||
module procedure grib_read_bytes_real8
|
||||
module procedure grib_read_bytes_real4
|
||||
module procedure grib_read_bytes_int4
|
||||
module procedure grib_read_bytes_char
|
||||
module procedure grib_read_bytes_real8
|
||||
module procedure grib_read_bytes_real4
|
||||
end interface grib_read_bytes
|
||||
|
||||
!> Write nbytes bytes from the buffer in a file opened with grib_open_file.
|
||||
|
@ -52,10 +52,10 @@
|
|||
!> @param nbytes number of bytes to be written
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_write_bytes
|
||||
module procedure grib_write_bytes_int4
|
||||
module procedure grib_write_bytes_char
|
||||
module procedure grib_write_bytes_real8
|
||||
module procedure grib_write_bytes_real4
|
||||
module procedure grib_write_bytes_int4
|
||||
module procedure grib_write_bytes_char
|
||||
module procedure grib_write_bytes_real8
|
||||
module procedure grib_write_bytes_real4
|
||||
end interface grib_write_bytes
|
||||
|
||||
!> Get the size of a coded message.
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
||||
! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||
|
||||
|
||||
!> Get the distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||
!>
|
||||
!>
|
||||
|
@ -22,9 +21,9 @@
|
|||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_index_get
|
||||
module procedure grib_index_get_int, &
|
||||
grib_index_get_long, &
|
||||
grib_index_get_string, &
|
||||
grib_index_get_real8
|
||||
grib_index_get_long, &
|
||||
grib_index_get_string, &
|
||||
grib_index_get_real8
|
||||
end interface grib_index_get
|
||||
|
||||
!> Get the number of distinct values of the key in argument contained in the index. The key must belong to the index.
|
||||
|
@ -42,7 +41,7 @@
|
|||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_index_get_size
|
||||
module procedure grib_index_get_size_int, &
|
||||
grib_index_get_size_long
|
||||
grib_index_get_size_long
|
||||
end interface grib_index_get_size
|
||||
|
||||
!> Select the message subset with key==value.
|
||||
|
@ -60,9 +59,9 @@
|
|||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_index_select
|
||||
module procedure grib_index_select_int, &
|
||||
grib_index_select_long, &
|
||||
grib_index_select_string, &
|
||||
grib_index_select_real8
|
||||
grib_index_select_long, &
|
||||
grib_index_select_string, &
|
||||
grib_index_select_real8
|
||||
end interface grib_index_select
|
||||
|
||||
!> Get the value for a key from a message.
|
||||
|
@ -97,14 +96,14 @@
|
|||
!> @param[out] status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_get
|
||||
module procedure grib_get_int, &
|
||||
grib_get_long, &
|
||||
grib_get_real4, &
|
||||
grib_get_real8, &
|
||||
grib_get_string, &
|
||||
grib_get_int_array, &
|
||||
grib_get_byte_array, &
|
||||
grib_get_real4_array, &
|
||||
grib_get_real8_array
|
||||
grib_get_long, &
|
||||
grib_get_real4, &
|
||||
grib_get_real8, &
|
||||
grib_get_string, &
|
||||
grib_get_int_array, &
|
||||
grib_get_byte_array, &
|
||||
grib_get_real4_array, &
|
||||
grib_get_real8_array
|
||||
end interface grib_get
|
||||
|
||||
!> Get the size of an array key.
|
||||
|
@ -120,8 +119,8 @@
|
|||
!> @param size size of the array key
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_get_size
|
||||
module procedure grib_get_size_int, &
|
||||
grib_get_size_long
|
||||
module procedure grib_get_size_int, &
|
||||
grib_get_size_long
|
||||
end interface grib_get_size
|
||||
|
||||
!> Set the value for a key in a message.
|
||||
|
@ -149,18 +148,18 @@
|
|||
!> @param[out] status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_set
|
||||
module procedure grib_set_int, &
|
||||
grib_set_long, &
|
||||
grib_set_real4, &
|
||||
grib_set_real8, &
|
||||
grib_set_string, &
|
||||
grib_set_int_array, &
|
||||
grib_set_long_array, &
|
||||
grib_set_byte_array, &
|
||||
grib_set_real4_array, &
|
||||
grib_set_real8_array
|
||||
grib_set_long, &
|
||||
grib_set_real4, &
|
||||
grib_set_real8, &
|
||||
grib_set_string, &
|
||||
grib_set_int_array, &
|
||||
grib_set_long_array, &
|
||||
grib_set_byte_array, &
|
||||
grib_set_real4_array, &
|
||||
grib_set_real8_array
|
||||
end interface grib_set
|
||||
|
||||
interface grib_set_force
|
||||
module procedure grib_set_force_real4_array, &
|
||||
grib_set_force_real8_array
|
||||
grib_set_force_real8_array
|
||||
end interface grib_set_force
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
!> @param nbytes number of bytes to be read
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_read_from_file
|
||||
module procedure grib_read_from_file_int4
|
||||
module procedure grib_read_from_file_int4_size_t
|
||||
module procedure grib_read_from_file_char
|
||||
module procedure grib_read_from_file_char_size_t
|
||||
module procedure grib_read_from_file_int4
|
||||
module procedure grib_read_from_file_int4_size_t
|
||||
module procedure grib_read_from_file_char
|
||||
module procedure grib_read_from_file_char_size_t
|
||||
end interface grib_read_from_file
|
||||
|
||||
!> Reads nbytes bytes into the buffer from a file opened with grib_open_file.
|
||||
|
@ -36,14 +36,14 @@
|
|||
!> @param nbytes number of bytes to be read
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_read_bytes
|
||||
module procedure grib_read_bytes_int4
|
||||
module procedure grib_read_bytes_int4_size_t
|
||||
module procedure grib_read_bytes_char
|
||||
module procedure grib_read_bytes_char_size_t
|
||||
module procedure grib_read_bytes_real8
|
||||
module procedure grib_read_bytes_real8_size_t
|
||||
module procedure grib_read_bytes_real4
|
||||
module procedure grib_read_bytes_real4_size_t
|
||||
module procedure grib_read_bytes_int4
|
||||
module procedure grib_read_bytes_int4_size_t
|
||||
module procedure grib_read_bytes_char
|
||||
module procedure grib_read_bytes_char_size_t
|
||||
module procedure grib_read_bytes_real8
|
||||
module procedure grib_read_bytes_real8_size_t
|
||||
module procedure grib_read_bytes_real4
|
||||
module procedure grib_read_bytes_real4_size_t
|
||||
end interface grib_read_bytes
|
||||
|
||||
!> Write nbytes bytes from the buffer in a file opened with grib_open_file.
|
||||
|
@ -58,14 +58,14 @@
|
|||
!> @param nbytes number of bytes to be written
|
||||
!> @param status GRIB_SUCCESS if OK, integer value on error
|
||||
interface grib_write_bytes
|
||||
module procedure grib_write_bytes_int4
|
||||
module procedure grib_write_bytes_int4_size_t
|
||||
module procedure grib_write_bytes_char
|
||||
module procedure grib_write_bytes_char_size_t
|
||||
module procedure grib_write_bytes_real8
|
||||
module procedure grib_write_bytes_real8_size_t
|
||||
module procedure grib_write_bytes_real4
|
||||
module procedure grib_write_bytes_real4_size_t
|
||||
module procedure grib_write_bytes_int4
|
||||
module procedure grib_write_bytes_int4_size_t
|
||||
module procedure grib_write_bytes_char
|
||||
module procedure grib_write_bytes_char_size_t
|
||||
module procedure grib_write_bytes_real8
|
||||
module procedure grib_write_bytes_real8_size_t
|
||||
module procedure grib_write_bytes_real4
|
||||
module procedure grib_write_bytes_real4_size_t
|
||||
end interface grib_write_bytes
|
||||
|
||||
!> Get the size of a coded message.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -33,21 +33,21 @@ module grib_typeSizes
|
|||
integer, parameter :: FourByteInt = selected_int_kind(9), &
|
||||
EightByteInt = selected_int_kind(18)
|
||||
|
||||
integer, parameter :: FourByteReal = selected_real_kind(P = 6, R = 37), &
|
||||
EightByteReal = selected_real_kind(P = 13, R = 307)
|
||||
integer, parameter :: FourByteReal = selected_real_kind(P=6, R=37), &
|
||||
EightByteReal = selected_real_kind(P=13, R=307)
|
||||
contains
|
||||
logical function byteSizesOK()
|
||||
! Users may call this function once to ensure that the kind parameters
|
||||
! the module defines are available with the current compiler.
|
||||
! We can't ensure that the two REAL kinds are actually four and
|
||||
! eight bytes long, but we can ensure that they are distinct.
|
||||
! Early Fortran 90 compilers would sometimes report incorrect results for
|
||||
! the bit_size intrinsic, but I haven't seen this in a long time.
|
||||
! Users may call this function once to ensure that the kind parameters
|
||||
! the module defines are available with the current compiler.
|
||||
! We can't ensure that the two REAL kinds are actually four and
|
||||
! eight bytes long, but we can ensure that they are distinct.
|
||||
! Early Fortran 90 compilers would sometimes report incorrect results for
|
||||
! the bit_size intrinsic, but I haven't seen this in a long time.
|
||||
|
||||
! Local variables
|
||||
integer (kind = FourByteInt) :: Four
|
||||
integer(kind=FourByteInt) :: Four
|
||||
|
||||
if (bit_size(Four) == 32 .and. &
|
||||
if (bit_size(Four) == 32 .and. &
|
||||
FourByteReal > 0 .and. EightByteReal > 0 .and. &
|
||||
FourByteReal /= EightByteReal) then
|
||||
byteSizesOK = .true.
|
||||
|
|
|
@ -12,25 +12,25 @@ integer function kind_of_size_t()
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_size_t=-1
|
||||
kind_of_size_t = -1
|
||||
|
||||
call check_size_t(x2(1),x2(2),ret)
|
||||
call check_size_t(x2(1), x2(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=2
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_size_t(x4(1),x4(2),ret)
|
||||
call check_size_t(x4(1), x4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=4
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_size_t(x8(1),x8(2),ret)
|
||||
call check_size_t(x8(1), x8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=8
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_size_t
|
||||
|
||||
|
@ -40,25 +40,25 @@ integer function kind_of_long()
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_long=-1
|
||||
kind_of_long = -1
|
||||
|
||||
call check_long(x2(1),x2(2),ret)
|
||||
call check_long(x2(1), x2(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=2
|
||||
return
|
||||
endif
|
||||
kind_of_long = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_long(x4(1),x4(2),ret)
|
||||
call check_long(x4(1), x4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=4
|
||||
return
|
||||
endif
|
||||
kind_of_long = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_long(x8(1),x8(2),ret)
|
||||
call check_long(x8(1), x8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=8
|
||||
return
|
||||
endif
|
||||
kind_of_long = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_long
|
||||
|
||||
|
@ -68,25 +68,25 @@ integer function kind_of_int()
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_int=-1
|
||||
kind_of_int = -1
|
||||
|
||||
call check_int(x2(1),x2(2),ret)
|
||||
call check_int(x2(1), x2(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=2
|
||||
return
|
||||
endif
|
||||
kind_of_int = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_int(x4(1),x4(2),ret)
|
||||
call check_int(x4(1), x4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=4
|
||||
return
|
||||
endif
|
||||
kind_of_int = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_int(x8(1),x8(2),ret)
|
||||
call check_int(x8(1), x8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=8
|
||||
return
|
||||
endif
|
||||
kind_of_int = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_int
|
||||
|
||||
|
@ -95,19 +95,19 @@ integer function kind_of_float()
|
|||
real(8), dimension(2) :: x8 = (/1., 2./)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_float=-1
|
||||
kind_of_float = -1
|
||||
|
||||
call check_float(x4(1),x4(2),ret)
|
||||
call check_float(x4(1), x4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_float=4
|
||||
return
|
||||
endif
|
||||
kind_of_float = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_float(x8(1),x8(2),ret)
|
||||
call check_float(x8(1), x8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_float=8
|
||||
return
|
||||
endif
|
||||
kind_of_float = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_float
|
||||
|
||||
|
@ -116,19 +116,19 @@ integer function kind_of_double()
|
|||
real(8), dimension(2) :: real8 = (/1., 2./)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_double=-1
|
||||
kind_of_double = -1
|
||||
|
||||
call check_double(real4(1),real4(2),ret)
|
||||
call check_double(real4(1), real4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_double=4
|
||||
return
|
||||
endif
|
||||
kind_of_double = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_double(real8(1),real8(2),ret)
|
||||
call check_double(real8(1), real8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_double=8
|
||||
return
|
||||
endif
|
||||
kind_of_double = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_double
|
||||
|
||||
|
@ -140,22 +140,22 @@ program kind_h
|
|||
real(kind=4), dimension(2) :: r4
|
||||
real(kind=8), dimension(2) :: r8
|
||||
|
||||
print *,"integer,public,parameter :: kindOfInt=",kind_of_int()
|
||||
print *,"integer,public,parameter :: kindOfLong=",kind_of_long()
|
||||
print *,"integer,public,parameter :: kindOfSize_t=",kind_of_size_t()
|
||||
print *,"integer,public,parameter :: kindOfSize=",kind_of_size_t()
|
||||
print *,"integer,public,parameter :: kindOfDouble=",kind_of_double()
|
||||
print *,"integer,public,parameter :: kindOfFloat=",kind_of_float()
|
||||
call f_sizeof(i(1),i(2),size)
|
||||
print *,"integer,public,parameter :: sizeOfInteger=",size
|
||||
call f_sizeof(i2(1),i2(2),size)
|
||||
print *,"integer,public,parameter :: sizeOfInteger2=",size
|
||||
call f_sizeof(i4(1),i4(2),size)
|
||||
print *,"integer,public,parameter :: sizeOfInteger4=",size
|
||||
call f_sizeof(r4(1),r4(2),size)
|
||||
print *,"integer,public,parameter :: sizeOfReal4=",size
|
||||
call f_sizeof(r8(1),r8(2),size)
|
||||
print *,"integer,public,parameter :: sizeOfReal8=",size
|
||||
print *, "integer,public,parameter :: kindOfInt=", kind_of_int()
|
||||
print *, "integer,public,parameter :: kindOfLong=", kind_of_long()
|
||||
print *, "integer,public,parameter :: kindOfSize_t=", kind_of_size_t()
|
||||
print *, "integer,public,parameter :: kindOfSize=", kind_of_size_t()
|
||||
print *, "integer,public,parameter :: kindOfDouble=", kind_of_double()
|
||||
print *, "integer,public,parameter :: kindOfFloat=", kind_of_float()
|
||||
call f_sizeof(i(1), i(2), size)
|
||||
print *, "integer,public,parameter :: sizeOfInteger=", size
|
||||
call f_sizeof(i2(1), i2(2), size)
|
||||
print *, "integer,public,parameter :: sizeOfInteger2=", size
|
||||
call f_sizeof(i4(1), i4(2), size)
|
||||
print *, "integer,public,parameter :: sizeOfInteger4=", size
|
||||
call f_sizeof(r4(1), r4(2), size)
|
||||
print *, "integer,public,parameter :: sizeOfReal4=", size
|
||||
call f_sizeof(r8(1), r8(2), size)
|
||||
print *, "integer,public,parameter :: sizeOfReal8=", size
|
||||
|
||||
end program kind_h
|
||||
|
||||
|
|
|
@ -12,25 +12,25 @@ integer function kind_of_long()
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_long=-1
|
||||
kind_of_long = -1
|
||||
|
||||
call check_long(x2(1),x2(2),ret)
|
||||
call check_long(x2(1), x2(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=2
|
||||
return
|
||||
endif
|
||||
kind_of_long = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_long(x4(1),x4(2),ret)
|
||||
call check_long(x4(1), x4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=4
|
||||
return
|
||||
endif
|
||||
kind_of_long = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_long(x8(1),x8(2),ret)
|
||||
call check_long(x8(1), x8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_long=8
|
||||
return
|
||||
endif
|
||||
kind_of_long = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_long
|
||||
|
||||
|
@ -40,37 +40,37 @@ integer function kind_of_int()
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_int=-1
|
||||
kind_of_int = -1
|
||||
|
||||
call check_int(x2(1),x2(2),ret)
|
||||
call check_int(x2(1), x2(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=2
|
||||
return
|
||||
endif
|
||||
kind_of_int = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_int(x4(1),x4(2),ret)
|
||||
call check_int(x4(1), x4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=4
|
||||
return
|
||||
endif
|
||||
kind_of_int = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_int(x8(1),x8(2),ret)
|
||||
call check_int(x8(1), x8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=8
|
||||
return
|
||||
endif
|
||||
kind_of_int = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_int
|
||||
|
||||
program same_int_long
|
||||
integer ki,kl
|
||||
integer ki, kl
|
||||
|
||||
ki=kind_of_int()
|
||||
kl=kind_of_long()
|
||||
ki = kind_of_int()
|
||||
kl = kind_of_long()
|
||||
if (ki /= kl) then
|
||||
write (*,'(i1)') 0
|
||||
write (*, '(i1)') 0
|
||||
else
|
||||
write (*,'(i1)') 1
|
||||
endif
|
||||
write (*, '(i1)') 1
|
||||
end if
|
||||
end program same_int_long
|
||||
|
||||
|
|
|
@ -12,25 +12,25 @@ integer function kind_of_size_t()
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_size_t=-1
|
||||
kind_of_size_t = -1
|
||||
|
||||
call check_size_t(x2(1),x2(2),ret)
|
||||
call check_size_t(x2(1), x2(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=2
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_size_t(x4(1),x4(2),ret)
|
||||
call check_size_t(x4(1), x4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=4
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_size_t(x8(1),x8(2),ret)
|
||||
call check_size_t(x8(1), x8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_size_t=8
|
||||
return
|
||||
endif
|
||||
kind_of_size_t = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_size_t
|
||||
|
||||
|
@ -40,37 +40,37 @@ integer function kind_of_int()
|
|||
integer(8), dimension(2) :: x8 = (/1, 2/)
|
||||
character(len=1) :: ret
|
||||
|
||||
kind_of_int=-1
|
||||
kind_of_int = -1
|
||||
|
||||
call check_int(x2(1),x2(2),ret)
|
||||
call check_int(x2(1), x2(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=2
|
||||
return
|
||||
endif
|
||||
kind_of_int = 2
|
||||
return
|
||||
end if
|
||||
|
||||
call check_int(x4(1),x4(2),ret)
|
||||
call check_int(x4(1), x4(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=4
|
||||
return
|
||||
endif
|
||||
kind_of_int = 4
|
||||
return
|
||||
end if
|
||||
|
||||
call check_int(x8(1),x8(2),ret)
|
||||
call check_int(x8(1), x8(2), ret)
|
||||
if (ret == 't') then
|
||||
kind_of_int=8
|
||||
return
|
||||
endif
|
||||
kind_of_int = 8
|
||||
return
|
||||
end if
|
||||
|
||||
end function kind_of_int
|
||||
|
||||
program same_int_size_t
|
||||
integer ki,kl
|
||||
integer ki, kl
|
||||
|
||||
ki=kind_of_int()
|
||||
kl=kind_of_size_t()
|
||||
ki = kind_of_int()
|
||||
kl = kind_of_size_t()
|
||||
if (ki /= kl) then
|
||||
write (*,'(i1)') 0
|
||||
write (*, '(i1)') 0
|
||||
else
|
||||
write (*,'(i1)') 1
|
||||
endif
|
||||
write (*, '(i1)') 1
|
||||
end if
|
||||
end program same_int_size_t
|
||||
|
||||
|
|
Loading…
Reference in New Issue