eccodes
 All Data Structures Namespaces Files Functions Groups Pages
Public Member Functions
eccodes::codes_get_element Interface Reference

Get a value of specified index from an array key. More...

Public Member Functions

subroutine codes_get_real4_element (msgid, key, index, value, status)
 Get a real(4) value of specified index from an array key. More...
 
subroutine codes_get_real8_element (msgid, key, index, value, status)
 Get a real(8) value of specified index from an array key. More...
 
subroutine codes_get_real4_elements (msgid, key, index, value, status)
 Get the real(4) values whose indexes are stored in the array "index" from an array key. More...
 
subroutine codes_get_real8_elements (msgid, key, index, value, status)
 Get the real(8) values whose indexes are stored in the array "index" from an array key. More...
 

Detailed Description

Get a value of specified index from an array key.

Given an ID and key name as input a value corresponding to the given index is returned. The index is zero based i.e. the first element has zero index, the second element index one and so on. If the parameter index is an array all the values correspondig to the indexes list is returned. The ID references to a message loaded in memory.

In case of error, if the status parameter (optional) is not given, the program will exit with an error message.
Otherwise the error message can be gathered with codes_get_error_string.

Examples: grib_nearest.f90

See Also
codes_new_from_file, codes_release, codes_get
Parameters
[in]idID of the message loaded in memory
[in]keykey name
[in]indexindex can be a scalar or array of integer(4)
[out]valuevalue can be a scalar or array of integer(4),real(4),real(8)
[out]statusCODES_SUCCESS if OK, integer value on error

Member Function/Subroutine Documentation

subroutine codes_get_real4_element ( integer(kind=kindofint), intent(in)  msgid,
character(len=*), intent(in)  key,
integer(kind=kindofint), intent(in)  index,
real(kind = kindoffloat), intent(out)  value,
integer(kind=kindofint), intent(out), optional  status 
)

Get a real(4) value of specified index from an array key.

In case of error, if the status parameter (optional) is not given, the program will exit with an error message.
Otherwise the error message can be gathered with codes_get_error_string.

Parameters
msgidid of the grib loaded in memory
keykey name
indexinteger(4) index
valuereal(4) value
statusCODES_SUCCESS if OK, integer value on error
subroutine codes_get_real4_elements ( integer(kind=kindofint), intent(in)  msgid,
character(len=*), intent(in)  key,
integer(kind=kindofint), dimension(:), intent(in)  index,
real(kind = kindoffloat), dimension(:), intent(out)  value,
integer(kind=kindofint), intent(out), optional  status 
)

Get the real(4) values whose indexes are stored in the array "index" from an array key.

In case of error, if the status parameter (optional) is not given, the program will exit with an error message.
Otherwise the error message can be gathered with codes_get_error_string.

Parameters
msgidid of the grib loaded in memory
keykey name
indexinteger(4) array indexes
valuereal(4) array value
statusCODES_SUCCESS if OK, integer value on error
subroutine codes_get_real8_element ( integer(kind=kindofint), intent(in)  msgid,
character(len=*), intent(in)  key,
integer(kind=kindofint), intent(in)  index,
real(kind = kindofdouble), intent(out)  value,
integer(kind=kindofint), intent(out), optional  status 
)

Get a real(8) value of specified index from an array key.

In case of error, if the status parameter (optional) is not given, the program will exit with an error message.
Otherwise the error message can be gathered with codes_get_error_string.

Parameters
msgidid of the grib loaded in memory
keykey name
indexinteger(4) index
valuereal(8) value
statusCODES_SUCCESS if OK, integer value on error
subroutine codes_get_real8_elements ( integer(kind=kindofint), intent(in)  msgid,
character(len=*), intent(in)  key,
integer(kind=kindofint), dimension(:), intent(in)  index,
real(kind = kindofdouble), dimension(:), intent(out)  value,
integer(kind=kindofint), intent(out), optional  status 
)

Get the real(8) values whose indexes are stored in the array "index" from an array key.

In case of error, if the status parameter (optional) is not given, the program will exit with an error message.
Otherwise the error message can be gathered with codes_get_error_string.

Parameters
msgidid of the grib loaded in memory
keykey name
indexinteger(4) array index
valuereal(8) array value
statusCODES_SUCCESS if OK, integer value on error

The documentation for this interface was generated from the following file:
This website is beyond its original expiry date and the content may be out of date. The site owner has been notified and may choose to extend the expiry date and remove this banner. If you have any questions about this, please visit our support portal.