NCEPLIBS-bufr  11.7.0
 All Data Structures Files Functions Variables Pages
idn30.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Convert an FXY value from its five or six character
3 C> representation to its bit-wise (integer) representation
4 
5 C> This function converts an FXY value from its 5 or 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] ADN30 -- character*(*): FXY value
12 C> @param[in] L30 -- integer: Length of ADN30; can be either 5 or 6
13 C> characters
14 C> @returns idn30 -- integer: Bit-wise representation of FXY value
15 C>
16 C> @remarks
17 C> - This function is the logical inverse of function adn30().
18 C>
19 C> <b>Program History Log:</b>
20 C> | Date | Programmer | Comments |
21 C> | -----|------------|----------|
22 C> | 1994-01-06 | J. Woollen | Original author |
23 C> | 1998-07-08 | J. Woollen | Replaced call to CRAY library routine "ABORT" with call to new internal BUFRLIB routine bort() |
24 C> | 2003-11-04 | S. Bender | Added remarks and routine interdependencies |
25 C> | 2003-11-04 | D. Keyser | Unified/portable for WRF; added history documentation |
26 C>
27  FUNCTION idn30(ADN30,L30)
28 
29  COMMON /hrdwrd/ nbytw,nbitw,iord(8)
30 
31  CHARACTER*(*) adn30
32  CHARACTER*128 bort_str
33 
34 C----------------------------------------------------------------------
35 C----------------------------------------------------------------------
36 
37  IF(len(adn30).LT.l30) goto 900
38  IF(l30.EQ.5) THEN
39  READ(adn30,'(I5)') idn30
40  IF(idn30.LT.0 .OR. idn30.GT.65535) goto 901
41  ELSEIF(l30.EQ.6) THEN
42  idn30 = ifxy(adn30)
43  ELSE
44  goto 902
45  ENDIF
46 
47 C EXITS
48 C -----
49 
50  RETURN
51 900 WRITE(bort_str,'("BUFRLIB: IDN30 - FUNCTION INPUT STRING ",A,'//
52  . '" CHARACTER LENGTH (",I4,") IS TOO SHORT (< L30,",I5)')
53  . adn30,len(adn30),l30
54  CALL bort(bort_str)
55 901 WRITE(bort_str,'("BUFRLIB: IDN30 - DESCRIPTOR INTEGER '//
56  . 'REPRESENTATION, IDN30 (",I8,"), IS OUTSIDE 16-BIT RANGE '//
57  . '(0-65535)")') idn30
58  CALL bort(bort_str)
59 902 WRITE(bort_str,'("BUFRLIB: IDN30 - FUNCTION INPUT STRING ",A,'//
60  . '" CHARACTER LENGTH (",I4,") MUST BE EITHER 5 OR 6")')
61  . adn30,l30
62  CALL bort(bort_str)
63  END
function idn30(ADN30, L30)
This function converts an FXY value from its 5 or 6 character representation to its bit-wise (integer...
Definition: idn30.f:27
character *(*) function adn30(IDN, L30)
This function converts an FXY value from its bit-wise (integer) representation to its 5 or 6 characte...
Definition: adn30.f:28
function ifxy(ADSC)
This function converts an FXY value from its 6 character representation to its bit-wise (integer) rep...
Definition: ifxy.f:42
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:22