1 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
3 C SUBPROGRAM: PDSEUP.F UNPACKS GRIB PDS EXTENSION 41- FOR ENSEMBLE
4 C PRGMMR: RICHARD WOBUS ORG: W/NP20 DATE: 98-09-28
6 C ABSTRACT: UNPACKS GRIB PDS EXTENSION STARTING ON BYTE 41 FOR ENSEMBLE
7 C FORECAST PRODUCTS. FOR FORMAT OF PDS EXTENSION, SEE NMC OFFICE NOTE 38
10 C 95-03-14 ZOLTAN TOTH AND MARK IREDELL
11 C 95-10-31 IREDELL REMOVED SAVES AND PRINTS
12 C 98-09-28 WOBUS CORRECTED MEMBER EXTRACTION
14 C USAGE: CALL PDSENS.F(KENS,KPROB,XPROB,KCLUST,KMEMBR,ILAST,MSGA)
15 C INPUT ARGUMENT LIST:
16 C ILAST - LAST BYTE TO BE UNPACKED (IF GREATER/EQUAL TO FIRST BYT
17 C IN ANY OF FOUR SECTIONS BELOW, WHOLE SECTION IS PACKED.
18 C MSGA - FULL PDS SECTION, INCLUDING NEW ENSEMBLE EXTENSION
20 C OUTPUT ARGUMENT LIST: (INCLUDING WORK ARRAYS)
21 C KENS(5) - BYTES 41-45 (GENERAL SECTION, ALWAYS PRESENT.)
22 C KPROB(2) - BYTES 46-47 (PROBABILITY SECTION, PRESENT ONLY IF NEEDE
23 C XPROB(2) - BYTES 48-51&52-55 (PROBABILITY SECTION, IF NEEDED.)
24 C KCLUST(16)-BYTES 61-76 (CLUSTERING SECTION, IF NEEDED.)
25 C KMEMBR(80)-BYTES 77-86 (CLUSTER MEMBERSHIP SECTION, IF NEEDED.)
27 C REMARKS: USE PDSENS.F FOR PACKING PDS ENSEMBLE EXTENSION.
28 C SUBPROGRAM CAN BE CALLED FROM A MULTIPROCESSING ENVIRONMENT.
31 C LANGUAGE: CF77 FORTRAN
32 C MACHINE: CRAY, WORKSTATIONS
36 SUBROUTINE PDSEUP
(KENS
,KPROB
,XPROB
,KCLUST
,KMEMBR
,ILAST
,MSGA
)
37 INTEGER KENS
(5),KPROB
(2),KCLUST
(16),KMEMBR
(80)
43 EQUIVALENCE
(CKREF
(1),KREF
,REFNCE
)
44 C CHECKING TOTAL NUMBER OF BYTES IN PDS (IBYTES)
45 CALL GBYTE
(MSGA
, IBYTES
, 0,24)
46 IF(ILAST
.GT
.IBYTES
) THEN
53 C UNPACKING FIRST SECTION (GENERAL INFORMATION)
54 CALL GBYTES
(MSGA
,KENS
,40*8,8,0,5)
55 C UNPACKING 2ND SECTION (PROBABILITY SECTION)
57 CALL GBYTES
(MSGA
,KPROB
,45*8,8,0,2)
60 CALL GBYTE
(MSGA
,KREF
,47*8,32)
63 CALL GBYTE
(CKREF
,JSGN
,0,1)
64 CALL GBYTE
(CKREF
,JEXP
,1,7)
65 CALL GBYTE
(CKREF
,IFR
,8,24)
67 CALL GBYTE
(CKREF
,JSGN
,32,1)
68 CALL GBYTE
(CKREF
,JEXP
,33,7)
69 CALL GBYTE
(CKREF
,IFR
,40,24)
73 ELSE IF (JEXP
.EQ
.0.AND
.IFR
.EQ
.0) THEN
76 REFNCE
= FLOAT
(IFR
) * 16.0 ** (JEXP
- 64 - 6)
77 IF (JSGN
.NE
.0) REFNCE
= - REFNCE
81 CALL GBYTE
(MSGA
,KREF
,51*8,32)
84 CALL GBYTE
(CKREF
,JSGN
,0,1)
85 CALL GBYTE
(CKREF
,JEXP
,1,7)
86 CALL GBYTE
(CKREF
,IFR
,8,24)
88 CALL GBYTE
(CKREF
,JSGN
,32,1)
89 CALL GBYTE
(CKREF
,JEXP
,33,7)
90 CALL GBYTE
(CKREF
,IFR
,40,24)
94 ELSE IF (JEXP
.EQ
.0.AND
.IFR
.EQ
.0) THEN
97 REFNCE
= FLOAT
(IFR
) * 16.0 ** (JEXP
- 64 - 6)
98 IF (JSGN
.NE
.0) REFNCE
= - REFNCE
103 C UNPACKING 3RD SECTION (CLUSTERING INFORMATION)
104 IF(ILAST
.GE
.61) CALL GBYTES
(MSGA
,KCLUST
,60*8,8,0,16)
105 C UNPACKING 4TH SECTION (CLUSTERMEMBERSHIP INFORMATION)
106 IF(ILAST
.GE
.77) CALL GBYTES
(MSGA
,KMEMBR
,76*8,1,0,80)