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
245 5 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
284 1 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+++++++++++++++++++++++')
376 900 CALL
bort(
'BUFRLIB: UFBSEQ - BUFR FILE IS CLOSED, IT MUST BE'//
378 901 CALL
bort(
'BUFRLIB: UFBSEQ - A MESSAGE MUST BE OPEN IN BUFR '//
380 902
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - THE INPUT STRING (",A,") '//
381 .
'DOES NOT CONTAIN ANY MNEMONICS!!")') str
383 903
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - THERE CANNOT BE MORE THAN '//
384 .
'ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE ",I3'//
387 904
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - THIRD ARGUMENT (INPUT) MUST'//
388 . .GT.
' BE ZERO (HERE IT IS",I4,") - INPUT MNEMONIC IS ",A)')
391 905
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - FOURTH ARGUMENT (INPUT) '//
392 . .GT.
'MUST BE ZERO (HERE IT IS",I4,") - INPUT MNEMONIC IS ",A)')
395 906 CALL
bort(
'BUFRLIB: UFBSEQ - LOCATION OF INTERNAL TABLE FOR '//
396 .
'BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL '//
398 907
WRITE(bort_str,
'("BUFRLIB: UFBSEQ - INPUT MNEMONIC ",A," MUST '//
399 .
'BE A SEQUENCE (HERE IT IS TYPE """,A,""")")') tags(1),typ(node)
401 908
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
405 910
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)
409 911
WRITE(bort_str,.GE.
'("BUFRLIB: UFBSEQ - VARIABLE INS1 MUST BE '//
410 .
'ZERO, HERE IT IS",I4," - INPUT MNEMONIC IS ",A)') ins1,tags(1)
subroutine parstr(STR, TAGS, MTAG, NTAG, SEP, LIMIT80)
THIS SUBROUTINE PARSES A STRING CONTAINING ONE OR MORE SUBSTRINGS INTO AN ARRAY OF SUBSTRINGS...
This module declares and initializes the BMISS variable.
This module contains array and variable declarations used to store the internal jump/link table...
subroutine status(LUNIT, LUN, IL, IM)
This subroutine checks whether a specified Fortran logical unit number is currently connected to the ...
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
function invwin(NODE, LUN, INV1, INV2)
THIS FUNCTION LOOKS FOR A SPECIFIED NODE WITHIN THE PORTION OF THE CURRENT SUBSET BUFFER BOUNDED BY T...
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...
function invtag(NODE, LUN, INV1, INV2)
THIS FUNCTION LOOKS FOR A SPECIFIED MNEMONIC WITHIN THE PORTION OF THE CURRENT SUBSET BUFFER BOUNDED ...