NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
getgb1r.f
Go to the documentation of this file.
1C> @file
2C> @brief Reads and unpacks a grib message.
3C> @author Mark Iredell @date 1995-10-31
4
5C> Program history log:
6C> - Mark Iredell 1995-10-31
7C> - Chuang 2004-07-22 Add packing bit number nbitss in the argument
8C> list because eta grib files need it to repack grib file.
9C> @param[in] LUGB Integer unit of the unblocked grib data file.
10C> @param[in] LSKIP Integer number of bytes to skip.
11C> @param[in] LGRIB Integer number of bytes to read.
12C> @param[out] KF Integer number of data points unpacked.
13C> @param[out] KPDS Integer (200) unpacked pds parameters.
14C> @param[out] KGDS Integer (200) unpacked gds parameters.
15C> @param[out] KENS Integer (200) unpacked ensemble pds parms.
16C> @param[out] LB Logical*1 (kf) unpacked bitmap if present.
17C> @param[out] F Real (kf) unpacked data.
18C> @param[out] NBITSS Packaging bit number. Used by GRIB file to repack.
19C> @param[out] IRET Integer return code.
20C> - 0 All ok.
21C> - 97 Error reading grib file.
22C> - other w3fi63 grib unpacker return code.
23C>
24C> @note There is no protection against unpacking too much data.
25C> Subprogram can be called from a multiprocessing environment.
26C> Do not engage the same logical unit from more than one processor.
27C> This subprogram is intended for private use by getgb routines only.
28C>
29C> @author Mark Iredell @date 1995-10-31
30
31C-----------------------------------------------------------------------
32 SUBROUTINE getgb1r(LUGB,LSKIP,LGRIB,KF,KPDS,KGDS,KENS,LB,F,NBITSS
33 + ,IRET)
34 INTEGER KPDS(200),KGDS(200),KENS(200)
35 LOGICAL*1 LB(*)
36 REAL F(*)
37 INTEGER KPTR(200)
38 CHARACTER GRIB(LGRIB)*1
39C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
40C READ GRIB RECORD
41 CALL baread(lugb,lskip,lgrib,lread,grib)
42C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
43C UNPACK GRIB RECORD
44 IF(lread.EQ.lgrib) THEN
45 CALL w3fi63(grib,kpds,kgds,lb,f,kptr,iret)
46 IF(iret.EQ.0.AND.kpds(23).EQ.2) THEN
47 CALL pdseup(kens,kprob,xprob,kclust,kmembr,45,grib(9))
48 ENDIF
49 ELSE
50 iret=97
51 ENDIF
52 nbitss=kptr(20)
53C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
54C RETURN NUMBER OF POINTS
55 IF(iret.EQ.0) THEN
56 kf=kptr(10)
57 ELSE
58 kf=0
59 ENDIF
60C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
61 RETURN
62 END
subroutine getgb1r(lugb, lskip, lgrib, kf, kpds, kgds, kens, lb, f, nbitss, iret)
Program history log:
Definition getgb1r.f:34
subroutine pdseup(kens, kprob, xprob, kclust, kmembr, ilast, msga)
Unpacks grib pds extension starting on byte 41 for ensemble forecast products.
Definition pdseup.f:28
subroutine w3fi63(msga, kpds, kgds, kbms, data, kptr, kret)
Unpack a GRIB (edition 1) field to the exact grid specified in the GRIB message, isolate the bit map,...
Definition w3fi63.f:243