NCEPLIBS-bufr  12.1.0
fxy.F90 File Reference

Process FXY values, including converting between character and WMO bit-wise representations. More...

Go to the source code of this file.

Functions/Subroutines

character *(*) function adn30 (idn, ldn)
 Convert an FXY value from its WMO bit-wise representation to a character string of length 5 or 6. More...
 
subroutine cadn30 (idn, adn)
 Convert an FXY value from its WMO bit-wise representation to its 6 character representation. More...
 
integer function idn30 (adn, ldn)
 Convert an FXY value from a character string to the WMO bit-wise representation. More...
 
integer function ifxy (adsc)
 Convert an FXY value from its 6 character representation to its WMO bit-wise representation. More...
 
integer function igetfxy (str, cfxy)
 Search for and return a valid FXY number from within a character string. More...
 
subroutine nemtab (lun, nemo, idn, tab, iret)
 Get information about a descriptor, based on a mnemonic. More...
 
integer function numbck (numb)
 Check an FXY number for validity. More...
 
subroutine numtab (lun, idn, nemo, tab, iret)
 Get information about a descriptor, based on the WMO bit-wise representation of an FXY value. More...
 
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 FXY value. More...
 

Detailed Description

Process FXY values, including converting between character and WMO bit-wise representations.

Author
J. Ator
Date
2024-02-29

Definition in file fxy.F90.

Function/Subroutine Documentation

◆ adn30()

character*(*) function adn30 ( integer, intent(in)  idn,
integer, intent(in)  ldn 
)

Convert an FXY value from its WMO bit-wise representation to a character string of length 5 or 6.

For an description of the WMO bit-wise representation of the FXY value, see ifxy().

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

Parameters
idn- WMO bit-wise representation of FXY value
ldn- Length of string to be returned; can be either 5 or 6 characters
Returns
adn30 - FXY character string
Author
J. Woollen
Date
1994-01-06

Definition at line 17 of file fxy.F90.

References bort().

Referenced by igetrfel(), istdesc(), ufbqcd(), upds3(), and wrdxtb().

◆ cadn30()

subroutine cadn30 ( integer, intent(in)  idn,
character*(*), intent(out)  adn 
)

Convert an FXY value from its WMO bit-wise representation to its 6 character representation.

This subroutine is similar to function adn30(), except that it always returns 6 characters, and it always returns its output as a call parameter instead of a function value, which in turn allows it to be more easily called from within a C language function.

For a description of the WMO bit-wise representation of an FXY value, see ifxy().

Parameters
idn- WMO bit-wise representation of FXY value
adn- FXY value
Author
J. Ator
Date
2004-08-18

Definition at line 64 of file fxy.F90.

Referenced by bufr_c2f_interface::cadn30_c().

◆ idn30()

integer function idn30 ( character*(*), intent(in)  adn,
integer, intent(in)  ldn 
)

Convert an FXY value from a character string to the WMO bit-wise representation.

For an description of the WMO bit-wise representation of the FXY value, see ifxy().

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

Parameters
adn- FXY value; must be of length 5 or 6
ldn- Length of adn; can be either 5 or 6 characters
Returns
idn30 - WMO bit-wise representation of FXY value
Author
J. Woollen
Date
1994-01-06

Definition at line 90 of file fxy.F90.

References bort(), and ifxy().

◆ ifxy()

integer function ifxy ( character*6, intent(in)  adsc)

Convert an FXY value from its 6 character representation to its WMO bit-wise representation.

Per the official WMO BUFR regulations, an FXY value can be represented as a bit-wise integer in 16 bits, ordered from left (most significant) to right (least significant), and where the F value occupies the first 2 bits, the X value occupies the next 6 bits, and the Y value occupies the last 8 bits.

For example, if ADSC = '063022'

   F |     X     |      Y
   0 |     63    |      22
  0 0 1 1 1 1 1 1 0 0 0 1 0 1 1 0

then the corresponding ifxy

  = ( 2**13 + 2**12 + 2**11 + 2**10 + 2**9 + 2**8 +
      2**4 + 2**2 + 2**1 )

  = 16150
Parameters
adsc- FXY value
Returns
ifxy - WMO bit-wise representation of FXY value
Author
J. Woollen
Date
1994-01-06

Definition at line 151 of file fxy.F90.

Referenced by getcfmng(), idn30(), bufr_c2f_interface::ifxy_c(), ireadmt(), and ufbqcp().

◆ igetfxy()

integer function igetfxy ( character*(*), intent(in)  str,
character*6, intent(out)  cfxy 
)

Search for and return a valid FXY number from within a character string.

The FXY number may be in format of either FXXYYY or F-XX-YYY within the input string, but it is always returned in format FXXYYY upon output.

Parameters
str- input string
cfxy- FXY number in format FXXYYY
Returns
  • 0 normal return.
  • -1 could not find a valid FXY number in str
Author
Ator
Date
2007-01-19

Definition at line 178 of file fxy.F90.

References numbck().

◆ nemtab()

subroutine nemtab ( integer, intent(in)  lun,
character*(*), intent(in)  nemo,
integer, intent(out)  idn,
character, intent(out)  tab,
integer, intent(out)  iret 
)

Get information about a descriptor, based on a mnemonic.

Parameters
lun- File ID associated with DX BUFR tables
nemo- Mnemonic
idn- WMO bit-wise representation of FXY value for descriptor for descriptor associated with nemo
tab- Type associated with idn:
  • 'B' Table B descriptor.
  • 'D' Table D descriptor.
  • 'C' Table C operator.
iret- Return code:
  • Positional index of idn within internal Table B, if tab = 'B'
  • Positional index of idn within internal Table D, if tab = 'D'
  • The X portion of the FXY value in idn, if tab = 'C'.
  • 0, otherwise
Author
J. Woollen
Date
1994-01-06

Definition at line 431 of file fxy.F90.

References moda_tababd::idnb, moda_tababd::idnd, moda_tababd::ntbb, moda_tababd::ntbd, moda_tababd::tabb, and moda_tababd::tabd.

Referenced by chekstab(), cmsgini(), elemdx(), getcfmng(), igetrfel(), msgini(), nemdefs(), bufr_c2f_interface::nemtab_c(), seqsdx(), tabsub(), ufbdmp(), ufbqcd(), ufdump(), and upftbv().

◆ numbck()

integer function numbck ( character*6, intent(in)  numb)

Check an FXY number for validity.

Parameters
numb- FXY value
Returns
numbck - Indicator as to whether numb is valid:
  • 0 = Yes
  • -1 = No, the first character ("F" value) is not '0', '1', '2', or '3'
  • -2 = No, characters 2-6 ("X" and "Y" values) are not all numeric
  • -3 = No, characters 2-3 ("X" value) are not between '00' and '63'
  • -4 = No, characters 4-6 ("Y" value) are not between '000' and '255'
Author
Woollen
Date
1994-01-06

Definition at line 236 of file fxy.F90.

Referenced by igetfxy().

◆ numtab()

subroutine numtab ( integer, intent(in)  lun,
integer, intent(in)  idn,
character*(*), intent(out)  nemo,
character, intent(out)  tab,
integer, intent(out)  iret 
)

Get information about a descriptor, based on the WMO bit-wise representation of an FXY value.

For a description of the WMO bit-wise representation of the FXY value, see ifxy().

Parameters
lun- File ID associated with DX BUFR tables
idn- WMO bit-wise representation of FXY value for descriptor
nemo- Mnemonic associated with idn
tab- Type associated with idn:
  • 'B' Table B descriptor
  • 'D' Table D descriptor
  • 'C' Table C operator
  • 'R' Replication descriptor
  • 'F' Replication factor
iret- Return code:
  • Positional index of idn within internal Table B, if tab = 'B'
  • Positional index of idn within internal Table D, if tab = 'D'
  • The X portion of the FXY value in idn, if tab = 'C'
  • ((-1) * the Y portion of the FXY value in idn), if tab = 'R' and the replication is regular (i.e. non-delayed)
  • 5 if tab = 'R' or tab = 'F' and the replication is 1-bit delayed
  • 4 if tab = 'R' or tab = 'F' and the replication is 8-bit delayed (stack)
  • 3 if tab = 'R' or tab = 'F' and the replication is 8-bit delayed
  • 2 if tab = 'R' or tab = 'F' and the replication is 16-bit delayed
  • 0 otherwise
Author
J. Woollen
Date
1994-01-06

Definition at line 356 of file fxy.F90.

References numtbd().

Referenced by cktaba(), nemtbd(), seqsdx(), stndrd(), and ufbqcp().

◆ numtbd()

subroutine numtbd ( integer, intent(in)  lun,
integer, intent(in)  idn,
character*(*), intent(out)  nemo,
character, intent(out)  tab,
integer, intent(out)  iret 
)

Get information about a Table B or Table D descriptor, based on the WMO bit-wise representation of an FXY value.

For a description of the WMO bit-wise representation of the FXY value, see ifxy().

Parameters
lun- File ID associated with DX BUFR tables
idn- WMO bit-wise representation of FXY value for Table B or Table D descriptor
nemo- Mnemonic associated with idn
tab- Type associated with idn:
  • 'B' Table B descriptor
  • 'D' Table D descriptor
iret- Return code:
  • Positional index of idn within internal Table B, if tab = 'B'
  • Positional index of idn within internal Table D, if tab = 'D'
  • 0 otherwise
Author
J. Woollen
Date
2002-05-14

Definition at line 289 of file fxy.F90.

References moda_tababd::idnb, moda_tababd::idnd, moda_tababd::ntbb, moda_tababd::ntbd, moda_tababd::tabb, and moda_tababd::tabd.

Referenced by getcfmng(), numtab(), bufr_c2f_interface::numtbd_c(), and ufdump().