eccodes: eccodes::codes_get_element Interface Reference

eccodes

- Main Page
- C Interface
- F90 Interface
- Python Interface

- Data Structures
- Data Fields

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, kindex, value, status)
| Get a real(4) value of specified index from an array key. More...
subroutine | codes_get_real8_element (msgid, key, kindex, value, status)
| Get a real(8) value of specified index from an array key. More...
subroutine | codes_get_real4_elements (msgid, key, kindex, 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, kindex, 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] | id | ID of the message loaded in memory
  [in] | key | key name
  [in] | index | index can be a scalar or array of integer(4)
  [out] | value | value can be a scalar or array of integer(4),real(4),real(8)
  [out] | status | CODES_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) | kindex,
|  | 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

  msgid | id of the grib loaded in memory
  key | key name
  kindex | integer(4) index
  value | real(4) value
  status | CODES_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) | kindex,
|  | 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

  msgid | id of the grib loaded in memory
  key | key name
  kindex | integer(4) array indexes
  value | real(4) array value
  status | CODES_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) | kindex,
|  | 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

  msgid | id of the grib loaded in memory
  key | key name
  kindex | integer(4) index
  value | real(8) value
  status | CODES_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) | kindex,
|  | 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

  msgid | id of the grib loaded in memory
  key | key name
  kindex | integer(4) array index
  value | real(8) array value
  status | CODES_SUCCESS if OK, integer value on error

The documentation for this interface was generated from the following file:

- eccodes_f90.f90