NCEPLIBS-g2
3.5.0
|
Allow access to predefined GRIB2 Grid Definition Templates (GDT) stored in a file. More...
Functions/Subroutines | |
subroutine | freegridlist () |
This subroutine frees the memory allocated for the linked list of grid templates stored in module variable gridlist. More... | |
subroutine | getgridbyname (lunit, name, igdtn, igdtmpl, iret) |
This subroutine searches a file referenced by fortran unit lunit for a Grid Definition Template assigned to the requested name. More... | |
subroutine | getgridbynum (lunit, number, igdtn, igdtmpl, iret) |
This subroutine searches a file referenced by fortran unit lunit for a Grid Definition Template assigned to the requested number. More... | |
integer function | readgrids (lunit) |
This function reads the list of GDT entries in the file associated with fortran unit, lunit. More... | |
Variables | |
integer, parameter | maxtemp = 200 |
maximum template number for grid definition. More... | |
integer | num_grids = 0 |
the number of grids. More... | |
Allow access to predefined GRIB2 Grid Definition Templates (GDT) stored in a file.
The GDTs are represented by a predefined number or a character abbreviation. At the first request, all the grid GDT entries in the file associated with input Fortran file unit number, lunit, are read into a linked list named gridlist. This list is searched for the requested entry. Users of this Fortran module should only call routines getgridbynum() and getgridbyname(), and freegridlist() to release all allocated memory.
The format of the file scanned by routines in this module is as follows. Each line contains one Grid entry containing five fields, each separated by a colon, ":". The fields are:
As an example, this is the entry for the 1x1 GFS global grid:
3:gbl_1deg: 0:19: 0 0 0 0 0 0 0 360 181 0 0 90000000 0 48 -90000000 359000000 1000000 1000000 0
subroutine g2grids::freegridlist |
This subroutine frees the memory allocated for the linked list of grid templates stored in module variable gridlist.
Definition at line 241 of file g2grids.F90.
References num_grids.
subroutine g2grids::getgridbyname | ( | integer, intent(in) | lunit, |
character(len = 8), intent(in) | name, | ||
integer, intent(out) | igdtn, | ||
integer, dimension(*), intent(out) | igdtmpl, | ||
integer, intent(out) | iret | ||
) |
This subroutine searches a file referenced by fortran unit lunit for a Grid Definition Template assigned to the requested name.
The input file format is described at the top of this module.
Callers should call freegridlist() to free the memory allocated when this function is called.
[in] | lunit | Unit number of file containing Grid definitions |
[in] | name | Grid name of the requested Grid definition |
[out] | igdtn | NN, indicating the number of the Grid Definition Template 3.NN |
[out] | igdtmpl | An array containing the values of each entry in the Grid Definition Template. |
[out] | iret | Error return code.
|
Definition at line 200 of file g2grids.F90.
References num_grids, and readgrids().
subroutine g2grids::getgridbynum | ( | integer, intent(in) | lunit, |
integer, intent(in) | number, | ||
integer, intent(out) | igdtn, | ||
integer, dimension(*), intent(out) | igdtmpl, | ||
integer, intent(out) | iret | ||
) |
This subroutine searches a file referenced by fortran unit lunit for a Grid Definition Template assigned to the requested number.
The input file format is described at the top of this module.
Callers should call freegridlist() to free the memory allocated when this function is called.
[in] | lunit | Unit number of file containing Grid definitions |
[in] | number | Grid number of the requested Grid definition |
[out] | igdtn | NN, indicating the number of the Grid Definition Template 3.NN |
[out] | igdtmpl | An array containing the values of each entry in the Grid Definition Template. |
[out] | iret | Error return code.
|
Definition at line 144 of file g2grids.F90.
References num_grids, and readgrids().
integer function g2grids::readgrids | ( | integer, intent(in) | lunit | ) |
This function reads the list of GDT entries in the file associated with fortran unit, lunit.
All the entries are stored in a linked list called gridlist.
[in] | lunit | Fortran unit number associated the the GDT file. |
Definition at line 58 of file g2grids.F90.
Referenced by getgridbyname(), and getgridbynum().
integer, parameter g2grids::maxtemp = 200 |
maximum template number for grid definition.
Definition at line 35 of file g2grids.F90.
integer g2grids::num_grids = 0 |
the number of grids.
Definition at line 47 of file g2grids.F90.
Referenced by freegridlist(), getgridbyname(), and getgridbynum().