All Data Structures Namespaces Files Functions Groups Pages
eccodes Module Reference

Module eccodes
This is the Fortran90 interface for ecCodes. More...

## Data Types

interface | codes_get
| Get the value for a key from a grib message. More...
interface | codes_get_element
| Get a value of specified index from an array key. More...
interface | codes_get_message_size
| Get the size of a coded message. More...
interface | codes_get_size
| Get the size of an array key. More...
interface | codes_grib_find_nearest
| Find the nearest point/points of a given latitude/longitude point. More...
interface | codes_grib_get_data
| Get latitude/longitude and data values. More...
interface | codes_index_get
| Get the distinct values of the key in argument contained in the index. More...
interface | codes_index_get_size
| Get the number of distinct values of the key in argument contained in the index. More...
interface | codes_index_select
| Select the message subset with key==value. More...
interface | codes_new_from_message
| Create a new message in memory from an integer or character array containting the coded message. More...
interface | codes_read_bytes
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
interface | codes_read_from_file
| Reads a message in the buffer array from the file opened with codes_open_file. More...
interface | codes_set
| Set the value for a key in a grib message. More...
interface | codes_write_bytes
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...

## Public Member Functions

subroutine | codes_set_missing (id, key, status)
| Wrapper for eccodes. More...
subroutine | codes_index_create (indexid, filename, keys, status)
| Create a new index form a file. More...
subroutine | codes_index_add_file (indexid, filename, status)
| Add a file to an index. More...
subroutine | codes_index_get_size_long (indexid, key, size, status)
| Get the number of distinct values of the key in argument contained in the index. More...
subroutine | codes_index_get_size_int (indexid, key, size, status)
| Get the number of distinct values of the key in argument contained in the index. More...
subroutine | codes_index_get_int (indexid, key, values, status)
| Get the distinct values of the key in argument contained in the index. More...
subroutine | codes_index_get_long (indexid, key, values, status)
| Get the distinct values of the key in argument contained in the index. More...
subroutine | codes_index_get_real8 (indexid, key, values, status)
| Get the distinct values of the key in argument contained in the index. More...
subroutine | codes_index_get_string (indexid, key, values, status)
| Get the distinct values of the key in argument contained in the index. More...
subroutine | codes_index_select_string (indexid, key, value, status)
| Select the message subset with key==value. More...
subroutine | codes_index_select_int (indexid, key, value, status)
| Select the message subset with key==value. More...
subroutine | codes_index_select_long (indexid, key, value, status)
| Select the message subset with key==value. More...
subroutine | codes_index_select_real8 (indexid, key, value, status)
| Select the message subset with key==value. More...
subroutine | codes_new_from_index (indexid, msgid, status)
| Create a new handle from an index after having selected the key values. More...
subroutine | codes_index_read (indexid, filename, status)
| Load an index file previously created with codes_index_write. More...
subroutine | codes_index_write (indexid, filename, status)
| Saves an index to a file for later reuse. More...
subroutine | codes_index_release (indexid, status)
| Delete the index. More...
subroutine | codes_open_file (ifile, filename, mode, status)
| Open a file according to a mode. More...
subroutine | codes_read_bytes_char (ifile, buffer, nbytes, status)
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
subroutine | codes_read_bytes_char_size_t (ifile, buffer, nbytes, status)
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
subroutine | codes_read_bytes_int4 (ifile, buffer, nbytes, status)
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
subroutine | codes_read_bytes_int4_size_t (ifile, buffer, nbytes, status)
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
subroutine | codes_read_bytes_real4 (ifile, buffer, nbytes, status)
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
subroutine | codes_read_bytes_real4_size_t (ifile, buffer, nbytes, status)
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
subroutine | codes_read_bytes_real8 (ifile, buffer, nbytes, status)
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
subroutine | codes_read_bytes_real8_size_t (ifile, buffer, nbytes, status)
| Reads nbytes bytes into the buffer from a file opened with codes_open_file. More...
subroutine | codes_read_from_file_int4 (ifile, buffer, nbytes, status)
| Reads a message in the buffer array from the file opened with codes_open_file. More...
subroutine | codes_read_from_file_int4_size_t (ifile, buffer, nbytes, status)
| Reads a message in the buffer array from the file opened with codes_open_file. More...
subroutine | codes_read_from_file_real4 (ifile, buffer, nbytes, status)
| Reads a message in the buffer array from the file opened with codes_open_file. More...
subroutine | codes_read_from_file_real4_size_t (ifile, buffer, nbytes, status)
| Reads a message in the buffer array from the file opened with codes_open_file. More...
subroutine | codes_read_from_file_real8 (ifile, buffer, nbytes, status)
| Reads a message in the buffer array from the file opened with codes_open_file. More...
subroutine | codes_read_from_file_real8_size_t (ifile, buffer, nbytes, status)
| Reads a message in the buffer array from the file opened with codes_open_file. More...
subroutine | codes_read_from_file_char (ifile, buffer, nbytes, status)
| Reads a message in the buffer array from the file opened with codes_open_file. More...
subroutine | codes_read_from_file_char_size_t (ifile, buffer, nbytes, status)
| Reads a message in the buffer array from the file opened with codes_open_file. More...
subroutine | codes_write_bytes_char (ifile, buffer, nbytes, status)
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...
subroutine | codes_write_bytes_char_size_t (ifile, buffer, nbytes, status)
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...
subroutine | codes_write_bytes_int4 (ifile, buffer, nbytes, status)
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...
subroutine | codes_write_bytes_int4_size_t (ifile, buffer, nbytes, status)
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...
subroutine | codes_write_bytes_real4 (ifile, buffer, nbytes, status)
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...
subroutine | codes_write_bytes_real4_size_t (ifile, buffer, nbytes, status)
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...
subroutine | codes_write_bytes_real8 (ifile, buffer, nbytes, status)
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...
subroutine | codes_write_bytes_real8_size_t (ifile, buffer, nbytes, status)
| Write nbytes bytes from the buffer in a file opened with codes_open_file. More...
subroutine | codes_close_file (ifile, status)
| Close a file. More...
subroutine | codes_count_in_file (ifile, n, status)
| Counts the messages in a file. More...
subroutine | codes_new_from_file (ifile, msgid, product_kind, status)
| Load in memory a message from a file. More...
subroutine | codes_any_new_from_file (ifile, msgid, status)
| Load in memory a message from a file. More...
subroutine | codes_grib_new_from_file (ifile, gribid, status)
| Load in memory a GRIB message from a file. More...
subroutine | codes_bufr_new_from_file (ifile, bufrid, status)
| Load in memory a BUFR message from a file. More...
subroutine | codes_new_from_message_char (msgid, message, status)
| Create a new message in memory from a character array containting the coded message. More...
subroutine | codes_new_from_message_int4 (msgid, message, status)
| Create a new message in memory from an integer array containting the coded message. More...
subroutine | codes_grib_new_from_samples (gribid, samplename, status)
| Create a new valid gribid from a GRIB sample contained in a samples directory pointed by the environment variable ECCODES_SAMPLES_PATH. More...
subroutine | codes_bufr_new_from_samples (bufrid, samplename, status)
| Create a new valid bufrid from a BUFR sample contained in a samples directory pointed by the environment variable ECCODES_SAMPLES_PATH. More...
subroutine | codes_release (msgid, status)
| Free the memory for the message referred as msgid. More...
subroutine | codes_clone (msgid_src, msgid_dest, status)
| Create a copy of a message. More...
subroutine | codes_copy_namespace (gribid_src, namespace, gribid_dest, status)
| Copy the value of all the keys belonging to a namespace from the source message to the destination message. More...
subroutine | codes_check (status, caller, string)
| Check the status returned by a subroutine. More...
subroutine | codes_grib_get_data_real4 (gribid, lats, lons, values, status)
| Get latitudes/longitudes/data values (real(4)). More...
subroutine | codes_grib_get_data_real8 (gribid, lats, lons, values, status)
| Get latitudes/longitudes/data values (real(8)). More...
subroutine | codes_keys_iterator_new (msgid, iterid, namespace, status)
| Create a new iterator on the keys. More...
subroutine | codes_keys_iterator_next (iterid, status)
| Advance to the next keys iterator value. More...
subroutine | codes_keys_iterator_delete (iterid, status)
| Delete a keys iterator and free memory. More...
subroutine | codes_keys_iterator_get_name (iterid, name, status)
| Get the name of a key from a keys iterator. More...
subroutine | codes_keys_iterator_rewind (iterid, status)
| Rewind a keys iterator. More...
subroutine | codes_dump (msgid, status)
| Dump the content of a message. More...
subroutine | codes_get_error_string (error, error_message, status)
| Get the error message given an error code. More...
subroutine | codes_get_size_int (msgid, key, size, status)
| Get the size of an array key. More...
subroutine | codes_get_size_long (msgid, key, size, status)
| Get the size of an array key. More...
subroutine | codes_get_int (msgid, key, value, status)
| Get the integer value of a key from a message. More...
subroutine | codes_get_long (msgid, key, value, status)
| Get the integer value of a key from a message. More...
subroutine | codes_is_missing (msgid, key, is_missing, status)
| Check if the value of a key is MISSING. More...
subroutine | codes_is_defined (msgid, key, is_defined, status)
| Check if a key is defined (exists in the message) More...
subroutine | codes_get_real4 (msgid, key, value, status)
| Get the real(4) value of a key from a message. More...
subroutine | codes_get_real8 (msgid, key, value, status)
| Get the real(8) value of a key from a message. More...
subroutine | codes_get_string (msgid, key, value, status)
| Get the character value of a key from a message. More...
subroutine | codes_get_string_array (msgid, key, value, status)
| Get the string array of values for a key from a message. More...
subroutine | codes_bufr_copy_data (msgid1, msgid2, status)
| Copy data values from a BUFR message msgid1 to another message msgid2. More...
subroutine | codes_set_string_array (msgid, key, value, status)
| Set the string values for an array key in a message. More...
subroutine | codes_get_int_array (msgid, key, value, status)
| Get the integer array of values for a key from a message. More...
subroutine | codes_get_long_array (msgid, key, value, status)
| Get the integer array of values for a key from a message. More...
subroutine | codes_get_byte_array (msgid, key, value, length, status)
| Get the array of bytes (character) for a key from a message. More...
subroutine | codes_get_real4_array (msgid, key, value, status)
| Get the real(4) array of values for a key from a message. More...
subroutine | codes_get_real8_array (msgid, key, value, status)
| Get the real(8) array of values for a key from a message. More...
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...
subroutine | codes_set_int (msgid, key, value, status)
| Set the integer value for a key in a message. More...
subroutine | codes_set_long (msgid, key, value, status)
| Set the integer value for a key in a message. More...
subroutine | codes_set_real4 (msgid, key, value, status)
| Set the real(4) value for a key in a message. More...
subroutine | codes_set_real8 (msgid, key, value, status)
| Set the real(8) value for a key in a message. More...
subroutine | codes_set_int_array (msgid, key, value, status)
| Set the integers values for an array key in a message. More...
subroutine | codes_set_long_array (msgid, key, value, status)
| Set the integers values for an array key in a message. More...
subroutine | codes_set_byte_array (msgid, key, value, length, status)
| Set the array of bytes (character) for a key in a message. More...
subroutine | codes_set_real4_array (msgid, key, value, status)
| Set the real(4) values for an array key in a message. More...
subroutine | codes_set_real8_array (msgid, key, value, status)
| Set the real(8) values for an array key in a message. More...
subroutine | codes_set_string (msgid, key, value, status)
| */ More...
subroutine | codes_get_message_size_int (msgid, nbytes, status)
| Get the size of a coded message. More...
subroutine | codes_get_message_size_size_t (msgid, nbytes, status)
| Get the size of a coded message. More...
subroutine | codes_copy_message (msgid, message, status)
| Copy the coded message into an array. More...
subroutine | codes_write (msgid, ifile, status)
| Write the coded message to a file. More...
subroutine | codes_grib_multi_write (multigribid, ifile, status)
| Write a multi field message to a file. More...
subroutine | codes_grib_multi_append (ingribid, startsection, multigribid, status)
| Append a single field grib message to a multi field grib message. More...
subroutine | codes_grib_find_nearest_multiple (gribid, is_lsm, inlats, inlons, outlats, outlons, values, distances, indexes, status)
| Find the nearest point of a set of points whose latitudes and longitudes are given in the inlats, inlons arrays respectively. More...
subroutine | codes_grib_find_nearest_single (gribid, is_lsm, inlat, inlon, outlat, outlon, value, distance, kindex, status)
| Find the nearest point of a given latitude/longitude point. More...
subroutine | codes_grib_find_nearest_four_single (gribid, is_lsm, inlat, inlon, outlat, outlon, value, distance, kindex, status)
| Find the 4 nearest points of a latitude longitude point. More...
subroutine | codes_grib_multi_support_on (status)
| Turn on the support for multiple fields in a single message. More...
subroutine | codes_grib_multi_support_off (status)
| Turn off the support for multiple fields in a single message. More...
subroutine | codes_gribex_mode_on (status)
| Turn on the compatibility mode with gribex. More...
subroutine | codes_gribex_mode_off (status)
| Turn off the compatibility mode with GRIBEX. More...
subroutine | codes_skip_computed (iterid, status)
| Skip the computed keys in a keys iterator. More...
subroutine | codes_skip_coded (iterid, status)
| Skip the coded keys in a keys iterator. More...
subroutine | codes_skip_duplicates (iterid, status)
| Skip the duplicated keys in a keys iterator. More...
subroutine | codes_skip_read_only (iterid, status)
| Skip the read_only keys in a keys iterator. More...
subroutine | codes_set_definitions_path (path, status)
| Set the definition path. More...
subroutine | codes_set_samples_path (path, status)
| Set the samples path. More...
subroutine | codes_copy_key (msgid_src, key, msgid_dest, status)
| Copy the value of a key from the source message to the destination message. More...

## Detailed Description

Module eccodes
This is the Fortran90 interface for ecCodes.

## Member Function/Subroutine Documentation

subroutine codes_any_new_from_file | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=kindofint), intent(out) | msgid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Load in memory a message from a file.

The message can be accessed through its msgid and it will be available
until codes_release is called.

Parameters

  ifile | id of the file opened with codes_open_file
  msgid | id of the message loaded in memory
  status | CODES_SUCCESS if OK, CODES_END_OF_FILE at the end of file, or error code

subroutine codes_bufr_copy_data | ( | integer(kind=kindofint), intent(in) | msgid1,
|  | integer(kind=kindofint), intent(in) | msgid2,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Copy data values from a BUFR message msgid1 to another message msgid2.

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

  msgid1 | id of the message from which the data are copied
  msgid2 | id of the message to which the data are copied
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_bufr_new_from_file | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=kindofint), intent(out) | bufrid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Load in memory a BUFR message from a file.

The message can be accessed through its bufrid and it will be available
until codes_release is called.
Examples: bufr_get_keys.f90

Parameters

  ifile | id of the file opened with codes_open_file
  bufrid | id of the BUFR loaded in memory
  status | CODES_SUCCESS if OK, CODES_END_OF_FILE at the end of file, or error code

subroutine codes_bufr_new_from_samples | ( | integer(kind=kindofint), intent(out) | bufrid,
|  | character(len=*), intent(in) | samplename,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Create a new valid bufrid from a BUFR sample contained in a samples directory pointed by the environment variable ECCODES_SAMPLES_PATH.

To know where the samples directory is run the codes_info tool.
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

  bufrid | id of the BUFR loaded in memory
  samplename | name of the BUFR sample to be used
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_check | ( | integer(kind=kindofint), intent(in) | status,
|  | character(len=*), intent(in) | caller,
|  | character(len=*), intent(in) | string
| ) |  |

Check the status returned by a subroutine.

In case of error it stops the program, returns the error code to the shell and prints the error message.

Parameters

  status | the status to be checked
  caller | name of the caller soubroutine
  string | a string variable from the caller routine (e.g. key,filename)

subroutine codes_clone | ( | integer(kind=kindofint), intent(in) | msgid_src,
|  | integer(kind=kindofint), intent(out) | msgid_dest,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Create a copy of a message.

Create a copy of a given message (msgid_src) giving a new
message in memory (msgid_dest) exactly identical to the original one.
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_clone.f90

Parameters

  msgid_src | message to be cloned
  msgid_dest | new message returned
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_close_file | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Close a file.

If the fileid does not refer to an opened file an error code is returned in status.
Examples: grib_get_keys.f90

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

  ifile | is the id of the file to be closed.
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_copy_key | ( | integer(kind=kindofint), intent(in) | msgid_src,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), intent(in) | msgid_dest,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Copy the value of a key from the source message to the destination message.

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_src | source message
  msgid_dest | destination message
  key | key whose value is to be copied
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_copy_message | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=1), dimension(:), intent(out) | message,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Copy the coded message into an array.

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 message loaded in memory
  message | array containing the coded message to be copied
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_copy_namespace | ( | integer(kind=kindofint), intent(in) | gribid_src,
|  | character(len=*), intent(in) | namespace,
|  | integer(kind=kindofint), intent(in) | gribid_dest,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Copy the value of all the keys belonging to a namespace from the source message to the destination message.

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

  gribid_src | source message
  gribid_dest | destination message
  namespace | namespace to be copied
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_count_in_file | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=kindofint), intent(out) | n,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Counts the messages in a file.

Examples: count_messages.f90

Parameters

  ifile | id of the file opened with codes_open_file
  n | number of messages in the file
  status | CODES_SUCCESS if OK or error code

subroutine codes_dump | ( | integer(kind=kindofint), intent(in) | msgid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Dump the content of a message.

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 message loaded in memory
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_byte_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | character(len=1), dimension(:), intent(inout) | value,
|  | integer(kind=kindofint), intent(out), optional | length,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the array of bytes (character) for a key from a message.

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 message loaded in memory
  key | key name
  value | character(len=1) array of byte values
  length | (optional) output: number of values retrieved
  status | (optional) CODES_SUCCESS if OK, integer value on error

subroutine codes_get_error_string | ( | integer(kind=kindofint), intent(in) | error,
|  | character(len=*), intent(out) | error_message,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the error message given an error code.

Parameters

  error | error code
  error_message | error message
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_int | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind = kindofint), intent(out) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the integer value of a key from a message.

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 message loaded in memory
  key | key name
  value | the integer(4) value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_int_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), dimension(:), intent(inout), allocatable | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the integer array of values for a key from a message.

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.
Note: This function supports the allocatable array attribute

Parameters

  msgid | id of the message loaded in memory
  key | key name
  value | integer(4) array value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_long | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind = kindoflong), intent(out) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the integer value of a key from a message.

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 message loaded in memory
  key | key name
  value | the integer(4) value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_long_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindoflong), dimension(:), intent(inout), allocatable | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the integer array of values for a key from a message.

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.
Note: This function supports the allocatable array attribute

Parameters

  msgid | id of the message loaded in memory
  key | key name
  value | integer(4) array value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_message_size_int | ( | integer(kind=kindofint), intent(in) | msgid,
|  | integer(kind=kindofint), intent(out) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the size of a coded message.

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 message loaded in memory
  nbytes | size in bytes of the message
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_message_size_size_t | ( | integer(kind=kindofint), intent(in) | msgid,
|  | integer(kind=kindofsize_t), intent(out) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the size of a coded message.

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 message loaded in memory
  nbytes | size in bytes of the message
  status | CODES_SUCCESS if OK, integer value on error

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

Get the real(4) value of a key from a message.

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 message loaded in memory
  key | key name
  value | the real(4) value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_real4_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | real(kind = kindoffloat), dimension(:), intent(inout), allocatable | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the real(4) array of values for a key from a message.

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.
Note: This function supports the allocatable array attribute

Parameters

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

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 message 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 message 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 | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | real(kind = kindofdouble), intent(out) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the real(8) value of a key from a message.

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 message loaded in memory
  key | key name
  value | the real(8) value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_real8_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | real(kind = kindofdouble), dimension(:), intent(inout), allocatable | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the real(8) array of values for a key from a message.

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.
Note: This function supports the allocatable array attribute

Parameters

  msgid | id of the message loaded in memory
  key | key name
  value | real(8) 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 message 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 message 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

subroutine codes_get_size_int | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), intent(out) | size,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

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.
Otherwise the error message can be gathered with codes_get_error_string.

Parameters

  msgid | id of the message loaded in memory
  key | name of the key
  size | size of the array key
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_size_long | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindoflong), intent(out) | size,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

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.
Otherwise the error message can be gathered with codes_get_error_string.

Parameters

  msgid | id of the message loaded in memory
  key | name of the key
  size | size of the array key
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_string | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | character(len=*), intent(out) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the character value of a key from a message.

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 message loaded in memory
  key | key name
  value | the character value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_get_string_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | character(len=*), dimension(:), intent(inout), allocatable | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the string array of values for a key from a message.

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.
Note: This function supports the allocatable array attribute

Parameters

  msgid | id of the message loaded in memory
  key | key name
  value | string array value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_find_nearest_four_single | ( | integer(kind=kindofint), intent(in) | gribid,
|  | logical, intent(in) | is_lsm,
|  | real(kind = kindofdouble), intent(in) | inlat,
|  | real(kind = kindofdouble), intent(in) | inlon,
|  | real(kind = kindofdouble), dimension(4), intent(out) | outlat,
|  | real(kind = kindofdouble), dimension(4), intent(out) | outlon,
|  | real(kind = kindofdouble), dimension(4), intent(out) | value,
|  | real(kind = kindofdouble), dimension(4), intent(out) | distance,
|  | integer(kind = kindofint), dimension(4), intent(out) | kindex,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Find the 4 nearest points of a latitude longitude point.

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

  gribid | id of the GRIB loaded in memory
  is_lsm | .true. if the nearest land point is required otherwise .false.
  inlat | latitude of the point
  inlon | longitudes of the point
  outlat | latitude of the nearest point
  outlon | longitude of the nearest point
  distance | distance between the given point and its nearest
  kindex | zero based index
  value | value of the field in the nearest point
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_find_nearest_multiple | ( | integer(kind=kindofint), intent(in) | gribid,
|  | logical, intent(in) | is_lsm,
|  | real(kind = kindofdouble), dimension(:), intent(in) | inlats,
|  | real(kind = kindofdouble), dimension(:), intent(in) | inlons,
|  | real(kind = kindofdouble), dimension(:), intent(out) | outlats,
|  | real(kind = kindofdouble), dimension(:), intent(out) | outlons,
|  | real(kind = kindofdouble), dimension(:), intent(out) | values,
|  | real(kind = kindofdouble), dimension(:), intent(out) | distances,
|  | integer(kind = kindofint), dimension(:), intent(out) | indexes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Find the nearest point of a set of points whose latitudes and longitudes are given in the inlats, inlons arrays respectively.

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

  gribid | id of the message loaded in memory
  is_lsm | .true. if the nearest land point is required otherwise .false.
  inlats | input real(8) array of the latitudes of the points
  inlons | input real(8) array of the longitudes of the points
  outlats | output real(8) array of the latitudes of the nearest points
  outlons | output real(8) array of the longitudes of the nearest points
  distances | output real(8) array of the distances
  indexes | output integer(4) array of the zero based indexes
  values | output real(8) array of the values
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_find_nearest_single | ( | integer(kind=kindofint), intent(in) | gribid,
|  | logical, intent(in) | is_lsm,
|  | real(kind = kindofdouble), intent(in) | inlat,
|  | real(kind = kindofdouble), intent(in) | inlon,
|  | real(kind = kindofdouble), intent(out) | outlat,
|  | real(kind = kindofdouble), intent(out) | outlon,
|  | real(kind = kindofdouble), intent(out) | value,
|  | real(kind = kindofdouble), intent(out) | distance,
|  | integer(kind = kindofint), intent(out) | kindex,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Find the nearest point of a given latitude/longitude point.

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

  gribid | id of the message loaded in memory
  is_lsm | .true. if the nearest land point is required otherwise .false.
  inlat | latitude of the point
  inlon | longitudes of the point
  outlat | latitude of the nearest point
  outlon | longitude of the nearest point
  distance | distance between the given point and its nearest
  kindex | zero based index
  value | value of the field in the nearest point
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_get_data_real4 | ( | integer(kind=kindofint), intent(in) | gribid,
|  | real ( kind = kindoffloat ), dimension(:), intent(out) | lats,
|  | real ( kind = kindoffloat ), dimension(:), intent(out) | lons,
|  | real ( kind = kindoffloat ), dimension(:), intent(out) | values,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get latitudes/longitudes/data values (real(4)).

Latitudes, longitudes, data values arrays are returned. They must be properly allocated by the caller and their required dimension can be obtained with codes_get_size or by getting (with codes_get) the value of the integer key "numberOfPoints".

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

  gribid | id of the message loaded in memory
  lats | latitudes array with dimension "size"
  lons | longitudes array with dimension "size"
  values | data values array with dimension "size"
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_get_data_real8 | ( | integer(kind=kindofint), intent(in) | gribid,
|  | real ( kind = kindofdouble ), dimension(:), intent(out) | lats,
|  | real ( kind = kindofdouble ), dimension(:), intent(out) | lons,
|  | real ( kind = kindofdouble ), dimension(:), intent(out) | values,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get latitudes/longitudes/data values (real(8)).

Latitudes, longitudes, data values arrays are returned. They must be properly allocated by the calling program/function. Their required dimension can be obtained by getting (with codes_get) the value of the integer key "numberOfPoints". 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

  gribid | id of the message loaded in memory
  lats | latitudes array
  lons | longitudes array
  values | data values array
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_multi_append | ( | integer(kind=kindofint), intent(in) | ingribid,
|  | integer(kind=kindofint), intent(in) | startsection,
|  | integer(kind=kindofint), intent(out) | multigribid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Append a single field grib message to a multi field grib message.

Only the sections with section number greather or equal "startsection" are copied from the input single message to the multi field output grib.

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

  ingribid | id of the input single grib
  startsection | starting from startsection (included) all the sections are copied from the input single grib to the output multi grib
  multigribid | id of the output multi filed grib
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_multi_support_off | ( | integer(kind=kindofint), intent(out), optional | status | ) |

Turn off the support for multiple fields in a single message.

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

  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_multi_support_on | ( | integer(kind=kindofint), intent(out), optional | status | ) |

Turn on the support for multiple fields in a single message.

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

  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_multi_write | ( | integer(kind=kindofint), intent(in) | multigribid,
|  | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write a multi field message to a file.

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

  multigribid | id of the multi field grib loaded in memory
  ifile | file id of a file opened with codes_open_file
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_grib_new_from_file | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=kindofint), intent(out) | gribid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Load in memory a GRIB message from a file.

The message can be accessed through its gribid and it will be available
until codes_release is called.
Examples: grib_get_keys.f90

Parameters

  ifile | id of the file opened with codes_open_file
  gribid | id of the GRIB loaded in memory
  status | CODES_SUCCESS if OK, CODES_END_OF_FILE at the end of file, or error code

subroutine codes_grib_new_from_samples | ( | integer(kind=kindofint), intent(out) | gribid,
|  | character(len=*), intent(in) | samplename,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Create a new valid gribid from a GRIB sample contained in a samples directory pointed by the environment variable ECCODES_SAMPLES_PATH.

To know where the samples directory is run the codes_info tool.
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_samples.f90

Parameters

  gribid | id of the message loaded in memory
  samplename | name of the sample to be used
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_gribex_mode_off | ( | integer(kind=kindofint), intent(out), optional | status | ) |

Turn off the compatibility mode with GRIBEX.

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

  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_gribex_mode_on | ( | integer(kind=kindofint), intent(out), optional | status | ) |

Turn on the compatibility mode with gribex.

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

  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_add_file | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | filename,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Add a file to an index.

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_index.f90

Parameters

  indexid | id of the index I want to add a file to
  filename | name of the file I want to add to the index
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_create | ( | integer(kind=kindofint), intent(inout) | indexid,
|  | character(len=*), intent(in) | filename,
|  | character(len=*), intent(in) | keys,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Create a new index form a file.

The file is indexed with the keys in argument.

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_index.f90

Parameters

  indexid | id of the newly created index
  filename | name of the file of messages to be indexed
  keys | comma separated list of keys for the index. The type of the key can be explicitly declared appending :l for long (or alternatively :i), :d for double, :s for string to the key name. If the type is not declared explicitly, the native type is assumed.
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_get_int | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), dimension(:), intent(out) | values,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the distinct values of the key in argument contained in the index.

The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.

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_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key for wich the values are returned
  values | array of values. The array must be allocated before entering this function and its size must be enough to contain all the values.
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_get_long | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindoflong), dimension(:), intent(out) | values,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the distinct values of the key in argument contained in the index.

The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.

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_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key for wich the values are returned
  values | array of values. The array must be allocated before entering this function and its size must be enough to contain all the values.
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_get_real8 | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | real(kind=kindofdouble), dimension(:), intent(out) | values,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the distinct values of the key in argument contained in the index.

The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.

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_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key for wich the values are returned
  values | array of values. The array must be allocated before entering this function and its size must be enough to contain all the values.
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_get_size_int | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), intent(out) | size,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

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.
Otherwise the error message can be gathered with codes_get_error_string.

Examples: grib_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key for which the number of values is computed
  size | number of distinct values of the key in the index
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_get_size_long | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindoflong), intent(out) | size,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

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.
Otherwise the error message can be gathered with codes_get_error_string.

Examples: grib_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key for which the number of values is computed
  size | number of distinct values of the key in the index
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_get_string | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | character(len=*), dimension(:), intent(out) | values,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the distinct values of the key in argument contained in the index.

The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string.

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_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key for wich the values are returned
  values | array of values. The array must be allocated before entering this function and its size must be enough to contain all the values.
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_read | ( | integer(kind=kindofint), intent(inout) | indexid,
|  | character(len=*), intent(in) | filename,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Load an index file previously created with codes_index_write.

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_index.f90

Parameters

  indexid | id of loaded index
  filename | name of the index file to load
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_release | ( | integer(kind=kindofint), intent(in) | indexid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Delete the index.

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

  indexid | id of an index created from a file.
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_select_int | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Select the message subset with key==value.

The value is a integer. The key must have been created with integer type or have integer as native type if the type was not explicitly defined in the index creation.

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_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key to be selected
  value | value of the key to select
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_select_long | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindoflong), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Select the message subset with key==value.

The value is a integer. The key must have been created with integer type or have integer as native type if the type was not explicitly defined in the index creation.

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_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key to be selected
  value | value of the key to select
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_select_real8 | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | real(kind=kindofdouble), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Select the message subset with key==value.

The value is a real. The key must have been created with real type or have real as native type if the type was not explicitly defined in the index creation.

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_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key to be selected
  value | value of the key to select
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_select_string | ( | integer(kind=kindofint), intent(in) | indexid,
|  | character(len=*), intent(in) | key,
|  | character(len=*), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Select the message subset with key==value.

The value is a integer. The key must have been created with string type or have string as native type if the type was not explicitly defined in the index creation.

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_index.f90

Parameters

  indexid | id of an index created from a file. The index must have been created with the key in argument.
  key | key to be selected
  value | value of the key to select
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_index_write | ( | integer(kind=kindofint), intent(inout) | indexid,
|  | character(len=*), intent(in) | filename,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Saves an index to a file for later reuse.

Index files can be read with codes_index_read.

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_index.f90

Parameters

  indexid | id of the index to save to file
  filename | name of file to save the index to
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_is_defined | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind = kindofint), intent(out) | is_defined,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Check if a key is defined (exists in the message)

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 message loaded in memory
  key | key name
  is_defined | 0->not defined, 1->defined
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_is_missing | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind = kindofint), intent(out) | is_missing,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Check if the value of a key is MISSING.

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 message loaded in memory
  key | key name
  is_missing | 0->not missing, 1->missing
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_keys_iterator_delete | ( | integer(kind=kindofint), intent(in) | iterid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Delete a keys iterator and free 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.

Parameters

  iterid | keys iterator id created with codes_keys_iterator_new
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_keys_iterator_get_name | ( | integer(kind=kindofint), intent(in) | iterid,
|  | character(len=*), intent(out) | name,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Get the name of a key from a keys iterator.

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

  iterid | keys iterator id created with codes_keys_iterator_new
  name | key name to be retrieved
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_keys_iterator_new | ( | integer(kind=kindofint), intent(in) | msgid,
|  | integer(kind=kindofint), intent(inout) | iterid,
|  | character(len=*), intent(in) | namespace,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Create a new iterator on the keys.

The keys iterator can be navigated to give all the key names which can then be used to get or set the key values with codes_get or codes_set. The set of keys returned can be controlled with the input variable namespace or using the functions codes_skip_read_only, codes_skip_duplicates, codes_skip_coded,codes_skip_computed. If namespace is a non-empty string only the keys belonging to that namespace are returned. Example namespaces are "ls" (to get the same default keys as the grib_ls) and "mars" to get the keys used by mars.

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 message loaded in memory
  iterid | keys iterator id to be used in the keys iterator functions
  namespace | the namespace of the keys to search for (all the keys if empty)
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_keys_iterator_next | ( | integer(kind=kindofint), intent(in) | iterid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Advance to the next keys iterator value.

Parameters

  iterid | keys iterator id created with codes_keys_iterator_new
  status | CODES_SUCCESS if next iterator exists, integer value if no more elements to iterate on

subroutine codes_keys_iterator_rewind | ( | integer(kind=kindofint), intent(in) | iterid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Rewind a keys iterator.

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

  iterid | keys iterator id created with codes_keys_iterator_new
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_new_from_file | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=kindofint), intent(out) | msgid,
|  | integer(kind=kindofint), intent(in) | product_kind,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Load in memory a message from a file.

The message can be accessed through its message ID and it will be available
until codes_release is called.
Examples: grib_get_keys.f90

Parameters

  ifile | id of the file opened with codes_open_file
  msgid | id of the message loaded in memory
  product_kind | One of CODES_PRODUCT_GRIB, CODES_PRODUCT_BUFR or CODES_PRODUCT_ANY
  status | CODES_SUCCESS if OK, CODES_END_OF_FILE at the end of file, or error code

subroutine codes_new_from_index | ( | integer(kind=kindofint), intent(in) | indexid,
|  | integer(kind=kindofint), intent(out) | msgid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Create a new handle from an index after having selected the key values.

All the keys belonging to the index must be selected before calling this function. Successive calls to this function will return all the handles compatible with the constraints defined selecting the values of the index keys. When no more handles are available from the index a NULL pointer is returned and the err variable is set to CODES_END_OF_INDEX.

The message can be accessed through its msgid and it will be available
until codes_release is called.
Examples: grib_index.f90

Parameters

  indexid | id of an index created from a file.
  msgid | id of the message loaded in memory
  status | CODES_SUCCESS if OK, CODES_END_OF_FILE at the end of file, or error code

subroutine codes_new_from_message_char | ( | integer(kind=kindofint), intent(out) | msgid,
|  | character(len=1), dimension(:), intent(in) | message,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Create a new message in memory from a character array containting the coded message.

The message can be accessed through its msgid and it will be available
until codes_release is called. A reference to the original coded
message is kept in the new message structure.

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_copy_message.f90

Parameters

  msgid | id of the message loaded in memory
  message | character array containing the coded message
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_new_from_message_int4 | ( | integer(kind=kindofint), intent(out) | msgid,
|  | integer(kind=4), dimension(:), intent(in) | message,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Create a new message in memory from an integer array containting the coded message.

The message can be accessed through its msgid and it will be available
until codes_release is called. A reference to the original coded
message is kept in the new message structure.

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_copy_message.f90

Parameters

  msgid | id of the message loaded in memory
  message | integer array containing the coded message
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_open_file | ( | integer(kind=kindofint), intent(out) | ifile,
|  | character(len=*), intent(in) | filename,
|  | character(len=*), intent(in) | mode,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Open a file according to a mode.

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_get_keys.f90

Parameters

  ifile | id of the opened file to be used in all the file functions.
  filename | name of the file to be open
  mode | open mode can be 'r' (read only), 'w' (write only) or 'a' (append)
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_bytes_char | ( | integer(kind=kindofint), intent(in) | ifile,
|  | character(len=1), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofint), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads nbytes bytes into the buffer from a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | binary buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_bytes_char_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | character(len=1), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofsize_t), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads nbytes bytes into the buffer from a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | binary buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_bytes_int4 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=4), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofint), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads nbytes bytes into the buffer from a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_bytes_int4_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=4), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofsize_t), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads nbytes bytes into the buffer from a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_bytes_real4 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=4), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofint), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads nbytes bytes into the buffer from a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_bytes_real4_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=4), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofsize_t), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads nbytes bytes into the buffer from a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_bytes_real8 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=8), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofint), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads nbytes bytes into the buffer from a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_bytes_real8_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=8), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofsize_t), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads nbytes bytes into the buffer from a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_from_file_char | ( | integer(kind=kindofint), intent(in) | ifile,
|  | character(len=1), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofint), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads a message in the buffer array from the file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_from_file_char_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | character(len=1), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofsize_t), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads a message in the buffer array from the file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_from_file_int4 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=4), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofint), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads a message in the buffer array from the file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | binary buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_from_file_int4_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=4), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofsize_t), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads a message in the buffer array from the file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | binary buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_from_file_real4 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=4), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofint), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads a message in the buffer array from the file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | binary buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_from_file_real4_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=4), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofsize_t), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads a message in the buffer array from the file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | binary buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_from_file_real8 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=8), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofint), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads a message in the buffer array from the file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | binary buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_read_from_file_real8_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=8), dimension(:), intent(out) | buffer,
|  | integer(kind=kindofsize_t), intent(inout) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Reads a message in the buffer array from the file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | binary buffer to be read
  nbytes | number of bytes to be read
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_release | ( | integer(kind=kindofint), intent(in) | msgid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Free the memory for the message referred as msgid.

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_get_keys.f90

Parameters

  msgid | id of the message loaded in memory
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_byte_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | character(len=1), dimension(:), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | length,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the array of bytes (character) for a key in a message.

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 message loaded in memory
  key | key name
  value | character(len=1) array of byte values
  length | (optional) output: number of values written
  status | (optional) CODES_SUCCESS if OK, integer value on error

subroutine codes_set_definitions_path | ( | character(len=*), intent(in) | path,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the definition path.

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

  path | definitions path
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_int | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the integer value for a key in a message.

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 message loaded in memory
  key | key name
  value | integer(4) value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_int_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), dimension(:), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the integers values for an array key in a message.

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 message loaded in memory
  key | key name
  value | integer(4) array value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_long | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindoflong), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the integer value for a key in a message.

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 message loaded in memory
  key | key name
  value | integer(4) value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_long_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindoflong), dimension(:), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the integers values for an array key in a message.

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 message loaded in memory
  key | key name
  value | integer(4) array value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_missing | ( | integer(kind=kindofint), intent(in) | id,
|  | character(len=*), intent(in) | key,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Wrapper for eccodes.

Set as missing the value for a key in a message.

It can be used to set a missing value in the header but not in
the data values. To set missing data values see the bitmap examples.
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_set_missing.f90

Parameters

  id | ID of the message loaded in memory
  key | key name
  status | CODES_SUCCESS if OK, integer value on error

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

Set the real(4) value for a key in a message.

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 message loaded in memory
  key | key name
  value | real(4) value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_real4_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | real(kind = kindoffloat), dimension(:), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the real(4) values for an array key in a message.

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 message loaded in memory
  key | key name
  value | real(4) array value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_real8 | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | real(kind = kindofdouble), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the real(8) value for a key in a message.

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 message loaded in memory
  key | key name
  value | real(8) value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_real8_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | real(kind = kindofdouble), dimension(:), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the real(8) values for an array key in a message.

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 message loaded in memory
  key | key name
  value | real(8) array value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_samples_path | ( | character(len=*), intent(in) | path,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the samples path.

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

  path | samples path
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_string | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | character(len=*), intent(in) | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

*/

Set the character value for a string key in a message.

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 message loaded in memory
  key | key name
  value | character value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_set_string_array | ( | integer(kind=kindofint), intent(in) | msgid,
|  | character(len=*), intent(in) | key,
|  | character(len=*), dimension(:), intent(in), allocatable | value,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Set the string values for an array key in a message.

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 message loaded in memory
  key | key name
  value | string array value
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_skip_coded | ( | integer(kind=kindofint), intent(in) | iterid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Skip the coded keys in a keys iterator.

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.

The coded keys are actually coded in the message.

See Also
  codes_keys_iterator_new, codes_keys_iterator_next, codes_keys_iterator_delete

Parameters

  iterid | keys iterator id
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_skip_computed | ( | integer(kind=kindofint), intent(in) | iterid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Skip the computed keys in a keys iterator.

The computed keys are not coded in the message they are computed from other keys.

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.

See Also
  codes_keys_iterator_new, codes_keys_iterator_next, codes_keys_iterator_delete

Parameters

  iterid | keys iterator id
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_skip_duplicates | ( | integer(kind=kindofint), intent(in) | iterid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Skip the duplicated keys in a keys iterator.

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.

See Also
  codes_keys_iterator_new, codes_keys_iterator_next, codes_keys_iterator_delete

Parameters

  iterid | keys iterator id
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_skip_read_only | ( | integer(kind=kindofint), intent(in) | iterid,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Skip the read_only keys in a keys iterator.

Read only keys cannot be set.

See Also
  codes_keys_iterator_new, codes_keys_iterator_next, codes_keys_iterator_delete

Parameters

  iterid | keys iterator id
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write | ( | integer(kind=kindofint), intent(in) | msgid,
|  | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write the coded message to a file.

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 message loaded in memory
  ifile | file id of a file opened with codes_open_file
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write_bytes_char | ( | integer(kind=kindofint), intent(in) | ifile,
|  | character(len=1), dimension(:), intent(in) | buffer,
|  | integer(kind=kindofint), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write nbytes bytes from the buffer in a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be written
  nbytes | number of bytes to be written
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write_bytes_char_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | character(len=1), dimension(:), intent(in) | buffer,
|  | integer(kind=kindofsize_t), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write nbytes bytes from the buffer in a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be written
  nbytes | number of bytes to be written
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write_bytes_int4 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=4), dimension(:), intent(in) | buffer,
|  | integer(kind=kindofint), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write nbytes bytes from the buffer in a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be written
  nbytes | number of bytes to be written
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write_bytes_int4_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | integer(kind=4), dimension(:), intent(in) | buffer,
|  | integer(kind=kindofsize_t), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write nbytes bytes from the buffer in a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be written
  nbytes | number of bytes to be written
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write_bytes_real4 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=4), dimension(:), intent(in) | buffer,
|  | integer(kind=kindofint), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write nbytes bytes from the buffer in a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be written
  nbytes | number of bytes to be written
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write_bytes_real4_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=4), dimension(:), intent(in) | buffer,
|  | integer(kind=kindofsize_t), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write nbytes bytes from the buffer in a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be written
  nbytes | number of bytes to be written
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write_bytes_real8 | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=8), dimension(:), intent(in) | buffer,
|  | integer(kind=kindofint), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write nbytes bytes from the buffer in a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be written
  nbytes | number of bytes to be written
  status | CODES_SUCCESS if OK, integer value on error

subroutine codes_write_bytes_real8_size_t | ( | integer(kind=kindofint), intent(in) | ifile,
|  | real(kind=8), dimension(:), intent(in) | buffer,
|  | integer(kind=kindofsize_t), intent(in) | nbytes,
|  | integer(kind=kindofint), intent(out), optional | status
| ) |  |

Write nbytes bytes from the buffer in a file opened with codes_open_file.

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

  ifile | id of the opened file to be used in all the file functions.
  buffer | buffer to be written
  nbytes | number of bytes to be written
  status | CODES_SUCCESS if OK, integer value on error

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

- eccodes_f90.f90