31 recursive subroutine readsb(lunit,iret)
35 use modv_vars,
only: im8b
45 integer,
intent(in) :: lunit
46 integer,
intent(out) :: iret
53 call x84(lunit,my_lunit,1)
72 call status(lunit,lun,il,im)
73 if(il==0)
call bort(
'BUFRLIB: READSB - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
74 if(il>0)
call bort(
'BUFRLIB: READSB - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
96 elseif(
msgunp(lun)==1)
then
124 recursive integer function ireadsb(lunit)
result(iret)
126 use modv_vars,
only: im8b
130 integer,
intent(in) :: lunit
137 call x84(lunit,my_lunit,1)
173 recursive subroutine readns(lunit,subset,jdate,iret)
177 use modv_vars,
only: im8b, lendat
184 integer,
intent(in) :: lunit
185 integer,
intent(out) :: jdate, iret
188 character*8,
intent(out) :: subset
195 call x84(lunit,my_lunit,1)
196 call readns(my_lunit,subset,jdate,iret)
197 call x48(jdate,jdate,1)
198 call x48(iret,iret,1)
207 subset(1:8) = csubset(1:8)
214 call status(lunit,lun,il,im)
215 if(il==0)
call bort(
'BUFRLIB: READNS - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
216 if(il>0)
call bort(
'BUFRLIB: READNS - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
217 if(
inode(lun)==0)
then
223 if (lendat/=10) jdate = mod(jdate,10**8)
230 call readmg(lunit,subset,jdate,iret)
255 recursive integer function ireadns(lunit,subset,idate)
result(iret)
257 use modv_vars,
only: im8b
261 integer,
intent(in) :: lunit
262 integer,
intent(out) :: idate
265 character*8,
intent(out) :: subset
271 call x84(lunit,my_lunit,1)
272 iret=
ireadns(my_lunit,subset,idate)
273 call x48(idate,idate,1)
278 call readns(lunit,subset,idate,iret)
321 use modv_vars,
only: im8b
327 integer,
intent(in) :: lunit
334 call x84(lunit,my_lunit,1)
350 call status(lunit,lun,il,im)
351 if(il==0)
call bort(
'BUFRLIB: WRITSB - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
352 if(il<0)
call bort(
'BUFRLIB: WRITSB - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
353 if(im==0)
call bort(
'BUFRLIB: WRITSB - A MESSAGE MUST BE OPEN IN OUTPUT BUFR FILE, NONE ARE')
445 recursive subroutine writsa(lunxx,lmsgt,msgt,msgl)
449 use modv_vars,
only: im8b
456 integer,
intent(in) :: lunxx, lmsgt
457 integer,
intent(out) :: msgt(*), msgl
464 call x84(lunxx,my_lunxx,1)
465 call x84(lmsgt,my_lmsgt,1)
466 call writsa(my_lunxx, my_lmsgt*2, msgt, msgl)
468 call x48(msgl,msgl,1)
485 call status(lunit,lun,il,im)
486 if(il==0)
call bort(
'BUFRLIB: WRITSA - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
487 if(il<0)
call bort(
'BUFRLIB: WRITSA - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
488 if(im==0)
call bort(
'BUFRLIB: WRITSA - A MESSAGE MUST BE OPEN IN OUTPUT BUFR FILE, NONE ARE')
492 if(lunxx<0)
call closmg(lunit)
497 if(
msglen(lun)>lmsgt)
call bort(
'BUFRLIB: WRITSA - OVERFLOW OF OUTPUT BUFR MESSAGE ARRAY; TRY A LARGER '// &
498 'DIMENSION FOR THIS ARRAY')
528 if( (
msglen(lun)>0) .and. (msgl+
msglen(lun)<=lmsgt) )
then
530 msgt(msgl+n) =
msgtxt(n,lun)
566 recursive subroutine rdmgsb(lunit,imsg,isub)
570 use modv_vars,
only: im8b
577 integer,
intent(in) :: lunit, imsg, isub
578 integer my_lunit, my_imsg, my_isub, lun, il, im, i, jdate, iret,
bort_target_set
580 character*128 bort_str
587 call x84(lunit,my_lunit,1)
588 call x84(imsg,my_imsg,1)
589 call x84(isub,my_isub,1)
590 call rdmgsb(my_lunit,my_imsg,my_isub)
605 call openbf(lunit,
'IN',lunit)
606 call status(lunit,lun,il,im)
612 call readmg(lunit,subset,jdate,iret)
614 write(bort_str,
'("BUFRLIB: RDMGSB - HIT END OF FILE BEFORE READING REQUESTED MESSAGE NO.",I5," IN '//&
615 'BUFR FILE CONNECTED TO UNIT",I4)') imsg,lunit
625 write(bort_str,
'("BUFRLIB: RDMGSB - ALL SUBSETS READ BEFORE READING REQ. SUBSET NO.",I3," IN '// &
626 'REQ. MSG NO.",I5," IN BUFR FILE CONNECTED TO UNIT",I4)') isub,imsg,lunit
653 use modv_vars,
only: iprt, nby0, nby1, nby2, nby3
661 integer,
intent(in) :: lunit, lun
662 integer ibyt, lbyt, lbit, nbyt, ii, iupb
674 if(msgfull(
mbyt(lun),ibyt,
maxbyt) .or. ((ibyt>65530).and.(
nsub(lun)>0)))
then
689 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
690 write ( unit=errstr, fmt=
'(A,A,I7,A)')
'BUFRLIB: MSGUPD - SUBSET LONGER THAN ANY POSSIBLE MESSAGE ', &
691 '{MAXIMUM MESSAGE LENGTH = ',
maxbyt,
'}'
693 call errwrt(
'>>>>>>>OVERLARGE SUBSET DISCARDED FROM FILE<<<<<<<<')
694 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
717 lbit = (nby0+nby1+nby2+4)*8
720 lbyt = nby0+nby1+nby2+nby3
721 nbyt = iupb(
mbay(1,lun),lbyt+1,24)
723 call pkb(nbyt+ibyt,24,
mbay(1,lun),lbit)
740 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
741 write ( unit=errstr, fmt=
'(A,I7,A,A)')
'BUFRLIB: MSGUPD - SUBSET HAS BYTE COUNT = ',ibyt,
' > UPPER LIMIT OF 65535'
743 call errwrt(
'>>>>>>>WILL BE WRITTEN INTO ITS OWN MESSAGE<<<<<<<<')
744 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
787 subroutine pad(ibay,ibit,ibyt,ipadb)
791 integer,
intent(inout) :: ibay(*), ibit
792 integer,
intent(in) :: ipadb
793 integer,
intent(out) :: ibyt
796 character*128 bort_str
800 ipad = ipadb - mod(ibit+8,ipadb)
802 call pkb(ipad,8,ibay,ibit)
804 call pkb(0,ipad,ibay,ibit)
807 if(mod(ibit,8)/=0)
then
808 write(bort_str,
'("BUFRLIB: PAD - THE NUMBER OF BITS IN A PACKED'// &
809 ' SUBSET AFTER PADDING (",I8,") IS NOT A MULTIPLE OF 8")') ibit
841 recursive integer function lcmgdf(lunit,subset)
result(iret)
845 use modv_vars,
only: im8b
851 integer,
intent(in) :: lunit
852 integer my_lunit, lun, il, im, mtyp, msbt, inod, nte, i, lcs,
bort_target_set
854 character*8,
intent(in) :: subset
861 call x84(lunit,my_lunit,1)
862 iret=
lcmgdf(my_lunit,subset)
870 call strsuc(subset,csubset,lcs)
880 call status(lunit,lun,il,im)
881 if (il==0)
call bort(
'BUFRLIB: LCMGDF - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN')
885 call nemtba(lun,subset,mtyp,msbt,inod)
892 if ( (
typ(inod+i)==
'CHR') .and. (
ibt(inod+i)>64) )
then
927 recursive subroutine ufbpos(lunit,irec,isub,subset,jdate)
931 use modv_vars,
only: im8b
938 integer,
intent(in) :: lunit, irec, isub
939 integer,
intent(out) :: jdate
940 integer my_lunit, my_irec, my_isub, lun, il, im, jrec, jsub, iret,
bort_target_set
942 character*128 bort_str
944 character*8,
intent(out) :: subset
950 call x84(lunit,my_lunit,1)
951 call x84(irec,my_irec,1)
952 call x84(isub,my_isub,1)
953 call ufbpos(my_lunit,my_irec,my_isub,subset,jdate)
954 call x48(jdate,jdate,1)
963 subset(1:8) = csubset(1:8)
970 call status(lunit,lun,il,im)
971 if(il==0)
call bort(
'BUFRLIB: UFBPOS - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
972 if(il>0)
call bort(
'BUFRLIB: UFBPOS - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
975 write(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED MESSAGE NUMBER TO READ IN (",I5,") IS NOT VALID")') irec
979 write(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED SUBSET NUMBER TO READ IN (",I5,") IS NOT VALID")') isub
985 call ufbcnt(lunit,jrec,jsub)
989 if(irec<jrec .or. (irec==jrec.and.isub<jsub))
then
993 call ufbcnt(lunit,jrec,jsub)
999 call readmg(lunit,subset,jdate,iret)
1001 write(bort_str,
'("BUFRLIB: UFBPOS - REQUESTED MESSAGE NUMBER '// &
1002 'TO READ IN (",I5,") EXCEEDS THE NUMBER OF MESSAGES IN THE FILE (",I5,")")') irec, jrec
1005 call ufbcnt(lunit,jrec,jsub)
1008 do while (isub>jsub)
1011 write(bort_str,
'("BUFRLIB: UFBPOS - REQ. SUBSET NUMBER TO READ'// &
1012 ' IN (",I5,") EXCEEDS THE NUMBER OF SUBSETS (",I5,") IN THE REQ. MESSAGE (",I5,")")') isub, jsub, irec
1015 call ufbcnt(lunit,jrec,jsub)
1034 use modv_vars,
only: bmiss
1044 integer,
intent(in) :: lun
1045 integer,
intent(out) :: iret
1046 integer ier, n, node, kbit, nbt, icbfms, igetrfel
1052 equivalence(cval,rval)
1071 if(
itp(node)==1)
then
1074 elseif(
itp(node)==2)
then
1076 nrfelm(n,lun) = igetrfel(n,lun)
1077 if (
ival(n)<2_8**
ibt(node)-1)
then
1082 elseif(
itp(node)==3)
then
1088 nbt = min(8,
nbit(n)/8)
1089 call upc(cval,nbt,
mbay(1,lun),kbit,.true.)
1090 if (
nbit(n)<=64 .and. icbfms(cval,nbt)/=0)
then
1121 integer,
intent(in) :: lun
1123 integer n, node, nbit, ncr, numchr, jj, ibfms, igetrfel, imrkopr
1130 equivalence(cval,rval)
1136 nrfelm(n,lun) = igetrfel(n,lun)
1137 if(
itp(node)==1)
then
1139 elseif(
typ(node)==
'NUM')
then
1140 if( (ibfms(
val(n,lun))==1) .or. (
val(n,lun)/=
val(n,lun)) )
then
1144 ival(n) = ipks(
val(n,lun),node)
1156 if(
itp(node)<3)
then
1158 if ( imrkopr(
tag(node)) == 1 )
then
1167 if ( ncr>8 .and.
luncpy(lun)/=0 )
then
1174 if(ibfms(rval)/=0)
then
1176 numchr = min(ncr,len(lstr))
1178 call ipkm(lstr(jj:jj),1,255)
1212 use modv_vars,
only: maxjl, maxss, maxrcr, iprt
1223 character*128 bort_str
1225 integer,
intent(in) :: lun
1226 integer,
intent(out) :: iret
1227 integer nbmp(2,maxrcr), newn(2,maxrcr), knx(maxrcr), nodi, node, mbmp, nr, i, j, n, nn, n1, n2, new, ivob, igetrfel
1244 outer:
do while (.true.)
1250 write(bort_str,
'("BUFRLIB: RCSTPL - THE NUMBER OF RECURSION LEVELS EXCEEDS THE LIMIT (",I3,")")') maxrcr
1259 write(bort_str,
'("BUFRLIB: RCSTPL - UNSET EXPANSION SEGMENT ",A)')
tag(nodi)
1262 if(n2-n1+1>maxjl)
then
1264 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1265 call errwrt(
'BUFRLIB: RCSTPL - MAXJL OVERFLOW; SUBSET SKIPPED')
1266 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1272 newn(2,nr) = n2-n1+1
1284 do i=nbmp(1,nr),nbmp(2,nr)
1285 if(knx(nr)==0) knx(nr) =
nval(lun)
1286 if(i>nbmp(1,nr)) newn(1,nr) = 1
1287 do j=newn(1,nr),newn(2,nr)
1288 if(
nval(lun)+1>maxss)
then
1290 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1291 call errwrt(
'BUFRLIB: RCSTPL - MAXSS OVERFLOW; SUBSET SKIPPED')
1292 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1313 if(
itp(node)==1)
then
1320 new =
nval(lun)-knx(nr)
1321 val(knx(nr)+1,lun) =
val(knx(nr)+1,lun) + new
1327 if(nr-1 == 0)
exit outer
1348 use modv_vars,
only: maxjl, maxss, iprt
1358 integer,
intent(in) :: lun, invn, nbmp
1359 integer i, j, ival, jval, n, n1, n2, nodi, node, newn, invr, knvn
1361 character*128 bort_str, errstr
1363 logical drp, drs, drb, drx
1366 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1367 write ( unit=errstr, fmt=
'(A,I3,A,I7,A,I5,A,A10)' ) &
1368 'BUFRLIB: USRTPL - LUN:INVN:NBMP:TAG(INODE(LUN)) = ', lun,
':', invn,
':', nbmp,
':',
tag(
inode(lun))
1370 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1376 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1377 call errwrt(.LE.
'BUFRLIB: USRTPL - NBMP 0 - IMMEDIATE RETURN')
1378 call errwrt(
'+++++++++++++++++++++WARNING+++++++++++++++++++++++')
1396 write(bort_str,
'("BUFRLIB: USRTPL - THIRD ARGUMENT (INPUT) = ",'// &
1397 'I4,", MUST BE 1 WHEN SECOND ARGUMENT (INPUT) IS 1 (SUBSET NODE) (",A,")")') nbmp,
tag(nodi)
1400 elseif(invn>0 .and. invn<=
nval(lun))
then
1402 nodi =
inv(invn,lun)
1403 drp =
typ(nodi) ==
'DRP'
1404 drs =
typ(nodi) ==
'DRS'
1405 drb =
typ(nodi) ==
'DRB'
1406 drx = drp .or. drs .or. drb
1407 ival = nint(
val(invn,lun))
1408 jval = 2**
ibt(nodi)-1
1409 val(invn,lun) = ival+nbmp
1410 if(drb.and.nbmp/=1)
then
1411 write(bort_str,
'("BUFRLIB: USRTPL - THIRD ARGUMENT (INPUT) = ",'// &
1412 'I4,", MUST BE 1 WHEN NODE IS DRB (1-BIT DELAYED REPL. FACTOR) (",A,")")') nbmp,
tag(nodi)
1416 write(bort_str,
'("BUFRLIB: USRTPL - NODE IS OF TYPE ",A," - IT '// &
1417 'MUST BE EITHER A SUBSET OR DELAYED REPL. FACTOR (",A,")")')
typ(nodi),
tag(nodi)
1421 write(bort_str,
'("BUFRLIB: USRTPL - REPLICATION FACTOR IS NEGATIVE (=",I5,") (",A,")")') ival,
tag(nodi)
1424 if(ival+nbmp>jval)
then
1425 write(bort_str,
'("BUFRLIB: USRTPL - REPLICATION FACTOR OVERFLOW (EXCEEDS MAXIMUM OF",I6," (",A,")")') jval,
tag(nodi)
1431 write(bort_str,
'("BUFRLIB: USRTPL - INVENTORY INDEX {FIRST '// &
1432 'ARGUMENT (INPUT)} OUT OF BOUNDS (=",I5,", RANGE IS 1 TO",I6,") ")') invn,
nval(lun)
1443 write(bort_str,
'("BUFRLIB: USRTPL - UNSET EXPANSION SEGMENT (",A,")")')
tag(nodi)
1446 if(n2-n1+1>maxjl)
then
1447 write(bort_str,
'("BUFRLIB: USRTPL - TEMPLATE ARRAY OVERFLOW, EXCEEDS THE LIMIT (",I6,") (",A,")")') maxjl,
tag(nodi)
1459 if(
nval(lun)+newn*nbmp>maxss)
then
1460 write(bort_str,
'("BUFRLIB: USRTPL - INVENTORY OVERFLOW (",I6,"), EXCEEDS THE LIMIT (",I6,") (",A,")")') &
1461 nval(lun)+newn*nbmp, maxss,
tag(nodi)
1465 do j=
nval(lun),invn+1,-1
1466 inv(j+newn*nbmp,lun) =
inv(j,lun)
1467 val(j+newn*nbmp,lun) =
val(j,lun)
1470 if(drp.or.drs)
vtmp(1) = newn
1486 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1487 write ( unit=errstr, fmt=
'(A,A,A10,2(A,I5),A,I7)' )
'BUFRLIB: USRTPL - TAG(INV(INVN,LUN)):NEWN:NBMP:', &
1488 'NVAL(LUN) = ',
tag(
inv(invn,lun)),
':', newn,
':', nbmp,
':',
nval(lun)
1491 write ( unit=errstr, fmt=
'(2(A,I5),A,A10)' )
'For I = ', i,
', ITMP(I) = ',
itmp(i),
', TAG(ITMP(I)) = ',
tag(
itmp(i))
1494 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1501 outer:
do while (.true.)
1504 if(
itp(node)==0)
then
1506 if(
inv(invr,lun)==node)
then
1507 val(invr,lun) =
val(invr,lun)+newn*nbmp
1511 write(bort_str,
'("BUFRLIB: USRTPL - BAD BACKUP STRATEGY (",A,")")')
tag(nodi)
1539 use modv_vars,
only: im8b
1547 integer,
intent(in) :: lubfi, lubfj
1548 integer my_lubfi, my_lubfj, luni, il, im, lunj, jl, jm, is, js, node, nodj, ityp, iwrds, jwrds, &
1551 character*128 bort_str
1553 logical herei, herej, missi, missj, samei
1559 call x84(lubfi,my_lubfi,1)
1560 call x84(lubfj,my_lubfj,1)
1561 call invmrg(my_lubfi,my_lubfj)
1579 call status(lubfi,luni,il,im)
1580 call status(lubfj,lunj,jl,jm)
1584 do while(is<=
nval(luni))
1589 write(bort_str,
'("BUFRLIB: INVMRG - NODE FROM INPUT BUFR FILE '// &
1590 '(",I7,") DOES NOT EQUAL NODE FROM OUTPUT BUFR FILE (",I7,"), TABULAR MISMATCH")') node, nodj
1597 if(
typ(node)==
'DRB')
then
1602 iwrds =
nwords(is,luni)+ioff
1603 jwrds =
nwords(js,lunj)+ioff
1604 if(iwrds>ioff .and. jwrds==ioff)
then
1605 do n=
nval(lunj),js+1,-1
1606 inv(n+iwrds-jwrds,lunj) =
inv(n,lunj)
1607 val(n+iwrds-jwrds,lunj) =
val(n,lunj)
1610 inv(js+n,lunj) =
inv(is+n,luni)
1611 val(js+n,lunj) =
val(is+n,luni)
1613 nval(lunj) =
nval(lunj)+iwrds-jwrds
1619 elseif((ityp==2).or.(ityp==3))
then
1623 missi = .not.(herei)
1624 missj = .not.(herej)
1625 samei =
val(is,luni)==
val(js,lunj)
1626 if(herei.and.missj)
then
1627 val(js,lunj) =
val(is,luni)
1629 elseif(herei.and.herej.and..not.samei)
then
1658 integer,
intent(in) :: n, lun
1663 do k=1,nint(
val(n,lun))
1664 iret = iret + nint(
val(iret+n+1,lun))
subroutine strbtm(n, lun, ival)
Store internal information in module moda_bitmaps if the input element is part of a bitmap.
recursive subroutine bort(str)
Log an error message, then either return to or abort the application program.
subroutine bort_target_unset
Clear any existing bort target.
integer function bort_target_set()
Sets a new bort target, if bort catching is enabled and such a target doesn't already exist.
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 pkb(nval, nbits, ibay, ibit)
Encode an integer value within a specified number of bits of an integer array, starting at the bit im...
subroutine pkb8(nval, nbits, ibay, ibit)
Encode an 8-byte integer value within a specified number of bits of an integer array,...
subroutine rdcmps(lun)
Read the next compressed BUFR data subset into internal arrays.
subroutine wrcmps(lunix)
Write a compressed BUFR data subset.
subroutine mvb(ib1, nb1, ib2, nb2, nbm)
Copy a specified number of bytes from one packed binary array to another.
subroutine nemtba(lun, nemo, mtyp, msbt, inod)
Get information about a Table A descriptor from the internal DX BUFR tables.
subroutine errwrt(str)
Specify a custom location for the logging of error and diagnostic messages generated by the NCEPLIBS-...
subroutine strsuc(str1, str2, lens)
Remove leading and trailing blanks from a character string.
integer function ibfms(r8val)
Check whether a real*8 data value returned from a previous call to any of the NCEPLIBS-bufr values-re...
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, dimension(:), allocatable ibay
Current data subset.
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.
integer maxbyt
Maximum length of an output BUFR message.
Declare arrays and variables used to store bitmaps internally within a data subset definition.
integer lstnod
Most recent jump/link table entry that was processed by function igetrfel() and whose corresponding v...
integer nbtm
Number of stored bitmaps for the current data subset (up to a maximum of mxbtm).
integer lstnodct
Current count of consecutive occurrences of lstnod.
logical linbtm
Set to .true.
Declare arrays used to store, for each output file ID, a copy of the BUFR message that was most recen...
integer, dimension(:), allocatable msglen
Length (in integers) of BUFR message most recently written to each output file ID.
integer, dimension(:,:), allocatable msgtxt
BUFR message most recently written to each output file ID.
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 an array used to pack or unpack all of the values of a BUFR data subset.
integer *8, dimension(:), allocatable ival
BUFR data subset values.
Declare arrays which provide working space in several subprograms (usrtpl() and ufbcup()) which manip...
real *8, dimension(:), allocatable vtmp
val array elements for new sections of a growing subset buffer.
integer, dimension(:), allocatable itmp
inv array elements for new sections of a growing subset buffer.
Declare variables for use when merging parts of different data subsets.
integer nmrg
Number of merges.
integer ntot
Total number of calls to subroutine invmrg().
integer namb
Number of potential merges that weren't made because of ambiguities.
integer nrpl
Number of expansions of Table D mnemonics using short (1-bit) delayed replication.
Declare a variable used to indicate whether output BUFR messages should be compressed.
character ccmf
Flag indicating whether BUFR output messages are to be compressed; this variable is initialized to a ...
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 idate
Section 1 date-time of message.
integer, dimension(:), allocatable nmsg
Current message pointer within logical unit.
integer, dimension(:), allocatable msub
Total number of data subsets in message.
integer, dimension(:), allocatable nsub
Current subset pointer within message.
Declare an array used to store a status code for each file ID if an error or other abnormal result oc...
integer, dimension(:), allocatable iscodes
Abnormal status codes.
Declare arrays and variables used to store the internal jump/link table.
integer, dimension(:), allocatable jseq
Temporary storage used in expanding sequences.
integer, dimension(:,:), allocatable iseq
Temporary storage used in expanding sequences.
integer, dimension(:), allocatable isc
Scale factors corresponding to tag and typ:
integer, dimension(:), allocatable ibt
Bit widths corresponding to tag and typ:
real *8, dimension(:), allocatable vali
Initialized data values corresponding to 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:
Declare an array used to store, for each file ID, the logical unit number corresponding to a separate...
integer, dimension(:), allocatable luncpy
Logical unit numbers used to copy long character strings between BUFR data subsets.
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...
integer, dimension(:,:), allocatable nrfelm
Referenced data value, for data values which refer to a previous data value in the BUFR data subset v...
Declare arrays used in subroutine rcstpl() to store subset segments that are being copied from a subs...
integer, dimension(:,:), allocatable iutmp
inv array elements for new sections of a growing subset buffer.
real *8, dimension(:,:), allocatable vutmp
val array elements for new sections of a growing subset buffer.
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 ufbcnt(lunit, kmsg, ksub)
Get the current location of the file pointer within a BUFR file, in terms of a message number countin...
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 closmg(lunin)
Close the BUFR message that is currently open for writing within internal arrays associated with logi...
recursive subroutine readmg(lunxx, subset, jdate, iret)
Read the next BUFR message from logical unit abs(lunxx) into internal arrays.
subroutine msgini(lun)
Initialize, within the internal arrays, a new uncompressed BUFR message for output.
subroutine msgwrt(lunit, mesg, mgbyt)
Perform final checks and updates on a BUFR message before writing it to a specified Fortran logical u...
recursive subroutine ufbpos(lunit, irec, isub, subset, jdate)
Jump forwards or backwards to a specified data subset within a BUFR file.
subroutine pad(ibay, ibit, ibyt, ipadb)
Pad a BUFR data subset with zeroed-out bits up to the next byte boundary.
subroutine rdtree(lun, iret)
Read the next uncompressed BUFR data subset into internal arrays.
subroutine wrtree(lun)
Pack a BUFR data subset.
subroutine msgupd(lunit, lun)
Write an uncompressed BUFR data subset.
subroutine usrtpl(lun, invn, nbmp)
Expand a subset template within internal arrays.
recursive subroutine writsa(lunxx, lmsgt, msgt, msgl)
Write a complete data subset into a BUFR message, and return each completed message within a memory a...
recursive integer function ireadns(lunit, subset, idate)
Call subroutine readns() and pass back its return code as the function value.
integer function nwords(n, lun)
Compute the length of a specified delayed replication sequence within a data subset.
recursive subroutine writsb(lunit)
Write a complete data subset into a BUFR message, for eventual output to logical unit lunit.
recursive subroutine invmrg(lubfi, lubfj)
Merge parts of data subsets which have duplicate space and time coordinates but different or unique o...
recursive integer function ireadsb(lunit)
Call subroutine readsb() and pass back its return code as the function value.
recursive subroutine readsb(lunit, iret)
Read the next data subset from a BUFR message.
subroutine rcstpl(lun, iret)
Initialize a subset template within internal arrays.
recursive integer function lcmgdf(lunit, subset)
Check whether the subset definition for a given message type contains any long character strings (gre...
recursive subroutine rdmgsb(lunit, imsg, isub)
Read a specified data subset from a BUFR file.
recursive subroutine readns(lunit, subset, jdate, iret)
Read the next data subset from a BUFR file.
recursive subroutine readlc(lunit, chr, str)
Read a long character string (greater than 8 bytes) from a data subset.
recursive subroutine writlc(lunit, chr, str)
Write a long character string (greater than 8 bytes) to a data subset.
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.