NCEPLIBS-g2 4.0.0
|
Module for the NCEPLIBS-g2 file-based GRIB2 API. More...
Functions/Subroutines | |
character(len=(len(string)+1)) function | addcnullchar (string, nlen) |
Add a C_NULL_CHAR to a string to create a C compatible string. | |
integer function | g2cf_close (g2id) |
Close a GRIB2 file. | |
integer function | g2cf_inq (g2id, num_msg) |
Learn how many messages are in a GRIB2 file. | |
integer function | g2cf_inq_dim (g2id, msg_num, prod_num, dim_num, dimlen, name, val) |
Learn about a dimension. | |
integer function | g2cf_inq_msg (g2id, msg_num, discipline, num_fields, num_local, center, subcenter, master_version, local_version) |
Learn about a message are in a GRIB2 file. | |
integer function | g2cf_inq_msg_time (g2id, msg_num, sig_ref_time, year, month, day, hour, minute, second) |
Learn about message date/time. | |
integer function | g2cf_inq_prod (g2id, msg_num, prod_num, pds_template_len, pds_template, gds_template_len, gds_template, drs_template_len, drs_template) |
Learn about a product. | |
integer function | g2cf_open (path, mode, g2id) |
Open a GRIB2 file. | |
integer function | g2cf_open_index (data_file, index_file, mode, g2cid) |
Open a GRIB2 file using an exsiting index file (generated by the grb2index utility). | |
integer function | g2cf_set_log_level (log_level) |
Turn internal logging on. | |
character(len=nlen) function | stripcnullchar (cstring, nlen) |
Check cstring for a c null char, strip it off and return regular string. | |
Variables | |
integer, parameter | g2_max_drs_template_len = 55 |
Maximum number of entries in a DRS template. | |
integer, parameter | g2_max_gds_template_len = 50 |
Maximum number of entries in a GDS template. | |
integer, parameter | g2_max_name = 1024 |
Maximum name length. | |
integer, parameter | g2_max_pds_template_len = 50 |
Maximum number of entries in a PDS template. | |
integer, parameter | g2_noerr = 0 |
Return value from functions when there is no error. | |
Module for the NCEPLIBS-g2 file-based GRIB2 API.
character(len = (len(string) + 1)) function g2cf::addcnullchar | ( | character(len=*), intent(in) | string, |
integer, intent(inout) | nlen | ||
) |
Add a C_NULL_CHAR to a string to create a C compatible string.
Assumes target variable will be of length LEN(string)+1. Trailing blanks will be stripped from string and length of trimmed string will be returned in nlen.
string | The string to trimmed and null-terminated |
nlen | The length of the returned string, including null-terminator. |
This function was originally written by, Richard Weed, Ph.D., as part of netcdf-fortran.
Definition at line 42 of file g2cf.F90.
Referenced by g2cf_open(), and g2cf_open_index().
integer function g2cf::g2cf_close | ( | integer, intent(in) | g2id | ) |
integer function g2cf::g2cf_inq | ( | integer, intent(in) | g2id, |
integer, intent(out) | num_msg | ||
) |
integer function g2cf::g2cf_inq_dim | ( | integer, intent(in) | g2id, |
integer, intent(in) | msg_num, | ||
integer, intent(in) | prod_num, | ||
integer, intent(in) | dim_num, | ||
integer(kind = 8), intent(out) | dimlen, | ||
character, dimension(*), intent(out) | name, | ||
real, dimension(*), intent(out), optional | val | ||
) |
Learn about a dimension.
[in] | g2id | The ID of the open file |
[in] | msg_num | The message number in the file (first message is 1). |
[in] | prod_num | The product number in the message (first product is 1). |
[in] | dim_num | The dimension number in the product (first dimension is 1). |
[out] | dimlen | Length of dimension. |
[out] | name | Name of dimension. |
[out] | val | Array of values along the dimension. |
Definition at line 392 of file g2cf.F90.
References g2_noerr, and stripcnullchar().
integer function g2cf::g2cf_inq_msg | ( | integer, intent(in) | g2id, |
integer, intent(in) | msg_num, | ||
integer(kind = 1), intent(out) | discipline, | ||
integer, intent(out) | num_fields, | ||
integer, intent(out) | num_local, | ||
integer(kind = 2), intent(out) | center, | ||
integer(kind = 2), intent(out) | subcenter, | ||
integer(kind = 1), intent(out) | master_version, | ||
integer(kind = 1), intent(out) | local_version | ||
) |
Learn about a message are in a GRIB2 file.
[in] | g2id | The ID of the open file |
[in] | msg_num | The number of message to learn about. The first message in the file is number 1. |
[out] | discipline | The discipline of the message. |
[out] | num_fields | Number of fields in the message. |
[out] | num_local | Number of local sections in the message. |
[out] | center | Originating center. |
[out] | subcenter | Originating sub-center. |
[out] | master_version | Master version. |
[out] | local_version | Local version. |
integer function g2cf::g2cf_inq_msg_time | ( | integer, intent(in) | g2id, |
integer, intent(in) | msg_num, | ||
integer(kind = 1), intent(out) | sig_ref_time, | ||
integer(kind = 2), intent(out) | year, | ||
integer(kind = 1), intent(out) | month, | ||
integer(kind = 1), intent(out) | day, | ||
integer(kind = 1), intent(out) | hour, | ||
integer(kind = 1), intent(out) | minute, | ||
integer(kind = 1), intent(out) | second | ||
) |
Learn about message date/time.
g2id | The ID of the open file |
msg_num | The message number in the file (first message is 1). |
sig_ref_time | The significant reference time. |
year | Year |
month | Mongh |
day | Day |
hour | Hour |
minute | Minute |
second | Second |
integer function g2cf::g2cf_inq_prod | ( | integer, intent(in) | g2id, |
integer, intent(in) | msg_num, | ||
integer, intent(in) | prod_num, | ||
integer, intent(out) | pds_template_len, | ||
integer(kind = 8), dimension(*), intent(out) | pds_template, | ||
integer, intent(out) | gds_template_len, | ||
integer(kind = 8), dimension(*), intent(out) | gds_template, | ||
integer, intent(out) | drs_template_len, | ||
integer(kind = 8), dimension(*), intent(out) | drs_template | ||
) |
Learn about a product.
[in] | g2id | The ID of the open file |
[in] | msg_num | The message number in the file (first message is 1). |
[in] | prod_num | The product number in the message (first product is 1). |
[out] | pds_template_len | Length of the PDS template. |
[out] | pds_template | The PDS template values. |
[out] | gds_template_len | Length of the GDS template. |
[out] | gds_template | The GDS template values. |
[out] | drs_template_len | Length of the DRS template. |
[out] | drs_template | The DRS template values. |
integer function g2cf::g2cf_open | ( | character(len = *), intent(in) | path, |
integer, intent(in) | mode, | ||
integer, intent(inout) | g2id | ||
) |
Open a GRIB2 file.
path | The path to the file |
mode | Flag with open mode information |
g2id | The ID of the open file |
Definition at line 109 of file g2cf.F90.
References addcnullchar().
integer function g2cf::g2cf_open_index | ( | character(len=*), intent(in) | data_file, |
character(len=*), intent(in) | index_file, | ||
integer, intent(in) | mode, | ||
integer, intent(inout) | g2cid | ||
) |
Open a GRIB2 file using an exsiting index file (generated by the grb2index utility).
data_file | Path to data file. |
index_file | Path to index file. |
mode | Open mode, may be NC_CLOBBER (0) or NC_NOCLOBBER. |
g2cid | File ID. |
Definition at line 152 of file g2cf.F90.
References addcnullchar().
integer function g2cf::g2cf_set_log_level | ( | integer, intent(in) | log_level | ) |
character(len=nlen) function g2cf::stripcnullchar | ( | character(len=*), intent(in) | cstring, |
integer, intent(in) | nlen | ||
) |
Check cstring for a c null char, strip it off and return regular string.
Limit length of cstring loaded into string to nlen.
[in] | cstring | String which may have null char. |
[in] | nlen | Length of string. |
This function was originally written by, Richard Weed, Ph.D., as part of netcdf-fortran.
Definition at line 81 of file g2cf.F90.
Referenced by g2cf_inq_dim().
integer, parameter g2cf::g2_max_drs_template_len = 55 |
integer, parameter g2cf::g2_max_gds_template_len = 50 |
integer, parameter g2cf::g2_max_name = 1024 |
integer, parameter g2cf::g2_max_pds_template_len = 50 |
integer, parameter g2cf::g2_noerr = 0 |
Return value from functions when there is no error.
Definition at line 12 of file g2cf.F90.
Referenced by g2cf_inq_dim().