updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / var / external / bufr / pkftbv.f
blob3c53135345023aae1a232d5bbc28b61e00f78fc5
1 REAL*8 FUNCTION PKFTBV(NBITS,IBIT)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: PKFTBV
6 C PRGMMR: JATOR ORG: NP12 DATE: 2005-11-29
8 C ABSTRACT: THIS FUNCTION COMPUTES AND RETURNS THE VALUE EQUIVALENT
9 C TO THE SETTING OF BIT# IBIT WITHIN A FLAG TABLE OF NBITS BITS.
10 C IF THE COMPUTATION FAILS FOR ANY REASON, THEN THE VALUE BMISS
11 C (10E10) IS RETURNED. NOTE THAT THIS SUBROUTINE IS THE LOGICAL
12 C INVERSE OF BUFRLIB SUBROUTINE UPFTBV.
14 C PROGRAM HISTORY LOG:
15 C 2005-11-29 J. ATOR -- ORIGINAL VERSION
17 C USAGE: PKFTBV (NBITS,IBIT)
18 C INPUT ARGUMENT LIST:
19 C NBITS - INTEGER: NUMBER OF BITS IN FLAG TABLE
20 C IBIT - INTEGER: NUMBER OF BIT TO BE SET WITHIN FLAG TABLE
22 C OUTPUT ARGUMENT LIST:
23 C PKFTBV - REAL*8: VALUE EQUIVALENT TO THE SETTING OF BIT# IBIT
24 C WITHIN A FLAG TABLE OF NBITS BITS.
26 C REMARKS:
27 C THIS ROUTINE CALLS: None
28 C THIS ROUTINE IS CALLED BY: None
29 C Normally called only by application
30 C programs.
32 C ATTRIBUTES:
33 C LANGUAGE: FORTRAN 77
34 C MACHINE: PORTABLE TO ALL PLATFORMS
36 C$$$
38 INCLUDE 'bufrlib.prm'
40 C----------------------------------------------------------------------
41 C----------------------------------------------------------------------
43 IF((NBITS.LE.0).OR.(IBIT.LE.0).OR.(IBIT.GT.NBITS)) THEN
44 PKFTBV = BMISS
45 ELSE
46 PKFTBV = (2.)**(NBITS-IBIT)
47 ENDIF
49 RETURN
50 END