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,
ireadmt,
ibfms,
icbfms
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)'
426 write(fmt(15:20),
'(A,I2)')
'F20.',
isc(node)
428 write(fmt(18:20),
'(A)')
'I20'
430 if(unit(1:4)==
'FLAG')
then
432 call upftbv(lunit,nemo,rval,mxfv,ifv,nifv)
438 write(fmtf,
'(A2,I1,A4)')
'(I', isz,
',A1)'
439 if((ipt+isz)<=24)
then
440 write(unit(ipt:ipt+isz),fmtf) ifv(ii),
','
443 unit(12:23) =
'MANY BITS ON'
447 unit(ipt-1:ipt-1) =
')'
451 write(luout,fmt) numb,nemo,rval,unit,desc
454 write(luout,fmt) numb,nemo,ival,unit,desc
456 if( (unit(1:4)==
'FLAG' .or. unit(1:4)==
'CODE') .and. (
cdmf==
'Y') )
then
459 if(unit(1:4)==
'CODE')
then
461 ifv(nifv) = nint(rval)
465 call srchtbf_c(idn,ifv(ii),icfdp(1),mxcfdp,-1,cfmeang,lcfmeang,lcfmg,iersf)
467 write(luout,fmt) ifv(ii),
' = ',cfmeang(1:lcfmg)
469 write(luout,fmt) ifv(ii),
' = ',
'***THIS IS AN ILLEGAL/UNDEFINED VALUE***'
476 do while((jj<iersf).and.(ierft<0))
478 call numtbd(lun,icfdp(jj),nemod,tab,ierbd)
479 if((ierbd>0).and.(tab==
'B'))
call fstag(lun,nemod,-1,nv,nout,ierft)
482 ifvd = nint(
val(nout,lun))
483 if(jj>1) icfdp(1) = icfdp(jj)
484 call srchtbf_c(idn,ifv(ii),icfdp(1),mxcfdp,ifvd,cfmeang,lcfmeang,lcfmg,iersf)
485 if(iersf==0)
write(luout,fmt) ifv(ii),
' = ', cfmeang(1:lcfmg)
497 if(
ibfms(rval)/=0)
then
499 else if(nchr<=8)
then
505 do while((ii<=nls).and.(.not.found))
506 if(nemo==lsnemo(ii))
then
514 if(nls>mxls)
call bort(
'BUFRLIB: UFDUMP - MXLS OVERFLOW')
519 call strsuc(nemo,nemo3,lnm3)
520 lsct(ii) = lsct(ii) + 1
521 write(fmtf,
'(A,I1,A)')
'(2A,I',
isize(lsct(ii)),
')'
522 write(nemo3,fmtf) nemo(1:lnm3),
'#', lsct(ii)
525 call readlc(lunit,lchr2,nemo3)
526 if (
icbfms(lchr2,nchr)/=0)
then
533 if ( nchr<=20 .or. lchr==pmiss )
then
535 fmt =
'(A6,2X,A10,2X,A20,2X,"(",I2,")",A24,2X,A48)'
536 write(luout,fmt) numb,nemo,lchr,nchr,unit,desc
538 fmt =
'(A6,2X,A10,2X,A,2X,"(",I3,")",A23,2X,A48)'
539 write(luout,fmt) numb,nemo,lchr2(1:nchr),nchr,unit,desc
545 write(luout,
'(/A/)')
' >>> END OF SUBSET <<< '
581 use modv_vars,
only: im8b, reps
588 integer,
intent(in) :: lunit, ldxot
589 integer my_lunit, my_ldxot, lun, il, im, n, na, nc, nch, ic, icms, nseq
591 character card*80, cardi1*80, cardi2*80, cardi3*80, cardi4*80, cmstr*20, wrk3*10, wrk1*8, wrk2*8, adn*6
593 logical tbskip, tdskip, xtrci1
595 data cardi1 /
'| | | |'/
596 data cardi2 /
'| | |'/
597 data cardi3 /
'| | | | | |-------------|'/
598 data cardi4 /
'|------------------------------------------------------------------------------|'/
601 tbskip(adn) = ((adn==
'063000').or.(adn==
'063255').or.(adn==
'031000').or.(adn==
'031001').or.(adn==
'031002'))
602 tdskip(adn) = ((adn==
'360001').or.(adn==
'360002').or.(adn==
'360003').or.(adn==
'360004'))
609 call x84(lunit,my_lunit,1)
610 call x84(ldxot,my_ldxot,1)
611 call dxdump(my_lunit,my_ldxot)
619 call status(lunit,lun,il,im)
620 if(il==0)
call bort(
'BUFRLIB: DXDUMP - BUFR FILE IS CLOSED, IT MUST BE OPEN')
627 write (ldxot,
'(A)') card
632 card(15:64)=
' USER DEFINITIONS FOR TABLE-A TABLE-B TABLE D '
633 write (ldxot,
'(A)') card
635 write (ldxot,
'(A)') cardi4
638 card( 3:10)=
'MNEMONIC'
640 card(23:33)=
'DESCRIPTION'
641 write (ldxot,
'(A)') card
646 write (ldxot,
'(A)') card
650 write (ldxot,
'(A)') cardi1
654 if(.not.tdskip(
tabd(n,lun)(1:6)))
then
656 card( 3:10)=
tabd(n,lun)( 7:14)
657 card(14:19)=
tabd(n,lun)( 1: 6)
658 card(23:77)=
tabd(n,lun)(16:70)
663 if(
taba(na,lun)(4:11)==
tabd(n,lun)(7:14))
then
665 if(na==
ntba(lun)) xtrci1=.true.
669 write (ldxot,
'(A)') card
671 write (ldxot,
'(A)') cardi1
679 write (ldxot,
'(A)') cardi1
682 if(.not.tbskip(
tabb(n,lun)(1:6)))
then
684 card( 3:10)=
tabb(n,lun)( 7:14)
685 card(14:19)=
tabb(n,lun)( 1: 6)
686 card(23:77)=
tabb(n,lun)(16:70)
687 write (ldxot,
'(A)') card
691 write (ldxot,
'(A)') cardi1
695 write (ldxot,
'(A)') cardi4
698 card( 3:10)=
'MNEMONIC'
699 card(14:21)=
'SEQUENCE'
700 write (ldxot,
'(A)') card
704 write (ldxot,
'(A)') card
708 write (ldxot,
'(A)') cardi2
711 if(.not.tdskip(
tabd(n,lun)(1:6)))
then
713 card( 3:10)=
tabd(n,lun)( 7:14)
723 if(
irp(nc,1)/=0)
then
726 cmstr(icms:icms)=reps(
irp(nc,1))
728 cmstr(icms+1:icms+nch)=wrk2(1:nch)
730 if(
irp(nc,1)/=0)
then
733 cmstr(icms:icms)=reps(
irp(nc,1)+5)
735 if(
krp(nc,1)/=0)
then
738 write (wrk1,
'(I3)')
krp(nc,1)
739 call strsuc(wrk1,wrk2,nch)
740 cmstr(icms+1:icms+nch)=wrk2(1:nch)
745 if(ic>(79-icms))
then
746 write (ldxot,
'(A)') card
748 card( 3:10)=
tabd(n,lun)( 7:14)
751 card(ic:ic+icms-1)=cmstr(1:icms)
756 write (ldxot,
'(A)') card
757 write (ldxot,
'(A)') cardi2
764 write (ldxot,
'(A)') cardi4
767 card( 3:10)=
'MNEMONIC'
769 card(21:29)=
'REFERENCE'
772 write (ldxot,
'(A)') card
780 write (ldxot,
'(A)') card
784 write (ldxot,
'(A)') cardi3
787 if(.not.tbskip(
tabb(n,lun)(1:6)))
then
789 card( 3:10)=
tabb(n,lun)( 7:14)
790 card(41:64)=
tabb(n,lun)(71:94)
793 card(17-nch+1:17)=wrk2
794 if(
tabb(n,lun)(95:95)==
'-') card(17-nch:17-nch)=
'-'
797 card(31-nch+1:31)=wrk3
798 if(
tabb(n,lun)(99:99)==
'-') card(31-nch:31-nch)=
'-'
801 card(37-nch+1:37)=wrk2
802 write (ldxot,
'(a)') card
806 write (ldxot,
'(A)') cardi3
813 write (ldxot,
'(A)') card
828 recursive subroutine getabdb(lunit,tabdb,itab,jtab)
830 use modv_vars,
only: im8b
837 integer,
intent(in) :: lunit, itab
838 integer,
intent(out) :: jtab
839 integer my_lunit, my_itab, lun, il, im, i, j, k, nseq
841 character*128,
intent(out) :: tabdb(*)
848 call x84(lunit,my_lunit,1)
849 call x84(itab,my_itab,1)
850 call getabdb(my_lunit,tabdb,my_itab,jtab)
851 call x48(jtab,jtab,1)
860 call status(lunit,lun,il,im)
866 nemo =
tabd(i,lun)(7:14)
871 write(tabdb(jtab),fmt=
'(A,A8,10(1X,A10))')
'D ', nemo, (
nem(k,1),k=j,min(j+9,nseq))
881 write(tabdb(jtab),fmt=
'(A,A8,1X,A42)')
'B ',
tabb(i,lun)(7:14),
tabb(i,lun)(71:112)
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.