From 48eb7bab9c3cc1beec4905de99c9df5b895b26ce Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 13 Dec 2017 14:28:14 +0000 Subject: [PATCH] ECC-598: F90 documentation of allocatable array attribute --- fortran/eccodes_f90_int.f90 | 20 +++++++++++++------- fortran/eccodes_f90_long_int.f90 | 26 +++++++++++++++----------- fortran/eccodes_f90_tail.f90 | 1 + fortran/grib_f90_head.f90 | 10 +++++----- fortran/grib_f90_int.f90 | 14 ++++++++------ fortran/grib_f90_long_int.f90 | 22 ++++++++++++---------- 6 files changed, 54 insertions(+), 39 deletions(-) diff --git a/fortran/eccodes_f90_int.f90 b/fortran/eccodes_f90_int.f90 index 874d6aa8e..36f03f290 100644 --- a/fortran/eccodes_f90_int.f90 +++ b/fortran/eccodes_f90_int.f90 @@ -66,9 +66,10 @@ !> !> Given a \em msgid and \em key as input a \em value for the \em key is returned. !> In some cases the \em 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 \em value array must be allocated by the caller + !> As examples of GRIB array keys we have "values" (the data values), + !> "pl" (the list of number of points for each latitude in a reduced grid) and + !> "pv" (the list of vertical levels). + !> In these cases the \em value array must be allocated by the caller !> and their required dimension can be obtained with \ref codes_get_size. \n !> The \em value can be integer(4), real(4), real(8), character. !> Although each key has its own native type, a key of type integer @@ -76,6 +77,8 @@ !> Analogous conversions are always provided when possible. !> Illegal conversions are real to integer and character to any other type. !> + !> Note: The output array variable must support the \b allocatable array attribute. + !> !> The \em msgid references to a message loaded in memory. !> !> In case of error, if the status parameter (optional) is not given, the program will @@ -88,7 +91,8 @@ !> !> @param[in] msgid id of the message loaded in memory !> @param[in] key key name - !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character. + !> Arrays must support the \b allocatable attribute. !> @param[out] status CODES_SUCCESS if OK, integer value on error interface codes_get module procedure codes_get_int, & @@ -122,9 +126,10 @@ !> !> The given \em value is set for the \em key in the \em msgid message. !> In some cases the \em 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 \em value array must be allocated by the caller + !> As examples of GRIB array keys we have "values" (the data values), + !> "pl" (the list of number of points for each latitude in a reduced grid) and + !> "pv" (the list of vertical levels). + !> In these cases the \em value array must be allocated by the caller !> and their required dimension can be obtained with \ref codes_get_size. \n !> The msgid references to a message loaded in memory. !> @@ -139,6 +144,7 @@ !> @param[in] msgid id of the message loaded in memory !> @param[in] key key name !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8) + !> Arrays must support the \b allocatable attribute. !> @param[out] status CODES_SUCCESS if OK, integer value on error interface codes_set module procedure codes_set_int, & diff --git a/fortran/eccodes_f90_long_int.f90 b/fortran/eccodes_f90_long_int.f90 index 153a24f56..c7c8be88b 100644 --- a/fortran/eccodes_f90_long_int.f90 +++ b/fortran/eccodes_f90_long_int.f90 @@ -68,9 +68,10 @@ !> !> Given a \em msgid and \em key as input a \em value for the \em key is returned. !> In some cases the \em 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 \em value array must be allocated by the caller + !> As examples of GRIB array keys we have "values" (the data values), + !> "pl" (the list of number of points for each latitude in a reduced grid) and + !> "pv" (the list of vertical levels). + !> In these cases the \em value array must be allocated by the caller !> and their required dimension can be obtained with \ref codes_get_size. \n !> The \em value can be integer(4), real(4), real(8), character. !> Although each key has its own native type, a key of type integer @@ -90,7 +91,8 @@ !> !> @param[in] msgid id of the message loaded in memory !> @param[in] key key name - !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character. + !> Arrays must support the \b allocatable attribute. !> @param[out] status CODES_SUCCESS if OK, integer value on error interface codes_get module procedure codes_get_int, & @@ -125,9 +127,10 @@ !> !> The given \em value is set for the \em key in the \em msgid message. !> In some cases the \em 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 \em value array must be allocated by the caller + !> As examples of GRIB array keys we have "values" (the data values), + !> "pl" (the list of number of points for each latitude in a reduced grid) and + !> "pv" (the list of vertical levels). + !> In these cases the \em value array must be allocated by the caller !> and their required dimension can be obtained with \ref codes_get_size. \n !> The msgid references to a message loaded in memory. !> @@ -139,10 +142,11 @@ !> !> @see codes_new_from_file, codes_release, codes_get !> - !> @param[in] msgid id of the message loaded in memory - !> @param[in] key key name - !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8) - !> @param[out] status CODES_SUCCESS if OK, integer value on error + !> @param[in] msgid id of the message loaded in memory + !> @param[in] key key name + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8). + !> Arrays must support the \b allocatable attribute. + !> @param[out] status CODES_SUCCESS if OK, integer value on error interface codes_set module procedure codes_set_int, & codes_set_long, & diff --git a/fortran/eccodes_f90_tail.f90 b/fortran/eccodes_f90_tail.f90 index 0ab31c172..1cea0a5f8 100644 --- a/fortran/eccodes_f90_tail.f90 +++ b/fortran/eccodes_f90_tail.f90 @@ -1810,6 +1810,7 @@ end subroutine codes_bufr_copy_data !> In case of error, if the status parameter (optional) is not given, the program will !> exit with an error message.\n Otherwise the error message can be !> gathered with @ref codes_get_error_string. + !> Note: This function supports the \b allocatable array attribute !> !> @param msgid id of the message loaded in memory !> @param key key name diff --git a/fortran/grib_f90_head.f90 b/fortran/grib_f90_head.f90 index 1ff65f821..f02f81a7e 100644 --- a/fortran/grib_f90_head.f90 +++ b/fortran/grib_f90_head.f90 @@ -60,11 +60,11 @@ module grib_api !> !> @see grib_new_from_file, grib_release, grib_get !> - !> @param[in] gribid id of the grib loaded in memory - !> @param[in] key key name - !> @param[in] index index can be a scalar or array of integer(4) - !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8) - !> @param[out] status GRIB_SUCCESS if OK, integer value on error + !> @param[in] gribid id of the GRIB loaded in memory + !> @param[in] key key name + !> @param[in] index index can be a scalar or array of integer(4) + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8) + !> @param[out] status GRIB_SUCCESS if OK, integer value on error interface grib_get_element module procedure grib_get_real4_element, & grib_get_real8_element, & diff --git a/fortran/grib_f90_int.f90 b/fortran/grib_f90_int.f90 index 3ad86e1d6..e0f572e54 100644 --- a/fortran/grib_f90_int.f90 +++ b/fortran/grib_f90_int.f90 @@ -66,9 +66,10 @@ !> !> Given a \em msgid and \em key as input a \em value for the \em key is returned. !> In some cases the \em 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 \em value array must be allocated by the caller + !> As examples of GRIB array keys we have "values" (the data values), + !> "pl" (the list of number of points for each latitude in a reduced grid) and + !> "pv" (the list of vertical levels). + !> In these cases the \em value array must be allocated by the caller !> and their required dimension can be obtained with \ref grib_get_size. \n !> The \em value can be integer(4), real(4), real(8), character. !> Although each key has its own native type, a key of type integer @@ -123,9 +124,10 @@ !> !> The given \em value is set for the \em key in the \em msgid message. !> In some cases the \em 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 \em value array must be allocated by the caller + !> As examples of GRIB array keys we have "values" (the data values), + !> "pl" (the list of number of points for each latitude in a reduced grid) and + !> "pv" (the list of vertical levels). + !> In these cases the \em value array must be allocated by the caller !> and their required dimension can be obtained with \ref grib_get_size. \n !> The msgid references to a message loaded in memory. !> diff --git a/fortran/grib_f90_long_int.f90 b/fortran/grib_f90_long_int.f90 index 5d789ce48..1b3f471bd 100644 --- a/fortran/grib_f90_long_int.f90 +++ b/fortran/grib_f90_long_int.f90 @@ -69,9 +69,10 @@ !> !> Given a \em msgid and \em key as input a \em value for the \em key is returned. !> In some cases the \em 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 \em value array must be allocated by the caller + !> As examples of GRIB array keys we have "values" (the data values), + !> "pl" (the list of number of points for each latitude in a reduced grid) and + !> "pv" (the list of vertical levels). + !> In these cases the \em value array must be allocated by the caller !> and their required dimension can be obtained with \ref grib_get_size. \n !> The \em value can be integer(4), real(4), real(8), character. !> Although each key has its own native type, a key of type integer @@ -90,10 +91,10 @@ !> @see grib_new_from_file, grib_release, grib_set !> !> - !> @param[in] msgid id of the message loaded in memory - !> @param[in] key key name - !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character - !> @param[out] status GRIB_SUCCESS if OK, integer value on error + !> @param[in] msgid id of the message loaded in memory + !> @param[in] key key name + !> @param[out] value value can be a scalar or array of integer(4),real(4),real(8),character. + !> @param[out] status GRIB_SUCCESS if OK, integer value on error interface grib_get module procedure grib_get_int, & grib_get_long, & @@ -127,9 +128,10 @@ !> !> The given \em value is set for the \em key in the \em msgid message. !> In some cases the \em 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 \em value array must be allocated by the caller + !> As examples of GRIB array keys we have "values" (the data values), + !> "pl" (the list of number of points for each latitude in a reduced grid) and + !> "pv" (the list of vertical levels). + !> In these cases the \em value array must be allocated by the caller !> and their required dimension can be obtained with \ref grib_get_size. \n !> The msgid references to a message loaded in memory. !>