NCEPLIBS-bufr  12.1.0
cidecode.F90 File Reference

Decode character strings and integer values. More...

Go to the source code of this file.

Functions/Subroutines

recursive integer function iupb (mbay, nbyt, nbit)
 Decode an integer value from within a specified number of bits of an integer array, starting with the first bit of a specified byte of the array. More...
 
recursive integer function iupm (cbay, nbits)
 Decode an integer value from within a specified number of bits of a character string, starting with the first bit of the first byte of the string. More...
 
subroutine up8 (nval, nbits, ibay, ibit)
 Decode an 8-byte integer value from within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array. More...
 
subroutine upb (nval, nbits, ibay, ibit)
 Decode an integer value from within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array. More...
 
subroutine upb8 (nval, nbits, ibit, ibay)
 Decode an 8-byte integer value from within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array. More...
 
subroutine upbb (nval, nbits, ibit, ibay)
 Decode an integer value from within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array. More...
 
subroutine upc (chr, nchr, ibay, ibit, cnvnull)
 Decode a character string from within a specified number of bytes of an integer array, starting at the bit immediately after a specified bit within the array. More...
 
real *8 function ups (ival, node)
 Unpack a real*8 value from an integer by applying the proper scale and reference values. More...
 

Detailed Description

Decode character strings and integer values.

Author
J. Woollen
Date
1994-01-06

Definition in file cidecode.F90.

Function/Subroutine Documentation

◆ iupb()

recursive integer function iupb ( integer, dimension(*), intent(in)  mbay,
integer, intent(in)  nbyt,
integer, intent(in)  nbit 
)

Decode an integer value from within a specified number of bits of an integer array, starting with the first bit of a specified byte of the array.

Parameters
mbay- Array containing encoded value
nbyt- Byte within mbay at whose first bit to begin decoding
nbit- Number of bits to be decoded, up to a maximum of 32
Returns
iupb - Decoded value
Author
J. Woollen
Date
1994-01-06

Definition at line 225 of file cidecode.F90.

References upb(), and x84().

Referenced by getlens(), iupbs01(), iupbs3(), rdmems(), rtrcptb(), stndrd(), upds3(), and wrdxtb().

◆ iupm()

recursive integer function iupm ( character*4, intent(in)  cbay,
integer, intent(in)  nbits 
)

Decode an integer value from within a specified number of bits of a character string, starting with the first bit of the first byte of the string.

This function is the logical inverse of subroutine ipkm().

Parameters
cbay- String
nbits- Number of bits from cbay to be decoded, up to a maximum of 32
Returns
iupm - Decoded value
Author
J. Woollen
Date
1994-01-06

Definition at line 264 of file cidecode.F90.

References bort(), irev(), and x84().

Referenced by icbfms(), and wrdxtb().

◆ up8()

subroutine up8 ( integer*8, intent(out)  nval,
integer, intent(in)  nbits,
integer, dimension(*), intent(in)  ibay,
integer, intent(inout)  ibit 
)

Decode an 8-byte integer value from within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array.

This subroutine is similar to subroutine upb8(), except that here ibit is both an input and an output argument, and the overall order of the arguments is different.

This subroutine is the logical inverse of subroutine pkb8().

Parameters
ibay- Array containing encoded value
ibit- Bit pointer within ibay
  • On input, ibit points to the bit within ibay after which to begin decoding nval
  • On output, ibit points to the last bit of ibay which contained the decoded nval
nbits- Number of bits to be decoded
nval- Decoded value
Author
J. Woollen
Date
2022-05-06

Definition at line 127 of file cidecode.F90.

References upb8().

Referenced by rdcmps(), ufbtab(), and wrcmps().

◆ upb()

subroutine upb ( integer, intent(out)  nval,
integer, intent(in)  nbits,
integer, dimension(*), intent(in)  ibay,
integer, intent(inout)  ibit 
)

Decode an integer value from within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array.

This subroutine is similar to subroutine upbb(), except that here ibit is both an input and an output argument, and the overall order of the arguments is different.

Parameters
ibay- Array containing encoded value
ibit- Bit pointer within ibay
  • On input, ibit points to the bit within ibay after which to begin decoding nval
  • On output, ibit points to the last bit of ibay which contained the decoded nval
nbits- Number of bits to be decoded
nval- Decoded value
Remarks
  • This subroutine is the logical inverse of subroutine pkb().
Author
J. Woollen
Date
1994-01-06

Definition at line 201 of file cidecode.F90.

References upbb().

Referenced by copysb(), iupb(), mvb(), rdcmps(), readsb(), stndrd(), ufbtab(), ufbtam(), upb8(), upc(), and writlc().

◆ upb8()

subroutine upb8 ( integer*8, intent(out)  nval,
integer, intent(in)  nbits,
integer, intent(in)  ibit,
integer, dimension(*), intent(in)  ibay 
)

Decode an 8-byte integer value from within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array.

This subroutine is similar to subroutine up8(), except that here ibit is only an input argument, and the overall order of the arguments is different.

This subroutine will not work properly if nbits is greater than 64.

Parameters
ibay- Array containing encoded value
ibit- Bit within ibay after which to begin decoding nval
nbits- Number of bits to be decoded
nval- Decoded value
Author
J. Woollen
Date
2022-05-06

Definition at line 79 of file cidecode.F90.

References bort(), and upb().

Referenced by rdtree(), ufbget(), ufbtab(), ufbtam(), and up8().

◆ upbb()

subroutine upbb ( integer, intent(out)  nval,
integer, intent(in)  nbits,
integer, intent(in)  ibit,
integer, dimension(*), intent(in)  ibay 
)

Decode an integer value from within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array.

This subroutine is similar to subroutine upb(), except that here ibit is only an input argument, and the overall order of the arguments is different.

Parameters
ibay- Array containing encoded value
ibit- Bit within ibay after which to begin decoding nval
nbits- Number of bits to be decoded
nval- Decoded value
Author
J. Woollen
Date
1994-01-06

Definition at line 153 of file cidecode.F90.

Referenced by rcstpl(), upb(), and writlc().

◆ upc()

subroutine upc ( character*(*), intent(out)  chr,
integer, intent(in)  nchr,
integer, dimension(*), intent(in)  ibay,
integer, intent(inout)  ibit,
logical, intent(in)  cnvnull 
)

Decode a character string from within a specified number of bytes of an integer array, starting at the bit immediately after a specified bit within the array.

Remarks
  • This subroutine is the logical inverse of subroutine pkc().
  • On input, there is no requirement that ibit must point to the first bit of a byte within ibay. In other words, the nchr characters to be decoded do not necessarily need to be aligned on byte boundaries within ibay.
Parameters
chr- Decoded string
nchr- Number of bytes of ibay from within which to decode chr (i.e. the number of characters in chr)
ibay- Array from which to decode chr
ibit- Bit pointer within ibay
  • On input, ibit points to the bit within ibay after which to begin decoding chr
  • On output, ibit points to the last bit of ibay which was decoded
cnvnull- .true. if null characters in ibay should be converted to blanks within chr; .false. otherwise
Author
J. Woollen
Date
1994-01-06

Definition at line 25 of file cidecode.F90.

References upb().

Referenced by rdcmps(), rdtree(), readlc(), stbfdx(), stndrd(), ufbget(), ufbtab(), ufbtam(), and wrcmps().

◆ ups()

real*8 function ups ( integer*8, intent(in)  ival,
integer, intent(in)  node 
)

Unpack a real*8 value from an integer by applying the proper scale and reference values.

Normally the scale and reference values are obtained from index node of the internal jump/link table arrays isc(*) and irf(*); however, the reference value in irf(*) will be overridden if a 2-03 operator is in effect for this node.

This function is the logical inverse of function ipks().

Parameters
ival- Packed BUFR integer
node- Index into internal jump/link tables
Returns
ups - User value
Author
J. Ator
Date
2012-03-02

Definition at line 318 of file cidecode.F90.

References moda_tables::ibt, moda_nrv203::ienrv, moda_nrv203::inodnrv, moda_tables::irf, moda_tables::isc, moda_nrv203::isnrv, moda_nrv203::nnrv, moda_nrv203::nrv, moda_tables::tag, and moda_nrv203::tagnrv.

Referenced by rdcmps(), rdtree(), ufbget(), ufbtab(), and ufbtam().