40 RECURSIVE SUBROUTINE ufbpos(LUNIT,IREC,ISUB,SUBSET,JDATE)
49 CHARACTER*128 bort_str
61 CALL x84(lunit,my_lunit,1)
62 CALL x84(irec,my_irec,1)
63 CALL x84(isub,my_isub,1)
64 CALL ufbpos(my_lunit,my_irec,my_isub,subset,jdate)
65 CALL x48(jdate,jdate,1)
74 CALL status(lunit,lun,il,im)
78 IF(irec.LE.0)
GOTO 902
79 IF(isub.LE.0)
GOTO 903
84 CALL ufbcnt(lunit,jrec,jsub)
89 IF(irec.LT.jrec .OR. (irec.EQ.jrec.AND.isub.LT.jsub))
THEN
93 CALL ufbcnt(lunit,jrec,jsub)
99 DO WHILE (irec.GT.jrec)
100 CALL readmg(lunit,subset,jdate,iret)
101 IF(iret.LT.0)
GOTO 904
102 CALL ufbcnt(lunit,jrec,jsub)
105 DO WHILE (isub.GT.jsub)
107 IF(iret.NE.0)
GOTO 905
108 CALL ufbcnt(lunit,jrec,jsub)
115 900
CALL bort(
'BUFRLIB: UFBPOS - INPUT BUFR FILE IS CLOSED, IT MUST'//
116 .
' BE OPEN FOR INPUT')
117 901
CALL bort(
'BUFRLIB: UFBPOS - INPUT BUFR FILE IS OPEN FOR OUTPUT'//
118 .
', IT MUST BE OPEN FOR INPUT')
119 902
WRITE(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED MESSAGE NUMBER '//
120 .
'TO READ IN (",I5,") IS NOT VALID")') irec
122 903
WRITE(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED SUBSET NUMBER '//
123 .
'TO READ IN (",I5,") IS NOT VALID")') isub
125 904
WRITE(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED MESSAGE NUMBER '//
126 .
'TO READ IN (",I5,") EXCEEDS THE NUMBER OF MESSAGES IN THE '//
127 .
'FILE (",I5,")")') irec,jrec
129 905
WRITE(bort_str,
'("BUFRLIB: UFBPOS - REQ. SUBSET NUMBER TO READ'//
130 .
' IN (",I3,") EXCEEDS THE NUMBER OF SUBSETS (",I3,") IN THE '//
131 .
'REQ. MESSAGE (",I5,")")') isub,ksub,irec
subroutine bort(STR)
Log one error message and abort application program.
Wrap C NCEPLIBS-bufr functions so they can be called from within the Fortran part of the library.
This module contains array and variable declarations used to store BUFR messages internally for multi...
This module contains declarations for arrays used to store information about the current BUFR message...
integer, dimension(:), allocatable nmsg
Current message pointer within logical unit.
integer, dimension(:), allocatable nsub
Current subset pointer within message.
This module declares and initializes the IM8B variable.
logical, public im8b
Status indicator to keep track of whether all future calls to BUFRLIB subroutines and functions from ...
recursive subroutine readmg(LUNXX, SUBSET, JDATE, IRET)
Reads the next BUFR message from logical unit ABS(LUNXX) into internal arrays.
recursive subroutine readsb(LUNIT, IRET)
Read the next data subset from a BUFR message.
recursive subroutine status(LUNIT, LUN, IL, IM)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
recursive subroutine ufbcnt(LUNIT, KMSG, KSUB)
Get the current message number and data subset number within a BUFR file.
recursive subroutine ufbpos(LUNIT, IREC, ISUB, SUBSET, JDATE)
This subroutine repositions the file pointer to the beginning of a specified data subset within a spe...
subroutine x48(IIN4, IOUT8, NVAL)
Encode one or more 4-byte integer values as 8-byte integer values.
subroutine x84(IIN8, IOUT4, NVAL)
Encode one or more 8-byte integer values as 4-byte integer values.