142 SUBROUTINE ufbseq(LUNIN,USR,I1,I2,IRET,STR)
154 CHARACTER*156 BORT_STR
156 CHARACTER*10 TAGS(MTAG)
159 DATA ifirst1/0/,ifirst2/0/
161 SAVE ifirst1, ifirst2
172 CALL status(lunit,lun,il,im)
176 io = min(max(0,il),1)
177 IF(lunit.NE.lunin) io = 0
181 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
182 errstr = .LE.
'BUFRLIB: UFBSEQ - 3rd ARG. (INPUT) IS 0, ' //
183 .
'SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
186 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
191 IF(iprt.EQ.-1) ifirst1 = 1
192 IF(io.EQ.0 .OR. ifirst1.EQ.0 .OR. iprt.GE.1)
THEN
193 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
194 errstr = .LE.
'BUFRLIB: UFBSEQ - 4th ARG. (INPUT) IS 0, ' //
195 .
'SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
198 IF(iprt.EQ.0 .AND. io.EQ.1)
THEN
199 errstr =
'Note: Only the first occurrence of this WARNING ' //
200 .
'message is printed, there may be more. To output all ' //
203 errstr =
'modify your application program to add ' //
204 .
'"CALL OPENBF(0,''QUIET'',1)" prior to the first call ' //
205 .
'to a BUFRLIB routine.'
208 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
218 CALL parstr(str,tags,mtag,ntag,
' ',.true.)
219 IF(ntag.LT.1)
GOTO 902
220 IF(ntag.GT.1)
GOTO 903
223 IF(inode(lun).NE.inv(1,lun))
GOTO 906
241 DO node=inode(lun),
isc(inode(lun))
242 IF(str.EQ.
tag(node))
THEN
243 IF(
typ(node).EQ.
'SEQ'.OR.
typ(node).EQ.
'RPC')
THEN
2455 ins1 =
invtag(node,lun,ins1,nval(lun))
246 IF(ins1.EQ.0)
GOTO 200
247 IF(
typ(node).EQ.
'RPC'.AND.val(ins1,lun).EQ.0.)
THEN
251 ins2 =
invtag(node,lun,ins1+1,nval(lun))
252 IF(ins2.EQ.0) ins2 = 10e5
254 DO WHILE(
link(nods).EQ.0.AND.
jmpb(nods).GT.0)
257 IF(
link(nods).EQ.0)
THEN
259 ELSEIF(
link(nods).GT.0)
THEN
260 insx =
invwin(
link(nods),lun,ins1+1,nval(lun))-1
262 ins2 = min(ins2,insx)
263 ELSEIF(
typ(node).EQ.
'SUB')
THEN
271 ityp =
itp(inv(isq,lun))
272 IF(ityp.GT.1) nseq = nseq+1
274 IF(nseq.GT.i1)
GOTO 908
2841 ins1 =
invtag(node,lun,ins1,nval(lun))
285 IF(ins1.GT.nval(lun))
GOTO 200
287 IF(
typ(node).EQ.
'RPC'.AND.val(ins1,lun).EQ.0.)
THEN
290 ELSEIF(io.EQ.0.AND.iret+1.GT.i2)
THEN
292 CALL errwrt(
'++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++')
293 WRITE ( unit=errstr, fmt=
'(A,I5,A,A,A)' )
294 .
'BUFRLIB: UFBSEQ - INCOMPLETE READ; ONLY THE FIRST ', i2,
295 .
' (=4TH INPUT ARG.) ''LEVELS'' OF INPUT MNEMONIC ', tags(1),
298 CALL errwrt(
'++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++')
303 ELSEIF(ins1.EQ.0)
THEN
304 IF(io.EQ.1.AND.iret.LT.i2)
GOTO 910
309 IF(ins1.EQ. 0)
GOTO 200
310 IF(iret.EQ.i2)
GOTO 200
320 DO WHILE(
itp(inv(j,lun)).LT.2)
323 IF(io.EQ.0) usr(i,iret) = val(j,lun )
324 IF(io.EQ.1) val(j,lun ) = usr(i,iret)
338 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
339 errstr =
'BUFRLIB: UFBSEQ - NO SPECIFIED VALUES READ IN, ' //
340 .
'SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
343 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
347 IF(iprt.EQ.-1) ifirst2 = 1
348 IF(ifirst2.EQ.0 .OR. iprt.GE.1)
THEN
349 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
350 errstr =
'BUFRLIB: UFBSEQ - NO SPECIFIED VALUES WRITTEN OUT, ' //
351 .
'SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
354 CALL errwrt(
'MAY NOT BE IN THE BUFR TABLE(?)')
356 errstr =
'Note: Only the first occurrence of this WARNING ' //
357 .
'message is printed, there may be more. To output all ' //
360 errstr =
'modify your application program to add ' //
361 .
'"CALL OPENBF(0,''QUIET'',1)" prior to the first call ' //
362 .
'to a BUFRLIB routine.'
365 CALL errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
376900
CALL bort(
'BUFRLIB: UFBSEQ - BUFR FILE IS CLOSED, IT MUST BE'//
378901
CALL bort(
'BUFRLIB: UFBSEQ - A MESSAGE MUST BE OPEN IN BUFR '//
380902
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - THE INPUT STRING (",A,") '//
381 .
'DOES NOT CONTAIN ANY MNEMONICS!!")') str
383903
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - THERE CANNOT BE MORE THAN '//
384 .
'ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE ",I3'//
387904
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - THIRD ARGUMENT (INPUT) MUST'//
388 . .GT.
' BE ZERO (HERE IT IS",I4,") - INPUT MNEMONIC IS ",A)')
391905
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - FOURTH ARGUMENT (INPUT) '//
392 . .GT.
'MUST BE ZERO (HERE IT IS",I4,") - INPUT MNEMONIC IS ",A)')
395906
CALL bort(
'BUFRLIB: UFBSEQ - LOCATION OF INTERNAL TABLE FOR '//
396 .
'BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL '//
398907
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - INPUT MNEMONIC ",A," MUST '//
399 .
'BE A SEQUENCE (HERE IT IS TYPE """,A,""")")') tags(1),
typ(node)
401908
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - INPUT SEQ. MNEM. ",A,'//
402 . .GT.
'" CONSISTS OF",I4," TABLE B MNEM., THE MAX. SPECIFIED IN'//
403 .
' (INPUT) ARGUMENT 3 (",I3,")")') tags(1),nseq,i1
405910
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - NO. OF ''LEVELS'' WRITTEN '//
406 . .LT.
'(",I5,") NO. REQUESTED (",I5,") - INCOMPLETE WRITE '//
407 .
'(INPUT MNEMONIC IS ",A,")")') iret,i2,tags(1)
409911
WRITE(bort_str,.GE.
'("BUFRLIB: UFBSEQ - VARIABLE INS1 MUST BE '//
410 .
'ZERO, HERE IT IS",I4," - INPUT MNEMONIC IS ",A)') ins1,tags(1)
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
function invtag(NODE, LUN, INV1, INV2)
THIS FUNCTION LOOKS FOR A SPECIFIED MNEMONIC WITHIN THE PORTION OF THE CURRENT SUBSET BUFFER BOUNDED ...
function invwin(NODE, LUN, INV1, INV2)
THIS FUNCTION LOOKS FOR A SPECIFIED NODE WITHIN THE PORTION OF THE CURRENT SUBSET BUFFER BOUNDED BY T...
This module contains array and variable declarations used to store the internal jump/link table.
integer, dimension(:), allocatable link
Link indices corresponding to tag, typ and jmpb:
integer, dimension(:), allocatable itp
Integer type values corresponding to typ:
integer, dimension(:), allocatable isc
Scale factors corresponding to tag and typ:
character *3, dimension(:), allocatable typ
Type indicators corresponding to tag:
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
integer, dimension(:), allocatable jmpb
Jump backward indices corresponding to tag and typ:
This module declares and initializes the BMISS variable.
real *8, public bmiss
Current placeholder value to represent "missing" data when reading from or writing to BUFR files; thi...
subroutine parstr(STR, TAGS, MTAG, NTAG, SEP, LIMIT80)
THIS SUBROUTINE PARSES A STRING CONTAINING ONE OR MORE SUBSTRINGS INTO AN ARRAY OF SUBSTRINGS.
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
subroutine ufbseq(LUNIN, USR, I1, I2, IRET, STR)
This subroutine reads or writes an entire sequence of data values from or to the BUFR data subset tha...