NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
getgb1re.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> Reads and unpacks a grib message.
6C>
7C> PROGRAM HISTORY LOG:
8C> Mark Iredell 1995-10-31
9C> Y. Zhu 1997-02-11 Included probability and cluster arguments.
10C>
11C> @param[in] LUGB Integer unit of the unblocked grib data file.
12C> @param[in] LSKIP Integer number of bytes to skip.
13C> @param[in] LGRIB Integer number of bytes to read.
14C> @param[out] KF Integer number of data points unpacked.
15C> @param[out] KPDS Integer (200) unpacked pds parameters.
16C> @param[out] KGDS Integer (200) unpacked gds parameters.
17C> @param[out] KENS Integer (200) unpacked ensemble pds parms.
18C> @param[out] KPROB Integer (2) probability ensemble parms.
19C> @param[out] XPROB Real (2) probability ensemble parms.
20C> @param[out] KCLUST Integer (16) cluster ensemble parms.
21C> @param[out] KMEMBR Integer (8) cluster ensemble parms.
22C> @param[out] LB Logical*1 (kf) unpacked bitmap if present.
23C> @param[out] F Real (kf) unpacked data.
24C> @param[out] IRET Integer return code.
25C> - 0 All ok.
26C> - 97 Error reading grib file.
27C> - other w3fi63 grib unpacker return code.
28C>
29C> @note There is no protection against unpacking too much data.
30C> Subprogram can be called from a multiprocessing environment.
31C> Do not engage the same logical unit from more than one processor.
32C> This subprogram is intended for private use by getgb routines only.
33C>
34C> @author Mark Iredell @date 1995-10-31
35C-----------------------------------------------------------------------
36 SUBROUTINE getgb1re(LUGB,LSKIP,LGRIB,KF,KPDS,KGDS,KENS,
37 & KPROB,XPROB,KCLUST,KMEMBR,LB,F,IRET)
38 INTEGER KPDS(200),KGDS(200),KENS(200)
39 INTEGER KPROB(2),KCLUST(16),KMEMBR(80)
40 REAL XPROB(2)
41 LOGICAL*1 LB(*)
42 REAL F(*)
43 INTEGER KPTR(200)
44 CHARACTER GRIB(LGRIB)*1
45C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
46C READ GRIB RECORD
47 CALL baread(lugb,lskip,lgrib,lread,grib)
48C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
49C UNPACK GRIB RECORD
50 IF(lread.EQ.lgrib) THEN
51 CALL w3fi63(grib,kpds,kgds,lb,f,kptr,iret)
52 IF(iret.EQ.0.AND.kpds(23).EQ.2) THEN
53 CALL pdseup(kens,kprob,xprob,kclust,kmembr,86,grib(9))
54 ENDIF
55 ELSE
56 iret=97
57 ENDIF
58C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
59C RETURN NUMBER OF POINTS
60 IF(iret.EQ.0) THEN
61 kf=kptr(10)
62 ELSE
63 kf=0
64 ENDIF
65C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
66 RETURN
67 END
subroutine getgb1re(lugb, lskip, lgrib, kf, kpds, kgds, kens, kprob, xprob, kclust, kmembr, lb, f, iret)
Reads and unpacks a grib message.
Definition getgb1re.f:38
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