NCEPLIBS-bufr 11.7.1
ifxy.f
Go to the documentation of this file.
1C> @file
2C> @brief Convert an FXY value from its six character representation
3C> to its bit-wise (integer) representation
4
5C> This function converts an FXY value from its 6 character
6C> representation to its bit-wise (integer) representation.
7C>
8C> @author J. Woollen
9C> @date 1994-01-06
10C>
11C> @param[in] ADSC -- character*6: FXY value
12C> @returns ifxy -- integer: Bit-wise representation of FXY value
13C>
14C> @remarks
15C> Per the [official WMO BUFR regulations](@ref manual), an FXY value
16C> can be represented as a bit-wise integer in 16 bits, ordered from
17C> left (most significant) to right (least significant), and where the
18C> F value occupies the first 2 bits, the X value occupies the next 6
19C> bits, and the Y value occupies the last 8 bits.
20C>
21C> For example, if ADSC = '063022'
22C>
23C> F | X | Y
24C> 0 | 63 | 22
25C> 0 0 1 1 1 1 1 1 0 0 0 1 0 1 1 0
26C>
27C> then the corresponding ifxy
28C>
29C> = ( 2**13 + 2**12 + 2**11 + 2**10 + 2**9 + 2**8 +
30C> 2**4 + 2**2 + 2**1 )
31C>
32C> = 16150
33C>
34C> <b>Program History Log:</b>
35C> | Date | Programmer | Comments |
36C> | -----|------------|----------|
37C> | 1994-01-06 | J. Woollen | Original author |
38C> | 2003-11-04 | J. Ator | Added documentation |
39C> | 2003-11-04 | S. Bender | Added remarks and routine interdependencies |
40C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added history documentation |
41C>
42 FUNCTION ifxy(ADSC)
43
44 CHARACTER*6 adsc
45
46C----------------------------------------------------------------------
47C----------------------------------------------------------------------
48
49 READ(adsc,'(I1,I2,I3)') IF,ix,iy
50 ifxy = if*2**14 + ix*2**8 + iy
51 RETURN
52 END
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:43