emcsfc_snow2mdl
1.13.0
|
Determine whether file is grib or not. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | gdt_to_gds (igdtnum, igdstmpl, igdtlen, kgds, ni, nj, res) |
Convert from the grib2 grid description template array used by the ncep grib2 library, to the grib1 grid description section array used by ncep ipolates library. More... | |
subroutine | grib2_check (kgds, igdstmplen) |
Determine length of grib2 gds template array, which is a function of the map projection. More... | |
subroutine | grib2_free (gfld) |
Deallocate the grib2 gribfield pointers. More... | |
subroutine | grib2_null (gfld) |
Nullify the grib2 gribfield pointers. More... | |
subroutine | grib_check (file_name, isgrib) |
Determine whether file is grib or not. More... | |
subroutine | init_grib2 (century, year, month, day, hour, kgds, lat11, latlast, lon11, lonlast, listsec0, listsec1, igds, ipdstmpl, ipdsnum, igdstmpl, igdstmplen, idefnum, ideflist, ngrdpts) |
Initialize grib2 arrays required by the ncep g2 library according to grib1 gds information. More... | |
subroutine | skgb2 (LUGB, ISEEK, MSEEK, LSKIP, LGRIB, I1) |
Determine whether file is grib or not. More... | |
subroutine gdt_to_gds | ( | integer, intent(in) | igdtnum, |
integer, dimension(igdtlen), intent(in) | igdstmpl, | ||
integer, intent(in) | igdtlen, | ||
integer, dimension(200), intent(out) | kgds, | ||
integer, intent(out) | ni, | ||
integer, intent(out) | nj, | ||
real, intent(out) | res | ||
) |
Convert from the grib2 grid description template array used by the ncep grib2 library, to the grib1 grid description section array used by ncep ipolates library.
[in] | igdtnum | grib2 grid desc template number |
[in] | igdstmpl | grib2 grid desc template array |
[in] | igdtlen | grib2 grid desc template array size |
[out] | kgds | grib1 grid description section array used by ncep ipolates library. |
[out] | ni | i grid dimensions |
[out] | nj | j grid dimensions |
[out] | res | grid resolution in km |
condition codes: 50 - unrecognized model grid type; fatal
Definition at line 139 of file grib_utils.F90.
Referenced by model_grid::read_mdl_grid_info(), snowdat::readafwa(), snowdat::readautosnow(), and snowdat::readnesdis().
subroutine grib2_check | ( | integer, dimension(200), intent(in) | kgds, |
integer, intent(out) | igdstmplen | ||
) |
Determine length of grib2 gds template array, which is a function of the map projection.
[in] | kgds | grib1 gds array |
[in] | igdstmplen | length of gds template array. |
condition codes: 47 - unrecognized grid type; fatal
Definition at line 350 of file grib_utils.F90.
Referenced by snow2mdl::write_grib2().
subroutine grib2_free | ( | type(gribfield), intent(inout) | gfld | ) |
Deallocate the grib2 gribfield pointers.
[in] | gfld | a gribfield data structure |
Definition at line 635 of file grib_utils.F90.
Referenced by snowdat::nh_climo_check(), model_grid::read_mdl_grid_info(), snowdat::readautosnow(), and snowdat::readnesdis().
subroutine grib2_null | ( | type(gribfield), intent(inout) | gfld | ) |
Nullify the grib2 gribfield pointers.
[in] | gfld | a gribfield data structure |
Definition at line 610 of file grib_utils.F90.
Referenced by snowdat::nh_climo_check(), model_grid::read_mdl_grid_info(), snowdat::readafwa(), snowdat::readautosnow(), and snowdat::readnesdis().
subroutine grib_check | ( | character*(*), intent(in) | file_name, |
integer, intent(out) | isgrib | ||
) |
Determine whether file is grib or not.
program history log:
[in] | file_name | - file to be checked |
[out] | isgrib | - '1' or '2' if grib1/2 file '0' if not grib |
input files:
condition codes: all fatal
Definition at line 23 of file grib_utils.F90.
References skgb2().
Referenced by model_grid::read_mdl_grid_info(), snowdat::readafwa(), and snowdat::readnesdis().
subroutine init_grib2 | ( | integer, intent(in) | century, |
integer, intent(in) | year, | ||
integer, intent(in) | month, | ||
integer, intent(in) | day, | ||
integer, intent(in) | hour, | ||
integer, dimension(200), intent(in) | kgds, | ||
real, intent(in) | lat11, | ||
real, intent(in) | latlast, | ||
real, intent(in) | lon11, | ||
real, intent(in) | lonlast, | ||
integer, dimension(2), intent(out) | listsec0, | ||
integer, dimension(13), intent(out) | listsec1, | ||
integer, dimension(5), intent(out) | igds, | ||
integer, dimension(15), intent(out) | ipdstmpl, | ||
integer, intent(out) | ipdsnum, | ||
integer, dimension(igdstmplen), intent(out) | igdstmpl, | ||
integer, intent(in) | igdstmplen, | ||
integer, intent(out) | idefnum, | ||
integer, intent(out) | ideflist, | ||
integer, intent(out) | ngrdpts | ||
) |
Initialize grib2 arrays required by the ncep g2 library according to grib1 gds information.
The grib1 gds is held in the kgds array, which is used by the ncep ipolates and w3nco (grib 1) libraries.
Call routine grib2_check first to determine igdstmplen.
[in] | century | current date/time info |
[in] | year | current date/time info |
[in] | month | current date/time info |
[in] | day | current date/time info |
[in] | hour | current date/time info |
[in] | kgds | grib1 gds information |
[in] | igdstmplen | length of grib2 gdt template. |
[in] | lat11 | lat of first grid point |
[in] | lon11 | lon of first grid point |
[in] | latlast | lat of last grid point |
[in] | lonlast | lon of last grid point |
[out] | igds | grib2 section 3 information. |
[out] | listsec0 | grib2 section 0 information. |
[out] | listsec1 | grib2 section 1 information. |
[out] | ipdsnum | grib2 pds template number |
[out] | ipdstmpl | grib2 pds template array |
[out] | igdstmpl | grib2 gds template array |
[out] | idefnum | information for non-reg grid, grid points in each row. |
[out] | ideflist | information for non-reg grid, grid points in each row. |
[out] | ngrdpts | number of model grid points. |
Definition at line 397 of file grib_utils.F90.
Referenced by snow2mdl::write_grib2().
subroutine skgb2 | ( | integer, intent(in) | LUGB, |
integer, intent(in) | ISEEK, | ||
integer, intent(in) | MSEEK, | ||
integer, intent(out) | LSKIP, | ||
integer, intent(out) | LGRIB, | ||
integer, intent(out) | I1 | ||
) |
Determine whether file is grib or not.
Based on w3nco library routine skgb.
[in] | lugb | file unit number |
[in] | iseek | number of bits to skip before search. |
[in] | mseek | max number of bytes to search. |
[out] | lskip | number of bytes to skip before message |
[out] | lgrib | number of bytes in message. '0' if not grib. |
[out] | i1 | '1' or '2' if grib1/2 file. '0' if not grib. |
input file:
Definition at line 75 of file grib_utils.F90.
Referenced by grib_check().