NCEPLIBS-bufr 11.7.1
pkftbv.f
Go to the documentation of this file.
1C> @file
2C> @brief Determine the numerical data value equivalent to the
3C> setting of a specified bit within a flag table.
4
5C> This function computes the numerical value equivalent to the
6C> setting of bit #IBIT within a flag table of NBITS bits.
7C>
8C> <p>If the computation fails for any reason, then the function
9C> returns the current placeholder value for "missing" data.
10C>
11C> @author J. Ator
12C> @date 2005-11-29
13C>
14C> @param[in] NBITS -- integer: Total number of bits in flag table
15C> @param[in] IBIT -- integer: Number of bit to be set
16C>
17C> @returns pkftbv -- real*8: Value equivalent to the setting of
18C> bit #IBIT within a flag table of NBITS bits
19C>
20C> @remarks
21C> - This function is the logical inverse of subroutine upftbv().
22C> - According to the WMO standard, bits within a bit field are
23C> numbered from left to right, so bit #1 is always the high-order
24C> (i.e. most significant) bit in any bit field.
25C>
26C> <b>Program history log:</b>
27C> | Date | Programmer | Comments |
28C> | -----|------------|----------|
29C> | 2005-11-29 | J. Ator | Original version |
30C>
31 REAL*8 FUNCTION pkftbv(NBITS,IBIT)
32
33 USE modv_bmiss
34
35C----------------------------------------------------------------------
36C----------------------------------------------------------------------
37
38 IF((nbits.LE.0).OR.(ibit.LE.0).OR.(ibit.GT.nbits)) THEN
40 ELSE
41 pkftbv = (2.)**(nbits-ibit)
42 ENDIF
43
44 RETURN
45 END
This module declares and initializes the BMISS variable.
Definition: modv_BMISS.f90:9
real *8, public bmiss
Current placeholder value to represent "missing" data when reading from or writing to BUFR files; thi...
Definition: modv_BMISS.f90:15
real *8 function pkftbv(NBITS, IBIT)
This function computes the numerical value equivalent to the setting of bit #IBIT within a flag table...
Definition: pkftbv.f:32