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