2020-01-28 14:32:34 +00:00
|
|
|
! (C) Copyright 2005- ECMWF.
|
2015-01-28 22:54:42 +00:00
|
|
|
!
|
|
|
|
! This software is licensed under the terms of the Apache Licence Version 2.0
|
|
|
|
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
2021-02-15 12:46:59 +00:00
|
|
|
!
|
2015-01-28 22:54:42 +00:00
|
|
|
! 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.
|
|
|
|
!>
|
|
|
|
!>
|
|
|
|
!> In case of error, if the status parameter (optional) is not given, the program will
|
|
|
|
!> exit with an error message.\n Otherwise the error message can be
|
|
|
|
!> gathered with @ref codes_get_error_string.
|
|
|
|
!>
|
2016-08-25 18:08:19 +00:00
|
|
|
!> \b Examples: \ref grib_index.f90 "grib_index.f90"
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
|
|
|
!> @param indexid id of an index created from a file. The index must have been created with the key in argument.
|
|
|
|
!> @param key key for wich the values are returned
|
|
|
|
!> @param values array of values. The array must be allocated before entering this function and its size must be enough to contain all the values.
|
|
|
|
!> @param status CODES_SUCCESS if OK, integer value on error
|
|
|
|
interface codes_index_get
|
|
|
|
module procedure codes_index_get_int, &
|
2021-02-15 12:46:59 +00:00
|
|
|
codes_index_get_string, &
|
|
|
|
codes_index_get_real8
|
2015-01-28 22:54:42 +00:00
|
|
|
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.
|
|
|
|
!>
|
|
|
|
!>
|
|
|
|
!> In case of error, if the status parameter (optional) is not given, the program will
|
|
|
|
!> exit with an error message.\n Otherwise the error message can be
|
|
|
|
!> gathered with @ref codes_get_error_string.
|
|
|
|
!>
|
2016-08-25 18:08:19 +00:00
|
|
|
!> \b Examples: \ref grib_index.f90 "grib_index.f90"
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
|
|
|
!> @param indexid id of an index created from a file. The index must have been created with the key in argument.
|
|
|
|
!> @param key key for which the number of values is computed
|
|
|
|
!> @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
|
2021-02-15 12:46:59 +00:00
|
|
|
module procedure codes_index_get_size_int
|
2015-01-28 22:54:42 +00:00
|
|
|
end interface codes_index_get_size
|
2021-02-15 12:46:59 +00:00
|
|
|
|
|
|
|
!> Select the message subset with key==value.
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
|
|
|
!>
|
|
|
|
!> In case of error, if the status parameter (optional) is not given, the program will
|
|
|
|
!> exit with an error message.\n Otherwise the error message can be
|
|
|
|
!> gathered with @ref codes_get_error_string.
|
|
|
|
!>
|
2016-08-25 18:08:19 +00:00
|
|
|
!> \b Examples: \ref grib_index.f90 "grib_index.f90"
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
|
|
|
!> @param indexid id of an index created from a file. The index must have been created with the key in argument.
|
|
|
|
!> @param key key to be selected
|
|
|
|
!> @param value value of the key to select
|
|
|
|
!> @param status CODES_SUCCESS if OK, integer value on error
|
|
|
|
interface codes_index_select
|
|
|
|
module procedure codes_index_select_int, &
|
2021-02-15 12:46:59 +00:00
|
|
|
codes_index_select_string, &
|
|
|
|
codes_index_select_real8
|
2015-01-28 22:54:42 +00:00
|
|
|
end interface codes_index_select
|
2017-02-22 11:12:10 +00:00
|
|
|
|
|
|
|
!> Get the value for a key from a message.
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
2017-02-22 11:12:10 +00:00
|
|
|
!> Given a \em msgid and \em key as input a \em value for the \em key is returned.
|
2015-01-28 22:54:42 +00:00
|
|
|
!> In some cases the \em value can be an array rather than a scalar.
|
2017-12-13 14:28:14 +00:00
|
|
|
!> As examples of GRIB array keys we have "values" (the data values),
|
|
|
|
!> "pl" (the list of number of points for each latitude in a reduced grid) and
|
|
|
|
!> "pv" (the list of vertical levels).
|
|
|
|
!> In these cases the \em value array must be allocated by the caller
|
2015-01-28 22:54:42 +00:00
|
|
|
!> and their required dimension can be obtained with \ref codes_get_size. \n
|
|
|
|
!> The \em value can be integer(4), real(4), real(8), character.
|
|
|
|
!> Although each key has its own native type, a key of type integer
|
|
|
|
!> can be retrieved (with \ref codes_get) as real(4), real(8) or character.
|
|
|
|
!> Analogous conversions are always provided when possible.
|
|
|
|
!> Illegal conversions are real to integer and character to any other type.
|
|
|
|
!>
|
2017-12-13 14:28:14 +00:00
|
|
|
!> Note: The output array variable must support the \b allocatable array attribute.
|
|
|
|
!>
|
2017-02-22 11:12:10 +00:00
|
|
|
!> The \em msgid references to a message loaded in memory.
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
|
|
|
!> In case of error, if the status parameter (optional) is not given, the program will
|
|
|
|
!> exit with an error message.\n Otherwise the error message can be
|
|
|
|
!> gathered with @ref codes_get_error_string.
|
|
|
|
!>
|
2016-08-25 18:08:19 +00:00
|
|
|
!> \b Examples: \ref grib_get_keys.f90 "grib_get_keys.f90", \ref grib_print_data.f90 "grib_print_data.f90"
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
|
|
|
!> @see codes_new_from_file, codes_release, codes_set
|
|
|
|
!>
|
2017-02-22 11:12:10 +00:00
|
|
|
!> @param[in] msgid id of the message loaded in memory
|
|
|
|
!> @param[in] key key name
|
2017-12-13 14:28:14 +00:00
|
|
|
!> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character.
|
|
|
|
!> Arrays must support the \b allocatable attribute.
|
2017-02-22 11:12:10 +00:00
|
|
|
!> @param[out] status CODES_SUCCESS if OK, integer value on error
|
2015-01-28 22:54:42 +00:00
|
|
|
interface codes_get
|
|
|
|
module procedure codes_get_int, &
|
2021-02-15 12:46:59 +00:00
|
|
|
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
|
2015-01-28 22:54:42 +00:00
|
|
|
end interface codes_get
|
|
|
|
|
|
|
|
!> Get the size of an array key.
|
|
|
|
!>
|
|
|
|
!> To get the size of a key representing an array.
|
|
|
|
!>
|
|
|
|
!> In case of error, if the status parameter (optional) is not given, the program will
|
|
|
|
!> exit with an error message.\n Otherwise the error message can be
|
|
|
|
!> gathered with @ref codes_get_error_string.
|
|
|
|
!>
|
2017-02-22 11:12:10 +00:00
|
|
|
!> @param msgid id of the message loaded in memory
|
2015-01-28 22:54:42 +00:00
|
|
|
!> @param key name of the key
|
|
|
|
!> @param size size of the array key
|
|
|
|
!> @param status CODES_SUCCESS if OK, integer value on error
|
|
|
|
interface codes_get_size
|
2021-02-15 12:46:59 +00:00
|
|
|
module procedure codes_get_size_int
|
2015-01-28 22:54:42 +00:00
|
|
|
end interface codes_get_size
|
|
|
|
|
2017-02-22 11:12:10 +00:00
|
|
|
!> Set the value for a key in a message.
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
2017-02-22 11:12:10 +00:00
|
|
|
!> The given \em value is set for the \em key in the \em msgid message.
|
2015-01-28 22:54:42 +00:00
|
|
|
!> In some cases the \em value can be an array rather than a scalar.
|
2017-12-13 14:28:14 +00:00
|
|
|
!> As examples of GRIB array keys we have "values" (the data values),
|
|
|
|
!> "pl" (the list of number of points for each latitude in a reduced grid) and
|
|
|
|
!> "pv" (the list of vertical levels).
|
|
|
|
!> In these cases the \em value array must be allocated by the caller
|
2015-01-28 22:54:42 +00:00
|
|
|
!> and their required dimension can be obtained with \ref codes_get_size. \n
|
2017-02-22 11:12:10 +00:00
|
|
|
!> The msgid references to a message loaded in memory.
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
|
|
|
!> In case of error, if the status parameter (optional) is not given, the program will
|
|
|
|
!> exit with an error message.\n Otherwise the error message can be
|
|
|
|
!> gathered with @ref codes_get_error_string.
|
|
|
|
!>
|
2016-08-25 18:08:19 +00:00
|
|
|
!> \b Examples: \ref grib_set_keys.f90 "grib_set_keys.f90"
|
2015-01-28 22:54:42 +00:00
|
|
|
!>
|
|
|
|
!> @see codes_new_from_file, codes_release, codes_get
|
|
|
|
!>
|
2017-02-22 11:12:10 +00:00
|
|
|
!> @param[in] msgid id of the message loaded in memory
|
|
|
|
!> @param[in] key key name
|
|
|
|
!> @param[out] value value can be a scalar or array of integer(4),real(4),real(8)
|
|
|
|
!> @param[out] status CODES_SUCCESS if OK, integer value on error
|
2015-01-28 22:54:42 +00:00
|
|
|
interface codes_set
|
|
|
|
module procedure codes_set_int, &
|
2021-02-15 12:46:59 +00:00
|
|
|
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
|
2015-01-28 22:54:42 +00:00
|
|
|
end interface codes_set
|
|
|
|
|
|
|
|
interface codes_set_force
|
|
|
|
module procedure codes_set_force_real4_array, &
|
2021-02-15 12:46:59 +00:00
|
|
|
codes_set_force_real8_array
|
2015-01-28 22:54:42 +00:00
|
|
|
end interface codes_set_force
|
|
|
|
|