NCEPLIBS-g2 4.0.0
|
Convert every GRIB2 field to individual GRIB1 messages. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | cnv21 (ifl1, ifl2) |
This subroutine converts every GRIB2 field in a file to a GRIB1 field. | |
subroutine | gdt2gds (igds, igdstmpl, idefnum, ideflist, kgds, igrid, iret) |
This routine converts grid information from a GRIB2 Grid Description Section as well as its Grid Definition Template to GRIB1 GDS info. | |
subroutine | levelcnv (ipdstmpl, ltype, lval) |
This routine converts Level/layer information from a GRIB2 Product Definition Template to GRIB1 Level type and Level value. | |
subroutine | makepds (idisc, idsect, ipdsnum, ipdstmpl, ibmap, idrsnum, idrstmpl, kpds, iret) |
This routine creates a GRIB1 PDS (Section 1) from appropriate information from a GRIB2 Product Definition Template. | |
subroutine | makepdsens (ipdsnum, ipdstmpl, kpds, kens, kprob, xprob, kclust, kmembr, iret) |
This routine creates the GRIB1 NCEP Ensemble PDS extension information from appropriate information from a GRIB2 Product Definition Template. | |
subroutine | putgbexn (lugb, kf, kpds, kgds, kens, kprob, xprob, kclust, kmembr, ibs, nbits, lb, f, iret) |
Pack and write a grib message. | |
subroutine | setbit (ibm, ibs, ids, len, mg, g, gmin, gmax, nbit) |
The number of bits required to pack a given field for particular binary and decimal scalings is computed. | |
Convert every GRIB2 field to individual GRIB1 messages.
Definition in file cnv21.F90.
subroutine cnv21 | ( | integer, intent(in) | ifl1, |
integer, intent(in) | ifl2 | ||
) |
This subroutine converts every GRIB2 field in a file to a GRIB1 field.
If a GRIB2 message contains more than one data field, then each field is saved in individual GRIB1 messages.
Date | Programmer | Comments |
---|---|---|
2003-06-11 | Gilbert | Initial |
2008-05-14 | Vuong | Add option -m0 No explicit missing values included within data values. |
[in] | ifl1 | Fortran unit number of input GRIB2 file. |
[in] | ifl2 | Fortran unit number of output GRIB1 file. |
Definition at line 19 of file cnv21.F90.
References gdt2gds(), getgb2(), gf_free(), makepds(), makepdsens(), putgbexn(), and rdieee().
Referenced by cnvgrib().
subroutine gdt2gds | ( | integer, dimension(*), intent(in) | igds, |
integer, dimension(*), intent(in) | igdstmpl, | ||
integer, intent(in) | idefnum, | ||
integer, dimension(*), intent(in) | ideflist, | ||
integer, dimension(*), intent(out) | kgds, | ||
integer, intent(out) | igrid, | ||
integer, intent(out) | iret | ||
) |
This routine converts grid information from a GRIB2 Grid Description Section as well as its Grid Definition Template to GRIB1 GDS info.
In addition, a check is made to determine if the grid is an NCEP predefined grid.
Date | Programmer | Comments |
---|---|---|
2003-06-17 | Gilbert | Initial. |
2004-04-27 | Gilbert | Added support for gaussian grids. |
2007-04-16 | Vuong | Added Curvilinear Orthogonal grids. |
2007-05-29 | Vuong | Added Rotate Lat/Lon E-grid (203) |
[in] | igds | Contains information read from the appropriate GRIB Grid Definition Section 3 for the field being returned. Must be dimensioned >= 5.
|
[in] | igdstmpl | Grid Definition Template values for GDT 3.igds(5) |
[in] | idefnum | The number of entries in array ideflist. i.e. number of rows (or columns) for which optional grid points are defined. |
[in] | ideflist | Optional integer array containing the number of grid points contained in each row (or column). |
[out] | kgds | GRIB1 GDS as described in w3fi63 format. |
[out] | igrid | NCEP predefined GRIB1 grid number set to 255, if not NCEP grid |
[out] | iret | Error return value:
|
subroutine levelcnv | ( | integer, dimension(*), intent(in) | ipdstmpl, |
integer, intent(out) | ltype, | ||
integer, intent(out) | lval | ||
) |
This routine converts Level/layer information from a GRIB2 Product Definition Template to GRIB1 Level type and Level value.
Date | Programmer | Comments |
---|---|---|
2003-06-12 | Gilbert | Initial |
2007-10-24 | Boi Vuong | Added level 8 (Nominal top of atmosphere) |
2011-01-13 | Boi Vuong | Added level/layer values from 235 to 239 |
[in] | ipdstmpl | GRIB2 Product Definition Template values |
[out] | ltype | GRIB1 level type (PDS octet 10) |
[out] | lval | GRIB1 level/layer value(s) (PDS octets 11 and 12) |
Definition at line 533 of file cnv21.F90.
Referenced by makepds().
subroutine makepds | ( | integer, intent(in) | idisc, |
integer, dimension(*), intent(in) | idsect, | ||
integer, intent(in) | ipdsnum, | ||
integer, dimension(*), intent(in) | ipdstmpl, | ||
integer, intent(in) | ibmap, | ||
integer, intent(in) | idrsnum, | ||
integer, dimension(*), intent(in) | idrstmpl, | ||
integer, dimension(*), intent(out) | kpds, | ||
integer, intent(out) | iret | ||
) |
This routine creates a GRIB1 PDS (Section 1) from appropriate information from a GRIB2 Product Definition Template.
Date | Programmer | Comments |
---|---|---|
2003-06-12 | Gilbert | Initial. |
2005-04-19 | Gilbert | Changed scaling factor used with potential vorticity surfaces. |
2007-05-08 | VUONG | Add Product Definition Template entries 120-124, 131, 88, 45, 47. |
2007-05-14 | Boi Vuong | Added Time Range Indicator 51 (Climatological Mean Value) |
2007-10-24 | Boi Vuong | Added level 8 (Nominal top of atmosphere) |
2009-05-19 | Boi Vuong | Added levels 10(Entire Atmosphere), 11(Cumulonimbus Base),12(Cumulonimbus Top) and level 126(Isobaric Pa) |
2009-12-14 | Boi Vuong | Added check for WAFS to use PDT 4.15 for Icing, Turbulence and Cumulonimbus |
2010-08-10 | Boi Vuong | Added check for FNMOC to use TMP as TMAX and TMIN - Removed check WAFS MAX wind level |
2011-10-24 | Boi Vuong | Added check for NAM (NMM-B) parameters to set statistical processing as MAX and MIN |
2012-03-29 | Boi Vuong | Added check Time Range for APCP in FNMOC |
2014-05-20 | Boi Vuong | Added check Time Range after F252 |
2014-11-14 | Boi Vuong | Added check Time Range for 15-hr or 18-hr or 21-hr or 24-hr Accumulation for APCP after F240 |
2018-07-26 | Boi Vuong | Added check Time Range for continuous accumulated APCP after F252 when convert from grib2 to grib1 |
[in] | idisc | GRIB2 discipline from Section 0. |
[in] | idsect | GRIB2 Section 1 info.
|
[in] | ipdsnum | GRIB2 Product Definition Template Number |
[in] | ipdstmpl | GRIB2 Product Definition Template entries for PDT 4.ipdsnum |
[in] | ibmap | GRIB2 bitmap indicator from octet 6, Section 6. |
[in] | idrsnum | GRIB2 Data Representation Template Number |
[in] | idrstmpl | GRIB2 Data Representation Template entries |
[out] | kpds | GRIB1 PDS info as specified in W3FI63.
|
[out] | iret | Error return value:
|
Definition at line 264 of file cnv21.F90.
References levelcnv(), and params::param_g2_to_g1().
Referenced by cnv21().
subroutine makepdsens | ( | integer, intent(in) | ipdsnum, |
integer, dimension(*), intent(in) | ipdstmpl, | ||
integer, dimension(*), intent(inout) | kpds, | ||
integer, dimension(5), intent(out) | kens, | ||
integer, dimension(2), intent(out) | kprob, | ||
real, dimension(2), intent(out) | xprob, | ||
integer, dimension(16), intent(out) | kclust, | ||
integer, dimension(80), intent(out) | kmembr, | ||
integer, intent(out) | iret | ||
) |
This routine creates the GRIB1 NCEP Ensemble PDS extension information from appropriate information from a GRIB2 Product Definition Template.
Date | Programmer | Comments |
---|---|---|
2003-06-12 | Gilbert | Initial |
2007-05-14 | Boi Vuong | Corrected scale factor probabilities |
2010-07-26 | Boi Vuong | Added two type of ensemblers (4 and 192) |
[in] | ipdsnum | GRIB2 Product Definition Template Number |
[in] | ipdstmpl | GRIB2 Product Definition Template entries for PDT 4.ipdsnum |
[in,out] | kpds | GRIB1 PDS info as specified in W3FI63.
|
[out] | kens | Ensemble identification for PDS octets 41-45 |
[out] | kprob | Ensemble probability info for PDS octets 46 47 |
[out] | xprob | Ensemble probability info for PDS octets 48-55 |
[out] | kclust | Ensemble cluster info for PDS octets 61-76 |
[out] | kmembr | Ensemble membership info for PDS octest 77-86 |
[out] | iret | Error return value:
|
Definition at line 766 of file cnv21.F90.
Referenced by cnv21().
subroutine putgbexn | ( | lugb, | |
kf, | |||
integer, dimension(200) | kpds, | ||
integer, dimension(200) | kgds, | ||
integer, dimension(200) | kens, | ||
integer, dimension(2) | kprob, | ||
real, dimension(2) | xprob, | ||
integer, dimension(16) | kclust, | ||
integer, dimension(80) | kmembr, | ||
ibs, | |||
nbits, | |||
logical*1, dimension(kf) | lb, | ||
real, dimension(kf) | f, | ||
iret | |||
) |
Pack and write a grib message.
This subprogram is nearly the inverse of getgbe.
Date | Programmer | Comments |
---|---|---|
94-04-01 | Iredell | Initial. |
95-10-31 | Iredell | Removed saves and prints |
97-02-11 | Y. Zhu | Included probability and cluster arguments |
2002-03-18 | Gilbert | Modified from putgbex to account for binary scale factors. |
[in] | lugb | teger unit of the unblocked grib data file |
[in] | kf | teger number of data points |
[in] | kpds | teger (200) pds parameters
|
[in] | kgds | teger (200) gds parameters
|
[in] | kens | teger (200) ensemble pds parms
|
[in] | kprob | teger (2) probability ensemble parms |
[in] | xprob | al (2) probability ensemble parms |
[in] | kclust | teger (16) cluster ensemble parms |
[in] | kmembr | teger (8) cluster ensemble parms |
[in] | ibs | teger binary scale factor (0 to ignore) |
[in] | nbits | teger number of bits in which to pack (0 to ignore) |
[in] | lb | gical*1 (kf) bitmap if present |
[in] | f | al (kf) data |
[out] | iret | teger return code
|
Definition at line 1381 of file cnv21.F90.
References setbit().
Referenced by cnv21().
subroutine setbit | ( | ibm, | |
ibs, | |||
ids, | |||
len, | |||
dimension(len) | mg, | ||
dimension(len) | g, | ||
gmin, | |||
gmax, | |||
nbit | |||
) |
The number of bits required to pack a given field for particular binary and decimal scalings is computed.
The minimum and maximum rounded field values are also returned. GRIB bitmap masking for valid data is optionally used.
[in] | ibm | integer bitmap flag (=0 for no bitmap). |
[in] | ibs | integer binary scaling (e.g. ibs=3 to round field to nearest eighth value). |
[in] | ids | integer decimal scaling (e.g. ids=3 to round field to nearest milli-value) (note that ids and ibs can both be nonzero, e.g. ids=1 and ibs=1 rounds to the nearest twentieth). |
[in] | len | integer length of the field and bitmap. |
[in] | mg | integer (len) bitmap if ibm=1 (0 to skip, 1 to keep). |
[in] | g | real (len) field. |
[out] | gmin | real minimum valid rounded field value. |
[out] | gmax | real maximum valid rounded field value. |
[out] | nbit | integer number of bits to pack. |
Definition at line 1480 of file cnv21.F90.
Referenced by putgbexn().