** TAG CREATION **
[WPS-merge.git] / ungrib / src / ngl / g2 / mova2i.c
blobf8400ed415d130f8ad949d6ee45613533cb58f75
1 /*$$$ SUBPROGRAM DOCUMENTATION BLOCK
2 C . . . .
3 C SUBPROGRAM: mov_a2i Moves a bit string from a char*1 to int
4 C PRGMMR: Gilbert ORG: W/NP11 DATE: 02-08-15
6 C ABSTRACT: This Function copies a bit string from a Character*1 variable
7 C to an integer variable. It is intended to replace the Fortran Intrinsic
8 C Function ICHAR, which only supports 0 <= ICHAR(a) <= 127 on the
9 C IBM SP. If "a" is greater than 127 in the collating sequence,
10 C ICHAR(a) does not return the expected bit value.
11 C This function can be used for all values 0 <= ICHAR(a) <= 255.
13 C PROGRAM HISTORY LOG:
14 C 98-12-15 Gilbert
16 C USAGE: I = mov_a2i(a)
18 C INPUT ARGUMENT :
20 C a - Character*1 variable that holds the bitstring to extract
22 C RETURN ARGUMENT :
24 C mov_a2i - Integer value of the bitstring in character a
26 C REMARKS:
28 C None
30 C ATTRIBUTES:
31 C LANGUAGE: C
32 C MACHINE: IBM SP
35 C$$$i*/
37 #if defined _UNDERSCORE
38 int mov_a2i_(unsigned char *a)
39 #elif defined _DOUBLEUNDERSCORE
40 int mov_a2i__(unsigned char *a)
41 #else
42 int mov_a2i(unsigned char *a)
43 #endif
46 return (int)(*a);