NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
pdseup.f
Go to the documentation of this file.
1C> @file
2C> @brief Unpacks grib pds extension 41- for ensemble.
3C> @author Zoltan Toth and Mark Iredell @date DATE: 1995-03-14
4
5C> Unpacks grib pds extension starting on byte 41 for ensemble
6C> forecast products. for format of pds extension, see nmc office note 38
7C>
8C> Program history log:
9C> - Zoltan Toth and Mark Iredell 1995-03-14
10C> - Mark Iredell 1995-10-31 Removed saves and prints.
11C> - Richard Wobus 1998-09-28 Corrected member extraction.
12C> - Mark Iredell 2001-06-05 Apply linux port by ebisuzaki.
13C>
14C> @param[out] KENS (5) Bytes 41-45 (general section, always present.).
15C> @param[out] KPROB (2) Bytes 46-47 (probability section, present only if neede.
16C> @param[out] XPROB (2) Bytes 48-51&52-55 (probability section, if needed.).
17C> @param[out] KCLUST (16) Bytes 61-76 (clustering section, if needed.).
18C> @param[out] KMEMBR (80) Bytes 77-86 (cluster membership section, if needed.).
19C> @param[in] ILAST Last byte to be unpacked (if greater/equal to first byte
20C> in any of four sections below, whole section is packed).
21C> @param[in] MSGA Full pds section, including new ensemble extension.
22C>
23C> @note Use pdsens() for packing pds ensemble extension.
24C> Subprogram can be called from a multiprocessing environment.
25C>
26C> @author Zoltan Toth and Mark Iredell @date DATE: 1995-03-14
27 SUBROUTINE pdseup(KENS,KPROB,XPROB,KCLUST,KMEMBR,ILAST,MSGA)
28 INTEGER KENS(5),KPROB(2),KCLUST(16),KMEMBR(80)
29 dimension xprob(2)
30 CHARACTER*1 MSGA(100)
31C CHECKING TOTAL NUMBER OF BYTES IN PDS (IBYTES)
32 CALL gbytec(msga, ibytes, 0,24)
33 IF(ilast.GT.ibytes) THEN
34C ILAST=IBYTES
35 GO TO 333
36 ENDIF
37 IF(ilast.LT.41) THEN
38 GO TO 333
39 ENDIF
40C UNPACKING FIRST SECTION (GENERAL INFORMATION)
41 CALL gbytesc(msga,kens,40*8,8,0,5)
42C UNPACKING 2ND SECTION (PROBABILITY SECTION)
43 IF(ilast.GE.46) THEN
44 CALL gbytesc(msga,kprob,45*8,8,0,2)
45C
46 CALL gbytec (msga,jsgn,47*8,1)
47 CALL gbytec (msga,jexp,47*8+1,7)
48 CALL gbytec (msga,ifr,47*8+8,24)
49 xprob(1)=(-1)**jsgn*ifr*16.**(jexp-70)
50C
51 CALL gbytec (msga,jsgn,51*8,1)
52 CALL gbytec (msga,jexp,51*8+1,7)
53 CALL gbytec (msga,ifr,51*8+8,24)
54 xprob(2)=(-1)**jsgn*ifr*16.**(jexp-70)
55 ENDIF
56C
57C UNPACKING 3RD SECTION (CLUSTERING INFORMATION)
58 IF(ilast.GE.61) CALL gbytesc(msga,kclust,60*8,8,0,16)
59C UNPACKING 4TH SECTION (CLUSTERMEMBERSHIP INFORMATION)
60 IF(ilast.GE.77) CALL gbytesc(msga,kmembr,76*8,1,0,80)
61C
62 333 CONTINUE
63 RETURN
64 END
subroutine gbytec(in, iout, iskip, nbyte)
Wrapper for gbytesc() limiting NSKIP and N to 0 and 1.
Definition gbytec.f:14
subroutine gbytesc(in, iout, iskip, nbyte, nskip, n)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
Definition gbytesc.f:16
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