51 SUBROUTINE ufbpos(LUNIT,IREC,ISUB,SUBSET,JDATE)
56 CHARACTER*128 bort_str
65 CALL
status(lunit,lun,il,im)
69 IF(irec.LE.0) goto 902
70 IF(isub.LE.0) goto 903
75 CALL
ufbcnt(lunit,jrec,jsub)
80 IF(irec.LT.jrec .OR. (irec.EQ.jrec.AND.isub.LT.jsub))
THEN
84 CALL
ufbcnt(lunit,jrec,jsub)
90 DO WHILE (irec.GT.jrec)
91 CALL
readmg(lunit,subset,jdate,iret)
92 IF(iret.LT.0) goto 904
93 CALL
ufbcnt(lunit,jrec,jsub)
97 IF(isub.GT.ksub) goto 905
99 DO WHILE (isub-1.GT.jsub)
101 CALL
upb(nbyt,16,mbay(1,lun),ibit)
102 mbyt(lun) = mbyt(lun) + nbyt
103 nsub(lun) = nsub(lun) + 1
104 CALL
ufbcnt(lunit,jrec,jsub)
108 IF(iret.NE.0) goto 905
114 900 CALL
bort(
'BUFRLIB: UFBPOS - INPUT BUFR FILE IS CLOSED, IT MUST'//
115 .
' BE OPEN FOR INPUT')
116 901 CALL
bort(
'BUFRLIB: UFBPOS - INPUT BUFR FILE IS OPEN FOR OUTPUT'//
117 .
', IT MUST BE OPEN FOR INPUT')
118 902
WRITE(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED MESSAGE NUMBER '//
119 .
'TO READ IN (",I5,") IS NOT VALID")') irec
121 903
WRITE(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED SUBSET NUMBER '//
122 .
'TO READ IN (",I5,") IS NOT VALID")') isub
124 904
WRITE(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED MESSAGE NUMBER '//
125 .
'TO READ IN (",I5,") EXCEEDS THE NUMBER OF MESSAGES IN THE '//
126 .
'FILE (",I5,")")') irec,jrec
128 905
WRITE(bort_str,
'("BUFRLIB: UFBPOS - REQ. SUBSET NUMBER TO READ'//
129 .
' IN (",I3,") EXCEEDS THE NUMBER OF SUBSETS (",I3,") IN THE '//
130 .
'REQ. MESSAGE (",I5,")")') isub,ksub,irec
subroutine upb(NVAL, NBITS, IBAY, IBIT)
THIS SUBROUTINE UNPACKS AND RETURNS A BINARY INTEGER CONTAINED WITHIN NBITS BITS OF IBAY...
subroutine ufbpos(LUNIT, IREC, ISUB, SUBSET, JDATE)
THIS SUBROUTINE SHOULD ONLY BE CALLED WHEN LOGICAL UNIT LUNIT HAS BEEN OPENED FOR INPUT OPERATIONS...
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
void cewind(f77int *nfile)
This subroutine rewinds a BUFR file back to its beginning.
function nmsub(LUNIT)
This function returns the total number of data subsets available within the BUFR message that was mos...
subroutine ufbcnt(LUNIT, KMSG, KSUB)
THIS SUBROUTINE RETURNS A COUNT OF THE CURRENT MESSAGE NUMBER AND SUBSET NUMBER, WHERE THE MESSAGE NU...
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
This module contains array and variable declarations used to store BUFR messages internally for multi...
subroutine readmg(LUNXX, SUBSET, JDATE, IRET)
This subroutine reads the next BUFR message from logical unit ABS(LUNXX) into internal arrays...
subroutine readsb(LUNIT, IRET)
This subroutine reads the next data subset from a BUFR message into internal arrays.