37 recursive subroutine setvalnb ( lunit, tagpv, ntagpv, tagnb, ntagnb, r8val, iret )
39 use modv_vars,
only: im8b
47 integer,
intent(in) :: lunit, ntagpv, ntagnb
48 integer,
intent(out) :: iret
49 integer my_lunit, my_ntagpv, my_ntagnb, lun, il, im, npv, nnb, ierft
51 character*(*),
intent(in) :: tagpv, tagnb
53 real*8,
intent(in) :: r8val
58 call x84 ( lunit, my_lunit, 1 )
59 call x84 ( ntagpv, my_ntagpv, 1 )
60 call x84 ( ntagnb, my_ntagnb, 1 )
61 call setvalnb ( my_lunit, tagpv, my_ntagpv, tagnb, my_ntagnb, r8val, iret )
62 call x48 ( iret, iret, 1 )
70 call status (lunit, lun, il, im )
72 if (
inode(lun) /=
inv(1,lun) )
return
75 call fstag( lun, tagpv, ntagpv, 1, npv, ierft )
76 if ( ierft /= 0 )
return
79 call fstag( lun, tagnb, ntagnb, npv, nnb, ierft )
80 if ( ierft /= 0 )
return
121 recursive real*8 function getvalnb ( lunit, tagpv, ntagpv, tagnb, ntagnb )
result ( r8val )
123 use modv_vars,
only: im8b, bmiss
131 integer,
intent(in) :: lunit, ntagpv, ntagnb
132 integer my_lunit, my_ntagpv, my_ntagnb, lun, il, im, npv, nnb, ierft
134 character*(*),
intent(in) :: tagpv, tagnb
139 call x84(lunit,my_lunit,1)
140 call x84(ntagpv,my_ntagpv,1)
141 call x84(ntagnb,my_ntagnb,1)
142 r8val=
getvalnb(my_lunit,tagpv,my_ntagpv,tagnb,my_ntagnb)
150 call status (lunit, lun, il, im )
151 if ( il >= 0 )
return
152 if (
inode(lun) /=
inv(1,lun) )
return
155 call fstag( lun, tagpv, ntagpv, 1, npv, ierft )
156 if ( ierft /= 0 )
return
159 call fstag( lun, tagnb, ntagnb, npv, nnb, ierft )
160 if ( ierft /= 0 )
return
199 recursive subroutine writlc(lunit,chr,str)
201 use modv_vars,
only: im8b, mxlcc, iprt
211 integer,
intent(in) :: lunit
212 integer my_lunit, maxtg, lun, il, im, ntg, nnod, kon, ii, n, node, ioid, ival, mbit, nbit, nbmp, nchr, nbyt, nsubs, &
213 itagct, len0, len1, len2, len3, l4, l5, mbyte,
iupbs3
215 character*(*),
intent(in) :: chr, str
216 character*128 bort_str, errstr
227 call x84(lunit,my_lunit,1)
228 call writlc(my_lunit,chr,str)
234 call status(lunit,lun,il,im)
235 if(il==0)
call bort(
'BUFRLIB: WRITLC - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
236 if(il<0)
call bort(
'BUFRLIB: WRITLC - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
237 if(im==0)
call bort(
'BUFRLIB: WRITLC - A MESSAGE MUST BE OPEN IN OUTPUT BUFR FILE, NONE ARE')
240 call parstr(str,tgs,maxtg,ntg,
' ',.true.)
242 write(bort_str,
'("BUFRLIB: WRITLC - THERE CANNOT BE MORE THAN '// &
243 ' ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE",I4,")")') str,ntg
248 call parutg(lun,1,tgs(1),nnod,kon,roid)
254 do while((ii<=10).and.(tgs(1)(ii:ii)/=
'#'))
255 ctag(ii:ii)=tgs(1)(ii:ii)
268 do while (n+1<=
nval(lun))
271 if(
itp(node)==1)
then
274 elseif(ctag==
tag(node))
then
276 if(itagct==ioid)
then
277 if(
itp(node)/=3)
then
278 write(bort_str,
'("BUFRLIB: WRITLC - MNEMONIC ",A," DOES NOT REPRESENT A CHARACTER ELEMENT (TYP=",A,")")') &
285 nchr=min(mxlcc,
ibt(node)/8)
294 call getlens(
mbay(1,lun),3,len0,len1,len2,len3,l4,l5)
295 mbyte = len0 + len1 + len2 + len3 + 4
298 do while(nsubs<
nsub(lun))
304 if(nsubs/=
nsub(lun))
then
306 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
307 errstr =
'BUFRLIB: WRITLC - COULDN''T WRITE VALUE FOR ' // ctag // &
308 ' INTO SUBSET, BECAUSE NO SUBSET WAS OPEN FOR WRITING'
310 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
321 do while (n+1<=
nval(lun))
326 if(
itp(node)==1)
then
327 call upbb(ival,nbit,mbit,
mbay(1,lun))
329 elseif(ctag==
tag(node))
then
331 if(itagct==ioid)
then
332 if(
itp(node)/=3)
then
333 write(bort_str,
'("BUFRLIB: WRITLC - MNEMONIC ",A," DOES NOT REPRESENT A CHARACTER ELEMENT (TYP=",A,")")') &
342 call pkc(chr,nchr,
mbay(1,lun),mbit)
352 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
353 errstr =
'BUFRLIB: WRITLC - COULDN''T WRITE VALUE FOR ' // ctag //
' INTO SUBSET, BECAUSE IT WASN''T FOUND IN THE ' // &
356 errstr =
'(' // ctag //
' MAY NOT BE IN THE BUFR TABLE(?))'
358 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
404 recursive subroutine readlc(lunit,chr,str)
406 use modv_vars,
only: im8b, iprt
417 integer,
intent(in) :: lunit
418 integer my_lunit, maxtg, lchr, lun, il, im, ntg, nnod, kon, ii, n, nod, ioid, itagct, nchr, kbit
420 character*(*),
intent(in) :: str
421 character*(*),
intent(out) :: chr
423 character*128 bort_str, errstr
434 call x84(lunit,my_lunit,1)
435 call readlc(my_lunit,chr,str)
444 call status(lunit,lun,il,im)
445 if(il==0)
call bort(
'BUFRLIB: READLC - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
446 if(il>0)
call bort(
'BUFRLIB: READLC - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
447 if(im==0)
call bort(
'BUFRLIB: READLC - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
450 call parstr(str,tgs,maxtg,ntg,
' ',.true.)
452 write(bort_str,
'("BUFRLIB: READLC - THERE CANNOT BE MORE THAN '// &
453 'ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE ",I3,")")') str,ntg
459 call parutg(lun,0,tgs(1),nnod,kon,roid)
465 do while((ii<=10).and.(tgs(1)(ii:ii)/=
'#'))
466 ctag(ii:ii)=tgs(1)(ii:ii)
480 if(ctag==
tag(nod))
then
482 if(itagct==ioid)
then
484 write(bort_str,
'("BUFRLIB: READLC - MNEMONIC ",A," DOES NOT '// &
485 'REPRESENT A CHARACTER ELEMENT (ITP=",I2,")")') tgs(1),
itp(nod)
490 write(bort_str,
'("BUFRLIB: READLC - MNEMONIC ",A," IS A '// &
491 'CHARACTER STRING OF LENGTH",I4," BUT SPACE WAS PROVIDED FOR ONLY",I4, " CHARACTERS")') tgs(1),nchr,lchr
495 call upc(chr,nchr,
mbay(1,lun),kbit,.true.)
505 if(ctag==
crtag(ii))
then
507 if(itagct==ioid)
then
510 write(bort_str,
'("BUFRLIB: READLC - MNEMONIC ",A," IS A '// &
511 'CHARACTER STRING OF LENGTH",I4," BUT SPACE WAS PROVIDED FOR ONLY",I4, " CHARACTERS")') tgs(1),nchr,lchr
515 call upc(chr,nchr,
mbay(1,lun),kbit,.true.)
525 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
526 errstr =
'BUFRLIB: READLC - MNEMONIC ' // tgs(1) // &
527 ' NOT LOCATED IN REPORT SUBSET - RETURN WITH MISSING STRING FOR CHARACTER DATA ELEMENT'
529 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
533 call ipkm(chr(ii:ii),1,255)
641 recursive subroutine ufbint(lunin,usr,i1,i2,iret,str)
643 use modv_vars,
only: im8b, bmiss, iprt
650 character*(*),
intent(in) :: str
651 character*128 bort_str1, bort_str2, errstr
653 integer,
intent(in) :: lunin, i1, i2
654 integer,
intent(out) :: iret
655 integer nnod, ncon, nods, nodc, ivls, kons, ifirst1, ifirst2, my_lunin, my_i1, my_i2, lunit, lun, il, im, io
657 real*8,
intent(inout) :: usr(i1,i2)
659 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
661 data ifirst1 /0/, ifirst2 /0/
663 save ifirst1, ifirst2
668 call x84(lunin,my_lunin,1)
671 call ufbint(my_lunin,usr,my_i1,my_i2,iret,str)
672 call x48(iret,iret,1)
681 call status(lunit,lun,il,im)
682 if(il==0)
call bort(
'BUFRLIB: UFBINT - BUFR FILE IS CLOSED, IT MUST BE OPEN')
683 if(im==0)
call bort(
'BUFRLIB: UFBINT - A MESSAGE MUST BE OPEN IN BUFR FILE, NONE ARE')
684 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBINT - LOCATION OF INTERNAL TABLE FOR BUFR FILE DOES NOT AGREE ' // &
685 'WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
687 io = min(max(0,il),1)
688 if(lunit/=lunin) io = 0
692 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
693 errstr = .LE.
'BUFRLIB: UFBINT - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
696 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
701 if(iprt==-1) ifirst1 = 1
702 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
703 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
704 errstr = .LE.
'BUFRLIB: UFBINT - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
707 if(iprt==0 .and. io==1)
then
708 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
711 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
715 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
723 call string(str,lun,i1,io)
726 if(io==0) usr(1:i1,1:i2) = bmiss
729 call ufbrw(lun,usr,i1,i2,io,iret)
732 if(io==1 .and. iret/=i2 .and. iret>=0)
then
733 call trybump(lun,usr,i1,i2,io,iret)
735 write(bort_str1,
'("BUFRLIB: UFBINT - MNEMONIC STRING READ IN IS: ",A)') str
736 write(bort_str2,
'(18X,"THE NUMBER OF ''LEVELS'' ACTUALLY '// &
737 'WRITTEN (",I3,") DOES NOT EQUAL THE NUMBER REQUESTED (",I3,") - INCOMPLETE WRITE")') iret,i2
738 call bort2(bort_str1,bort_str2)
740 elseif(iret==-1)
then
747 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
748 errstr =
'BUFRLIB: UFBINT - NO SPECIFIED VALUES READ IN, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
751 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
755 if(iprt==-1) ifirst2 = 1
756 if(ifirst2==0 .or. iprt>=1)
then
757 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
758 errstr =
'BUFRLIB: UFBINT - NO SPECIFIED VALUES WRITTEN OUT, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
761 call errwrt(
'MAY NOT BE IN THE BUFR TABLE(?)')
763 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
766 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call ' // &
767 'to a BUFRLIB routine.'
770 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
874 recursive subroutine ufbrep(lunin,usr,i1,i2,iret,str)
876 use modv_vars,
only: im8b, bmiss, iac, iprt
883 character*(*),
intent(in) :: str
884 character*128 bort_str1, bort_str2, errstr
886 integer,
intent(in) :: lunin, i1, i2
887 integer,
intent(out) :: iret
888 integer ifirst1, my_lunin, my_i1, my_i2, lunit, lun, il, im, io, iac_prev
890 real*8,
intent(inout) :: usr(i1,i2)
899 call x84(lunin,my_lunin,1)
902 call ufbrep(my_lunin,usr,my_i1,my_i2,iret,str)
903 call x48(iret,iret,1)
912 call status(lunit,lun,il,im)
913 if(il==0)
call bort(
'BUFRLIB: UFBREP - BUFR FILE IS CLOSED, IT MUST BE OPEN')
914 if(im==0)
call bort(
'BUFRLIB: UFBREP - A MESSAGE MUST BE OPEN IN BUFR FILE, NONE ARE')
915 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBREP - LOCATION OF INTERNAL TABLE FOR BUFR FILE DOES NOT AGREE ' // &
916 'WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
918 io = min(max(0,il),1)
919 if(lunit/=lunin) io = 0
923 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
924 errstr = .LE.
'BUFRLIB: UFBREP - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
927 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
932 if(iprt==-1) ifirst1 = 1
933 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
934 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
935 errstr = .LE.
'BUFRLIB: UFBREP - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
938 if(iprt==0 .and. io==1)
then
939 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
942 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
946 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
954 if(io==0) usr(1:i1,1:i2) = bmiss
959 call string(str,lun,i1,io)
963 call ufbrp(lun,usr,i1,i2,io,iret)
965 if(io==1 .and. iret<i2)
then
966 write(bort_str1,
'("BUFRLIB: UFBREP - MNEMONIC STRING READ IN IS: ",A)') str
967 write(bort_str2,
'(18X,"THE NUMBER OF ''LEVELS'' ACTUALLY '// &
968 'WRITTEN (",I3,") LESS THAN THE NUMBER REQUESTED (",I3,") - INCOMPLETE WRITE")') iret,i2
969 call bort2(bort_str1,bort_str2)
972 if(iret==0 .and. io==0 .and. iprt>=1)
then
973 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
974 errstr =
'BUFRLIB: UFBREP - NO SPECIFIED VALUES READ IN, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
977 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1079 recursive subroutine ufbstp(lunin,usr,i1,i2,iret,str)
1081 use modv_vars,
only: im8b, bmiss, iprt
1088 character*(*),
intent(in) :: str
1089 character*128 bort_str1, bort_str2, errstr
1091 integer,
intent(in) :: lunin, i1, i2
1092 integer,
intent(out) :: iret
1093 integer ifirst1, my_lunin, my_i1, my_i2, lunit, lun, il, im, io
1095 real*8,
intent(inout) :: usr(i1,i2)
1104 call x84(lunin,my_lunin,1)
1105 call x84(i1,my_i1,1)
1106 call x84(i2,my_i2,1)
1107 call ufbstp(my_lunin,usr,my_i1,my_i2,iret,str)
1108 call x48(iret,iret,1)
1117 call status(lunit,lun,il,im)
1118 if(il==0)
call bort(
'BUFRLIB: UFBSTP - BUFR FILE IS CLOSED, IT MUST BE OPEN')
1119 if(im==0)
call bort(
'BUFRLIB: UFBSTP - A MESSAGE MUST BE OPEN IN BUFR FILE, NONE ARE')
1120 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBSTP - LOCATION OF INTERNAL TABLE FOR BUFR FILE DOES NOT AGREE ' // &
1121 'WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
1123 io = min(max(0,il),1)
1124 if(lunit/=lunin) io = 0
1128 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1129 errstr = .LE.
'BUFRLIB: UFBSTP - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1132 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1137 if(iprt==-1) ifirst1 = 1
1138 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
1139 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1140 errstr = .LE.
'BUFRLIB: UFBSTP - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1143 if(iprt==0 .and. io==1)
then
1144 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
1145 'all such messages,'
1147 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
1151 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1159 if(io==0) usr(1:i1,1:i2) = bmiss
1162 call string(str,lun,i1,io)
1165 call ufbsp(lun,usr,i1,i2,io,iret)
1167 if(io==1 .and. iret/=i2)
then
1168 write(bort_str1,
'("BUFRLIB: UFBSTP - MNEMONIC STRING READ IN IS: ",A)') str
1169 write(bort_str2,
'(18X,"THE NUMBER OF ''LEVELS'' ACTUALLY '// &
1170 'WRITTEN (",I3,") DOES NOT EQUAL THE NUMBER REQUESTED (",I3,") - INCOMPLETE WRITE")') iret,i2
1171 call bort2(bort_str1,bort_str2)
1174 if(iret==0 .and. io==0 .and. iprt>=1)
then
1175 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1176 errstr =
'BUFRLIB: UFBSTP - NO SPECIFIED VALUES READ IN, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1179 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1292 recursive subroutine ufbseq(lunin,usr,i1,i2,iret,str)
1294 use modv_vars,
only: im8b, bmiss, iprt
1302 integer,
intent(in) :: lunin, i1, i2
1303 integer,
intent(out) :: iret
1304 integer,
parameter :: mtag = 10
1305 integer ifirst1, ifirst2, my_lunin, my_i1, my_i2, lunit, lun, il, im, io, i, j, ntag, node, nods, ins1, ins2, insx, &
1308 real*8,
intent(inout) :: usr(i1,i2)
1310 character*(*),
intent(in) :: str
1311 character*156 bort_str
1312 character*128 errstr
1313 character*10 tags(mtag)
1315 data ifirst1 /0/, ifirst2 /0/
1317 save ifirst1, ifirst2
1322 call x84(lunin,my_lunin,1)
1323 call x84(i1,my_i1,1)
1324 call x84(i2,my_i2,1)
1325 call ufbseq(my_lunin,usr,my_i1,my_i2,iret,str)
1326 call x48(iret,iret,1)
1335 call status(lunit,lun,il,im)
1336 if(il==0)
call bort(
'BUFRLIB: UFBSEQ - BUFR FILE IS CLOSED, IT MUST BE OPEN')
1337 if(im==0)
call bort(
'BUFRLIB: UFBSEQ - A MESSAGE MUST BE OPEN IN BUFR FILE, NONE ARE')
1339 io = min(max(0,il),1)
1340 if(lunit/=lunin) io = 0
1344 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1345 errstr = .LE.
'BUFRLIB: UFBSEQ - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1348 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1353 if(iprt==-1) ifirst1 = 1
1354 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
1355 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1356 errstr = .LE.
'BUFRLIB: UFBSEQ - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1359 if(iprt==0 .and. io==1)
then
1360 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
1361 'all such messages,'
1363 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
1367 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1375 call parstr(str,tags,mtag,ntag,
' ',.true.)
1377 write(bort_str,
'("BUFRLIB: UFBSEQ - THE INPUT STRING (",A,") DOES NOT CONTAIN ANY MNEMONICS!!")') str
1381 write(bort_str,
'("BUFRLIB: UFBSEQ - THERE CANNOT BE MORE THAN '// &
1382 'ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE ",I3,")")') str,ntag
1385 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBSEQ - LOCATION OF INTERNAL TABLE FOR '// &
1386 'BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
1389 if(io==0) usr(1:i1,1:i2) = bmiss
1393 if(str==
tag(node))
then
1394 if(
typ(node)==
'SEQ' .or.
typ(node)==
'RPC')
then
1398 if(ins1==0)
exit outer
1399 if(
typ(node)/=
'RPC' .or.
val(ins1,lun)/=0.)
exit
1403 if(ins2==0) ins2 = 10e5
1405 do while(
link(nods)==0 .and.
jmpb(nods)>0)
1408 if(
link(nods)==0)
then
1410 elseif(
link(nods)>0)
then
1413 ins2 = min(ins2,insx)
1414 elseif(
typ(node)==
'SUB')
then
1418 write(bort_str,
'("BUFRLIB: UFBSEQ - INPUT MNEMONIC ",A," MUST '// &
1419 'BE A SEQUENCE (HERE IT IS TYPE """,A,""")")') tags(1),
typ(node)
1425 if(ityp>1) nseq = nseq+1
1428 write(bort_str,.GT.
'("BUFRLIB: UFBSEQ - INPUT SEQ. MNEM. ",A," CONSISTS OF",I4," TABLE B MNEM., THE MAX. '// &
1429 'SPECIFIED IN (INPUT) ARGUMENT 3 (",I3,")")') tags(1),nseq,i1
1433 inner:
do while (.true.)
1435 if(ins1>
nval(lun))
exit outer
1437 if(
typ(node)==
'RPC' .and.
val(ins1,lun)==0.)
then
1440 elseif(io==0 .and. iret+1>i2)
then
1442 call errwrt(
'++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++')
1443 write ( unit=errstr, fmt=
'(A,I5,A,A,A)' )
'BUFRLIB: UFBSEQ - INCOMPLETE READ; ONLY THE FIRST ', i2, &
1444 ' (=4TH INPUT ARG.) ''LEVELS'' OF INPUT MNEMONIC ', tags(1),
' WERE READ'
1446 call errwrt(
'++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++')
1451 elseif(ins1==0)
then
1452 if(io==1 .and. iret<i2)
then
1453 write(bort_str,
'("BUFRLIB: UFBSEQ - NO. OF ''LEVELS'.LT.
' WRITTEN (",I5,") NO. REQUESTED (",I5,") - '// &
1454 'INCOMPLETE WRITE (INPUT MNEMONIC IS ",A,")")') iret,i2,tags(1)
1458 write(bort_str,.GE.
'("BUFRLIB: UFBSEQ - VARIABLE INS1 MUST BE ZERO, HERE IT IS",I4," - INPUT MNEMONIC '// &
1459 'IS ",A)') ins1,tags(1)
1462 if(ins1==0 .or. iret==i2)
exit outer
1468 do while(
itp(
inv(j,lun))<2)
1471 if(io==0) usr(i,iret) =
val(j,lun)
1472 if(io==1)
val(j,lun) = usr(i,iret)
1482 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1483 errstr =
'BUFRLIB: UFBSEQ - NO SPECIFIED VALUES READ IN, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1486 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1490 if(iprt==-1) ifirst2 = 1
1491 if(ifirst2==0 .or. iprt>=1)
then
1492 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1493 errstr =
'BUFRLIB: UFBSEQ - NO SPECIFIED VALUES WRITTEN OUT, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1496 call errwrt(
'MAY NOT BE IN THE BUFR TABLE(?)')
1498 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
1499 'all such messages,'
1501 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
1505 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1552 recursive subroutine drfini(lunit,mdrf,ndrf,drftag)
1554 use modv_vars,
only: im8b
1561 character*(*),
intent(in) :: drftag
1563 integer,
intent(in) :: mdrf(*), lunit, ndrf
1564 integer,
parameter :: mxdrf = 2000
1565 integer my_mdrf(mxdrf), my_lunit, my_ndrf, lun, il, im, m, n, node
1570 call x84(lunit,my_lunit,1)
1571 call x84(ndrf,my_ndrf,1)
1572 call x84(mdrf(1),my_mdrf(1),my_ndrf)
1573 call drfini(my_lunit,my_mdrf,my_ndrf,drftag)
1578 call status(lunit,lun,il,im)
1582 do while ( n <=
nval(lun) )
1584 if(
itp(node)==1 .and.
tag(node)==drftag)
then
1586 call usrtpl(lun,n,mdrf(m))
1619 use modv_vars,
only: bmiss, iprt
1627 integer,
intent(in) :: lun, i1, i2, io
1628 integer,
intent(out) :: iret
1629 integer nnod, ncon, nods, nodc, ivls, kons, inc1, inc2, ins1, ins2, invn, i, j, invwin, ibfms, lstjpb
1631 real*8,
intent(inout) :: usr(i1,i2)
1633 character*128 errstr
1634 character*10 tagstr, subset
1636 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
1644 outer:
do while (.true.)
1645 call conwin(lun,inc1,inc2)
1649 elseif(inc1==0)
then
1655 call getwin(nods(j),lun,ins1,ins2)
1661 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1662 call errwrt(
'UFBRW LEV TAG IO INS1 INVN INS2 '//subset)
1663 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1665 if(io==0) tagstr=
tag(nods(i))(1:8)//
' R'
1666 if(io==1) tagstr=
tag(nods(i))(1:8)//
' W'
1667 invn = invwin(nods(i),lun,ins1,ins2)
1668 if(invn==0.and.io==1)
call drstpl(nods(i),lun,ins1,ins2,invn)
1669 write(errstr,
'("LEV=",I5,1X,A,3I7)') iret,tagstr,ins1,invn,ins2
1674 if(io==1 .and. iret<=i2)
then
1677 if(ibfms(usr(i,iret))==0)
then
1678 invn = invwin(nods(i),lun,ins1,ins2)
1680 call drstpl(nods(i),lun,ins1,ins2,invn)
1685 call newwin(lun,inc1,inc2)
1686 val(invn,lun) = usr(i,iret)
1687 elseif(lstjpb(nods(i),lun,
'RPS')==0)
then
1688 val(invn,lun) = usr(i,iret)
1689 elseif(ibfms(
val(invn,lun))/=0)
then
1690 val(invn,lun) = usr(i,iret)
1692 call drstpl(nods(i),lun,ins1,ins2,invn)
1697 call newwin(lun,inc1,inc2)
1698 val(invn,lun) = usr(i,iret)
1705 if(io==0 .and. iret<=i2)
then
1709 invn = invwin(nods(i),lun,ins1,ins2)
1710 if(invn>0) usr(i,iret) =
val(invn,lun)
1715 if(io==1.and.iret==i2)
return
1716 call nxtwin(lun,ins1,ins2)
1717 if(ins1>0 .and. ins1<inc2) cycle
1718 if(ncon>0) cycle outer
1729 end subroutine ufbrw
1760 integer,
intent(in) :: lun, i1, i2, io
1761 integer,
intent(out) :: iret
1762 integer nnod, ncon, nods, nodc, ivls, kons, ins1, ins2, invn, i, nz, invtag
1764 real*8,
intent(inout) :: usr(i1,i2)
1766 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
1777 if(ins1+1>
nval(lun))
return
1778 if(io==1 .and. iret==i2)
return
1779 ins1 = invtag(nods(nz),lun,ins1+1,
nval(lun))
1781 ins2 = invtag(nods(nz),lun,ins1+1,
nval(lun))
1782 if(ins2==0) ins2 =
nval(lun)
1785 if(io==0 .and. iret<=i2)
then
1788 invn = invtag(nods(i),lun,ins1,ins2)
1789 if(invn>0) usr(i,iret) =
val(invn,lun)
1794 if(io==1 .and. iret<=i2)
then
1797 invn = invtag(nods(i),lun,ins1,ins2)
1798 if(invn>0)
val(invn,lun) = usr(i,iret)
1807 end subroutine ufbrp
1844 integer,
intent(in) :: lun, i1, i2, io
1845 integer,
intent(out) :: iret
1846 integer nnod, ncon, nods, nodc, ivls, kons, ins1, ins2, invn, invm, i, invtag
1848 real*8,
intent(inout) :: usr(i1,i2)
1850 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
1858 if(ins1+1>
nval(lun))
return
1859 ins1 = invtag(nods(1),lun,ins1+1,
nval(lun))
1861 ins2 = invtag(nods(1),lun,ins1+1,
nval(lun))
1862 if(ins2==0) ins2 =
nval(lun)
1865 if(io==0 .and. iret<=i2)
then
1869 invn = invtag(nods(i),lun,invm,ins2)
1870 if(invn>0) usr(i,iret) =
val(invn,lun)
1871 invm = max(invn,invm)
1876 if(io==1 .and. iret<=i2)
then
1880 invn = invtag(nods(i),lun,invm,ins2)
1881 if(invn>0)
val(invn,lun) = usr(i,iret)
1882 invm = max(invn,invm)
1889 end subroutine ufbsp
1941 use modv_vars,
only: im8b, mxh4wlc, iprt
1947 integer,
intent(in) :: lunit
1948 integer my_lunit, lens, lenc, i
1950 character*(*),
intent(in) :: chr, str
1952 character*128 errstr
1958 call x84(lunit,my_lunit,1)
1964 call strsuc( str, mystr, lens )
1965 if ( lens == -1 )
return
1967 lenc = min( len( chr ), 120 )
1973 if ( ( lunit ==
luh4wlc(i) ) .and. ( mystr(1:lens) ==
sth4wlc(i)(1:lens) ) )
then
1975 chh4wlc(i)(1:lenc) = chr(1:lenc)
1982 if (
nh4wlc >= mxh4wlc )
then
1984 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1985 write ( unit=errstr, fmt=
'(A,A,I3)' )
'BUFRLIB: HOLD4WLC - THE MAXIMUM NUMBER OF LONG CHARACTER ', &
1986 'STRINGS THAT CAN BE HELD INTERNALLY IS ', mxh4wlc
1988 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2034 integer,
intent(in) :: lun, i1, i2, io
2035 integer,
intent(out) :: iret
2036 integer nnod, ncon, nods, nodc, ivls, kons, ndrp, invn, jnvn, knvn, invwin, lstjpb
2038 real*8,
intent(inout) :: usr(i1,i2)
2040 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
2044 ndrp = lstjpb(nods(1),lun,
'DRP')
2049 invn = invwin(ndrp,lun,1,
nval(lun))
2052 do while(nint(
val(jnvn,lun))>0)
2053 jnvn = jnvn+nint(
val(jnvn,lun))
2055 do knvn=1,
nval(lun)-jnvn+1
2056 inv(invn+knvn,lun) =
inv(jnvn+knvn-1,lun)
2057 val(invn+knvn,lun) =
val(jnvn+knvn-1,lun)
2059 nval(lun) =
nval(lun)-(jnvn-invn-1)
2064 call ufbrw(lun,usr,i1,i2,io,iret)
2088 recursive subroutine ufbovr(lunit,usr,i1,i2,iret,str)
2090 use modv_vars,
only: im8b, iprt
2097 integer,
intent(in) :: lunit, i1, i2
2098 integer,
intent(out) :: iret
2099 integer ifirst1, my_lunit, my_i1, my_i2, lun, il, im, io
2101 character*(*),
intent(in) :: str
2102 character*128 bort_str1, bort_str2, errstr
2104 real*8,
intent(inout) :: usr(i1,i2)
2114 call x84(lunit,my_lunit,1)
2115 call x84(i1,my_i1,1)
2116 call x84(i2,my_i2,1)
2117 call ufbovr(my_lunit,usr,my_i1,my_i2,iret,str)
2118 call x48(iret,iret,1)
2127 call status(lunit,lun,il,im)
2128 if(il==0)
call bort(
'BUFRLIB: UFBOVR - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
2129 if(il<0)
call bort(
'BUFRLIB: UFBOVR - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
2130 if(im==0)
call bort(
'BUFRLIB: UFBOVR - A MESSAGE MUST BE OPEN IN OUTPUT BUFR FILE, NONE ARE')
2131 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBOVR - LOCATION OF INTERNAL TABLE FOR '// &
2132 'OUTPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
2134 io = min(max(0,il),1)
2138 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2139 errstr = .LE.
'BUFRLIB: UFBOVR - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
2142 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2147 if(iprt==-1) ifirst1 = 1
2148 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
2149 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2150 errstr = .LE.
'BUFRLIB: UFBOVR - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
2153 if(iprt==0 .and. io==1)
then
2154 errstr =
'Note: Only the first occurrence of this WARNING ' // &
2155 'message is printed, there may be more. To output all such messages,'
2157 errstr =
'modify your application program to add ' // &
2158 '"CALL OPENBF(0,''QUIET'',1)" prior to the first call to a BUFRLIB routine.'
2161 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2170 call string(str,lun,i1,io)
2171 call trybump(lun,usr,i1,i2,io,iret)
2173 if(io==1 .and. iret/=i2)
then
2174 write(bort_str1,
'("BUFRLIB: UFBOVR - MNEMONIC STRING READ IN IS: ",A)') str
2175 write(bort_str2,
'(18X,"THE NUMBER OF ''LEVELS'' ACTUALLY '// &
2176 'WRITTEN (",I3,") DOES NOT EQUAL THE NUMBER REQUESTED (",I3,") - INCOMPLETE WRITE")') iret, i2
2177 call bort2(bort_str1,bort_str2)
2220 recursive subroutine ufbevn(lunit,usr,i1,i2,i3,iret,str)
2222 use modv_vars,
only: im8b, bmiss, iprt
2229 character*(*),
intent(in) :: str
2230 character*128 errstr
2232 integer,
intent(in) :: lunit, i1, i2, i3
2233 integer,
intent(out) :: iret
2234 integer invn(255), nnod, ncon, nods, nodc, ivls, kons, maxevn, my_lunit, my_i1, my_i2, my_i3, i, j, k, lun, il, im, &
2235 ins1, ins2, inc1, inc2, nnvn,
nvnwin
2237 real*8,
intent(out) :: usr(i1,i2,i3)
2241 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
2247 call x84(lunit,my_lunit,1)
2248 call x84(i1,my_i1,1)
2249 call x84(i2,my_i2,1)
2250 call x84(i3,my_i3,1)
2251 call ufbevn(my_lunit,usr,my_i1,my_i2,my_i3,iret,str)
2252 call x48(iret,iret,1)
2262 call status(lunit,lun,il,im)
2263 if(il==0)
call bort(
'BUFRLIB: UFBEVN - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
2264 if(il>0)
call bort(
'BUFRLIB: UFBEVN - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
2265 if(im==0)
call bort(
'BUFRLIB: UFBEVN - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
2266 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBEVN - LOCATION OF INTERNAL TABLE FOR '// &
2267 'INPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
2271 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2272 errstr = .LE.
'BUFRLIB: UFBEVN - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 6th ARG. (IRET) = 0; 7th ARG. (STR) ='
2275 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2281 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2282 errstr = .LE.
'BUFRLIB: UFBEVN - 4th ARG. (INPUT) IS 0, SO RETURN WITH 6th ARG. (IRET) = 0; 7th ARG. (STR) ='
2285 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2291 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2292 errstr = .LE.
'BUFRLIB: UFBEVN - 5th ARG. (INPUT) IS 0, SO RETURN WITH 6th ARG. (IRET) = 0; 7th ARG. (STR) ='
2295 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2303 call string(str,lun,i1,0)
2306 usr(1:i1,1:i2,1:i3) = bmiss
2312 outer:
do while (.true.)
2313 call conwin(lun,inc1,inc2)
2317 elseif(inc1==0)
then
2324 call getwin(nods(i),lun,ins1,ins2)
2330 if(.not.nodgt0)
then
2335 inner:
do while (.true.)
2340 nnvn =
nvnwin(nods(j),lun,ins1,ins2,invn,i3)
2341 maxevn = max(nnvn,maxevn)
2343 usr(j,iret,k) =
val(invn(k),lun)
2349 call nxtwin(lun,ins1,ins2)
2350 if(ins1<=0 .or. ins1>=inc2)
exit inner
2352 if(ncon<=0)
exit outer
2358 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2359 errstr =
'BUFRLIB: UFBEVN - NO SPECIFIED VALUES READ IN, SO RETURN WITH 6th ARG. (IRET) = 0; 7th ARG. (STR) ='
2362 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2403 recursive subroutine ufbinx(lunit,imsg,isub,usr,i1,i2,iret,str)
2405 use modv_vars,
only: im8b
2412 integer,
intent(in) :: lunit, imsg, isub, i1, i2
2413 integer,
intent(out) :: iret
2414 integer my_lunit, my_imsg, my_isub, my_i1, my_i2, lun, il, im, jdate, jret, i
2416 character*(*),
intent(in) :: str
2417 character*128 bort_str
2420 real*8,
intent(out) :: usr(i1,i2)
2427 call x84(lunit,my_lunit,1)
2428 call x84(imsg,my_imsg,1)
2429 call x84(isub,my_isub,1)
2430 call x84(i1,my_i1,1)
2431 call x84(i2,my_i2,1)
2432 call ufbinx(my_lunit,my_imsg,my_isub,usr,my_i1,my_i2,iret,str)
2433 call x48(iret,iret,1)
2438 call status(lunit,lun,il,im)
2443 call openbf(lunit,
'INX',lunit)
2451 call readmg(lunit,subset,jdate,jret)
2453 write(bort_str,
'("BUFRLIB: UFBINX - HIT END OF FILE BEFORE '// &
2454 'READING REQUESTED MESSAGE NO.",I5," IN BUFR FILE CONNECTED TO UNIT",I4)') imsg, lunit
2463 write(bort_str,
'("BUFRLIB: UFBINX - ALL SUBSETS READ BEFORE '// &
2464 'READING REQ. SUBSET NO.",I3," IN REQ. MSG NO.",I5," IN BUFR FILE CONNECTED TO UNIT",I4)') isub, imsg, lunit
2470 call ufbint(lunit,usr,i1,i2,iret,str)
2497 recursive subroutine ufbget(lunit,tab,i1,iret,str)
2499 use modv_vars,
only: im8b, bmiss
2510 integer,
intent(in) :: lunit, i1
2511 integer,
intent(out) :: iret
2512 integer nnod, ncon, nods, nodc, ivls, kons, my_lunit, my_i1, lun, il, im, i, n, node, nbmp, kbit, invn,
invwin
2514 character*(*),
intent(in) :: str
2517 real*8,
intent(out) :: tab(i1)
2520 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
2522 equivalence(cval,rval)
2528 call x84(lunit,my_lunit,1)
2529 call x84(i1,my_i1,1)
2530 call ufbget(my_lunit,tab,my_i1,iret,str)
2531 call x48(iret,iret,1)
2541 call status(lunit,lun,il,im)
2542 if(il==0)
call bort(
'BUFRLIB: UFBGET - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
2543 if(il>0)
call bort(
'BUFRLIB: UFBGET - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
2544 if(im==0)
call bort(
'BUFRLIB: UFBGET - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
2555 call string(str,lun,i1,0)
2567 if(node==nods(nnod))
then
2570 elseif(
itp(node)==1)
then
2584 if(
itp(node)==1)
then
2586 elseif(
itp(node)==2)
then
2587 if(ival<2_8**(
ibt(node))-1) tab(i) =
ups(ival,node)
2588 elseif(
itp(node)==3)
then
2591 call upc(cval,
nbit(invn)/8,
mbay(1,lun),kbit,.true.)
subroutine bort(str)
Log an error message, then abort the application program.
subroutine bort2(str1, str2)
Log two error messages, then abort the application program.
subroutine upb(nval, nbits, ibay, ibit)
Decode an integer value from within a specified number of bits of an integer array,...
subroutine upbb(nval, nbits, ibit, ibay)
Decode an integer value from within a specified number of bits of an integer array,...
subroutine upb8(nval, nbits, ibit, ibay)
Decode an 8-byte integer value from within a specified number of bits of an integer array,...
real *8 function ups(ival, node)
Unpack a real*8 value from an integer by applying the proper scale and reference values.
subroutine upc(chr, nchr, ibay, ibit, cnvnull)
Decode a character string from within a specified number of bytes of an integer array,...
subroutine pkc(chr, nchr, ibay, ibit)
Encode a character string within a specified number of bytes of an integer array, starting at the bit...
recursive subroutine ipkm(cbay, nbyt, n)
Encode an integer value within a specified number of bytes of a character string, up to a maximum of ...
subroutine errwrt(str)
Specify a custom location for the logging of error and diagnostic messages generated by the NCEPLIBS-...
subroutine fstag(lun, utag, nutag, nin, nout, iret)
Search for a specified occurrence of a specified mnemonic within a data subset definition,...
subroutine drstpl(inod, lun, inv1, inv2, invn)
Search for a specified mnemonic within unexpanded sequences of the internal jump/link table.
integer function nvnwin(node, lun, inv1, inv2, invn, nmax)
Search for all occurrences of a specified node within a specified portion of the current data subset.
integer function invtag(node, lun, inv1, inv2)
Search for a specified mnemonic within a specified portion of the current data subset.
subroutine nxtwin(lun, iwin, jwin)
Compute the start and end indices of the next window.
subroutine newwin(lun, iwin, jwin)
Compute the ending index of the window.
integer function invwin(node, lun, inv1, inv2)
Search for a specified node within a specified portion of the current data subset.
subroutine conwin(lun, inc1, inc2)
Search consecutive subset buffer segments for a conditional node.
subroutine getwin(node, lun, iwin, jwin)
Look for a window containing a specified node within the internal jump/link table.
subroutine strsuc(str1, str2, lens)
Remove leading and trailing blanks from a character string.
Declare arrays and variables used to store BUFR messages internally for multiple file IDs.
integer ibit
Bit pointer within ibay.
integer, dimension(:,:), allocatable mbay
Current BUFR message for each file ID.
integer, dimension(:), allocatable mbyt
Length (in bytes) of current BUFR message for each file ID.
Declare arrays and variables needed for the storage of data values needed when writing compressed dat...
integer ncol
Number of data subsets in message.
character *(:), dimension(:,:), allocatable catx
Character data values for all data subsets in message.
integer *8, dimension(:,:), allocatable matx
Non-character data values for all data subsets in message.
Declare arrays and variables needed to store long character strings (greater than 8 bytes) via subrou...
integer nh4wlc
Number of long character strings being stored.
character *14, dimension(:), allocatable sth4wlc
Table B mnemonics associated with long character strings.
integer, dimension(:), allocatable luh4wlc
File ID for associated output file.
character *120, dimension(:), allocatable chh4wlc
Long character strings.
Declare arrays used to store information about the current BUFR message that is in the process of bei...
integer, dimension(:), allocatable inode
Table A mnemonic for type of BUFR message.
integer, dimension(:), allocatable msub
Total number of data subsets in message.
integer, dimension(:), allocatable nsub
Current subset pointer within message.
Declare arrays and variables needed to store information about long character strings (greater than 8...
integer nrst
Number of long character strings in data subset.
integer, dimension(:), allocatable irnch
Lengths (in bytes) of long character strings.
integer, dimension(:), allocatable irbit
Pointers in data subset to first bits of long character strings.
character *10, dimension(:), allocatable crtag
Table B mnemonics associated with long character strings.
Declare arrays and variables used to store the internal jump/link table.
integer, dimension(:), allocatable isc
Scale factors corresponding to tag and typ:
integer, dimension(:), allocatable ibt
Bit widths corresponding to tag and typ:
character *3, dimension(:), allocatable typ
Type indicators corresponding to tag:
integer, dimension(:), allocatable jmpb
Jump backward indices corresponding to tag and typ:
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
integer, dimension(:), allocatable itp
Integer type values corresponding to typ:
integer, dimension(:), allocatable link
Link indices corresponding to tag, typ and jmpb:
Declare an array used to store, for each file ID from which a BUFR message is currently being read as...
integer, dimension(:), allocatable msgunp
Flag indicating how to unpack data subsets from BUFR message:
Declare arrays for internal storage of pointers to BUFR data subset values.
integer, dimension(:), allocatable nbit
Length (in bits) of each packed data value in data subset.
integer, dimension(:), allocatable mbit
Pointer in data subset to first bit of each packed data value.
Declare arrays used to store data values and associated metadata for the current BUFR data subset in ...
integer, dimension(:), allocatable nval
Number of data values in BUFR data subset.
real *8, dimension(:,:), allocatable, target val
Data values.
integer, dimension(:,:), allocatable, target inv
Inventory pointer which links each data value to its corresponding node in the internal jump/link tab...
recursive subroutine closbf(lunit)
Close the connection between logical unit lunit and the NCEPLIBS-bufr software.
subroutine rewnbf(lunit, isr)
Store or restore parameters associated with a BUFR file.
recursive subroutine openbf(lunit, io, lundx)
Connect a new file to the NCEPLIBS-bufr software for input or output operations, or initialize the li...
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 readmg(lunxx, subset, jdate, iret)
Read the next BUFR message from logical unit abs(lunxx) into internal arrays.
recursive subroutine getlens(mbay, ll, len0, len1, len2, len3, len4, len5)
Read the section lengths of a BUFR message, up to a specified point in the message.
subroutine usrtpl(lun, invn, nbmp)
Expand a subset template within internal arrays.
recursive subroutine readsb(lunit, iret)
Read the next data subset from a BUFR message.
recursive real *8 function getvalnb(lunit, tagpv, ntagpv, tagnb, ntagnb)
Read a data value corresponding to a specific occurrence of a mnemonic within a data subset,...
recursive subroutine ufbinx(lunit, imsg, isub, usr, i1, i2, iret, str)
Read one or more data values from a specified data subset.
subroutine ufbrp(lun, usr, i1, i2, io, iret)
Write or read specified data values to or from the current BUFR data subset within internal arrays,...
recursive subroutine ufbseq(lunin, usr, i1, i2, iret, str)
Read or write an entire sequence of data values from or to a data subset.
subroutine ufbrw(lun, usr, i1, i2, io, iret)
Write or read specified values to or from the current BUFR data subset within internal arrays,...
recursive subroutine hold4wlc(lunit, chr, str)
Write a long character string (greater than 8 bytes) to a data subset.
recursive subroutine ufbovr(lunit, usr, i1, i2, iret, str)
Overwrite one or more data values within a data subset.
recursive subroutine ufbint(lunin, usr, i1, i2, iret, str)
Read or write one or more data values from or to a data subset.
subroutine ufbsp(lun, usr, i1, i2, io, iret)
Write or read specified values to or from the current BUFR data subset within internal arrays,...
subroutine trybump(lun, usr, i1, i2, io, iret)
Try to expand a delayed replication sequence.
recursive subroutine drfini(lunit, mdrf, ndrf, drftag)
Explicitly initialize delayed replication factors and allocate a corresponding amount of space within...
recursive subroutine ufbstp(lunin, usr, i1, i2, iret, str)
Read or write one or more data values from or to a data subset.
recursive subroutine readlc(lunit, chr, str)
Read a long character string (greater than 8 bytes) from a data subset.
recursive subroutine setvalnb(lunit, tagpv, ntagpv, tagnb, ntagnb, r8val, iret)
Write a data value corresponding to a specific occurrence of a mnemonic within a data subset,...
recursive subroutine ufbevn(lunit, usr, i1, i2, i3, iret, str)
Read one or more data values from an NCEP prepbufr file.
recursive subroutine writlc(lunit, chr, str)
Write a long character string (greater than 8 bytes) to a data subset.
recursive subroutine ufbget(lunit, tab, i1, iret, str)
Read one or more data values from a data subset without advancing the subset pointer.
recursive subroutine ufbrep(lunin, usr, i1, i2, iret, str)
Read or write one or more data values from or to a data subset.
recursive integer function iupbs3(mbay, s3mnem)
Read a specified value from within Section 3 of a BUFR message.
subroutine parstr(str, tags, mtag, ntag, sep, limit80)
Parse a string containing one or more substrings into an array of substrings.
subroutine parutg(lun, io, utg, nod, kon, val)
Parse a mnemonic from a character string.
subroutine string(str, lun, i1, io)
Check whether a string is in the internal mnemonic string cache.
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.