NCEPLIBS-bufr  12.1.0
ciencode.F90 File Reference

Encode character strings and integer values. More...

Go to the source code of this file.

Functions/Subroutines

recursive subroutine ipkm (cbay, nbyt, n)
 Encode an integer value within a specified number of bytes of a character string, up to a maximum of 4 bytes. More...
 
integer *8 function ipks (val, node)
 Pack a real*8 value into an integer by applying the proper scale and reference values. More...
 
subroutine pkb (nval, nbits, ibay, ibit)
 Encode an integer value within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array. More...
 
subroutine pkb8 (nval, nbits, ibay, ibit)
 Encode an 8-byte integer value within a specified number of bits of an integer array, starting at the bit immediately after a specified bit within the array. More...
 
subroutine pkc (chr, nchr, ibay, ibit)
 Encode a character string within a specified number of bytes of an integer array, starting at the bit immediately after a specified bit within the array. More...
 

Detailed Description

Encode character strings and integer values.

Author
J. Woollen
Date
1994-01-06

Definition in file ciencode.F90.

Function/Subroutine Documentation

◆ ipkm()

recursive subroutine ipkm ( character*(*), intent(out)  cbay,
integer, intent(in)  nbyt,
integer, intent(in)  n 
)

Encode an integer value within a specified number of bytes of a character string, up to a maximum of 4 bytes.

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

Parameters
n- Value to be encoded
nbyt- Number of bytes of cbay (up to a maximum of 4) within which to encode n
cbay- String of length nbyt bytes containing encoded integer n
Author
J. Woollen
Date
1994-01-06

Definition at line 193 of file ciencode.F90.

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

Referenced by bfrini(), pktdd(), readlc(), wrcmps(), and wrtree().

◆ ipks()

integer*8 function ipks ( real*8, intent(in)  val,
integer, intent(in)  node 
)

Pack a real*8 value into 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.

Parameters
val- User value
node- Index into internal jump/link tables
Returns
ipks - Packed BUFR integer
Remarks
  • This function is the logical inverse of function ups().
Author
J. Ator
Date
2012-03-02

Definition at line 251 of file ciencode.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.

◆ pkb()

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

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

Parameters
nval- Value to be encoded
nbits- Number of bits of ibay within which to encode nval
ibay- Array containing encoded nval
ibit- Bit pointer within ibay
  • On input, ibit points to the bit within ibay after which to begin encoding nval
  • On output, ibit points to the last bit of ibay which contains the encoded nval
Remarks
  • This subroutine is the logical inverse of subroutine upb().
  • This subroutine will not work properly if nbits is greater than 32.
Author
J. Woollen
Date
1994-01-06

Definition at line 139 of file ciencode.F90.

References bort().

Referenced by atrcpt(), cmsgini(), cnved4(), cpyupd(), dxmini(), msgini(), msgupd(), msgwrt(), mvb(), pad(), padmsg(), pkb8(), pkbs1(), stndrd(), wrcmps(), and wrdxtb().

◆ pkb8()

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

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

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

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

Parameters
nval- Value to be encoded
nbits- Number of bits of ibay (up to a maximum of 64) within which to encode nval
ibay- Array containing encoded nval
ibit- Bit pointer within ibay
  • On input, ibit points to the bit within ibay after which to begin encoding nval
  • On output, ibit points to the last bit of ibay which contains the encoded nval
Author
J. Woollen
Date
2022-05-06

Definition at line 96 of file ciencode.F90.

References bort(), and pkb().

Referenced by wrcmps(), and wrtree().

◆ pkc()

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

Encode a character string 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 upc().
  • On input, there is no requirement that ibit must point to the first bit of a byte within ibay. Correspondingly, on output there is no guarantee that the nchr characters of chr will be aligned on byte boundaries when encoded within ibay.
Parameters
chr- String to be encoded
nchr- Number of bytes of ibay within which to encode chr (i.e. the number of characters in chr)
ibay- Array containing encoded chr
ibit- Bit pointer within ibay
  • On input, ibit points to the bit within ibay after which to begin encoding chr
  • On output, ibit points to the last bit of ibay which contains the encoded chr
Author
J. Woollen
Date
1994-01-06

Definition at line 24 of file ciencode.F90.

Referenced by cmsgini(), dxmini(), msgini(), msgwrt(), stndrd(), wrcmps(), wrdxtb(), writlc(), and wrtree().