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

Set the value for a key in a grib message. More...

Public Member Functions

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_string (msgid, key, value, status)
 Set the character value for a string 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...
 

Detailed Description

Set the value for a key in a grib message.

The given value is set for the key in the gribid message. In some cases the value can be an array rather than a scalar. As examples of array keys we have "values","pl", "pv" respectively the data values, the list of number of points for each latitude in a reduced grid and the list of vertical levels. In these cases the value array must be allocated by the caller and their required dimension can be obtained with codes_get_size.
The gribid references to a grib message loaded in memory.

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

Examples: grib_set_keys.f90

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

Member Function/Subroutine Documentation

subroutine codes_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
msgidid of the message loaded in memory
keykey name
valuecharacter(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_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
msgidid of the message loaded in memory
keykey name
valueinteger(4) value
statusCODES_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
msgidid of the message loaded in memory
keykey name
valueinteger(4) array value
statusCODES_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
msgidid of the message loaded in memory
keykey name
valueinteger(4) value
statusCODES_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
msgidid of the message loaded in memory
keykey name
valueinteger(4) array value
statusCODES_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
msgidid of the message loaded in memory
keykey name
valuereal(4) value
statusCODES_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
msgidid of the message loaded in memory
keykey name
valuereal(4) array value
statusCODES_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
msgidid of the message loaded in memory
keykey name
valuereal(8) value
statusCODES_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
msgidid of the message loaded in memory
keykey name
valuereal(8) array value
statusCODES_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
msgidid of the message loaded in memory
keykey name
valuecharacter value
statusCODES_SUCCESS if OK, integer value on error

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