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
205 recursive subroutine writlc(lunit,chr,str)
207 use modv_vars,
only: im8b, mxlcc, iprt
217 integer,
intent(in) :: lunit
218 integer my_lunit, maxtg, lun, il, im, ntg, nnod, kon, ii, n, node, ioid, ival, mbit, nbit, nbmp, nchr, nbyt, nsubs, &
219 itagct, len0, len1, len2, len3, l4, l5, mbyte,
iupbs3
221 character*(*),
intent(in) :: chr, str
222 character*128 bort_str, errstr
233 call x84(lunit,my_lunit,1)
234 call writlc(my_lunit,chr,str)
240 call status(lunit,lun,il,im)
241 if(il==0)
call bort(
'BUFRLIB: WRITLC - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
242 if(il<0)
call bort(
'BUFRLIB: WRITLC - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
243 if(im==0)
call bort(
'BUFRLIB: WRITLC - A MESSAGE MUST BE OPEN IN OUTPUT BUFR FILE, NONE ARE')
246 call parstr(str,tgs,maxtg,ntg,
' ',.true.)
248 write(bort_str,
'("BUFRLIB: WRITLC - THERE CANNOT BE MORE THAN '// &
249 ' ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE",I4,")")') str,ntg
254 call parutg(lun,1,tgs(1),nnod,kon,roid)
260 do while((ii<=10).and.(tgs(1)(ii:ii)/=
'#'))
261 ctag(ii:ii)=tgs(1)(ii:ii)
274 do while (n+1<=
nval(lun))
277 if(
itp(node)==1)
then
280 elseif(ctag==
tag(node))
then
282 if(itagct==ioid)
then
283 if(
itp(node)/=3)
then
284 write(bort_str,
'("BUFRLIB: WRITLC - MNEMONIC ",A," DOES NOT REPRESENT A CHARACTER ELEMENT (TYP=",A,")")') &
291 nchr=min(mxlcc,len(chr),
ibt(node)/8)
300 call getlens(
mbay(1,lun),3,len0,len1,len2,len3,l4,l5)
301 mbyte = len0 + len1 + len2 + len3 + 4
304 do while(nsubs<
nsub(lun))
310 if(nsubs/=
nsub(lun))
then
312 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
313 errstr =
'BUFRLIB: WRITLC - COULDN''T WRITE VALUE FOR ' // ctag // &
314 ' INTO SUBSET, BECAUSE NO SUBSET WAS OPEN FOR WRITING'
316 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
327 do while (n+1<=
nval(lun))
332 if(
itp(node)==1)
then
333 call upbb(ival,nbit,mbit,
mbay(1,lun))
335 elseif(ctag==
tag(node))
then
337 if(itagct==ioid)
then
338 if(
itp(node)/=3)
then
339 write(bort_str,
'("BUFRLIB: WRITLC - MNEMONIC ",A," DOES NOT REPRESENT A CHARACTER ELEMENT (TYP=",A,")")') &
348 call pkc(chr,nchr,
mbay(1,lun),mbit)
358 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
359 errstr =
'BUFRLIB: WRITLC - COULDN''T WRITE VALUE FOR ' // ctag //
' INTO SUBSET, BECAUSE IT WASN''T FOUND IN THE ' // &
362 errstr =
'(' // ctag //
' MAY NOT BE IN THE BUFR TABLE(?))'
364 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
410 recursive subroutine readlc(lunit,chr,str)
412 use modv_vars,
only: im8b, iprt
423 integer,
intent(in) :: lunit
424 integer my_lunit, maxtg, lchr, lun, il, im, ntg, nnod, kon, ii, n, nod, ioid, itagct, nchr, kbit
426 character*(*),
intent(in) :: str
427 character*(*),
intent(out) :: chr
429 character*128 bort_str, errstr
440 call x84(lunit,my_lunit,1)
441 call readlc(my_lunit,chr,str)
450 call status(lunit,lun,il,im)
451 if(il==0)
call bort(
'BUFRLIB: READLC - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
452 if(il>0)
call bort(
'BUFRLIB: READLC - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
453 if(im==0)
call bort(
'BUFRLIB: READLC - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
456 call parstr(str,tgs,maxtg,ntg,
' ',.true.)
458 write(bort_str,
'("BUFRLIB: READLC - THERE CANNOT BE MORE THAN '// &
459 'ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE ",I3,")")') str,ntg
465 call parutg(lun,0,tgs(1),nnod,kon,roid)
471 do while((ii<=10).and.(tgs(1)(ii:ii)/=
'#'))
472 ctag(ii:ii)=tgs(1)(ii:ii)
486 if(ctag==
tag(nod))
then
488 if(itagct==ioid)
then
490 write(bort_str,
'("BUFRLIB: READLC - MNEMONIC ",A," DOES NOT '// &
491 'REPRESENT A CHARACTER ELEMENT (ITP=",I2,")")') tgs(1),
itp(nod)
496 write(bort_str,
'("BUFRLIB: READLC - MNEMONIC ",A," IS A '// &
497 'CHARACTER STRING OF LENGTH",I4," BUT SPACE WAS PROVIDED FOR ONLY",I4, " CHARACTERS")') tgs(1),nchr,lchr
501 call upc(chr,nchr,
mbay(1,lun),kbit,.true.)
511 if(ctag==
crtag(ii))
then
513 if(itagct==ioid)
then
516 write(bort_str,
'("BUFRLIB: READLC - MNEMONIC ",A," IS A '// &
517 'CHARACTER STRING OF LENGTH",I4," BUT SPACE WAS PROVIDED FOR ONLY",I4, " CHARACTERS")') tgs(1),nchr,lchr
521 call upc(chr,nchr,
mbay(1,lun),kbit,.true.)
531 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
532 errstr =
'BUFRLIB: READLC - MNEMONIC ' // tgs(1) // &
533 ' NOT LOCATED IN REPORT SUBSET - RETURN WITH MISSING STRING FOR CHARACTER DATA ELEMENT'
535 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
539 call ipkm(chr(ii:ii),1,255)
647 recursive subroutine ufbint(lunin,usr,i1,i2,iret,str)
651 use modv_vars,
only: im8b, bmiss, iprt
659 character*(*),
intent(in) :: str
660 character*128 bort_str1, bort_str2, errstr
663 integer,
intent(in) :: lunin, i1, i2
664 integer,
intent(out) :: iret
665 integer nnod, ncon, nods, nodc, ivls, kons, ifirst1, ifirst2, my_lunin, my_i1, my_i2, lunit, lun, il, im, io, lcstr
667 real*8,
intent(inout) :: usr(i1,i2)
669 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
671 data ifirst1 /0/, ifirst2 /0/
673 save ifirst1, ifirst2
678 call x84(lunin,my_lunin,1)
681 call ufbint(my_lunin,usr,my_i1,my_i2,iret,str)
682 call x48(iret,iret,1)
692 call strsuc(str,cstr,lcstr)
702 call status(lunit,lun,il,im)
703 if(il==0)
call bort(
'BUFRLIB: UFBINT - BUFR FILE IS CLOSED, IT MUST BE OPEN')
704 if(im==0)
call bort(
'BUFRLIB: UFBINT - A MESSAGE MUST BE OPEN IN BUFR FILE, NONE ARE')
705 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBINT - LOCATION OF INTERNAL TABLE FOR BUFR FILE DOES NOT AGREE ' // &
706 'WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
708 io = min(max(0,il),1)
709 if(lunit/=lunin) io = 0
713 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
714 errstr = .LE.
'BUFRLIB: UFBINT - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
717 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
722 if(iprt==-1) ifirst1 = 1
723 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
724 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
725 errstr = .LE.
'BUFRLIB: UFBINT - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
728 if(iprt==0 .and. io==1)
then
729 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
732 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
736 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
744 call string(str,lun,i1,io)
747 if(io==0) usr(1:i1,1:i2) = bmiss
750 call ufbrw(lun,usr,i1,i2,io,iret)
753 if(io==1 .and. iret/=i2 .and. iret>=0)
then
754 call trybump(lun,usr,i1,i2,io,iret)
756 write(bort_str1,
'("BUFRLIB: UFBINT - MNEMONIC STRING READ IN IS: ",A)') str
757 write(bort_str2,
'(18X,"THE NUMBER OF ''LEVELS'' ACTUALLY '// &
758 'WRITTEN (",I3,") DOES NOT EQUAL THE NUMBER REQUESTED (",I3,") - INCOMPLETE WRITE")') iret,i2
759 call bort2(bort_str1,bort_str2)
761 elseif(iret==-1)
then
768 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
769 errstr =
'BUFRLIB: UFBINT - NO SPECIFIED VALUES READ IN, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
772 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
776 if(iprt==-1) ifirst2 = 1
777 if(ifirst2==0 .or. iprt>=1)
then
778 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
779 errstr =
'BUFRLIB: UFBINT - NO SPECIFIED VALUES WRITTEN OUT, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
782 call errwrt(
'MAY NOT BE IN THE BUFR TABLE(?)')
784 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
787 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call ' // &
788 'to a BUFRLIB routine.'
791 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
895 recursive subroutine ufbrep(lunin,usr,i1,i2,iret,str)
897 use modv_vars,
only: im8b, bmiss, iac, iprt
904 character*(*),
intent(in) :: str
905 character*128 bort_str1, bort_str2, errstr
907 integer,
intent(in) :: lunin, i1, i2
908 integer,
intent(out) :: iret
909 integer ifirst1, my_lunin, my_i1, my_i2, lunit, lun, il, im, io, iac_prev
911 real*8,
intent(inout) :: usr(i1,i2)
920 call x84(lunin,my_lunin,1)
923 call ufbrep(my_lunin,usr,my_i1,my_i2,iret,str)
924 call x48(iret,iret,1)
933 call status(lunit,lun,il,im)
934 if(il==0)
call bort(
'BUFRLIB: UFBREP - BUFR FILE IS CLOSED, IT MUST BE OPEN')
935 if(im==0)
call bort(
'BUFRLIB: UFBREP - A MESSAGE MUST BE OPEN IN BUFR FILE, NONE ARE')
936 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBREP - LOCATION OF INTERNAL TABLE FOR BUFR FILE DOES NOT AGREE ' // &
937 'WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
939 io = min(max(0,il),1)
940 if(lunit/=lunin) io = 0
944 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
945 errstr = .LE.
'BUFRLIB: UFBREP - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
948 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
953 if(iprt==-1) ifirst1 = 1
954 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
955 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
956 errstr = .LE.
'BUFRLIB: UFBREP - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
959 if(iprt==0 .and. io==1)
then
960 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
963 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
967 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
975 if(io==0) usr(1:i1,1:i2) = bmiss
980 call string(str,lun,i1,io)
984 call ufbrp(lun,usr,i1,i2,io,iret)
986 if(io==1 .and. iret<i2)
then
987 write(bort_str1,
'("BUFRLIB: UFBREP - MNEMONIC STRING READ IN IS: ",A)') str
988 write(bort_str2,
'(18X,"THE NUMBER OF ''LEVELS'' ACTUALLY '// &
989 'WRITTEN (",I3,") LESS THAN THE NUMBER REQUESTED (",I3,") - INCOMPLETE WRITE")') iret,i2
990 call bort2(bort_str1,bort_str2)
993 if(iret==0 .and. io==0 .and. iprt>=1)
then
994 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
995 errstr =
'BUFRLIB: UFBREP - NO SPECIFIED VALUES READ IN, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
998 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1100 recursive subroutine ufbstp(lunin,usr,i1,i2,iret,str)
1102 use modv_vars,
only: im8b, bmiss, iprt
1109 character*(*),
intent(in) :: str
1110 character*128 bort_str1, bort_str2, errstr
1112 integer,
intent(in) :: lunin, i1, i2
1113 integer,
intent(out) :: iret
1114 integer ifirst1, my_lunin, my_i1, my_i2, lunit, lun, il, im, io
1116 real*8,
intent(inout) :: usr(i1,i2)
1125 call x84(lunin,my_lunin,1)
1126 call x84(i1,my_i1,1)
1127 call x84(i2,my_i2,1)
1128 call ufbstp(my_lunin,usr,my_i1,my_i2,iret,str)
1129 call x48(iret,iret,1)
1138 call status(lunit,lun,il,im)
1139 if(il==0)
call bort(
'BUFRLIB: UFBSTP - BUFR FILE IS CLOSED, IT MUST BE OPEN')
1140 if(im==0)
call bort(
'BUFRLIB: UFBSTP - A MESSAGE MUST BE OPEN IN BUFR FILE, NONE ARE')
1141 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBSTP - LOCATION OF INTERNAL TABLE FOR BUFR FILE DOES NOT AGREE ' // &
1142 'WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
1144 io = min(max(0,il),1)
1145 if(lunit/=lunin) io = 0
1149 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1150 errstr = .LE.
'BUFRLIB: UFBSTP - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1153 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1158 if(iprt==-1) ifirst1 = 1
1159 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
1160 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1161 errstr = .LE.
'BUFRLIB: UFBSTP - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1164 if(iprt==0 .and. io==1)
then
1165 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
1166 'all such messages,'
1168 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
1172 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1180 if(io==0) usr(1:i1,1:i2) = bmiss
1183 call string(str,lun,i1,io)
1186 call ufbsp(lun,usr,i1,i2,io,iret)
1188 if(io==1 .and. iret/=i2)
then
1189 write(bort_str1,
'("BUFRLIB: UFBSTP - MNEMONIC STRING READ IN IS: ",A)') str
1190 write(bort_str2,
'(18X,"THE NUMBER OF ''LEVELS'' ACTUALLY '// &
1191 'WRITTEN (",I3,") DOES NOT EQUAL THE NUMBER REQUESTED (",I3,") - INCOMPLETE WRITE")') iret,i2
1192 call bort2(bort_str1,bort_str2)
1195 if(iret==0 .and. io==0 .and. iprt>=1)
then
1196 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1197 errstr =
'BUFRLIB: UFBSTP - NO SPECIFIED VALUES READ IN, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1200 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1313 recursive subroutine ufbseq(lunin,usr,i1,i2,iret,str)
1315 use modv_vars,
only: im8b, bmiss, iprt
1323 integer,
intent(in) :: lunin, i1, i2
1324 integer,
intent(out) :: iret
1325 integer,
parameter :: mtag = 10
1326 integer ifirst1, ifirst2, my_lunin, my_i1, my_i2, lunit, lun, il, im, io, i, j, ntag, node, nods, ins1, ins2, insx, &
1329 real*8,
intent(inout) :: usr(i1,i2)
1331 character*(*),
intent(in) :: str
1332 character*156 bort_str
1333 character*128 errstr
1334 character*10 tags(mtag)
1336 data ifirst1 /0/, ifirst2 /0/
1338 save ifirst1, ifirst2
1343 call x84(lunin,my_lunin,1)
1344 call x84(i1,my_i1,1)
1345 call x84(i2,my_i2,1)
1346 call ufbseq(my_lunin,usr,my_i1,my_i2,iret,str)
1347 call x48(iret,iret,1)
1356 call status(lunit,lun,il,im)
1357 if(il==0)
call bort(
'BUFRLIB: UFBSEQ - BUFR FILE IS CLOSED, IT MUST BE OPEN')
1358 if(im==0)
call bort(
'BUFRLIB: UFBSEQ - A MESSAGE MUST BE OPEN IN BUFR FILE, NONE ARE')
1360 io = min(max(0,il),1)
1361 if(lunit/=lunin) io = 0
1365 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1366 errstr = .LE.
'BUFRLIB: UFBSEQ - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1369 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1374 if(iprt==-1) ifirst1 = 1
1375 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
1376 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1377 errstr = .LE.
'BUFRLIB: UFBSEQ - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1380 if(iprt==0 .and. io==1)
then
1381 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
1382 'all such messages,'
1384 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
1388 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1396 call parstr(str,tags,mtag,ntag,
' ',.true.)
1398 write(bort_str,
'("BUFRLIB: UFBSEQ - THE INPUT STRING (",A,") DOES NOT CONTAIN ANY MNEMONICS!!")') str
1402 write(bort_str,
'("BUFRLIB: UFBSEQ - THERE CANNOT BE MORE THAN '// &
1403 'ONE MNEMONIC IN THE INPUT STRING (",A,") (HERE THERE ARE ",I3,")")') str,ntag
1406 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBSEQ - LOCATION OF INTERNAL TABLE FOR '// &
1407 'BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
1410 if(io==0) usr(1:i1,1:i2) = bmiss
1414 if(str==
tag(node))
then
1415 if(
typ(node)==
'SEQ' .or.
typ(node)==
'RPC')
then
1419 if(ins1==0)
exit outer
1420 if(
typ(node)/=
'RPC' .or.
val(ins1,lun)/=0.)
exit
1424 if(ins2==0) ins2 = 10e5
1426 do while(
link(nods)==0 .and.
jmpb(nods)>0)
1429 if(
link(nods)==0)
then
1431 elseif(
link(nods)>0)
then
1434 ins2 = min(ins2,insx)
1435 elseif(
typ(node)==
'SUB')
then
1439 write(bort_str,
'("BUFRLIB: UFBSEQ - INPUT MNEMONIC ",A," MUST '// &
1440 'BE A SEQUENCE (HERE IT IS TYPE """,A,""")")') tags(1),
typ(node)
1446 if(ityp>1) nseq = nseq+1
1449 write(bort_str,.GT.
'("BUFRLIB: UFBSEQ - INPUT SEQ. MNEM. ",A," CONSISTS OF",I4," TABLE B MNEM., THE MAX. '// &
1450 'SPECIFIED IN (INPUT) ARGUMENT 3 (",I3,")")') tags(1),nseq,i1
1454 inner:
do while (.true.)
1456 if(ins1>
nval(lun))
exit outer
1458 if(
typ(node)==
'RPC' .and.
val(ins1,lun)==0.)
then
1461 elseif(io==0 .and. iret+1>i2)
then
1463 call errwrt(
'++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++')
1464 write ( unit=errstr, fmt=
'(A,I5,A,A,A)' )
'BUFRLIB: UFBSEQ - INCOMPLETE READ; ONLY THE FIRST ', i2, &
1465 ' (=4TH INPUT ARG.) ''LEVELS'' OF INPUT MNEMONIC ', tags(1),
' WERE READ'
1467 call errwrt(
'++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++')
1472 elseif(ins1==0)
then
1473 if(io==1 .and. iret<i2)
then
1474 write(bort_str,
'("BUFRLIB: UFBSEQ - NO. OF ''LEVELS'.LT.
' WRITTEN (",I5,") NO. REQUESTED (",I5,") - '// &
1475 'INCOMPLETE WRITE (INPUT MNEMONIC IS ",A,")")') iret,i2,tags(1)
1479 write(bort_str,.GE.
'("BUFRLIB: UFBSEQ - VARIABLE INS1 MUST BE ZERO, HERE IT IS",I4," - INPUT MNEMONIC '// &
1480 'IS ",A)') ins1,tags(1)
1483 if(ins1==0 .or. iret==i2)
exit outer
1489 do while(
itp(
inv(j,lun))<2)
1492 if(io==0) usr(i,iret) =
val(j,lun)
1493 if(io==1)
val(j,lun) = usr(i,iret)
1503 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1504 errstr =
'BUFRLIB: UFBSEQ - NO SPECIFIED VALUES READ IN, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1507 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1511 if(iprt==-1) ifirst2 = 1
1512 if(ifirst2==0 .or. iprt>=1)
then
1513 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1514 errstr =
'BUFRLIB: UFBSEQ - NO SPECIFIED VALUES WRITTEN OUT, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
1517 call errwrt(
'MAY NOT BE IN THE BUFR TABLE(?)')
1519 errstr =
'Note: Only the first occurrence of this WARNING message is printed, there may be more. To output ' // &
1520 'all such messages,'
1522 errstr =
'modify your application program to add "CALL OPENBF(0,''QUIET'',1)" prior to the first call to a ' // &
1526 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1573 recursive subroutine drfini(lunit,mdrf,ndrf,drftag)
1575 use modv_vars,
only: im8b
1582 character*(*),
intent(in) :: drftag
1584 integer,
intent(in) :: mdrf(*), lunit, ndrf
1585 integer,
parameter :: mxdrf = 2000
1586 integer my_mdrf(mxdrf), my_lunit, my_ndrf, lun, il, im, m, n, node
1591 call x84(lunit,my_lunit,1)
1592 call x84(ndrf,my_ndrf,1)
1593 call x84(mdrf(1),my_mdrf(1),my_ndrf)
1594 call drfini(my_lunit,my_mdrf,my_ndrf,drftag)
1599 call status(lunit,lun,il,im)
1603 do while ( n <=
nval(lun) )
1605 if(
itp(node)==1 .and.
tag(node)==drftag)
then
1607 call usrtpl(lun,n,mdrf(m))
1640 use modv_vars,
only: bmiss, iprt
1648 integer,
intent(in) :: lun, i1, i2, io
1649 integer,
intent(out) :: iret
1650 integer nnod, ncon, nods, nodc, ivls, kons, inc1, inc2, ins1, ins2, invn, i, j, invwin, ibfms, lstjpb
1652 real*8,
intent(inout) :: usr(i1,i2)
1654 character*128 errstr
1655 character*10 tagstr, subset
1657 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
1665 outer:
do while (.true.)
1666 call conwin(lun,inc1,inc2)
1670 elseif(inc1==0)
then
1676 call getwin(nods(j),lun,ins1,ins2)
1682 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1683 call errwrt(
'UFBRW LEV TAG IO INS1 INVN INS2 '//subset)
1684 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1686 if(io==0) tagstr=
tag(nods(i))(1:8)//
' R'
1687 if(io==1) tagstr=
tag(nods(i))(1:8)//
' W'
1688 invn = invwin(nods(i),lun,ins1,ins2)
1689 if(invn==0.and.io==1)
call drstpl(nods(i),lun,ins1,ins2,invn)
1690 write(errstr,
'("LEV=",I5,1X,A,3I7)') iret,tagstr,ins1,invn,ins2
1695 if(io==1 .and. iret<=i2)
then
1698 if(ibfms(usr(i,iret))==0)
then
1699 invn = invwin(nods(i),lun,ins1,ins2)
1701 call drstpl(nods(i),lun,ins1,ins2,invn)
1706 call newwin(lun,inc1,inc2)
1707 val(invn,lun) = usr(i,iret)
1708 elseif(lstjpb(nods(i),lun,
'RPS')==0)
then
1709 val(invn,lun) = usr(i,iret)
1710 elseif(ibfms(
val(invn,lun))/=0)
then
1711 val(invn,lun) = usr(i,iret)
1713 call drstpl(nods(i),lun,ins1,ins2,invn)
1718 call newwin(lun,inc1,inc2)
1719 val(invn,lun) = usr(i,iret)
1726 if(io==0 .and. iret<=i2)
then
1730 invn = invwin(nods(i),lun,ins1,ins2)
1731 if(invn>0) usr(i,iret) =
val(invn,lun)
1736 if(io==1.and.iret==i2)
return
1737 call nxtwin(lun,ins1,ins2)
1738 if(ins1>0 .and. ins1<inc2) cycle
1739 if(ncon>0) cycle outer
1750 end subroutine ufbrw
1781 integer,
intent(in) :: lun, i1, i2, io
1782 integer,
intent(out) :: iret
1783 integer nnod, ncon, nods, nodc, ivls, kons, ins1, ins2, invn, i, nz, invtag
1785 real*8,
intent(inout) :: usr(i1,i2)
1787 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
1798 if(ins1+1>
nval(lun))
return
1799 if(io==1 .and. iret==i2)
return
1800 ins1 = invtag(nods(nz),lun,ins1+1,
nval(lun))
1802 ins2 = invtag(nods(nz),lun,ins1+1,
nval(lun))
1803 if(ins2==0) ins2 =
nval(lun)
1806 if(io==0 .and. iret<=i2)
then
1809 invn = invtag(nods(i),lun,ins1,ins2)
1810 if(invn>0) usr(i,iret) =
val(invn,lun)
1815 if(io==1 .and. iret<=i2)
then
1818 invn = invtag(nods(i),lun,ins1,ins2)
1819 if(invn>0)
val(invn,lun) = usr(i,iret)
1828 end subroutine ufbrp
1865 integer,
intent(in) :: lun, i1, i2, io
1866 integer,
intent(out) :: iret
1867 integer nnod, ncon, nods, nodc, ivls, kons, ins1, ins2, invn, invm, i, invtag
1869 real*8,
intent(inout) :: usr(i1,i2)
1871 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
1879 if(ins1+1>
nval(lun))
return
1880 ins1 = invtag(nods(1),lun,ins1+1,
nval(lun))
1882 ins2 = invtag(nods(1),lun,ins1+1,
nval(lun))
1883 if(ins2==0) ins2 =
nval(lun)
1886 if(io==0 .and. iret<=i2)
then
1890 invn = invtag(nods(i),lun,invm,ins2)
1891 if(invn>0) usr(i,iret) =
val(invn,lun)
1892 invm = max(invn,invm)
1897 if(io==1 .and. iret<=i2)
then
1901 invn = invtag(nods(i),lun,invm,ins2)
1902 if(invn>0)
val(invn,lun) = usr(i,iret)
1903 invm = max(invn,invm)
1910 end subroutine ufbsp
1962 use modv_vars,
only: im8b, mxh4wlc, iprt
1968 integer,
intent(in) :: lunit
1969 integer my_lunit, lens, lenc, i
1971 character*(*),
intent(in) :: chr, str
1973 character*128 errstr
1979 call x84(lunit,my_lunit,1)
1985 call strsuc( str, mystr, lens )
1986 if ( lens == -1 )
return
1988 lenc = min( len( chr ), 120 )
1994 if ( ( lunit ==
luh4wlc(i) ) .and. ( mystr(1:lens) ==
sth4wlc(i)(1:lens) ) )
then
1996 chh4wlc(i)(1:lenc) = chr(1:lenc)
2003 if (
nh4wlc >= mxh4wlc )
then
2005 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2006 write ( unit=errstr, fmt=
'(A,A,I3)' )
'BUFRLIB: HOLD4WLC - THE MAXIMUM NUMBER OF LONG CHARACTER ', &
2007 'STRINGS THAT CAN BE HELD INTERNALLY IS ', mxh4wlc
2009 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2055 integer,
intent(in) :: lun, i1, i2, io
2056 integer,
intent(out) :: iret
2057 integer nnod, ncon, nods, nodc, ivls, kons, ndrp, invn, jnvn, knvn, invwin, lstjpb
2059 real*8,
intent(inout) :: usr(i1,i2)
2061 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
2065 ndrp = lstjpb(nods(1),lun,
'DRP')
2070 invn = invwin(ndrp,lun,1,
nval(lun))
2073 do while(nint(
val(jnvn,lun))>0)
2074 jnvn = jnvn+nint(
val(jnvn,lun))
2076 do knvn=1,
nval(lun)-jnvn+1
2077 inv(invn+knvn,lun) =
inv(jnvn+knvn-1,lun)
2078 val(invn+knvn,lun) =
val(jnvn+knvn-1,lun)
2080 nval(lun) =
nval(lun)-(jnvn-invn-1)
2085 call ufbrw(lun,usr,i1,i2,io,iret)
2109 recursive subroutine ufbovr(lunit,usr,i1,i2,iret,str)
2111 use modv_vars,
only: im8b, iprt
2118 integer,
intent(in) :: lunit, i1, i2
2119 integer,
intent(out) :: iret
2120 integer ifirst1, my_lunit, my_i1, my_i2, lun, il, im, io
2122 character*(*),
intent(in) :: str
2123 character*128 bort_str1, bort_str2, errstr
2125 real*8,
intent(inout) :: usr(i1,i2)
2135 call x84(lunit,my_lunit,1)
2136 call x84(i1,my_i1,1)
2137 call x84(i2,my_i2,1)
2138 call ufbovr(my_lunit,usr,my_i1,my_i2,iret,str)
2139 call x48(iret,iret,1)
2148 call status(lunit,lun,il,im)
2149 if(il==0)
call bort(
'BUFRLIB: UFBOVR - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
2150 if(il<0)
call bort(
'BUFRLIB: UFBOVR - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
2151 if(im==0)
call bort(
'BUFRLIB: UFBOVR - A MESSAGE MUST BE OPEN IN OUTPUT BUFR FILE, NONE ARE')
2152 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBOVR - LOCATION OF INTERNAL TABLE FOR '// &
2153 'OUTPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
2155 io = min(max(0,il),1)
2159 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2160 errstr = .LE.
'BUFRLIB: UFBOVR - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
2163 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2168 if(iprt==-1) ifirst1 = 1
2169 if(io==0 .or. ifirst1==0 .or. iprt>=1)
then
2170 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2171 errstr = .LE.
'BUFRLIB: UFBOVR - 4th ARG. (INPUT) IS 0, SO RETURN WITH 5th ARG. (IRET) = 0; 6th ARG. (STR) ='
2174 if(iprt==0 .and. io==1)
then
2175 errstr =
'Note: Only the first occurrence of this WARNING ' // &
2176 'message is printed, there may be more. To output all such messages,'
2178 errstr =
'modify your application program to add ' // &
2179 '"CALL OPENBF(0,''QUIET'',1)" prior to the first call to a BUFRLIB routine.'
2182 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2191 call string(str,lun,i1,io)
2192 call trybump(lun,usr,i1,i2,io,iret)
2194 if(io==1 .and. iret/=i2)
then
2195 write(bort_str1,
'("BUFRLIB: UFBOVR - MNEMONIC STRING READ IN IS: ",A)') str
2196 write(bort_str2,
'(18X,"THE NUMBER OF ''LEVELS'' ACTUALLY '// &
2197 'WRITTEN (",I3,") DOES NOT EQUAL THE NUMBER REQUESTED (",I3,") - INCOMPLETE WRITE")') iret, i2
2198 call bort2(bort_str1,bort_str2)
2241 recursive subroutine ufbevn(lunit,usr,i1,i2,i3,iret,str)
2243 use modv_vars,
only: im8b, bmiss, iprt
2250 character*(*),
intent(in) :: str
2251 character*128 errstr
2253 integer,
intent(in) :: lunit, i1, i2, i3
2254 integer,
intent(out) :: iret
2255 integer invn(255), nnod, ncon, nods, nodc, ivls, kons, maxevn, my_lunit, my_i1, my_i2, my_i3, i, j, k, lun, il, im, &
2256 ins1, ins2, inc1, inc2, nnvn,
nvnwin
2258 real*8,
intent(out) :: usr(i1,i2,i3)
2262 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
2268 call x84(lunit,my_lunit,1)
2269 call x84(i1,my_i1,1)
2270 call x84(i2,my_i2,1)
2271 call x84(i3,my_i3,1)
2272 call ufbevn(my_lunit,usr,my_i1,my_i2,my_i3,iret,str)
2273 call x48(iret,iret,1)
2283 call status(lunit,lun,il,im)
2284 if(il==0)
call bort(
'BUFRLIB: UFBEVN - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
2285 if(il>0)
call bort(
'BUFRLIB: UFBEVN - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
2286 if(im==0)
call bort(
'BUFRLIB: UFBEVN - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
2287 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBEVN - LOCATION OF INTERNAL TABLE FOR '// &
2288 'INPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
2292 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2293 errstr = .LE.
'BUFRLIB: UFBEVN - 3rd ARG. (INPUT) IS 0, SO RETURN WITH 6th ARG. (IRET) = 0; 7th ARG. (STR) ='
2296 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2302 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2303 errstr = .LE.
'BUFRLIB: UFBEVN - 4th ARG. (INPUT) IS 0, SO RETURN WITH 6th ARG. (IRET) = 0; 7th ARG. (STR) ='
2306 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2312 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2313 errstr = .LE.
'BUFRLIB: UFBEVN - 5th ARG. (INPUT) IS 0, SO RETURN WITH 6th ARG. (IRET) = 0; 7th ARG. (STR) ='
2316 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2324 call string(str,lun,i1,0)
2327 usr(1:i1,1:i2,1:i3) = bmiss
2333 outer:
do while (.true.)
2334 call conwin(lun,inc1,inc2)
2338 elseif(inc1==0)
then
2345 call getwin(nods(i),lun,ins1,ins2)
2351 if(.not.nodgt0)
then
2356 inner:
do while (.true.)
2361 nnvn =
nvnwin(nods(j),lun,ins1,ins2,invn,i3)
2362 maxevn = max(nnvn,maxevn)
2364 usr(j,iret,k) =
val(invn(k),lun)
2370 call nxtwin(lun,ins1,ins2)
2371 if(ins1<=0 .or. ins1>=inc2)
exit inner
2373 if(ncon<=0)
exit outer
2379 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2380 errstr =
'BUFRLIB: UFBEVN - NO SPECIFIED VALUES READ IN, SO RETURN WITH 6th ARG. (IRET) = 0; 7th ARG. (STR) ='
2383 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
2424 recursive subroutine ufbinx(lunit,imsg,isub,usr,i1,i2,iret,str)
2426 use modv_vars,
only: im8b
2433 integer,
intent(in) :: lunit, imsg, isub, i1, i2
2434 integer,
intent(out) :: iret
2435 integer my_lunit, my_imsg, my_isub, my_i1, my_i2, lun, il, im, jdate, jret, i
2437 character*(*),
intent(in) :: str
2438 character*128 bort_str
2441 real*8,
intent(out) :: usr(i1,i2)
2448 call x84(lunit,my_lunit,1)
2449 call x84(imsg,my_imsg,1)
2450 call x84(isub,my_isub,1)
2451 call x84(i1,my_i1,1)
2452 call x84(i2,my_i2,1)
2453 call ufbinx(my_lunit,my_imsg,my_isub,usr,my_i1,my_i2,iret,str)
2454 call x48(iret,iret,1)
2459 call status(lunit,lun,il,im)
2464 call openbf(lunit,
'INX',lunit)
2472 call readmg(lunit,subset,jdate,jret)
2474 write(bort_str,
'("BUFRLIB: UFBINX - HIT END OF FILE BEFORE '// &
2475 'READING REQUESTED MESSAGE NO.",I5," IN BUFR FILE CONNECTED TO UNIT",I4)') imsg, lunit
2484 write(bort_str,
'("BUFRLIB: UFBINX - ALL SUBSETS READ BEFORE '// &
2485 'READING REQ. SUBSET NO.",I3," IN REQ. MSG NO.",I5," IN BUFR FILE CONNECTED TO UNIT",I4)') isub, imsg, lunit
2491 call ufbint(lunit,usr,i1,i2,iret,str)
2518 recursive subroutine ufbget(lunit,tab,i1,iret,str)
2520 use modv_vars,
only: im8b, bmiss
2531 integer,
intent(in) :: lunit, i1
2532 integer,
intent(out) :: iret
2533 integer nnod, ncon, nods, nodc, ivls, kons, my_lunit, my_i1, lun, il, im, i, n, node, nbmp, kbit, invn,
invwin
2535 character*(*),
intent(in) :: str
2538 real*8,
intent(out) :: tab(i1)
2541 common /usrstr/ nnod, ncon, nods(20), nodc(10), ivls(10), kons(10)
2543 equivalence(cval,rval)
2549 call x84(lunit,my_lunit,1)
2550 call x84(i1,my_i1,1)
2551 call ufbget(my_lunit,tab,my_i1,iret,str)
2552 call x48(iret,iret,1)
2562 call status(lunit,lun,il,im)
2563 if(il==0)
call bort(
'BUFRLIB: UFBGET - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
2564 if(il>0)
call bort(
'BUFRLIB: UFBGET - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
2565 if(im==0)
call bort(
'BUFRLIB: UFBGET - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
2576 call string(str,lun,i1,0)
2588 if(node==nods(nnod))
then
2591 elseif(
itp(node)==1)
then
2605 if(
itp(node)==1)
then
2607 elseif(
itp(node)==2)
then
2608 if(ival<2_8**(
ibt(node))-1) tab(i) =
ups(ival,node)
2609 elseif(
itp(node)==3)
then
2612 call upc(cval,
nbit(invn)/8,
mbay(1,lun),kbit,.true.)
recursive subroutine bort(str)
Log an error message, then either return to or abort the application program.
recursive subroutine bort2(str1, str2)
Log two error messages, then either return to or 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.
Wrap C NCEPLIBS-bufr functions so they can be called from within the Fortran part of the library.
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 variables used to optionally catch and return any future bort error string to the application...
integer caught_str_len
Length of bort error string.
logical bort_target_is_unset
.true.
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.