41 recursive subroutine ufbdmp(lunin,luprt)
43 use modv_vars,
only: im8b
52 integer,
intent(in) :: lunin, luprt
53 integer,
parameter :: mxfv = 31
54 integer ifv(mxfv), my_lunin, my_luprt, luout, lunit, lun, il, im, nv, nd, it, ib, is, ir, jp, lk, jb, &
57 character lchr2*120, lchr*20, pmiss*20, bits*14, tg*10, tg_rj*10, vc*8, fmtf*7, tp*3, tab, you
63 data pmiss /
' MISSING'/
71 call x84(lunin,my_lunin,1)
72 call x84(luprt,my_luprt,1)
73 call ufbdmp(my_lunin,my_luprt)
88 call status(lunit,lun,il,im)
89 if(il==0)
call bort(
'BUFRLIB: UFBDMP - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
90 if(il>0)
call bort(
'BUFRLIB: UFBDMP - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
91 if(im==0)
call bort(
'BUFRLIB: UFBDMP - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
92 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBDMP - LOCATION OF INTERNAL TABLE FOR '// &
93 'INPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
98 if(luprt==0 .and. mod(nv,20)==0)
then
102 print*,
'(<enter> for MORE, q <enter> to QUIT)'
110 print*,
'==> You have chosen to stop the dumping of this subset'
130 call nemtab(lun,tg,idn,tab,n)
131 if(
tabb(n,lun)(71:75)==
'FLAG')
then
135 call upftbv(lunit,tg,vl,mxfv,ifv,nifv)
141 write(fmtf,
'(A2,I1,A4)')
'(I', isz,
',A1)'
142 if((ipt+isz)<=14)
then
143 write(bits(ipt:ipt+isz),fmtf) ifv(ii),
','
146 bits(2:13) =
'MANY BITS ON'
150 bits(ipt-1:ipt-1) =
')'
154 if(
ibfms(vl)/=0)
then
155 write(luout,
'(I5,1X,A3,A1,I1,1X,A10,1X, A20, 14X,7(1X,I5))') nv,tp,
'-',it,tg_rj,pmiss,ib,is,ir,nd,jp,lk,jb
157 if(lunit==lunin)
then
158 write(luout,
'(I5,1X,A3,A1,I1,1X,A10,5X,G15.6,1X,A14,7(1X,I5))') nv,tp,
'-',it,tg_rj,vl,bits,ib,is,ir,nd,jp,lk,jb
160 write(luout,
'(I5,1X,A3,A1,I1,1X,A10,5X,F15.6,1X,A14,7(1X,I5))') nv,tp,
'-',it,tg_rj,vl,bits,ib,is,ir,nd,jp,lk,jb
166 call readlc(lunit,lchr2,tg_rj)
167 if (
icbfms(lchr2,nchr)/=0)
then
173 if(
ibfms(vl)/=0)
then
179 if ( nchr<=20 .or. lchr==pmiss )
then
181 write(luout,
'(I5,1X,A3,A1,I1,1X,A10,1X, A20, 14X,7(1X,I5))') nv,tp,
'-',it,tg_rj,lchr,ib,is,ir,nd,jp,lk,jb
183 write(luout,
'(I5,1X,A3,A1,I1,1X,A10,1X, A, 7(1X,I5))') nv,tp,
'-',it,tg_rj,lchr2(1:nchr),ib,is,ir,nd,jp,lk,jb
188 write(luout,
'(/A/)')
' >>> END OF SUBSET <<< '
231 use modv_vars,
only: im8b
242 integer,
intent(in) :: lunit, luprt
243 integer,
parameter :: mxfv = 31 , mxcfdp = 5, mxseq = 10, mxls = 10
244 integer ifv(mxfv), icfdp(mxcfdp), idxrep(mxseq), numrep(mxseq), lsqnam(mxseq), lsct(mxls), my_lunit, my_luprt, &
245 nseq, nls, lcfmeang, luout, lun, il, im, node, lnm2, lnm3, itmp, ityp, ii, jj, nifv, nv, n, nchr, idn, ipt, &
246 nrfe, nout, lcfmg, ifvd, iersf, ierbd, ierft, isz,
isize, iscl,
ireadmt,
ibfms,
icbfms,
imrkopr
251 character cfmeang*120, lchr2*120, fmt*80, desc*64, unit*24, lchr*20, pmiss*20, nemo3*15, nemo*10, nemo2*10, tagrfe*10, &
252 seqnam(mxseq)*10, lsnemo(mxls)*10, nemod*8, cval*8, fmtf*7, numb*6, type*3, tab, you
254 logical track, found, rdrv
256 equivalence(rval,cval)
258 data pmiss /
' MISSING'/
266 call x84(lunit,my_lunit,1)
267 call x84(luprt,my_luprt,1)
268 call ufdump(my_lunit,my_luprt)
276 lcfmeang = len(cfmeang)
286 call status(lunit,lun,il,im)
287 if(il==0)
call bort(
'BUFRLIB: UFDUMP - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
288 if(il>0)
call bort(
'BUFRLIB: UFDUMP - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
289 if(im==0)
call bort(
'BUFRLIB: UFDUMP - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
290 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFDUMP - LOCATION OF INTERNAL TABLE FOR '// &
291 'INPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
293 write(luout,
'(/,2A,/)')
'MESSAGE TYPE ',
tag(
inode(lun))
303 if(luprt==0 .and. mod(nv,20)==0)
then
307 print*,
'(<enter> for MORE, q <enter> to QUIT)'
315 print*,
'==> You have chosen to stop the dumping of this subset'
326 if(ityp>=1.and.ityp<=3)
then
327 call nemtab(lun,nemo,idn,tab,n)
329 numb =
tabb(n,lun)(1:6)
330 desc =
tabb(n,lun)(16:70)
331 unit =
tabb(n,lun)(71:94)
336 if((ityp==0).or.(ityp==1))
then
340 if((type==
'REP').or.(type==
'DRP').or.(type==
'DRB').or.(type==
'DRS'))
then
344 if(nseq>mxseq)
call bort(
'BUFRLIB: UFDUMP - MXSEQ OVERFLOW')
346 numrep(nseq) =
irf(node)
348 numrep(nseq) = nint(rval)
350 call strsuc(nemo,nemo2,lnm2)
351 fmt =
'(11X,A,I6,1X,A)'
352 write(luout,fmt) nemo2(1:lnm2), numrep(nseq),
'REPLICATIONS'
355 if(numrep(nseq)>1)
then
364 elseif( ((type==
'SEQ').or.(type==
'RPC').or.(type==
'RPS')) .and. (nseq>0) )
then
369 call strsuc(nemo,nemo2,lnm2)
370 do while ((ii>=1).and.(.not.track))
371 if(nemo2(1:lnm2)==seqnam(ii)(2:lsqnam(ii)-1))
then
374 fmt =
'(4X,A,2X,A,2X,A,I6,2X,A)'
375 write(luout,fmt)
'++++++', nemo2(1:lnm2),
'REPLICATION #', idxrep(ii),
'++++++'
376 if(idxrep(ii)<numrep(ii))
then
378 idxrep(ii) = idxrep(ii)+1
395 do while ((jj<=
nnrv).and.(.not.rdrv))
398 desc =
'New reference value for ' // nemo
409 tagrfe =
tag(
inv(nrfe,lun))
411 do while((jj>=1).and.(desc(jj:jj)==
' '))
414 if(jj<=33) desc(jj+1:jj+15) =
' for ' // tagrfe
418 if(
ibfms(rval)/=0)
then
420 fmt =
'(A6,2X,A10,2X,A20,2X,A24,6X,A48)'
421 write(luout,fmt) numb,nemo,pmiss,unit,desc
423 fmt =
'(A6,2X,A10,2X, ,2X,A24,6X,A48)'
431 write(fmt(15:20),
'(A,I2)')
'F20.', iscl
433 write(fmt(18:20),
'(A)')
'I20'
435 if(unit(1:4)==
'FLAG')
then
437 call upftbv(lunit,nemo,rval,mxfv,ifv,nifv)
443 write(fmtf,
'(A2,I1,A4)')
'(I', isz,
',A1)'
444 if((ipt+isz)<=24)
then
445 write(unit(ipt:ipt+isz),fmtf) ifv(ii),
','
448 unit(12:23) =
'MANY BITS ON'
452 unit(ipt-1:ipt-1) =
')'
456 write(luout,fmt) numb,nemo,rval,unit,desc
459 write(luout,fmt) numb,nemo,ival,unit,desc
461 if( (unit(1:4)==
'FLAG' .or. unit(1:4)==
'CODE') .and. (
cdmf==
'Y') )
then
464 if(unit(1:4)==
'CODE')
then
466 ifv(nifv) = nint(rval)
470 call srchtbf_c(idn,ifv(ii),icfdp(1),mxcfdp,-1,cfmeang,lcfmeang,lcfmg,iersf)
472 write(luout,fmt) ifv(ii),
' = ',cfmeang(1:lcfmg)
474 write(luout,fmt) ifv(ii),
' = ',
'***THIS IS AN ILLEGAL/UNDEFINED VALUE***'
481 do while((jj<iersf).and.(ierft<0))
483 call numtbd(lun,icfdp(jj),nemod,tab,ierbd)
484 if((ierbd>0).and.(tab==
'B'))
call fstag(lun,nemod,-1,nv,nout,ierft)
487 ifvd = nint(
val(nout,lun))
488 if(jj>1) icfdp(1) = icfdp(jj)
489 call srchtbf_c(idn,ifv(ii),icfdp(1),mxcfdp,ifvd,cfmeang,lcfmeang,lcfmg,iersf)
490 if(iersf==0)
write(luout,fmt) ifv(ii),
' = ', cfmeang(1:lcfmg)
502 if(
ibfms(rval)/=0)
then
504 else if(nchr<=8)
then
510 do while((ii<=nls).and.(.not.found))
511 if(nemo==lsnemo(ii))
then
519 if(nls>mxls)
call bort(
'BUFRLIB: UFDUMP - MXLS OVERFLOW')
524 call strsuc(nemo,nemo3,lnm3)
525 lsct(ii) = lsct(ii) + 1
526 write(fmtf,
'(A,I1,A)')
'(2A,I',
isize(lsct(ii)),
')'
527 write(nemo3,fmtf) nemo(1:lnm3),
'#', lsct(ii)
530 call readlc(lunit,lchr2,nemo3)
531 if (
icbfms(lchr2,nchr)/=0)
then
538 if ( nchr<=20 .or. lchr==pmiss )
then
540 fmt =
'(A6,2X,A10,2X,A20,2X,"(",I2,")",A24,2X,A48)'
541 write(luout,fmt) numb,nemo,lchr,nchr,unit,desc
543 fmt =
'(A6,2X,A10,2X,A,2X,"(",I3,")",A23,2X,A48)'
544 write(luout,fmt) numb,nemo,lchr2(1:nchr),nchr,unit,desc
550 write(luout,
'(/A/)')
' >>> END OF SUBSET <<< '
586 use modv_vars,
only: im8b, reps, fxy_fbit, fxy_sbyct, fxy_drp16, fxy_drp8, fxy_drp8s, fxy_drp1, &
587 fxy_drf16, fxy_drf8, fxy_drf1
594 integer,
intent(in) :: lunit, ldxot
595 integer my_lunit, my_ldxot, lun, il, im, n, na, nc, nch, ic, icms, nseq
597 character card*80, cardi1*80, cardi2*80, cardi3*80, cardi4*80, cmstr*20, wrk3*10, wrk1*8, wrk2*8, adn*6
599 logical tbskip, tdskip, xtrci1
601 data cardi1 /
'| | | |'/
602 data cardi2 /
'| | |'/
603 data cardi3 /
'| | | | | |-------------|'/
604 data cardi4 /
'|------------------------------------------------------------------------------|'/
607 tbskip(adn) = ((adn==fxy_sbyct).or.(adn==fxy_fbit).or.(adn==fxy_drf16).or.(adn==fxy_drf8).or.(adn==fxy_drf1))
608 tdskip(adn) = ((adn==fxy_drp16).or.(adn==fxy_drp8).or.(adn==fxy_drp8s).or.(adn==fxy_drp1))
615 call x84(lunit,my_lunit,1)
616 call x84(ldxot,my_ldxot,1)
617 call dxdump(my_lunit,my_ldxot)
625 call status(lunit,lun,il,im)
626 if(il==0)
call bort(
'BUFRLIB: DXDUMP - BUFR FILE IS CLOSED, IT MUST BE OPEN')
633 write (ldxot,
'(A)') card
638 card(15:64)=
' USER DEFINITIONS FOR TABLE-A TABLE-B TABLE D '
639 write (ldxot,
'(A)') card
641 write (ldxot,
'(A)') cardi4
644 card( 3:10)=
'MNEMONIC'
646 card(23:33)=
'DESCRIPTION'
647 write (ldxot,
'(A)') card
652 write (ldxot,
'(A)') card
656 write (ldxot,
'(A)') cardi1
660 if(.not.tdskip(
tabd(n,lun)(1:6)))
then
662 card( 3:10)=
tabd(n,lun)( 7:14)
663 card(14:19)=
tabd(n,lun)( 1: 6)
664 card(23:77)=
tabd(n,lun)(16:70)
669 if(
taba(na,lun)(4:11)==
tabd(n,lun)(7:14))
then
671 if(na==
ntba(lun)) xtrci1=.true.
675 write (ldxot,
'(A)') card
677 write (ldxot,
'(A)') cardi1
685 write (ldxot,
'(A)') cardi1
688 if(.not.tbskip(
tabb(n,lun)(1:6)))
then
690 card( 3:10)=
tabb(n,lun)( 7:14)
691 card(14:19)=
tabb(n,lun)( 1: 6)
692 card(23:77)=
tabb(n,lun)(16:70)
693 write (ldxot,
'(A)') card
697 write (ldxot,
'(A)') cardi1
701 write (ldxot,
'(A)') cardi4
704 card( 3:10)=
'MNEMONIC'
705 card(14:21)=
'SEQUENCE'
706 write (ldxot,
'(A)') card
710 write (ldxot,
'(A)') card
714 write (ldxot,
'(A)') cardi2
717 if(.not.tdskip(
tabd(n,lun)(1:6)))
then
719 card( 3:10)=
tabd(n,lun)( 7:14)
729 if(
irp(nc,1)/=0)
then
732 cmstr(icms:icms)=reps(
irp(nc,1))
734 cmstr(icms+1:icms+nch)=wrk2(1:nch)
736 if(
irp(nc,1)/=0)
then
739 cmstr(icms:icms)=reps(
irp(nc,1)+5)
741 if(
krp(nc,1)/=0)
then
744 write (wrk1,
'(I3)')
krp(nc,1)
745 call strsuc(wrk1,wrk2,nch)
746 cmstr(icms+1:icms+nch)=wrk2(1:nch)
751 if(ic>(79-icms))
then
752 write (ldxot,
'(A)') card
754 card( 3:10)=
tabd(n,lun)( 7:14)
757 card(ic:ic+icms-1)=cmstr(1:icms)
762 write (ldxot,
'(A)') card
763 write (ldxot,
'(A)') cardi2
770 write (ldxot,
'(A)') cardi4
773 card( 3:10)=
'MNEMONIC'
775 card(21:29)=
'REFERENCE'
778 write (ldxot,
'(A)') card
786 write (ldxot,
'(A)') card
790 write (ldxot,
'(A)') cardi3
793 if(.not.tbskip(
tabb(n,lun)(1:6)))
then
795 card( 3:10)=
tabb(n,lun)( 7:14)
796 card(41:64)=
tabb(n,lun)(71:94)
799 card(17-nch+1:17)=wrk2
800 if(
tabb(n,lun)(95:95)==
'-') card(17-nch:17-nch)=
'-'
803 card(31-nch+1:31)=wrk3
804 if(
tabb(n,lun)(99:99)==
'-') card(31-nch:31-nch)=
'-'
807 card(37-nch+1:37)=wrk2
808 write (ldxot,
'(a)') card
812 write (ldxot,
'(A)') cardi3
819 write (ldxot,
'(A)') card
834 recursive subroutine getabdb(lunit,tabdb,itab,jtab)
836 use modv_vars,
only: im8b
843 integer,
intent(in) :: lunit, itab
844 integer,
intent(out) :: jtab
845 integer my_lunit, my_itab, lun, il, im, i, j, k, nseq
847 character*128,
intent(out) :: tabdb(*)
854 call x84(lunit,my_lunit,1)
855 call x84(itab,my_itab,1)
856 call getabdb(my_lunit,tabdb,my_itab,jtab)
857 call x48(jtab,jtab,1)
866 call status(lunit,lun,il,im)
872 nemo =
tabd(i,lun)(7:14)
877 write(tabdb(jtab),fmt=
'(A,A8,10(1X,A10))')
'D ', nemo, (
nem(k,1),k=j,min(j+9,nseq))
887 write(tabdb(jtab),fmt=
'(A,A8,1X,A42)')
'B ',
tabb(i,lun)(7:14),
tabb(i,lun)(71:112)
integer function imrkopr(nemo)
Check whether a specified mnemonic is a Table C marker operator.
subroutine bort(str)
Log an error message, then abort the application program.
recursive subroutine upftbv(lunit, nemo, val, mxib, ibit, nib)
Given a Table B mnemonic with flag table units and a corresponding numerical data value,...
recursive subroutine ufdump(lunit, luprt)
Print a verbose listing of the contents of a data subset, including all data values and replicated se...
recursive subroutine getabdb(lunit, tabdb, itab, jtab)
Get Table B and Table D information from the internal DX BUFR tables.
recursive subroutine dxdump(lunit, ldxot)
Print a copy of the DX BUFR table associated with a specified Fortran logical unit.
recursive subroutine ufbdmp(lunin, luprt)
Print a verbose listing of the contents of a data subset, including all data values and replicated se...
subroutine nemtbd(lun, itab, nseq, nems, irps, knts)
Get information about a Table D descriptor from the internal DX BUFR tables.
subroutine nemtab(lun, nemo, idn, tab, iret)
Get information about a descriptor, based on a mnemonic.
subroutine numtbd(lun, idn, nemo, tab, iret)
Get information about a Table B or Table D descriptor, based on the WMO bit-wise representation of an...
subroutine fstag(lun, utag, nutag, nin, nout, iret)
Search for a specified occurrence of a specified mnemonic within a data subset definition,...
integer function ireadmt(lun)
Check the most recent BUFR message that was read via a call to one of the message-reading subroutines...
subroutine strsuc(str1, str2, lens)
Remove leading and trailing blanks from a character string.
integer function isize(num)
Compute the number of characters needed to encode an integer as a string.
recursive integer function icbfms(str, lstr)
Check whether a character string returned from a previous call to subroutine readlc() was encoded as ...
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 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 nsub
Current subset pointer within message.
Declare arrays used by various subroutines to hold information about Table D sequences.
integer, dimension(:,:), allocatable krp
Replication counts corresponding to nem:
integer, dimension(:,:), allocatable irp
Replication indicators corresponding to nem:
character *8, dimension(:,:), allocatable nem
Child mnemonics within Table D sequences.
Declare arrays and variables for use with any 2-03-YYY (change reference value) operators present wit...
integer nnrv
Number of entries in the jump/link table which contain new reference values (up to a maximum of mxnrv...
integer, dimension(:), allocatable inodnrv
Entries within jump/link table which contain new reference values.
Declare arrays and variables used to store DX BUFR tables internally for multiple file IDs.
integer, dimension(:), allocatable ntba
Number of Table A entries for each file ID (up to a maximum of maxtba, whose value is stored in array...
character *600, dimension(:,:), allocatable tabd
Table D entries for each file ID.
character *128, dimension(:,:), allocatable taba
Table A entries for each file ID.
integer, dimension(:), allocatable ntbd
Number of Table D entries for each file ID (up to a maximum of maxtbd, whose value is stored in array...
integer, dimension(:), allocatable ntbb
Number of Table B entries for each file ID (up to a maximum of maxtbb, whose value is stored in array...
character *128, dimension(:,:), allocatable tabb
Table B entries for each file ID.
Declare a variable used to indicate whether master code and flag tables should be read.
character cdmf
Flag indicating whether to include code and flag table information during reads of master BUFR tables...
Declare arrays and variables used to store the internal jump/link table.
integer, dimension(:), allocatable irf
Reference values corresponding to tag and typ:
integer, dimension(:), allocatable isc
Scale factors corresponding to tag and typ:
integer, dimension(:), allocatable ibt
Bit widths corresponding to tag and typ:
character *3, dimension(:), allocatable typ
Type indicators corresponding to tag:
integer, dimension(:), allocatable jmpb
Jump backward indices corresponding to tag and typ:
character *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
integer, dimension(:), allocatable jump
Jump forward indices corresponding to tag and typ:
integer, dimension(:), allocatable itp
Integer type values corresponding to typ:
integer, dimension(:), allocatable link
Link indices corresponding to tag, typ and jmpb:
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...
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 readlc(lunit, chr, str)
Read a long character string (greater than 8 bytes) from 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.