41 recursive subroutine ufbdmp(lunin,luprt)
45 use modv_vars,
only: im8b
54 integer,
intent(in) :: lunin, luprt
55 integer,
parameter :: mxfv = 31
56 integer ifv(mxfv), my_lunin, my_luprt, luout, lunit, lun, il, im, nv, nd, it, ib, is, ir, jp, lk, jb, &
57 idn, nifv, nchr, n, ii, ipt, isz,
isize,
ibfms,
icbfms,
bort_target_set
59 character lchr2*120, lchr*20, pmiss*20, bits*14, tg*10, tg_rj*10, vc*8, fmtf*7, tp*3, tab, you
65 data pmiss /
' MISSING'/
72 call x84(lunin,my_lunin,1)
73 call x84(luprt,my_luprt,1)
74 call ufbdmp(my_lunin,my_luprt)
96 call status(lunit,lun,il,im)
97 if(il==0)
call bort(
'BUFRLIB: UFBDMP - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
98 if(il>0)
call bort(
'BUFRLIB: UFBDMP - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
99 if(im==0)
call bort(
'BUFRLIB: UFBDMP - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
100 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFBDMP - LOCATION OF INTERNAL TABLE FOR '// &
101 'INPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
106 if(luprt==0 .and. mod(nv,20)==0)
then
110 print*,
'(<enter> for MORE, q <enter> to QUIT)'
118 print*,
'==> You have chosen to stop the dumping of this subset'
138 call nemtab(lun,tg,idn,tab,n)
139 if(
tabb(n,lun)(71:75)==
'FLAG')
then
143 call upftbv(lunit,tg,vl,mxfv,ifv,nifv)
149 write(fmtf,
'(A2,I1,A4)')
'(I', isz,
',A1)'
150 if((ipt+isz)<=14)
then
151 write(bits(ipt:ipt+isz),fmtf) ifv(ii),
','
154 bits(2:13) =
'MANY BITS ON'
158 bits(ipt-1:ipt-1) =
')'
162 if(
ibfms(vl)/=0)
then
163 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
165 if(lunit==lunin)
then
166 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
168 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
174 call readlc(lunit,lchr2,tg_rj)
175 if (
icbfms(lchr2,nchr)/=0)
then
181 if(
ibfms(vl)/=0)
then
187 if ( nchr<=20 .or. lchr==pmiss )
then
189 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
191 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
196 write(luout,
'(/A/)')
' >>> END OF SUBSET <<< '
239 use modv_vars,
only: im8b
250 integer,
intent(in) :: lunit, luprt
251 integer,
parameter :: mxfv = 31 , mxcfdp = 5, mxseq = 10, mxls = 10
252 integer ifv(mxfv), icfdp(mxcfdp), idxrep(mxseq), numrep(mxseq), lsqnam(mxseq), lsct(mxls), my_lunit, my_luprt, &
253 nseq, nls, lcfmeang, luout, lun, il, im, node, lnm2, lnm3, itmp, ityp, ii, jj, nifv, nv, n, nchr, idn, ipt, &
254 nrfe, nout, lcfmg, ifvd, iersf, ierbd, ierft, isz,
isize, iscl,
ireadmt,
ibfms,
icbfms,
imrkopr,
bort_target_set
259 character cfmeang*120, lchr2*120, fmt*80, desc*64, unit*24, lchr*20, pmiss*20, nemo3*15, nemo*10, nemo2*10, tagrfe*10, &
260 seqnam(mxseq)*10, lsnemo(mxls)*10, nemod*8, cval*8, fmtf*7, numb*6, type*3, tab, you
262 logical track, found, rdrv
264 equivalence(rval,cval)
266 data pmiss /
' MISSING'/
273 call x84(lunit,my_lunit,1)
274 call x84(luprt,my_luprt,1)
275 call ufdump(my_lunit,my_luprt)
290 lcfmeang = len(cfmeang)
300 call status(lunit,lun,il,im)
301 if(il==0)
call bort(
'BUFRLIB: UFDUMP - INPUT BUFR FILE IS CLOSED, IT MUST BE OPEN FOR INPUT')
302 if(il>0)
call bort(
'BUFRLIB: UFDUMP - INPUT BUFR FILE IS OPEN FOR OUTPUT, IT MUST BE OPEN FOR INPUT')
303 if(im==0)
call bort(
'BUFRLIB: UFDUMP - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE, NONE ARE')
304 if(
inode(lun)/=
inv(1,lun))
call bort(
'BUFRLIB: UFDUMP - LOCATION OF INTERNAL TABLE FOR '// &
305 'INPUT BUFR FILE DOES NOT AGREE WITH EXPECTED LOCATION IN INTERNAL SUBSET ARRAY')
307 write(luout,
'(/,2A,/)')
'MESSAGE TYPE ',
tag(
inode(lun))
317 if(luprt==0 .and. mod(nv,20)==0)
then
321 print*,
'(<enter> for MORE, q <enter> to QUIT)'
329 print*,
'==> You have chosen to stop the dumping of this subset'
340 if(ityp>=1.and.ityp<=3)
then
341 call nemtab(lun,nemo,idn,tab,n)
343 numb =
tabb(n,lun)(1:6)
344 desc =
tabb(n,lun)(16:70)
345 unit =
tabb(n,lun)(71:94)
350 if((ityp==0).or.(ityp==1))
then
354 if((type==
'REP').or.(type==
'DRP').or.(type==
'DRB').or.(type==
'DRS'))
then
358 if(nseq>mxseq)
call bort(
'BUFRLIB: UFDUMP - MXSEQ OVERFLOW')
360 numrep(nseq) =
irf(node)
362 numrep(nseq) = nint(rval)
364 call strsuc(nemo,nemo2,lnm2)
365 fmt =
'(11X,A,I6,1X,A)'
366 write(luout,fmt) nemo2(1:lnm2), numrep(nseq),
'REPLICATIONS'
369 if(numrep(nseq)>1)
then
378 elseif( ((type==
'SEQ').or.(type==
'RPC').or.(type==
'RPS')) .and. (nseq>0) )
then
383 call strsuc(nemo,nemo2,lnm2)
384 do while ((ii>=1).and.(.not.track))
385 if(nemo2(1:lnm2)==seqnam(ii)(2:lsqnam(ii)-1))
then
388 fmt =
'(4X,A,2X,A,2X,A,I6,2X,A)'
389 write(luout,fmt)
'++++++', nemo2(1:lnm2),
'REPLICATION #', idxrep(ii),
'++++++'
390 if(idxrep(ii)<numrep(ii))
then
392 idxrep(ii) = idxrep(ii)+1
409 do while ((jj<=
nnrv).and.(.not.rdrv))
412 desc =
'New reference value for ' // nemo
423 tagrfe =
tag(
inv(nrfe,lun))
425 do while((jj>=1).and.(desc(jj:jj)==
' '))
428 if(jj<=33) desc(jj+1:jj+15) =
' for ' // tagrfe
432 if(
ibfms(rval)/=0)
then
434 fmt =
'(A6,2X,A10,2X,A20,2X,A24,6X,A48)'
435 write(luout,fmt) numb,nemo,pmiss,unit,desc
437 fmt =
'(A6,2X,A10,2X, ,2X,A24,6X,A48)'
445 write(fmt(15:20),
'(A,I2)')
'F20.', iscl
447 write(fmt(18:20),
'(A)')
'I20'
449 if(unit(1:4)==
'FLAG')
then
451 call upftbv(lunit,nemo,rval,mxfv,ifv,nifv)
457 write(fmtf,
'(A2,I1,A4)')
'(I', isz,
',A1)'
458 if((ipt+isz)<=24)
then
459 write(unit(ipt:ipt+isz),fmtf) ifv(ii),
','
462 unit(12:23) =
'MANY BITS ON'
466 unit(ipt-1:ipt-1) =
')'
470 write(luout,fmt) numb,nemo,rval,unit,desc
473 write(luout,fmt) numb,nemo,ival,unit,desc
475 if( (unit(1:4)==
'FLAG' .or. unit(1:4)==
'CODE') .and. (
cdmf==
'Y') )
then
478 if(unit(1:4)==
'CODE')
then
480 ifv(nifv) = nint(rval)
484 call srchtbf_c(idn,ifv(ii),icfdp(1),mxcfdp,-1,cfmeang,lcfmeang,lcfmg,iersf)
486 write(luout,fmt) ifv(ii),
' = ',cfmeang(1:lcfmg)
488 write(luout,fmt) ifv(ii),
' = ',
'***THIS IS AN ILLEGAL/UNDEFINED VALUE***'
495 do while((jj<iersf).and.(ierft<0))
497 call numtbd(lun,icfdp(jj),nemod,tab,ierbd)
498 if((ierbd>0).and.(tab==
'B'))
call fstag(lun,nemod,-1,nv,nout,ierft)
501 ifvd = nint(
val(nout,lun))
502 if(jj>1) icfdp(1) = icfdp(jj)
503 call srchtbf_c(idn,ifv(ii),icfdp(1),mxcfdp,ifvd,cfmeang,lcfmeang,lcfmg,iersf)
504 if(iersf==0)
write(luout,fmt) ifv(ii),
' = ', cfmeang(1:lcfmg)
516 if(
ibfms(rval)/=0)
then
518 else if(nchr<=8)
then
524 do while((ii<=nls).and.(.not.found))
525 if(nemo==lsnemo(ii))
then
533 if(nls>mxls)
call bort(
'BUFRLIB: UFDUMP - MXLS OVERFLOW')
538 call strsuc(nemo,nemo3,lnm3)
539 lsct(ii) = lsct(ii) + 1
540 write(fmtf,
'(A,I1,A)')
'(2A,I',
isize(lsct(ii)),
')'
541 write(nemo3,fmtf) nemo(1:lnm3),
'#', lsct(ii)
544 call readlc(lunit,lchr2,nemo3)
545 if (
icbfms(lchr2,nchr)/=0)
then
552 if ( nchr<=20 .or. lchr==pmiss )
then
554 fmt =
'(A6,2X,A10,2X,A20,2X,"(",I2,")",A24,2X,A48)'
555 write(luout,fmt) numb,nemo,lchr,nchr,unit,desc
557 fmt =
'(A6,2X,A10,2X,A,2X,"(",I3,")",A23,2X,A48)'
558 write(luout,fmt) numb,nemo,lchr2(1:nchr),nchr,unit,desc
564 write(luout,
'(/A/)')
' >>> END OF SUBSET <<< '
602 use modv_vars,
only: im8b, reps, fxy_fbit, fxy_sbyct, fxy_drp16, fxy_drp8, fxy_drp8s, fxy_drp1, &
603 fxy_drf16, fxy_drf8, fxy_drf1
610 integer,
intent(in) :: lunit, ldxot
611 integer my_lunit, my_ldxot, lun, il, im, n, na, nc, nch, ic, icms, nseq,
bort_target_set
613 character card*80, cardi1*80, cardi2*80, cardi3*80, cardi4*80, cmstr*20, wrk3*10, wrk1*8, wrk2*8, adn*6
615 logical tbskip, tdskip, xtrci1
617 data cardi1 /
'| | | |'/
618 data cardi2 /
'| | |'/
619 data cardi3 /
'| | | | | |-------------|'/
620 data cardi4 /
'|------------------------------------------------------------------------------|'/
623 tbskip(adn) = ((adn==fxy_sbyct).or.(adn==fxy_fbit).or.(adn==fxy_drf16).or.(adn==fxy_drf8).or.(adn==fxy_drf1))
624 tdskip(adn) = ((adn==fxy_drp16).or.(adn==fxy_drp8).or.(adn==fxy_drp8s).or.(adn==fxy_drp1))
630 call x84(lunit,my_lunit,1)
631 call x84(ldxot,my_ldxot,1)
632 call dxdump(my_lunit,my_ldxot)
647 call status(lunit,lun,il,im)
648 if(il==0)
call bort(
'BUFRLIB: DXDUMP - BUFR FILE IS CLOSED, IT MUST BE OPEN')
655 write (ldxot,
'(A)') card
660 card(15:64)=
' USER DEFINITIONS FOR TABLE-A TABLE-B TABLE D '
661 write (ldxot,
'(A)') card
663 write (ldxot,
'(A)') cardi4
666 card( 3:10)=
'MNEMONIC'
668 card(23:33)=
'DESCRIPTION'
669 write (ldxot,
'(A)') card
674 write (ldxot,
'(A)') card
678 write (ldxot,
'(A)') cardi1
682 if(.not.tdskip(
tabd(n,lun)(1:6)))
then
684 card( 3:10)=
tabd(n,lun)( 7:14)
685 card(14:19)=
tabd(n,lun)( 1: 6)
686 card(23:77)=
tabd(n,lun)(16:70)
691 if(
taba(na,lun)(4:11)==
tabd(n,lun)(7:14))
then
693 if(na==
ntba(lun)) xtrci1=.true.
697 write (ldxot,
'(A)') card
699 write (ldxot,
'(A)') cardi1
707 write (ldxot,
'(A)') cardi1
710 if(.not.tbskip(
tabb(n,lun)(1:6)))
then
712 card( 3:10)=
tabb(n,lun)( 7:14)
713 card(14:19)=
tabb(n,lun)( 1: 6)
714 card(23:77)=
tabb(n,lun)(16:70)
715 write (ldxot,
'(A)') card
719 write (ldxot,
'(A)') cardi1
723 write (ldxot,
'(A)') cardi4
726 card( 3:10)=
'MNEMONIC'
727 card(14:21)=
'SEQUENCE'
728 write (ldxot,
'(A)') card
732 write (ldxot,
'(A)') card
736 write (ldxot,
'(A)') cardi2
739 if(.not.tdskip(
tabd(n,lun)(1:6)))
then
741 card( 3:10)=
tabd(n,lun)( 7:14)
751 if(
irp(nc,1)/=0)
then
754 cmstr(icms:icms)=reps(
irp(nc,1))
756 cmstr(icms+1:icms+nch)=wrk2(1:nch)
758 if(
irp(nc,1)/=0)
then
761 cmstr(icms:icms)=reps(
irp(nc,1)+5)
763 if(
krp(nc,1)/=0)
then
766 write (wrk1,
'(I3)')
krp(nc,1)
767 call strsuc(wrk1,wrk2,nch)
768 cmstr(icms+1:icms+nch)=wrk2(1:nch)
773 if(ic>(79-icms))
then
774 write (ldxot,
'(A)') card
776 card( 3:10)=
tabd(n,lun)( 7:14)
779 card(ic:ic+icms-1)=cmstr(1:icms)
784 write (ldxot,
'(A)') card
785 write (ldxot,
'(A)') cardi2
792 write (ldxot,
'(A)') cardi4
795 card( 3:10)=
'MNEMONIC'
797 card(21:29)=
'REFERENCE'
800 write (ldxot,
'(A)') card
808 write (ldxot,
'(A)') card
812 write (ldxot,
'(A)') cardi3
815 if(.not.tbskip(
tabb(n,lun)(1:6)))
then
817 card( 3:10)=
tabb(n,lun)( 7:14)
818 card(41:64)=
tabb(n,lun)(71:94)
821 card(17-nch+1:17)=wrk2
822 if(
tabb(n,lun)(95:95)==
'-') card(17-nch:17-nch)=
'-'
825 card(31-nch+1:31)=wrk3
826 if(
tabb(n,lun)(99:99)==
'-') card(31-nch:31-nch)=
'-'
829 card(37-nch+1:37)=wrk2
830 write (ldxot,
'(a)') card
834 write (ldxot,
'(A)') cardi3
841 write (ldxot,
'(A)') card
856 recursive subroutine getabdb(lunit,tabdb,itab,jtab)
860 use modv_vars,
only: im8b
867 integer,
intent(in) :: lunit, itab
868 integer,
intent(out) :: jtab
871 character*128,
intent(out) :: tabdb(*)
872 character,
allocatable :: ctabdb(:,:)
879 call x84(lunit,my_lunit,1)
880 call x84(itab,my_itab,1)
881 call getabdb(my_lunit,tabdb,my_itab,jtab)
882 call x48(jtab,jtab,1)
890 allocate(ctabdb(128,itab))
894 tabdb(i)(j:j) = ctabdb(j,i)
906 call status(lunit,lun,il,im)
912 nemo =
tabd(i,lun)(7:14)
917 write(tabdb(jtab),fmt=
'(A,A8,10(1X,A10))')
'D ', nemo, (
nem(k,1),k=j,min(j+9,nseq))
927 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.
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 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.