NCEPLIBS-bufr  12.0.0
idn30.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Convert an FXY value from a character string to the
3 C> WMO bit-wise representation.
4 C>
5 C> @author J. Woollen @date 1994-01-06
6 
7 C> Convert an FXY value from a character string to the
8 C> WMO bit-wise representation.
9 C>
10 C> For an description of the WMO bit-wise representation of the FXY
11 C> value, see ifxy().
12 C>
13 C> This function is the logical inverse of function adn30().
14 C>
15 C> @param[in] ADN30 - character*(*): FXY value. Must be of length 5 or 6.
16 C> @param[in] L30 - integer: Length of ADN30; can be either 5 or 6
17 C> characters.
18 C> @returns idn30 - integer: WMO bit-wise representation of FXY value.
19 C>
20 C> @author J. Woollen @date 1994-01-06
21  FUNCTION idn30(ADN30,L30)
22 
23  COMMON /hrdwrd/ nbytw,nbitw,iord(8)
24 
25  CHARACTER*(*) adn30
26  CHARACTER*128 bort_str
27 
28 C----------------------------------------------------------------------
29 C----------------------------------------------------------------------
30 
31  IF(len(adn30).LT.l30) GOTO 900
32  IF(l30.EQ.5) THEN
33  READ(adn30,'(I5)') idn30
34  IF(idn30.LT.0 .OR. idn30.GT.65535) GOTO 901
35  ELSEIF(l30.EQ.6) THEN
36  idn30 = ifxy(adn30)
37  ELSE
38  GOTO 902
39  ENDIF
40 
41 C EXITS
42 C -----
43 
44  RETURN
45 900 WRITE(bort_str,'("BUFRLIB: IDN30 - FUNCTION INPUT STRING ",A,'//
46  . '" CHARACTER LENGTH (",I4,") IS TOO SHORT (< L30,",I5)')
47  . adn30,len(adn30),l30
48  CALL bort(bort_str)
49 901 WRITE(bort_str,'("BUFRLIB: IDN30 - DESCRIPTOR INTEGER '//
50  . 'REPRESENTATION, IDN30 (",I8,"), IS OUTSIDE 16-BIT RANGE '//
51  . '(0-65535)")') idn30
52  CALL bort(bort_str)
53 902 WRITE(bort_str,'("BUFRLIB: IDN30 - FUNCTION INPUT STRING ",A,'//
54  . '" CHARACTER LENGTH (",I4,") MUST BE EITHER 5 OR 6")')
55  . adn30,l30
56  CALL bort(bort_str)
57  END
character *(*) function adn30(IDN, L30)
Convert a WMO bit-wise representation of an FXY value to a character string of length 5 or 6.
Definition: adn30.f:23
subroutine bort(STR)
Log one error message and abort application program.
Definition: bort.f:18
function idn30(ADN30, L30)
Convert an FXY value from a character string to the WMO bit-wise representation.
Definition: idn30.f:22
function ifxy(ADSC)
Convert an FXY value from its 6 character representation to its WMO bit-wise representation.
Definition: ifxy.f:34