25 subroutine upc(chr,nchr,ibay,ibit,cnvnull)
27 use modv_vars,
only: nbytw, iordle, iordbe
31 character*(*),
intent(out) :: chr
34 integer,
intent(in) :: nchr, ibay(*)
35 integer,
intent(inout) :: ibit
36 integer ival(2), lb, i, numchr
38 logical,
intent(in) :: cnvnull
40 equivalence(cval,ival)
52 numchr = min(nchr,len(chr))
54 call upb(ival(1),8,ibay,ibit)
55 if((ival(1)==0).and.(cnvnull))
then
79 subroutine upb8(nval,nbits,ibit,ibay)
81 use modv_vars,
only: nbitw
85 integer,
intent(in) :: nbits,ibit,ibay(*)
86 integer*8,
intent(out) :: nval
88 integer :: nvals(2), jbit, ival
91 equivalence(nval8,nvals)
94 call bort(
'BUFRLIB: UPB8 - nbits < zero !!!!!')
95 elseif(nbits<=32)
then
97 call upb(ival,nbits,ibay,jbit)
99 elseif(nbits<=64)
then
101 call upb(nvals(2),max(nbits-nbitw,0),ibay,jbit)
102 call upb(nvals(1),min(nbitw,nbits ),ibay,jbit)
127 subroutine up8(nval,nbits,ibay,ibit)
131 integer,
intent(in) :: nbits, ibay(*)
132 integer,
intent(inout) :: ibit
133 integer*8,
intent(out) :: nval
135 call upb8(nval,nbits,ibit,ibay)
153 subroutine upbb(nval,nbits,ibit,ibay)
155 use modv_vars,
only: nbitw
159 integer,
intent(in) :: ibay(*), ibit, nbits
160 integer,
intent(out) :: nval
161 integer nwd, nbt, int, jnt, irev, lbt
171 nbt = mod(ibit,nbitw)
172 int = ishft(irev(ibay(nwd)),nbt)
173 int = ishft(int,nbits-nbitw)
176 jnt = irev(ibay(nwd+1))
177 int = ior(int,ishft(jnt,lbt-2*nbitw))
201 subroutine upb(nval,nbits,ibay,ibit)
205 integer,
intent(in) :: ibay(*), nbits
206 integer,
intent(out) :: nval
207 integer,
intent(inout) :: ibit
209 call upbb(nval,nbits,ibit,ibay)
225 recursive integer function iupb(mbay,nbyt,nbit)
result(iret)
227 use modv_vars,
only: im8b
231 integer,
intent(in) :: mbay(*), nbit, nbyt
232 integer my_nbit, my_nbyt, mbit
239 call x84(nbyt,my_nbyt,1)
240 call x84(nbit,my_nbit,1)
241 iret =
iupb(mbay,my_nbyt,my_nbit)
248 call upb(iret,nbit,mbay,mbit)
264 recursive integer function iupm(cbay,nbits)
result(iret)
266 use modv_vars,
only: im8b, nbitw
270 character*4,
intent(in) :: cbay
272 character*128 bort_str
274 integer,
intent(in) :: nbits
275 integer my_nbits, int,
irev
277 equivalence(cint,int)
284 call x84(nbits,my_nbits,1)
285 iret =
iupm(cbay,my_nbits)
293 write(bort_str,
'("BUFRLIB: IUPM - NUMBER OF BITS BEING UNPACKED'// &
294 ', NBITS (",I4,"), IS > THE INTEGER WORD LENGTH ON THIS MACHINE, NBITW (",I3,")")') nbits,nbitw
299 iret = ishft(int,nbits-nbitw)
318 real*8 function ups(ival,node)
result(r8ret)
325 integer*8,
intent(in) :: ival
327 integer,
intent(in) :: node
330 real*8,
parameter :: ten = 10.
332 r8ret = ( ival +
irf(node) ) * ten**(-
isc(node))
337 if ( node ==
inodnrv(jj) )
then
340 imask = 2_8**(
ibt(node)-1)
341 if ( iand(ival,imask) > 0 )
then
342 nrv(jj) = (-1) * ( ival - imask )
348 else if ( (
tag(node)(1:8) ==
tagnrv(jj) ) .and. ( node >=
isnrv(jj) ) .and. ( node <=
ienrv(jj) ) )
then
350 r8ret = ( ival +
nrv(jj) ) * ten**(-
isc(node))
subroutine bort(str)
Log an error message, then abort the application program.
subroutine upb(nval, nbits, ibay, ibit)
Decode an integer value from within a specified number of bits of an integer array,...
subroutine upbb(nval, nbits, ibit, ibay)
Decode an integer value from within a specified number of bits of an integer array,...
subroutine upb8(nval, nbits, ibit, ibay)
Decode an 8-byte integer value from within a specified number of bits of an integer array,...
real *8 function ups(ival, node)
Unpack a real*8 value from an integer by applying the proper scale and reference values.
recursive integer function iupb(mbay, nbyt, nbit)
Decode an integer value from within a specified number of bits of an integer array,...
recursive integer function iupm(cbay, nbits)
Decode an integer value from within a specified number of bits of a character string,...
subroutine up8(nval, nbits, ibay, ibit)
Decode an 8-byte integer value from within a specified number of bits of an integer array,...
subroutine upc(chr, nchr, ibay, ibit, cnvnull)
Decode a character string from within a specified number of bytes of an integer array,...
integer function irev(n)
Return a copy of an integer value with the bytes possibly reversed.
Declare arrays and variables for use with any 2-03-YYY (change reference value) operators present wit...
integer, dimension(:), allocatable ienrv
End of entry range in jump/link table, within which the corresponding new reference value in nrv will...
character *8, dimension(:), allocatable tagnrv
Table B mnemonic to which the corresponding new reference value in nrv applies.
integer, dimension(:), allocatable isnrv
Start of entry range in jump/link table, within which the corresponding new reference value in nrv wi...
integer nnrv
Number of entries in the jump/link table which contain new reference values (up to a maximum of mxnrv...
integer *8, dimension(:), allocatable nrv
New reference values corresponding to inodnrv.
integer, dimension(:), allocatable inodnrv
Entries within jump/link table which contain new reference values.
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 *10, dimension(:), allocatable tag
Mnemonics in the jump/link table.
subroutine x84(iin8, iout4, nval)
Encode one or more 8-byte integer values as 4-byte integer values.