43 recursive subroutine readmg(lunxx,subset,jdate,iret)
47 use modv_vars,
only: im8b, iprt
55 integer,
intent(in) :: lunxx
56 integer,
intent(out) :: jdate, iret
57 integer my_lunxx, lunit, lun, il, im, ier,
idxmsg
59 character*8,
intent(out) :: subset
67 call x84(lunxx,my_lunxx,1)
68 call readmg(my_lunxx,subset,jdate,iret)
69 call x48(jdate,jdate,1)
81 call status(lunit,lun,il,im)
82 if(il==0)
call bort(
'BUFRLIB: READMG - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
83 if(il>0)
call bort(
'BUFRLIB: READMG - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
84 call wtstat(lunit,lun,il,1)
92 call wtstat(lunit,lun,il,0)
103 call cktaba(lun,subset,jdate,iret)
109 if(
isc3(lun)/=0)
return
116 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
117 errstr =
'BUFRLIB: READMG - INTERNAL DICTIONARY MESSAGE READ; ACCOUNT FOR IT THEN READ IN NEXT MESSAGE WITHOUT RETURNING'
119 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
141 recursive integer function ireadmg(lunit,subset,idate)
result(iret)
143 use modv_vars,
only: im8b
147 integer,
intent(in) :: lunit
148 integer,
intent(out) :: idate
151 character*8,
intent(out) :: subset
158 call x84(lunit,my_lunit,1)
159 iret=
ireadmg(my_lunit,subset,idate)
160 call x48(idate,idate,1)
166 call readmg(lunit,subset,idate,iret)
214 recursive subroutine readerme(mesg,lunit,subset,jdate,iret)
216 use modv_vars,
only: mxmsgl, im8b, nbytw, iprt, bmostr
224 integer,
intent(in) :: lunit, mesg(*)
225 integer,
intent(out) :: jdate, iret
228 character*8,
intent(out) :: subset
230 character*128 errstr, bort_str
234 equivalence(sec0,iec0)
241 call x84(lunit,my_lunit,1)
242 call readerme(mesg,my_lunit,subset,jdate,iret)
243 call x48(jdate,jdate,1)
244 call x48(iret,iret,1)
254 call status(lunit,lun,il,im)
255 if(il==0)
call bort(
'BUFRLIB: READERME - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
256 if(il>0)
call bort(
'BUFRLIB: READERME - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
257 call wtstat(lunit,lun,il, 1)
264 if(lnmsg*nbytw>mxmsgl)
then
265 write(bort_str,
'("BUFRLIB: READERME - INPUT BUFR MESSAGE LENGTH",1X,I6," BYTES) IS LARGER THAN '// &
266 'LIMIT OF ",I6," BYTES")') lnmsg*nbytw, mxmsgl
270 mbay(ii,lun) = mesg(ii)
275 if(sec0(1:4)/=bmostr) &
276 call bort(
'BUFRLIB: READERME - FIRST 4 BYTES READ FROM RECORD NOT "BUFR", DOES NOT CONTAIN BUFR DATA')
281 call cktaba(lun,subset,jdate,iret)
282 if(
isc3(lun)/=0)
return
296 if(
idrdm(lun)>0)
then
300 if(
idrdm(lun)==0)
then
307 else if(
idrdm(lun)>0)
then
314 if ( iprt >= 2 )
then
315 call errwrt(
'+++++++++++++++++++++++++++++++++++++++++++++++++')
316 write ( unit=errstr, fmt=
'(A,I3,A)' ) &
317 'BUFRLIB: READERME - STORED NEW DX TABLE CONSISTING OF (',
idrdm(lun),
') MESSAGES;'
319 errstr =
'WILL APPLY THIS TABLE TO ALL SUBSEQUENT DATA MESSAGES UNTIL NEXT DX TABLE IS PASSED IN'
321 call errwrt(
'+++++++++++++++++++++++++++++++++++++++++++++++++')
344 use modv_vars,
only: mxmsgld4
348 integer,
intent(in) :: lunit
349 integer,
intent(out) :: mesg(*), iret
352 call status(lunit,lun,il,im)
356 if(iret==-3)
call errwrt(
'BUFRLIB: RDMSGW - SKIPPING OVERLARGE MESSAGE')
357 if(iret==-2)
call errwrt(
'BUFRLIB: RDMSGW - SKIPPING CORRUPTED MESSAGE')
392 recursive subroutine openmb(lunit,subset,jdate)
394 use modv_vars,
only: im8b
400 integer,
intent(in) :: lunit, jdate
401 integer my_lunit, my_jdate, lun, il, im, mtyp, mstb, inod,
i4dy
403 character*(*),
intent(in) :: subset
412 call x84(lunit,my_lunit,1)
413 call x84(jdate,my_jdate,1)
414 call openmb(my_lunit,subset,my_jdate)
422 call status(lunit,lun,il,im)
423 if(il==0)
call bort(
'BUFRLIB: OPENMB - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
424 if(il<0)
call bort(
'BUFRLIB: OPENMB - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
428 call nemtba(lun,subset,mtyp,mstb,inod)
435 call wtstat(lunit,lun,il, 1)
464 recursive subroutine openmg(lunit,subset,jdate)
466 use modv_vars,
only: im8b
472 integer,
intent(in) :: lunit, jdate
473 integer my_lunit, my_jdate, lun, il, im, mtyp, mstb, inod,
i4dy
475 character*(*),
intent(in) :: subset
482 call x84(lunit,my_lunit,1)
483 call x84(jdate,my_jdate,1)
484 call openmg(my_lunit,subset,my_jdate)
492 call status(lunit,lun,il,im)
493 if(il==0)
call bort(
'BUFRLIB: OPENMG - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
494 if(il<0)
call bort(
'BUFRLIB: OPENMG - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
495 if(im/=0)
call closmg(lunit)
496 call wtstat(lunit,lun,il, 1)
500 call nemtba(lun,subset,mtyp,mstb,inod)
530 use modv_vars,
only: im8b
538 integer,
intent(in) :: lunin
539 integer my_lunin, lunit, lun, il, im
546 call x84(lunin,my_lunin,1)
556 call status(lunit,lun,il,im)
557 if(lunit/=lunin)
msglim(lun) = 0
558 if(il==0)
call bort(
'BUFRLIB: CLOSMG - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
559 if(il<0)
call bort(
'BUFRLIB: CLOSMG - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
565 else if(
nsub(lun)<0)
then
569 call wtstat(lunit,lun,il,0)
597 use modv_vars,
only: mxmsgld4, iprt, nby5, bmostr, bmcstr
609 integer,
intent(in) :: lunit, mgbyt, mesg(*)
610 integer iec0(2), mbyt, ibit, kbit, ii, jj, len0, len1, len2, len3, len4, l5, iad4, iad5, lun, il, im, npbyt, mwrd, &
611 nmwrd, iupbs01, idxmsg
624 call pkb(mbyt,24,iec0,ibit)
626 do ii = 1, nmwrd(iec0)
635 if(
cmnem(jj)==
'BEN')
then
642 mbyt = iupbs01(
mgwb,
'LENM')
644 do ii = 1, nmwrd(
mgwb)
658 if ( (
csmf==
'Y' ) .and. ( idxmsg(
mgwa)/=1 ) )
then
664 call pkc(bmcstr,nby5,
mgwa,ibit)
667 mbyt = iupbs01(
mgwb,
'LENM')
669 do ii = 1, nmwrd(
mgwb)
677 if ( (
ctrt==
'Y' ) .and. ( idxmsg(
mgwa)/=1 ) )
then
683 mbyt = iupbs01(
mgwb,
'LENM')
685 do ii = 1, nmwrd(
mgwb)
697 if(iupbs01(
mgwa,
'BEN')<4)
then
698 if(mod(len1,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 1 IS NOT A MULTIPLE OF 2')
699 if(mod(len2,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 2 IS NOT A MULTIPLE OF 2')
700 if(mod(len3,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 3 IS NOT A MULTIPLE OF 2')
701 if(mod(len4,2)/=0)
then
703 iad4 = len0+len1+len2+len3
721 call pkc(bmcstr,nby5,
mgwa,kbit)
732 call status(lunit,lun,il,im)
733 if(
null(lun)==0)
then
739 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
740 write ( unit=errstr, fmt=
'(A,I4,A,I7)')
'BUFRLIB: MSGWRT: LUNIT =', lunit,
', BYTES =', mbyt+npbyt
742 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
748 if(idxmsg(
mgwa)/=1)
then
769 use modv_vars,
only: mtv, nby0, nby1, nby2, nby3, nby5, bmostr, bmcstr, fxy_fbit, fxy_sbyct, fxy_drf8
778 integer,
intent(in) :: lun
779 integer nby4, nbyt, mtyp, msbt, inod, isub, iret, mcen, mear, mmon, mday, mour, mmin, mbit, ifxy
781 character*128 bort_str
788 call nemtba(lun,subtag,mtyp,msbt,inod)
789 if(
inode(lun)/=inod)
then
790 write(bort_str,
'("BUFRLIB: MSGINI - MISMATCH BETWEEN INODE (=",I7,") & POSITIONAL INDEX, INOD (",I7,") '// &
791 'OF SUBTAG (",A,") IN DICTIONARY")')
inode(lun), inod, subtag
794 call nemtab(lun,subtag,isub,tab,iret)
796 write(bort_str,
'("BUFRLIB: MSGINI - TABLE A MESSAGE TYPE MNEMONIC ",A," NOT FOUND IN INTERNAL TABLE D ARRAYS")') subtag
802 mcen = mod(
idate(lun)/10**8,100)+1
803 mear = mod(
idate(lun)/10**6,100)
804 mmon = mod(
idate(lun)/10**4,100)
805 mday = mod(
idate(lun)/10**2,100)
806 mour = mod(
idate(lun) ,100)
809 if(mcen==1)
call bort (
'BUFRLIB: MSGINI - BUFR MESSAGE DATE (IDATE) is 0000000000')
811 if(mear==0) mcen = mcen-1
812 if(mear==0) mear = 100
818 nbyt = nby0+nby1+nby2+nby3+nby4+nby5
822 call pkc(bmostr, 4 ,
mbay(1,lun),mbit)
823 call pkb(nbyt , 24 ,
mbay(1,lun),mbit)
824 call pkb( 3 , 8 ,
mbay(1,lun),mbit)
828 call pkb(nby1 , 24 ,
mbay(1,lun),mbit)
829 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
830 call pkb( 3 , 8 ,
mbay(1,lun),mbit)
831 call pkb( 7 , 8 ,
mbay(1,lun),mbit)
832 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
833 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
834 call pkb(mtyp , 8 ,
mbay(1,lun),mbit)
835 call pkb(msbt , 8 ,
mbay(1,lun),mbit)
836 call pkb( mtv , 8 ,
mbay(1,lun),mbit)
837 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
838 call pkb(mear , 8 ,
mbay(1,lun),mbit)
839 call pkb(mmon , 8 ,
mbay(1,lun),mbit)
840 call pkb(mday , 8 ,
mbay(1,lun),mbit)
841 call pkb(mour , 8 ,
mbay(1,lun),mbit)
842 call pkb(mmin , 8 ,
mbay(1,lun),mbit)
843 call pkb(mcen , 8 ,
mbay(1,lun),mbit)
847 call pkb(nby3 , 24 ,
mbay(1,lun),mbit)
848 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
849 call pkb( 0 , 16 ,
mbay(1,lun),mbit)
850 call pkb(2**7 , 8 ,
mbay(1,lun),mbit)
851 call pkb(ifxy(fxy_sbyct), 16,
mbay(1,lun),mbit)
852 call pkb(isub , 16 ,
mbay(1,lun),mbit)
853 call pkb(ifxy(
'102000') , 16,
mbay(1,lun),mbit)
854 call pkb(ifxy(fxy_drf8) , 16,
mbay(1,lun),mbit)
855 call pkb(ifxy(
'206001') , 16,
mbay(1,lun),mbit)
856 call pkb(ifxy(fxy_fbit), 16,
mbay(1,lun),mbit)
857 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
861 call pkb(nby4 , 24 ,
mbay(1,lun),mbit)
862 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
866 call pkc(bmcstr,nby5,
mbay(1,lun),mbit)
870 if(mod(mbit,8)/=0)
call bort(
'BUFRLIB: MSGINI - INITIALIZED MESSAGE DOES NOT END ON A BYTE BOUNDARY')
871 if(mbit/8/=nbyt)
then
872 write(bort_str,
'("BUFRLIB: MSGINI - NUMBER OF BYTES STORED FOR INITIALIZED MESSAGE (",I6,") IS NOT THE SAME AS FIRST '// &
873 'CALCULATED, NBYT (",I6)') mbit/8, nbyt
896 logical function msgfull(msiz,itoadd,mxsiz)
result(bool)
898 use modv_vars,
only: maxnc
905 integer,
intent(in) :: msiz, itoadd, mxsiz
920 if(
ctrt==
'Y') iwgbyt = iwgbyt + 6
923 if(
csmf==
'Y') iwgbyt = iwgbyt + (maxnc*2)
927 if ( ( msiz + itoadd + iwgbyt ) > mxsiz )
then
955 use modv_vars,
only: mxmsgl, im8b, iprt
961 integer,
intent(in) :: maxo
962 integer my_maxo, newsiz, nxstr, ldxa, ldxb, ldxd, ld30
967 common /dxtab/ nxstr(10), ldxa(10), ldxb(10), ldxd(10), ld30(10), dxstr(10)
974 call x84(maxo,my_maxo,1)
981 if((maxo==0).or.(maxo>mxmsgl))
then
989 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
990 write ( unit=errstr, fmt=
'(A,A,I7,A,I7)' )
'BUFRLIB: MAXOUT - THE RECORD LENGTH OF ALL BUFR MESSAGES ',&
991 'CREATED FROM THIS POINT ON IS BEING CHANGED FROM ',
maxbyt,
' TO ', newsiz
993 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1034 use modv_vars,
only: nbytw
1038 integer,
intent(in) :: lmesg
1039 integer,
intent(inout) :: mesg(*)
1040 integer,
intent(out) :: npbyt
1041 integer nmw, nmb, ibit, i, nmwrd, iupbs01
1047 if(nmw>lmesg)
call bort(
'BUFRLIB: PADMSG - CANNOT ADD PADDING TO MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1051 nmb = iupbs01(mesg,
'LENM')
1053 npbyt = ( nmw * nbytw ) - nmb
1055 call pkb(0,8,mesg,ibit)
1071 recursive integer function nmsub(lunit)
result(iret)
1073 use modv_vars,
only: im8b
1079 integer,
intent(in) :: lunit
1080 integer my_lunit, lun, il, im
1087 call x84(lunit,my_lunit,1)
1088 iret=
nmsub(my_lunit)
1098 call status(lunit,lun,il,im)
1099 if(il==0)
call bort(
'BUFRLIB: NMSUB - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
1100 if(il>0)
call bort(
'BUFRLIB: NMSUB - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
1101 if(im==0)
call bort(
'BUFRLIB: NMSUB - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
1121 integer function nmwrd(mbay)
result(iret)
1123 use modv_vars,
only: nbytw
1127 integer,
intent(in) :: mbay(*)
1134 iret = ((lenm/8)+1)*(8/nbytw)
1153 integer function lmsg(sec0)
result(iret)
1157 integer msec0(2),
nmwrd
1159 character*8,
intent(in) :: sec0
1162 equivalence(msec0,csec0)
1189 recursive subroutine getlens (mbay,ll,len0,len1,len2,len3,len4,len5)
1191 use modv_vars,
only: im8b, nby5
1195 integer,
intent(in) :: mbay(*), ll
1196 integer,
intent(out) :: len0, len1, len2, len3, len4, len5
1202 call x84(ll,my_ll,1)
1203 call getlens(mbay,my_ll,len0,len1,len2,len3,len4,len5)
1204 call x48(len0,len0,1)
1205 call x48(len1,len1,1)
1206 call x48(len2,len2,1)
1207 call x48(len3,len3,1)
1208 call x48(len4,len4,1)
1209 call x48(len5,len5,1)
1229 len2 =
iupb(mbay,iad2+1,24) *
iupbs01(mbay,
'ISC2')
1233 len3 =
iupb(mbay,iad3+1,24)
1237 len4 =
iupb(mbay,iad4+1,24)
1269 recursive subroutine cnved4(msgin,lmsgot,msgot)
1271 use modv_vars,
only: im8b, nbytw
1275 integer,
intent(in) :: msgin(*), lmsgot
1276 integer,
intent(out) :: msgot(*)
1277 integer my_lmsgot, i, nmw, len0, len1, len2, len3, l4, l5, iad2, iad4, lenm, lenmot, len1ot, len3ot, ibit,
iupbs01,
nmwrd
1283 call x84 ( lmsgot, my_lmsgot, 1 )
1284 call cnved4 ( msgin, my_lmsgot*2, msgot )
1289 if(
iupbs01(msgin,
'BEN')==4)
then
1295 call bort(
'BUFRLIB: CNVED4 - OVERFLOW OF OUTPUT (EDITION 4) MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1304 call getlens(msgin,3,len0,len1,len2,len3,l4,l5)
1307 iad4 = iad2 + len2 + len3
1315 if(lenmot>(lmsgot*nbytw)) &
1316 call bort(
'BUFRLIB: CNVED4 - OVERFLOW OF OUTPUT (EDITION 4) MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1323 call mvb ( msgin, 1, msgot, 1, 4 )
1325 call pkb ( lenmot, 24, msgot, ibit )
1326 call pkb ( 4, 8, msgot, ibit )
1330 call pkb ( len1ot, 24, msgot, ibit )
1331 call pkb (
iupbs01(msgin,
'BMT'), 8, msgot, ibit )
1332 call pkb (
iupbs01(msgin,
'OGCE'), 16, msgot, ibit )
1333 call pkb (
iupbs01(msgin,
'GSES'), 16, msgot, ibit )
1334 call pkb (
iupbs01(msgin,
'USN'), 8, msgot, ibit )
1335 call pkb (
iupbs01(msgin,
'ISC2')*128, 8, msgot, ibit )
1336 call pkb (
iupbs01(msgin,
'MTYP'), 8, msgot, ibit )
1338 call pkb ( 255, 8, msgot, ibit )
1339 call pkb (
iupbs01(msgin,
'MSBT'), 8, msgot, ibit )
1340 call pkb (
iupbs01(msgin,
'MTV'), 8, msgot, ibit )
1341 call pkb (
iupbs01(msgin,
'MTVL'), 8, msgot, ibit )
1342 call pkb (
iupbs01(msgin,
'YEAR'), 16, msgot, ibit )
1343 call pkb (
iupbs01(msgin,
'MNTH'), 8, msgot, ibit )
1344 call pkb (
iupbs01(msgin,
'DAYS'), 8, msgot, ibit )
1345 call pkb (
iupbs01(msgin,
'HOUR'), 8, msgot, ibit )
1346 call pkb (
iupbs01(msgin,
'MINU'), 8, msgot, ibit )
1348 call pkb ( 0, 8, msgot, ibit )
1352 call mvb ( msgin, iad2+1, msgot, (ibit/8)+1, len2+len3-1 )
1356 ibit = ( len0 + len1ot + len2 ) * 8
1357 call pkb ( len3ot, 24, msgot, ibit )
1361 ibit = ibit + ( len3ot * 8 ) - 24
1362 call mvb ( msgin, iad4+1, msgot, (ibit/8)+1, lenm-iad4 )
1378 recursive integer function ifbget(lunit)
result(iret)
1380 use modv_vars,
only: im8b
1386 integer,
intent(in) :: lunit
1387 integer my_lunit, lun, il, im
1393 call x84(lunit,my_lunit,1)
1403 call status(lunit,lun,il,im)
1404 if(il==0)
call bort(
'BUFRLIB: IFBGET - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
1405 if(il>0)
call bort(
'BUFRLIB: IFBGET - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
1406 if(im==0)
call bort(
'BUFRLIB: IFBGET - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
subroutine blocks(mbay, mwrd)
Encapsulate a BUFR message with IEEE Fortran control words as specified via the most recent call to s...
subroutine bort(str)
Log an error message, then abort the application program.
recursive integer function iupb(mbay, nbyt, nbit)
Decode an integer value from within a specified number of bits 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...
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 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 stbfdx(lun, mesg)
Copy a DX BUFR tables message into the internal memory arrays in module moda_tababd.
subroutine dxinit(lun, ioi)
Clear out the internal arrays (in module moda_tababd) holding the DX BUFR table, then optionally init...
integer function idxmsg(mesg)
Check whether a BUFR message contains DX BUFR tables information that was generated by the NCEPLIBS-b...
subroutine rdbfdx(lunit, lun)
Beginning at the current file pointer location within lunit, read a complete DX BUFR table into inter...
subroutine errwrt(str)
Specify a custom location for the logging of error and diagnostic messages generated by the NCEPLIBS-...
subroutine nemtab(lun, nemo, idn, tab, iret)
Get information about a descriptor, based on a mnemonic.
subroutine makestab
Build the entire internal jump/link table within module moda_tables, using all of the internal BUFR t...
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 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 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 an array used by subroutine readerme() to read in a new DX dictionary table as a consecutive ...
integer, dimension(:), allocatable idrdm
DX BUFR tables message count for each file ID.
Declare an array used by various subroutines and functions to hold a temporary working copy of a BUFR...
integer, dimension(:), allocatable mgwa
Temporary working copy of BUFR message.
Declare an array used by various subroutines and functions to hold a temporary working copy of a BUFR...
integer, dimension(:), allocatable mgwb
Temporary working copy of BUFR message.
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 keep track of which logical units should not have any empty (zero data subse...
integer, dimension(:), allocatable msglim
Tracking index for each file ID.
Declare a variable used to indicate whether output BUFR messages should be standardized.
character csmf
Flag indicating whether BUFR output messages are to be standardized; this variable is initialized to ...
Declare an array used to store a switch for each file ID, indicating whether any BUFR messages should...
integer, dimension(:), allocatable null
Output switch for each file ID:
Declare arrays and variables used to store custom values for certain mnemonics within Sections 0 and ...
integer, dimension(:), allocatable ivmnem
Custom values for use within Sections 0 and 1 of all future output BUFR messages written to all Fortr...
integer ns01v
Number of custom values stored.
character *8, dimension(:), allocatable cmnem
Section 0 and 1 mnemonics corresponding to ivmnem.
Declare an array used to store a switch for each file ID, indicating whether BUFR messages read from ...
integer, dimension(:), allocatable isc3
Section 3 switch for each file ID:
Declare arrays and variables used to store the internal jump/link table.
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
Declare variables used to store tank receipt time information within Section 1 of BUFR messages.
character *1 ctrt
Flag indicating whether tank receipt times are to be included within output BUFR messages; this varia...
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.
recursive subroutine status(lunit, lun, il, im)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
subroutine wtstat(lunit, lun, il, im)
Update file status in library internals.
subroutine padmsg(mesg, lmesg, npbyt)
Pad a BUFR message with zeroed-out bytes from the end of the message up to the next 8-byte boundary.
recursive subroutine maxout(maxo)
Specify the maximum length of a BUFR message that can be written to any output file by the NCEPLIBS-b...
integer function lmsg(sec0)
Given a character string containing Section 0 from a BUFR message, determine the array size (in integ...
logical function msgfull(msiz, itoadd, mxsiz)
Check whether the current data subset in the internal arrays will fit within the current BUFR message...
recursive subroutine openmg(lunit, subset, jdate)
Open and initialize a new BUFR message within internal arrays, for eventual output to logical unit lu...
recursive subroutine openmb(lunit, subset, jdate)
Open and initialize a new BUFR message within internal arrays, for eventual output to logical unit lu...
recursive subroutine closmg(lunin)
Close the BUFR message that is currently open for writing within internal arrays associated with logi...
recursive integer function nmsub(lunit)
Get the total number of data subsets available within the BUFR message that was most recently opened ...
integer function nmwrd(mbay)
Given an integer array containing Section 0 from a BUFR message, determine the array size (in integer...
integer function igetmxby()
Get the maximum length of a BUFR message that can be written to an output file by the NCEPLIBS-bufr s...
recursive subroutine readerme(mesg, lunit, subset, jdate, iret)
Read a BUFR message from a memory array.
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.
recursive integer function ifbget(lunit)
Check whether there are any more data subsets available to be read from a BUFR message.
subroutine rdmsgw(lunit, mesg, iret)
Read the next BUFR message from logical unit lunit as an array of integer words.
recursive subroutine cnved4(msgin, lmsgot, msgot)
Convert a BUFR edition 3 message to BUFR edition 4.
recursive integer function ireadmg(lunit, subset, idate)
Call subroutine readmg() and pass back its return code as the function value.
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...
subroutine usrtpl(lun, invn, nbmp)
Expand a subset template within internal arrays.
subroutine cktaba(lun, subset, jdate, iret)
Get the Table A mnemonic from Sections 1 and 3 of a BUFR message.
recursive integer function iupbs01(mbay, s01mnem)
Read a specified value from within Section 0 or Section 1 of a BUFR message.
recursive subroutine pkbs1(ival, mbay, s1mnem)
Write a specified value into a specified location within Section 1 of a BUFR message,...
recursive integer function iupbs3(mbay, s3mnem)
Read a specified value from within Section 3 of a BUFR message.
subroutine reads3(lun)
Read the Section 3 descriptors from the BUFR message in mbay(1,lun), then use the BUFR master tables ...
recursive integer function i4dy(idate)
Convert a date-time with a 2-digit year (YYMMDDHH) to a date-time with a 4-digit year (YYYYMMDDHH) us...
recursive subroutine stndrd(lunit, msgin, lmsgot, msgot)
Standardize a BUFR message.
recursive subroutine atrcpt(msgin, lmsgot, msgot)
Read an input message and output an equivalent BUFR message with a tank receipt time added to Section...
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.