NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
getgbens.f
Go to the documentation of this file.
1C> @file
2C> @brief Find and unpack a grib message.
3C> @author Mark Iredell @date 1994-04-01
4
5C> Read a grib index file (or optionally the grib file itself)
6C> to get the index buffer (i.e. table of contents) for the grib file.
7C> (The index buffer is saved for use by future prospective calls.)
8C> Find in the index buffer a reference to the grib message requested.
9C> The grib message request specifies the number of messages to skip
10C> and the unpacked pds and gds parameters. (A requested parameter
11C> of -1 means to allow any value of this parameter to be found.)
12C> If the requested grib message is found, then it is read from the
13C> grib file and unpacked. Its message number is returned along with
14C> the unpacked pds and gds parameters, the unpacked bitmap (if any),
15C> and the unpacked data. If the grib message is not found, then the
16C> return code will be nonzero.
17C> This obsolescent version has been replaced by getgbe.
18C>
19C> Program history log:
20C> - Mark Iredell 1994-04-01
21C> - Mark Iredell 1995-10-31 Modularized portions of code into subprograms
22C> and allowed for unspecified index file.
23C>
24C> @param[in] lugb integer unit of the unblocked grib data file.
25C> @param[in] lugi integer unit of the unblocked grib index file
26C> (=0 to get index buffer from the grib file).
27C> @param[in] jf integer maximum number of data points to unpack.
28C> @param[in] j integer number of messages to skip
29C> (=0 to search from beginning)
30C> (<0 to read index buffer and skip -1-j messages).
31C> @param[in] jpds integer (200) pds parameters for which to search
32C> (=-1 for wildcard).
33C> - 1: id of center.
34C> - 2: generating process id number.
35C> - 3: grid definition.
36C> - 4: gds/bms flag (right adj copy of octet 8).
37C> - 5: indicator of parameter.
38C> - 6: type of level.
39C> - 7: height/pressure , etc of level.
40C> - 8: year including (century-1).
41C> - 9: month of year.
42C> - 10: day of month.
43C> - 11: hour of day.
44C> - 12: minute of hour.
45C> - 13: indicator of forecast time unit.
46C> - 14: time range 1.
47C> - 15: time range 2.
48C> - 16: time range flag.
49C> - 17: number included in average.
50C> - 18: version nr of grib specification.
51C> - 19: version nr of parameter table.
52C> - 20: nr missing from average/accumulation.
53C> - 21: century of reference time of data.
54C> - 22: units decimal scale factor.
55C> - 23: subcenter number.
56C> - 24: pds byte 29, for nmc ensemble products.
57C> - 128 if forecast field error.
58C> - 64 if bias corrected fcst field.
59C> - 32 if smoothed field.
60C> - warning: can be combination of more than 1.
61C> - 25: pds byte 30, not used.
62C> @param[in] jgds integer (200) gds parameters for which to search
63C> (only searched if jpds(3)=255)
64C> (=-1 for wildcard).
65C> - 1: data representation type.
66C> - 19: number of vertical coordinate parameters.
67C> - 20: octet number of the list of vertical coordinate parameters or
68C> octet number of the list of numbers of points in each row or
69C> 255 if neither are present.
70C> - 21: for grids with pl, number of points in grid.
71C> - 22: number of words in each row.
72C> - Latitude/longitude grids.
73C> - 2: n(i) nr points on latitude circle.
74C> - 3: n(j) nr points on longitude meridian.
75C> - 4: la(1) latitude of origin.
76C> - 5: lo(1) longitude of origin.
77C> - 6: resolution flag (right adj copy of octet 17).
78C> - 7: la(2) latitude of extreme point.
79C> - 8: lo(2) longitude of extreme point.
80C> - 9: di longitudinal direction of increment.
81C> - 10: dj latitudinal direction increment.
82C> - 11: scanning mode flag (right adj copy of octet 28).
83C> - Gaussian grids.
84C> - 2: n(i) nr points on latitude circle.
85C> - 3: n(j) nr points on longitude meridian.
86C> - 4: la(1) latitude of origin.
87C> - 5: lo(1) longitude of origin.
88C> - 6: resolution flag (right adj copy of octet 17).
89C> - 7: la(2) latitude of extreme point.
90C> - 8: lo(2) longitude of extreme point.
91C> - 9: di longitudinal direction of increment.
92C> - 10: n - nr of circles pole to equator.
93C> - 11: scanning mode flag (right adj copy of octet 28).
94C> - 12: nv - nr of vert coord parameters.
95C> - 13: pv - octet nr of list of vert coord parameters or
96C> - pl - location of the list of numbers of points in each row
97C> (if no vert coord parameters are present) or 255 if neither are present.
98C> - Polar stereographic grids.
99C> - 2: n(i) nr points along lat circle.
100C> - 3: n(j) nr points along lon circle.
101C> - 4: la(1) latitude of origin.
102C> - 5: lo(1) longitude of origin.
103C> - 6: resolution flag (right adj copy of octet 17).
104C> - 7: lov grid orientation.
105C> - 8: dx - x direction increment.
106C> - 9: dy - y direction increment.
107C> - 10: projection center flag.
108C> - 11: scanning mode (right adj copy of octet 28).
109C> - Spherical harmonic coefficients.
110C> - 2: j pentagonal resolution parameter.
111C> - 3: k pentagonal resolution parameter.
112C> - 4: m pentagonal resolution parameter.
113C> - 5: representation type.
114C> - 6: coefficient storage mode.
115C> - Mercator grids.
116C> - 2: n(i) nr points on latitude circle.
117C> - 3: n(j) nr points on longitude meridian.
118C> - 4: la(1) latitude of origin.
119C> - 5: lo(1) longitude of origin.
120C> - 6: resolution flag (right adj copy of octet 17).
121C> - 7: la(2) latitude of last grid point.
122C> - 8: lo(2) longitude of last grid point.
123C> - 9: latit - latitude of projection intersection.
124C> - 10: reserved.
125C> - 11: scanning mode flag (right adj copy of octet 28).
126C> - 12: longitudinal dir grid length.
127C> - 13: latitudinal dir grid length.
128C> - Lambert conformal grids.
129C> - 2: nx nr points along x-axis.
130C> - 3: ny nr points along y-axis.
131C> - 4: la1 lat of origin (lower left).
132C> - 5: lo1 lon of origin (lower left).
133C> - 6: resolution (right adj copy of octet 17).
134C> - 7: lov - orientation of grid.
135C> - 8: dx - x-dir increment.
136C> - 9: dy - y-dir increment.
137C> - 10: projection center flag.
138C> - 11: scanning mode flag (right adj copy of octet 28).
139C> - 12: latin 1 - first lat from pole of secant cone inter.
140C> - 13: latin 2 - second lat from pole of secant cone inter.
141C> @param[in] jens integer (200) ensemble pds parms for which to search
142C> (only searched if jpds(23)=2)
143C> (=-1 for wildcard).
144C> - 1: application identifier.
145C> - 2: ensemble type.
146C> - 3: ensemble identifier.
147C> - 4: product identifier.
148C> - 5: smoothing flag.
149C>
150C> @param[out] kf integer number of data points unpacked.
151C> @param[out] k integer message number unpacked
152C> (can be same as j in calling program
153C> in order to facilitate multiple searches).
154C> @param[out] kpds integer (200) unpacked pds parameters.
155C> @param[out] kgds integer (200) unpacked gds parameters.
156C> @param[out] kens integer (200) unpacked ensemble pds parms.
157C> @param[out] lb logical*1 (kf) unpacked bitmap if present.
158C> @param[out] f real (kf) unpacked data.
159C> @param[out] iret integer return code.
160C> - 0: all ok.
161C> - 96: error reading index file.
162C> - 97: error reading grib file.
163C> - 98: number of data points greater than jf.
164C> - 99: request not found.
165C> - other w3fi63 grib unpacker return code.
166C>
167C> @note In order to unpack grib from a multiprocessing environment
168C> where each processor is attempting to read from its own pair of
169C> logical units, one must directly call subprogram getgbem as below,
170C> allocating a private copy of cbuf, nlen and nnum to each processor.
171C> do not engage the same logical unit from more than one processor.
172C>
173C> @author Mark Iredell @date 1994-04-01
174C-----------------------------------------------------------------------
175 SUBROUTINE getgbens(LUGB,LUGI,JF,J,JPDS,JGDS,JENS,
176 & KF,K,KPDS,KGDS,KENS,LB,F,IRET)
177 INTEGER JPDS(200),JGDS(200),JENS(200)
178 INTEGER KPDS(200),KGDS(200),KENS(200)
179 LOGICAL*1 LB(JF)
180 REAL F(JF)
181C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
182 print *,'PLEASE USE GETGBE RATHER THAN GETGBENS'
183 CALL getgbe(lugb,lugi,jf,j,jpds,jgds,jens,
184 & kf,k,kpds,kgds,kens,lb,f,iret)
185C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
186 RETURN
187 END
subroutine getgbe(lugb, lugi, jf, j, jpds, jgds, jens, kf, k, kpds, kgds, kens, lb, f, iret)
Find and unpack a grib message.
Definition getgbe.f:176
subroutine getgbens(lugb, lugi, jf, j, jpds, jgds, jens, kf, k, kpds, kgds, kens, lb, f, iret)
Read a grib index file (or optionally the grib file itself) to get the index buffer (i....
Definition getgbens.f:177