43 recursive subroutine readmg(lunxx,subset,jdate,iret)
47 use modv_vars,
only: im8b
55 integer,
intent(in) :: lunxx
56 integer,
intent(out) :: jdate, iret
57 integer iprt, my_lunxx, lunit, lun, il, im, ier,
idxmsg
59 character*8,
intent(out) :: subset
69 call x84(lunxx,my_lunxx,1)
70 call readmg(my_lunxx,subset,jdate,iret)
71 call x48(jdate,jdate,1)
83 call status(lunit,lun,il,im)
84 if(il==0)
call bort(
'BUFRLIB: READMG - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
85 if(il>0)
call bort(
'BUFRLIB: READMG - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
86 call wtstat(lunit,lun,il,1)
94 call wtstat(lunit,lun,il,0)
105 call cktaba(lun,subset,jdate,iret)
111 if(
isc3(lun)/=0)
return
118 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
119 errstr =
'BUFRLIB: READMG - INTERNAL DICTIONARY MESSAGE READ; ACCOUNT FOR IT THEN READ IN NEXT MESSAGE WITHOUT RETURNING'
121 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
143 recursive integer function ireadmg(lunit,subset,idate)
result(iret)
145 use modv_vars,
only: im8b
149 integer,
intent(in) :: lunit
150 integer,
intent(out) :: idate
153 character*8,
intent(out) :: subset
160 call x84(lunit,my_lunit,1)
161 iret=
ireadmg(my_lunit,subset,idate)
162 call x48(idate,idate,1)
168 call readmg(lunit,subset,idate,iret)
216 recursive subroutine readerme(mesg,lunit,subset,jdate,iret)
218 use modv_vars,
only: mxmsgl, im8b, nbytw
226 integer,
intent(in) :: lunit, mesg(*)
227 integer,
intent(out) :: jdate, iret
228 integer iprt, my_lunit, iec0(2), lun, il, im, ii, lnmsg,
lmsg,
idxmsg,
iupbs3
230 character*8,
intent(out) :: subset
232 character*128 errstr, bort_str
236 equivalence(sec0,iec0)
245 call x84(lunit,my_lunit,1)
246 call readerme(mesg,my_lunit,subset,jdate,iret)
247 call x48(jdate,jdate,1)
248 call x48(iret,iret,1)
258 call status(lunit,lun,il,im)
259 if(il==0)
call bort(
'BUFRLIB: READERME - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
260 if(il>0)
call bort(
'BUFRLIB: READERME - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
261 call wtstat(lunit,lun,il, 1)
268 if(lnmsg*nbytw>mxmsgl)
then
269 write(bort_str,
'("BUFRLIB: READERME - INPUT BUFR MESSAGE LENGTH",1X,I6," BYTES) IS LARGER THAN '// &
270 'LIMIT OF ",I6," BYTES")') lnmsg*nbytw, mxmsgl
274 mbay(ii,lun) = mesg(ii)
279 if(sec0(1:4)/=
'BUFR') &
280 call bort(
'BUFRLIB: READERME - FIRST 4 BYTES READ FROM RECORD NOT "BUFR", DOES NOT CONTAIN BUFR DATA')
285 call cktaba(lun,subset,jdate,iret)
286 if(
isc3(lun)/=0)
return
300 if(
idrdm(lun)>0)
then
304 if(
idrdm(lun)==0)
then
311 else if(
idrdm(lun)>0)
then
318 if ( iprt >= 2 )
then
319 call errwrt(
'+++++++++++++++++++++++++++++++++++++++++++++++++')
320 write ( unit=errstr, fmt=
'(A,I3,A)' ) &
321 'BUFRLIB: READERME - STORED NEW DX TABLE CONSISTING OF (',
idrdm(lun),
') MESSAGES;'
323 errstr =
'WILL APPLY THIS TABLE TO ALL SUBSEQUENT DATA MESSAGES UNTIL NEXT DX TABLE IS PASSED IN'
325 call errwrt(
'+++++++++++++++++++++++++++++++++++++++++++++++++')
348 use modv_vars,
only: mxmsgld4
352 integer,
intent(in) :: lunit
353 integer,
intent(out) :: mesg(*), iret
356 call status(lunit,lun,il,im)
360 if(iret==-3)
call errwrt(
'BUFRLIB: RDMSGW - SKIPPING OVERLARGE MESSAGE')
361 if(iret==-2)
call errwrt(
'BUFRLIB: RDMSGW - SKIPPING CORRUPTED MESSAGE')
396 recursive subroutine openmb(lunit,subset,jdate)
398 use modv_vars,
only: im8b
404 integer,
intent(in) :: lunit, jdate
405 integer my_lunit, my_jdate, lun, il, im, mtyp, mstb, inod,
i4dy
407 character*(*),
intent(in) :: subset
416 call x84(lunit,my_lunit,1)
417 call x84(jdate,my_jdate,1)
418 call openmb(my_lunit,subset,my_jdate)
426 call status(lunit,lun,il,im)
427 if(il==0)
call bort(
'BUFRLIB: OPENMB - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
428 if(il<0)
call bort(
'BUFRLIB: OPENMB - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
432 call nemtba(lun,subset,mtyp,mstb,inod)
439 call wtstat(lunit,lun,il, 1)
468 recursive subroutine openmg(lunit,subset,jdate)
470 use modv_vars,
only: im8b
476 integer,
intent(in) :: lunit, jdate
477 integer my_lunit, my_jdate, lun, il, im, mtyp, mstb, inod,
i4dy
479 character*(*),
intent(in) :: subset
486 call x84(lunit,my_lunit,1)
487 call x84(jdate,my_jdate,1)
488 call openmg(my_lunit,subset,my_jdate)
496 call status(lunit,lun,il,im)
497 if(il==0)
call bort(
'BUFRLIB: OPENMG - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
498 if(il<0)
call bort(
'BUFRLIB: OPENMG - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
499 if(im/=0)
call closmg(lunit)
500 call wtstat(lunit,lun,il, 1)
504 call nemtba(lun,subset,mtyp,mstb,inod)
534 use modv_vars,
only: im8b
542 integer,
intent(in) :: lunin
543 integer my_lunin, lunit, lun, il, im
550 call x84(lunin,my_lunin,1)
560 call status(lunit,lun,il,im)
561 if(lunit/=lunin)
msglim(lun) = 0
562 if(il==0)
call bort(
'BUFRLIB: CLOSMG - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
563 if(il<0)
call bort(
'BUFRLIB: CLOSMG - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
569 else if(
nsub(lun)<0)
then
573 call wtstat(lunit,lun,il,0)
601 use modv_vars,
only: mxmsgld4
613 integer,
intent(in) :: lunit, mgbyt, mesg(*)
614 integer iprt, iec0(2), mbyt, ibit, kbit, ii, jj, len0, len1, len2, len3, len4, l5, iad4, iad5, lun, il, im, npbyt, mwrd, &
615 nmwrd, iupbs01, idxmsg
618 character*4 bufr, sevn
634 call pkb(mbyt,24,iec0,ibit)
636 do ii = 1, nmwrd(iec0)
645 if(
cmnem(jj)==
'BEN')
then
652 mbyt = iupbs01(
mgwb,
'LENM')
654 do ii = 1, nmwrd(
mgwb)
668 if ( (
csmf==
'Y' ) .and. ( idxmsg(
mgwa)/=1 ) )
then
677 mbyt = iupbs01(
mgwb,
'LENM')
679 do ii = 1, nmwrd(
mgwb)
687 if ( (
ctrt==
'Y' ) .and. ( idxmsg(
mgwa)/=1 ) )
then
693 mbyt = iupbs01(
mgwb,
'LENM')
695 do ii = 1, nmwrd(
mgwb)
707 if(iupbs01(
mgwa,
'BEN')<4)
then
708 if(mod(len1,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 1 IS NOT A MULTIPLE OF 2')
709 if(mod(len2,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 2 IS NOT A MULTIPLE OF 2')
710 if(mod(len3,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 3 IS NOT A MULTIPLE OF 2')
711 if(mod(len4,2)/=0)
then
713 iad4 = len0+len1+len2+len3
742 call status(lunit,lun,il,im)
743 if(
null(lun)==0)
then
749 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
750 write ( unit=errstr, fmt=
'(A,I4,A,I7)')
'BUFRLIB: MSGWRT: LUNIT =', lunit,
', BYTES =', mbyt+npbyt
752 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
758 if(idxmsg(
mgwa)/=1)
then
786 integer,
intent(in) :: lun
787 integer ibct, ipd1, ipd2, ipd3, ipd4, nby0, nby1, nby2, nby3, nby4, nby5, nbyt, mtyp, msbt, inod, isub, iret, &
788 mcen, mear, mmon, mday, mour, mmin, mbit
790 character*128 bort_str
792 character*4 bufr, sevn
798 common /padesc/ ibct,ipd1,ipd2,ipd3,ipd4
799 common /msgptr/ nby0,nby1,nby2,nby3,nby4,nby5
804 call nemtba(lun,subtag,mtyp,msbt,inod)
805 if(
inode(lun)/=inod)
then
806 write(bort_str,
'("BUFRLIB: MSGINI - MISMATCH BETWEEN INODE (=",I7,") & POSITIONAL INDEX, INOD (",I7,") '// &
807 'OF SUBTAG (",A,") IN DICTIONARY")')
inode(lun), inod, subtag
810 call nemtab(lun,subtag,isub,tab,iret)
812 write(bort_str,
'("BUFRLIB: MSGINI - TABLE A MESSAGE TYPE MNEMONIC ",A," NOT FOUND IN INTERNAL TABLE D ARRAYS")') subtag
818 mcen = mod(
idate(lun)/10**8,100)+1
819 mear = mod(
idate(lun)/10**6,100)
820 mmon = mod(
idate(lun)/10**4,100)
821 mday = mod(
idate(lun)/10**2,100)
822 mour = mod(
idate(lun) ,100)
825 if(mcen==1)
call bort (
'BUFRLIB: MSGINI - BUFR MESSAGE DATE (IDATE) is 0000000000')
827 if(mear==0) mcen = mcen-1
828 if(mear==0) mear = 100
839 nbyt = nby0+nby1+nby2+nby3+nby4+nby5
843 call pkc(bufr , 4 ,
mbay(1,lun),mbit)
844 call pkb(nbyt , 24 ,
mbay(1,lun),mbit)
845 call pkb( 3 , 8 ,
mbay(1,lun),mbit)
849 call pkb(nby1 , 24 ,
mbay(1,lun),mbit)
850 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
851 call pkb( 3 , 8 ,
mbay(1,lun),mbit)
852 call pkb( 7 , 8 ,
mbay(1,lun),mbit)
853 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
854 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
855 call pkb(mtyp , 8 ,
mbay(1,lun),mbit)
856 call pkb(msbt , 8 ,
mbay(1,lun),mbit)
857 call pkb( 36 , 8 ,
mbay(1,lun),mbit)
858 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
859 call pkb(mear , 8 ,
mbay(1,lun),mbit)
860 call pkb(mmon , 8 ,
mbay(1,lun),mbit)
861 call pkb(mday , 8 ,
mbay(1,lun),mbit)
862 call pkb(mour , 8 ,
mbay(1,lun),mbit)
863 call pkb(mmin , 8 ,
mbay(1,lun),mbit)
864 call pkb(mcen , 8 ,
mbay(1,lun),mbit)
868 call pkb(nby3 , 24 ,
mbay(1,lun),mbit)
869 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
870 call pkb( 0 , 16 ,
mbay(1,lun),mbit)
871 call pkb(2**7 , 8 ,
mbay(1,lun),mbit)
872 call pkb(ibct , 16 ,
mbay(1,lun),mbit)
873 call pkb(isub , 16 ,
mbay(1,lun),mbit)
874 call pkb(ipd1 , 16 ,
mbay(1,lun),mbit)
875 call pkb(ipd2 , 16 ,
mbay(1,lun),mbit)
876 call pkb(ipd3 , 16 ,
mbay(1,lun),mbit)
877 call pkb(ipd4 , 16 ,
mbay(1,lun),mbit)
878 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
882 call pkb(nby4 , 24 ,
mbay(1,lun),mbit)
883 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
887 call pkc(sevn , 4 ,
mbay(1,lun),mbit)
891 if(mod(mbit,8)/=0)
call bort(
'BUFRLIB: MSGINI - INITIALIZED MESSAGE DOES NOT END ON A BYTE BOUNDARY')
892 if(mbit/8/=nbyt)
then
893 write(bort_str,
'("BUFRLIB: MSGINI - NUMBER OF BYTES STORED FOR INITIALIZED MESSAGE (",I6,") IS NOT THE SAME AS FIRST '// &
894 'CALCULATED, NBYT (",I6)') mbit/8, nbyt
917 logical function msgfull(msiz,itoadd,mxsiz)
result(bool)
919 use modv_vars,
only: maxnc
926 integer,
intent(in) :: msiz, itoadd, mxsiz
941 if(
ctrt==
'Y') iwgbyt = iwgbyt + 6
944 if(
csmf==
'Y') iwgbyt = iwgbyt + (maxnc*2)
948 if ( ( msiz + itoadd + iwgbyt ) > mxsiz )
then
976 use modv_vars,
only: mxmsgl, im8b
982 integer,
intent(in) :: maxo
983 integer my_maxo, iprt, newsiz, maxdx, idxv, nxstr, ldxa, ldxb, ldxd, ld30
988 common /dxtab/ maxdx,idxv,nxstr(10),ldxa(10),ldxb(10),ldxd(10),ld30(10),dxstr(10)
996 call x84(maxo,my_maxo,1)
1003 if((maxo==0).or.(maxo>mxmsgl))
then
1011 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1012 write ( unit=errstr, fmt=
'(A,A,I7,A,I7)' )
'BUFRLIB: MAXOUT - THE RECORD LENGTH OF ALL BUFR MESSAGES ',&
1013 'CREATED FROM THIS POINT ON IS BEING CHANGED FROM ',
maxbyt,
' TO ', newsiz
1015 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1057 use modv_vars,
only: nbytw
1061 integer,
intent(in) :: lmesg
1062 integer,
intent(inout) :: mesg(*)
1063 integer,
intent(out) :: npbyt
1064 integer nmw, nmb, ibit, i, nmwrd, iupbs01
1070 if(nmw>lmesg)
call bort(
'BUFRLIB: PADMSG - CANNOT ADD PADDING TO MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1074 nmb = iupbs01(mesg,
'LENM')
1076 npbyt = ( nmw * nbytw ) - nmb
1078 call pkb(0,8,mesg,ibit)
1094 recursive integer function nmsub(lunit)
result(iret)
1096 use modv_vars,
only: im8b
1102 integer,
intent(in) :: lunit
1103 integer my_lunit, lun, il, im
1110 call x84(lunit,my_lunit,1)
1111 iret=
nmsub(my_lunit)
1121 call status(lunit,lun,il,im)
1122 if(il==0)
call bort(
'BUFRLIB: NMSUB - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
1123 if(il>0)
call bort(
'BUFRLIB: NMSUB - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
1124 if(im==0)
call bort(
'BUFRLIB: NMSUB - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
1144 integer function nmwrd(mbay)
result(iret)
1146 use modv_vars,
only: nbytw
1150 integer,
intent(in) :: mbay(*)
1157 iret = ((lenm/8)+1)*(8/nbytw)
1176 integer function lmsg(sec0)
result(iret)
1180 integer msec0(2),
nmwrd
1182 character*8,
intent(in) :: sec0
1185 equivalence(msec0,csec0)
1212 recursive subroutine getlens (mbay,ll,len0,len1,len2,len3,len4,len5)
1214 use modv_vars,
only: im8b
1218 integer,
intent(in) :: mbay(*), ll
1219 integer,
intent(out) :: len0, len1, len2, len3, len4, len5
1225 call x84(ll,my_ll,1)
1226 call getlens(mbay,my_ll,len0,len1,len2,len3,len4,len5)
1227 call x48(len0,len0,1)
1228 call x48(len1,len1,1)
1229 call x48(len2,len2,1)
1230 call x48(len3,len3,1)
1231 call x48(len4,len4,1)
1232 call x48(len5,len5,1)
1252 len2 =
iupb(mbay,iad2+1,24) *
iupbs01(mbay,
'ISC2')
1256 len3 =
iupb(mbay,iad3+1,24)
1260 len4 =
iupb(mbay,iad4+1,24)
1292 recursive subroutine cnved4(msgin,lmsgot,msgot)
1294 use modv_vars,
only: im8b, nbytw
1298 integer,
intent(in) :: msgin(*), lmsgot
1299 integer,
intent(out) :: msgot(*)
1300 integer my_lmsgot, i, nmw, len0, len1, len2, len3, l4, l5, iad2, iad4, lenm, lenmot, len1ot, len3ot, ibit,
iupbs01,
nmwrd
1306 call x84 ( lmsgot, my_lmsgot, 1 )
1307 call cnved4 ( msgin, my_lmsgot*2, msgot )
1312 if(
iupbs01(msgin,
'BEN')==4)
then
1318 call bort(
'BUFRLIB: CNVED4 - OVERFLOW OF OUTPUT (EDITION 4) MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1327 call getlens(msgin,3,len0,len1,len2,len3,l4,l5)
1330 iad4 = iad2 + len2 + len3
1338 if(lenmot>(lmsgot*nbytw)) &
1339 call bort(
'BUFRLIB: CNVED4 - OVERFLOW OF OUTPUT (EDITION 4) MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1346 call mvb ( msgin, 1, msgot, 1, 4 )
1348 call pkb ( lenmot, 24, msgot, ibit )
1349 call pkb ( 4, 8, msgot, ibit )
1353 call pkb ( len1ot, 24, msgot, ibit )
1354 call pkb (
iupbs01(msgin,
'BMT'), 8, msgot, ibit )
1355 call pkb (
iupbs01(msgin,
'OGCE'), 16, msgot, ibit )
1356 call pkb (
iupbs01(msgin,
'GSES'), 16, msgot, ibit )
1357 call pkb (
iupbs01(msgin,
'USN'), 8, msgot, ibit )
1358 call pkb (
iupbs01(msgin,
'ISC2')*128, 8, msgot, ibit )
1359 call pkb (
iupbs01(msgin,
'MTYP'), 8, msgot, ibit )
1361 call pkb ( 255, 8, msgot, ibit )
1362 call pkb (
iupbs01(msgin,
'MSBT'), 8, msgot, ibit )
1363 call pkb (
iupbs01(msgin,
'MTV'), 8, msgot, ibit )
1364 call pkb (
iupbs01(msgin,
'MTVL'), 8, msgot, ibit )
1365 call pkb (
iupbs01(msgin,
'YEAR'), 16, msgot, ibit )
1366 call pkb (
iupbs01(msgin,
'MNTH'), 8, msgot, ibit )
1367 call pkb (
iupbs01(msgin,
'DAYS'), 8, msgot, ibit )
1368 call pkb (
iupbs01(msgin,
'HOUR'), 8, msgot, ibit )
1369 call pkb (
iupbs01(msgin,
'MINU'), 8, msgot, ibit )
1371 call pkb ( 0, 8, msgot, ibit )
1375 call mvb ( msgin, iad2+1, msgot, (ibit/8)+1, len2+len3-1 )
1379 ibit = ( len0 + len1ot + len2 ) * 8
1380 call pkb ( len3ot, 24, msgot, ibit )
1384 ibit = ibit + ( len3ot * 8 ) - 24
1385 call mvb ( msgin, iad4+1, msgot, (ibit/8)+1, lenm-iad4 )
1401 recursive integer function ifbget(lunit)
result(iret)
1403 use modv_vars,
only: im8b
1409 integer,
intent(in) :: lunit
1410 integer my_lunit, lun, il, im
1416 call x84(lunit,my_lunit,1)
1426 call status(lunit,lun,il,im)
1427 if(il==0)
call bort(
'BUFRLIB: IFBGET - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
1428 if(il>0)
call bort(
'BUFRLIB: IFBGET - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
1429 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.