1 C-----------------------------------------------------------------------
2 SUBROUTINE GETGB1R
(LUGB
,LSKIP
,LGRIB
,KF
,KPDS
,KGDS
,KENS
,LB
,F
,NBITSS
4 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C SUBPROGRAM: GETGB1R READS AND UNPACKS A GRIB MESSAGE
7 C PRGMMR: IREDELL ORG: W/NMC23 DATE: 95-10-31
9 C ABSTRACT: READ AND UNPACK A GRIB MESSAGE.
11 C PROGRAM HISTORY LOG:
13 C 04-07-22 CHUANG ADD PACKING BIT NUMBER NBITSS IN THE ARGUMENT
14 C LIST BECAUSE ETA GRIB FILES NEED IT TO REPACK GRIB FILE
15 C USAGE: CALL GETGB1R(LUGB,LSKIP,LGRIB,KF,KPDS,KGDS,KENS,LB,F,IRET)
17 C LUGB INTEGER UNIT OF THE UNBLOCKED GRIB DATA FILE
18 C LSKIP INTEGER NUMBER OF BYTES TO SKIP
19 C LGRIB INTEGER NUMBER OF BYTES TO READ
21 C KF INTEGER NUMBER OF DATA POINTS UNPACKED
22 C KPDS INTEGER (200) UNPACKED PDS PARAMETERS
23 C KGDS INTEGER (200) UNPACKED GDS PARAMETERS
24 C KENS INTEGER (200) UNPACKED ENSEMBLE PDS PARMS
25 C LB LOGICAL*1 (KF) UNPACKED BITMAP IF PRESENT
26 C F REAL (KF) UNPACKED DATA
27 C IRET INTEGER RETURN CODE
29 C 97 ERROR READING GRIB FILE
30 C OTHER W3FI63 GRIB UNPACKER RETURN CODE
33 C BAREAD BYTE-ADDRESSABLE READ
35 C PDSEUP UNPACK PDS EXTENSION
37 C REMARKS: THERE IS NO PROTECTION AGAINST UNPACKING TOO MUCH DATA.
38 C SUBPROGRAM CAN BE CALLED FROM A MULTIPROCESSING ENVIRONMENT.
39 C DO NOT ENGAGE THE SAME LOGICAL UNIT FROM MORE THAN ONE PROCESSOR.
40 C THIS SUBPROGRAM IS INTENDED FOR PRIVATE USE BY GETGB ROUTINES ONLY.
43 C LANGUAGE: FORTRAN 77
44 C MACHINE: CRAY, WORKSTATIONS
47 INTEGER KPDS
(200),KGDS
(200),KENS
(200)
51 CHARACTER GRIB
(LGRIB
)*1
52 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
54 CALL BAREAD
(LUGB
,LSKIP
,LGRIB
,LREAD
,GRIB
)
55 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
57 IF(LREAD
.EQ
.LGRIB
) THEN
58 CALL W3FI63
(GRIB
,KPDS
,KGDS
,LB
,F
,KPTR
,IRET
)
59 IF(IRET
.EQ
.0.AND
.KPDS
(23).EQ
.2) THEN
60 CALL PDSEUP
(KENS
,KPROB
,XPROB
,KCLUST
,KMEMBR
,45,GRIB
(9))
66 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
67 C RETURN NUMBER OF POINTS
73 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -