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
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)
79 subset(1:8) = csubset(1:8)
89 call status(lunit,lun,il,im)
90 if(il==0)
call bort(
'BUFRLIB: READMG - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
91 if(il>0)
call bort(
'BUFRLIB: READMG - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
92 call wtstat(lunit,lun,il,1)
100 call wtstat(lunit,lun,il,0)
111 call cktaba(lun,subset,jdate,iret)
117 if(
isc3(lun)/=0)
return
124 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
125 errstr =
'BUFRLIB: READMG - INTERNAL DICTIONARY MESSAGE READ; ACCOUNT FOR IT THEN READ IN NEXT MESSAGE WITHOUT RETURNING'
127 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
149 recursive integer function ireadmg(lunit,subset,idate)
result(iret)
151 use modv_vars,
only: im8b
155 integer,
intent(in) :: lunit
156 integer,
intent(out) :: idate
159 character*8,
intent(out) :: subset
165 call x84(lunit,my_lunit,1)
166 iret=
ireadmg(my_lunit,subset,idate)
167 call x48(idate,idate,1)
172 call readmg(lunit,subset,idate,iret)
220 recursive subroutine readerme(mesg,lunit,subset,jdate,iret)
224 use modv_vars,
only: mxmsgl, im8b, nbytw, iprt, bmostr
232 integer,
intent(in) :: lunit, mesg(*)
233 integer,
intent(out) :: jdate, iret
234 integer my_lunit, iec0(2), lun, il, im, ii, lnmsg,
lmsg,
idxmsg,
iupbs3,
bort_target_set
236 character*8,
intent(out) :: subset
239 character*128 errstr, bort_str
243 equivalence(sec0,iec0)
249 call x84(lunit,my_lunit,1)
250 call readerme(mesg,my_lunit,subset,jdate,iret)
251 call x48(jdate,jdate,1)
252 call x48(iret,iret,1)
261 subset(1:8) = csubset(1:8)
270 call status(lunit,lun,il,im)
271 if(il==0)
call bort(
'BUFRLIB: READERME - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
272 if(il>0)
call bort(
'BUFRLIB: READERME - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
273 call wtstat(lunit,lun,il, 1)
280 if(lnmsg*nbytw>mxmsgl)
then
281 write(bort_str,
'("BUFRLIB: READERME - INPUT BUFR MESSAGE LENGTH",1X,I6," BYTES) IS LARGER THAN '// &
282 'LIMIT OF ",I6," BYTES")') lnmsg*nbytw, mxmsgl
286 mbay(ii,lun) = mesg(ii)
291 if(sec0(1:4)/=bmostr) &
292 call bort(
'BUFRLIB: READERME - FIRST 4 BYTES READ FROM RECORD NOT "BUFR", DOES NOT CONTAIN BUFR DATA')
297 call cktaba(lun,subset,jdate,iret)
298 if(
isc3(lun)/=0)
return
312 if(
idrdm(lun)>0)
then
316 if(
idrdm(lun)==0)
then
323 else if(
idrdm(lun)>0)
then
330 if ( iprt >= 2 )
then
331 call errwrt(
'+++++++++++++++++++++++++++++++++++++++++++++++++')
332 write ( unit=errstr, fmt=
'(A,I3,A)' ) &
333 'BUFRLIB: READERME - STORED NEW DX TABLE CONSISTING OF (',
idrdm(lun),
') MESSAGES;'
335 errstr =
'WILL APPLY THIS TABLE TO ALL SUBSEQUENT DATA MESSAGES UNTIL NEXT DX TABLE IS PASSED IN'
337 call errwrt(
'+++++++++++++++++++++++++++++++++++++++++++++++++')
360 use modv_vars,
only: mxmsgld4
364 integer,
intent(in) :: lunit
365 integer,
intent(out) :: mesg(*), iret
368 call status(lunit,lun,il,im)
372 if(iret==-3)
call errwrt(
'BUFRLIB: RDMSGW - SKIPPING OVERLARGE MESSAGE')
373 if(iret==-2)
call errwrt(
'BUFRLIB: RDMSGW - SKIPPING CORRUPTED MESSAGE')
408 recursive subroutine openmb(lunit,subset,jdate)
412 use modv_vars,
only: im8b
418 integer,
intent(in) :: lunit, jdate
419 integer my_lunit, my_jdate, lun, il, im, mtyp, mstb, inod,
i4dy, lcsb,
bort_target_set
421 character*(*),
intent(in) :: subset
430 call x84(lunit,my_lunit,1)
431 call x84(jdate,my_jdate,1)
432 call openmb(my_lunit,subset,my_jdate)
440 call strsuc(subset,csubset,lcsb)
448 call status(lunit,lun,il,im)
449 if(il==0)
call bort(
'BUFRLIB: OPENMB - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
450 if(il<0)
call bort(
'BUFRLIB: OPENMB - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
454 call nemtba(lun,subset,mtyp,mstb,inod)
461 call wtstat(lunit,lun,il, 1)
490 recursive subroutine openmg(lunit,subset,jdate)
494 use modv_vars,
only: im8b
500 integer,
intent(in) :: lunit, jdate
501 integer my_lunit, my_jdate, lun, il, im, mtyp, mstb, inod,
i4dy, lcsb,
bort_target_set
503 character*(*),
intent(in) :: subset
510 call x84(lunit,my_lunit,1)
511 call x84(jdate,my_jdate,1)
512 call openmg(my_lunit,subset,my_jdate)
520 call strsuc(subset,csubset,lcsb)
528 call status(lunit,lun,il,im)
529 if(il==0)
call bort(
'BUFRLIB: OPENMG - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
530 if(il<0)
call bort(
'BUFRLIB: OPENMG - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
531 if(im/=0)
call closmg(lunit)
532 call wtstat(lunit,lun,il, 1)
536 call nemtba(lun,subset,mtyp,mstb,inod)
568 use modv_vars,
only: im8b
576 integer,
intent(in) :: lunin
583 call x84(lunin,my_lunin,1)
600 call status(lunit,lun,il,im)
601 if(lunit/=lunin)
msglim(lun) = 0
602 if(il==0)
call bort(
'BUFRLIB: CLOSMG - OUTPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR OUTPUT')
603 if(il<0)
call bort(
'BUFRLIB: CLOSMG - OUTPUT BUFR FILE IS OPEN FOR INPUT, IT MUST BE OPEN FOR OUTPUT')
609 else if(
nsub(lun)<0)
then
613 call wtstat(lunit,lun,il,0)
641 use modv_vars,
only: mxmsgld4, iprt, nby5, bmostr, bmcstr
653 integer,
intent(in) :: lunit, mgbyt, mesg(*)
654 integer iec0(2), mbyt, ibit, kbit, ii, jj, len0, len1, len2, len3, len4, l5, iad4, iad5, lun, il, im, npbyt, mwrd, &
655 nmwrd, iupbs01, idxmsg
668 call pkb(mbyt,24,iec0,ibit)
670 do ii = 1, nmwrd(iec0)
679 if(
cmnem(jj)==
'BEN')
then
686 mbyt = iupbs01(
mgwb,
'LENM')
688 do ii = 1, nmwrd(
mgwb)
702 if ( (
csmf==
'Y' ) .and. ( idxmsg(
mgwa)/=1 ) )
then
708 call pkc(bmcstr,nby5,
mgwa,ibit)
711 mbyt = iupbs01(
mgwb,
'LENM')
713 do ii = 1, nmwrd(
mgwb)
721 if ( (
ctrt==
'Y' ) .and. ( idxmsg(
mgwa)/=1 ) )
then
727 mbyt = iupbs01(
mgwb,
'LENM')
729 do ii = 1, nmwrd(
mgwb)
741 if(iupbs01(
mgwa,
'BEN')<4)
then
742 if(mod(len1,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 1 IS NOT A MULTIPLE OF 2')
743 if(mod(len2,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 2 IS NOT A MULTIPLE OF 2')
744 if(mod(len3,2)/=0)
call bort (
'BUFRLIB: MSGWRT - LENGTH OF SECTION 3 IS NOT A MULTIPLE OF 2')
745 if(mod(len4,2)/=0)
then
747 iad4 = len0+len1+len2+len3
765 call pkc(bmcstr,nby5,
mgwa,kbit)
776 call status(lunit,lun,il,im)
777 if(
null(lun)==0)
then
783 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
784 write ( unit=errstr, fmt=
'(A,I4,A,I7)')
'BUFRLIB: MSGWRT: LUNIT =', lunit,
', BYTES =', mbyt+npbyt
786 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
792 if(idxmsg(
mgwa)/=1)
then
813 use modv_vars,
only: mtv, nby0, nby1, nby2, nby3, nby5, bmostr, bmcstr, fxy_fbit, fxy_sbyct, fxy_drf8
822 integer,
intent(in) :: lun
823 integer nby4, nbyt, mtyp, msbt, inod, isub, iret, mcen, mear, mmon, mday, mour, mmin, mbit, ifxy
825 character*128 bort_str
832 call nemtba(lun,subtag,mtyp,msbt,inod)
833 if(
inode(lun)/=inod)
then
834 write(bort_str,
'("BUFRLIB: MSGINI - MISMATCH BETWEEN INODE (=",I7,") & POSITIONAL INDEX, INOD (",I7,") '// &
835 'OF SUBTAG (",A,") IN DICTIONARY")')
inode(lun), inod, subtag
838 call nemtab(lun,subtag,isub,tab,iret)
840 write(bort_str,
'("BUFRLIB: MSGINI - TABLE A MESSAGE TYPE MNEMONIC ",A," NOT FOUND IN INTERNAL TABLE D ARRAYS")') subtag
846 mcen = mod(
idate(lun)/10**8,100)+1
847 mear = mod(
idate(lun)/10**6,100)
848 mmon = mod(
idate(lun)/10**4,100)
849 mday = mod(
idate(lun)/10**2,100)
850 mour = mod(
idate(lun) ,100)
853 if(mcen==1)
call bort (
'BUFRLIB: MSGINI - BUFR MESSAGE DATE (IDATE) is 0000000000')
855 if(mear==0) mcen = mcen-1
856 if(mear==0) mear = 100
862 nbyt = nby0+nby1+nby2+nby3+nby4+nby5
866 call pkc(bmostr, 4 ,
mbay(1,lun),mbit)
867 call pkb(nbyt , 24 ,
mbay(1,lun),mbit)
868 call pkb( 3 , 8 ,
mbay(1,lun),mbit)
872 call pkb(nby1 , 24 ,
mbay(1,lun),mbit)
873 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
874 call pkb( 3 , 8 ,
mbay(1,lun),mbit)
875 call pkb( 7 , 8 ,
mbay(1,lun),mbit)
876 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
877 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
878 call pkb(mtyp , 8 ,
mbay(1,lun),mbit)
879 call pkb(msbt , 8 ,
mbay(1,lun),mbit)
880 call pkb( mtv , 8 ,
mbay(1,lun),mbit)
881 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
882 call pkb(mear , 8 ,
mbay(1,lun),mbit)
883 call pkb(mmon , 8 ,
mbay(1,lun),mbit)
884 call pkb(mday , 8 ,
mbay(1,lun),mbit)
885 call pkb(mour , 8 ,
mbay(1,lun),mbit)
886 call pkb(mmin , 8 ,
mbay(1,lun),mbit)
887 call pkb(mcen , 8 ,
mbay(1,lun),mbit)
891 call pkb(nby3 , 24 ,
mbay(1,lun),mbit)
892 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
893 call pkb( 0 , 16 ,
mbay(1,lun),mbit)
894 call pkb(2**7 , 8 ,
mbay(1,lun),mbit)
895 call pkb(ifxy(fxy_sbyct), 16,
mbay(1,lun),mbit)
896 call pkb(isub , 16 ,
mbay(1,lun),mbit)
897 call pkb(ifxy(
'102000') , 16,
mbay(1,lun),mbit)
898 call pkb(ifxy(fxy_drf8) , 16,
mbay(1,lun),mbit)
899 call pkb(ifxy(
'206001') , 16,
mbay(1,lun),mbit)
900 call pkb(ifxy(fxy_fbit), 16,
mbay(1,lun),mbit)
901 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
905 call pkb(nby4 , 24 ,
mbay(1,lun),mbit)
906 call pkb( 0 , 8 ,
mbay(1,lun),mbit)
910 call pkc(bmcstr,nby5,
mbay(1,lun),mbit)
914 if(mod(mbit,8)/=0)
call bort(
'BUFRLIB: MSGINI - INITIALIZED MESSAGE DOES NOT END ON A BYTE BOUNDARY')
915 if(mbit/8/=nbyt)
then
916 write(bort_str,
'("BUFRLIB: MSGINI - NUMBER OF BYTES STORED FOR INITIALIZED MESSAGE (",I6,") IS NOT THE SAME AS FIRST '// &
917 'CALCULATED, NBYT (",I6)') mbit/8, nbyt
940 logical function msgfull(msiz,itoadd,mxsiz)
result(bool)
942 use modv_vars,
only: maxnc
949 integer,
intent(in) :: msiz, itoadd, mxsiz
964 if(
ctrt==
'Y') iwgbyt = iwgbyt + 6
967 if(
csmf==
'Y') iwgbyt = iwgbyt + (maxnc*2)
971 if ( ( msiz + itoadd + iwgbyt ) > mxsiz )
then
999 use modv_vars,
only: mxmsgl, im8b, iprt
1005 integer,
intent(in) :: maxo
1006 integer my_maxo, newsiz, nxstr, ldxa, ldxb, ldxd, ld30
1008 character*128 errstr
1011 common /dxtab/ nxstr(10), ldxa(10), ldxb(10), ldxd(10), ld30(10), dxstr(10)
1018 call x84(maxo,my_maxo,1)
1025 if((maxo==0).or.(maxo>mxmsgl))
then
1033 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1034 write ( unit=errstr, fmt=
'(A,A,I7,A,I7)' )
'BUFRLIB: MAXOUT - THE RECORD LENGTH OF ALL BUFR MESSAGES ',&
1035 'CREATED FROM THIS POINT ON IS BEING CHANGED FROM ',
maxbyt,
' TO ', newsiz
1037 call errwrt(
'++++++++++++++BUFR ARCHIVE LIBRARY+++++++++++++++++')
1078 use modv_vars,
only: nbytw
1082 integer,
intent(in) :: lmesg
1083 integer,
intent(inout) :: mesg(*)
1084 integer,
intent(out) :: npbyt
1085 integer nmw, nmb, ibit, i, nmwrd, iupbs01
1091 if(nmw>lmesg)
call bort(
'BUFRLIB: PADMSG - CANNOT ADD PADDING TO MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1095 nmb = iupbs01(mesg,
'LENM')
1097 npbyt = ( nmw * nbytw ) - nmb
1099 call pkb(0,8,mesg,ibit)
1115 recursive integer function nmsub(lunit)
result(iret)
1119 use modv_vars,
only: im8b
1125 integer,
intent(in) :: lunit
1132 call x84(lunit,my_lunit,1)
1133 iret=
nmsub(my_lunit)
1150 call status(lunit,lun,il,im)
1151 if(il==0)
call bort(
'BUFRLIB: NMSUB - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
1152 if(il>0)
call bort(
'BUFRLIB: NMSUB - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
1153 if(im==0)
call bort(
'BUFRLIB: NMSUB - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
1173 integer function nmwrd(mbay)
result(iret)
1175 use modv_vars,
only: nbytw
1179 integer,
intent(in) :: mbay(*)
1186 iret = ((lenm/8)+1)*(8/nbytw)
1205 integer function lmsg(sec0)
result(iret)
1209 integer msec0(2),
nmwrd
1211 character*8,
intent(in) :: sec0
1214 equivalence(msec0,csec0)
1241 recursive subroutine getlens (mbay,ll,len0,len1,len2,len3,len4,len5)
1243 use modv_vars,
only: im8b, nby5
1247 integer,
intent(in) :: mbay(*), ll
1248 integer,
intent(out) :: len0, len1, len2, len3, len4, len5
1254 call x84(ll,my_ll,1)
1255 call getlens(mbay,my_ll,len0,len1,len2,len3,len4,len5)
1256 call x48(len0,len0,1)
1257 call x48(len1,len1,1)
1258 call x48(len2,len2,1)
1259 call x48(len3,len3,1)
1260 call x48(len4,len4,1)
1261 call x48(len5,len5,1)
1281 len2 =
iupb(mbay,iad2+1,24) *
iupbs01(mbay,
'ISC2')
1285 len3 =
iupb(mbay,iad3+1,24)
1289 len4 =
iupb(mbay,iad4+1,24)
1321 recursive subroutine cnved4(msgin,lmsgot,msgot)
1325 use modv_vars,
only: im8b, nbytw
1329 integer,
intent(in) :: msgin(*), lmsgot
1330 integer,
intent(out) :: msgot(*)
1331 integer my_lmsgot, i, nmw, len0, len1, len2, len3, l4, l5, iad2, iad4, lenm, lenmot, len1ot, len3ot, ibit, &
1338 call x84 ( lmsgot, my_lmsgot, 1 )
1339 call cnved4 ( msgin, my_lmsgot*2, msgot )
1352 if(
iupbs01(msgin,
'BEN')==4)
then
1358 call bort(
'BUFRLIB: CNVED4 - OVERFLOW OF OUTPUT (EDITION 4) MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1367 call getlens(msgin,3,len0,len1,len2,len3,l4,l5)
1370 iad4 = iad2 + len2 + len3
1378 if(lenmot>(lmsgot*nbytw)) &
1379 call bort(
'BUFRLIB: CNVED4 - OVERFLOW OF OUTPUT (EDITION 4) MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
1386 call mvb ( msgin, 1, msgot, 1, 4 )
1388 call pkb ( lenmot, 24, msgot, ibit )
1389 call pkb ( 4, 8, msgot, ibit )
1393 call pkb ( len1ot, 24, msgot, ibit )
1394 call pkb (
iupbs01(msgin,
'BMT'), 8, msgot, ibit )
1395 call pkb (
iupbs01(msgin,
'OGCE'), 16, msgot, ibit )
1396 call pkb (
iupbs01(msgin,
'GSES'), 16, msgot, ibit )
1397 call pkb (
iupbs01(msgin,
'USN'), 8, msgot, ibit )
1398 call pkb (
iupbs01(msgin,
'ISC2')*128, 8, msgot, ibit )
1399 call pkb (
iupbs01(msgin,
'MTYP'), 8, msgot, ibit )
1401 call pkb ( 255, 8, msgot, ibit )
1402 call pkb (
iupbs01(msgin,
'MSBT'), 8, msgot, ibit )
1403 call pkb (
iupbs01(msgin,
'MTV'), 8, msgot, ibit )
1404 call pkb (
iupbs01(msgin,
'MTVL'), 8, msgot, ibit )
1405 call pkb (
iupbs01(msgin,
'YEAR'), 16, msgot, ibit )
1406 call pkb (
iupbs01(msgin,
'MNTH'), 8, msgot, ibit )
1407 call pkb (
iupbs01(msgin,
'DAYS'), 8, msgot, ibit )
1408 call pkb (
iupbs01(msgin,
'HOUR'), 8, msgot, ibit )
1409 call pkb (
iupbs01(msgin,
'MINU'), 8, msgot, ibit )
1411 call pkb ( 0, 8, msgot, ibit )
1415 call mvb ( msgin, iad2+1, msgot, (ibit/8)+1, len2+len3-1 )
1419 ibit = ( len0 + len1ot + len2 ) * 8
1420 call pkb ( len3ot, 24, msgot, ibit )
1424 ibit = ibit + ( len3ot * 8 ) - 24
1425 call mvb ( msgin, iad4+1, msgot, (ibit/8)+1, lenm-iad4 )
1441 recursive integer function ifbget(lunit)
result(iret)
1445 use modv_vars,
only: im8b
1451 integer,
intent(in) :: lunit
1458 call x84(lunit,my_lunit,1)
1476 call status(lunit,lun,il,im)
1477 if(il==0)
call bort(
'BUFRLIB: IFBGET - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
1478 if(il>0)
call bort(
'BUFRLIB: IFBGET - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
1479 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...
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.
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...
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, 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 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.