NCEPLIBS-bufr  11.5.0
 All Data Structures Files Functions Variables Pages
idn30.f
Go to the documentation of this file.
1 C> @file
2 C> @author WOOLLEN @date 1994-01-06
3 
4 C> THIS FUNCTION CONVERTS A DESCRIPTOR FROM ITS FIVE OR SIX
5 C> CHARACTER ASCII REPRESENTATION TO ITS BIT-WISE (INTEGER)
6 C> REPRESENTATION.
7 C>
8 C> PROGRAM HISTORY LOG:
9 C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
10 C> 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
11 C> "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
12 C> ROUTINE "BORT"
13 C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
14 C> INTERDEPENDENCIES
15 C> 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
16 C> DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
17 C> MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
18 C> TERMINATES ABNORMALLY
19 C>
20 C> USAGE: IDN30 (ADN30, L30)
21 C> INPUT ARGUMENT LIST:
22 C> ADN30 - CHARACTER*(*): CHARACTER FORM OF DESCRIPTOR (FXY
23 C> VALUE)
24 C> L30 - INTEGER: LENGTH OF ADN30 (NUMBER OF CHARACTERS, 5 OR
25 C> 6)
26 C>
27 C> OUTPUT ARGUMENT LIST:
28 C> IDN - INTEGER: BIT-WISE REPRESENTATION OF DESCRIPTOR (FXY)
29 C> VALUE
30 C>
31 C> REMARKS:
32 C> THIS ROUTINE CALLS: ADN30 BORT IFXY
33 C> THIS ROUTINE IS CALLED BY: STBFDX
34 C> Normally not called by any application
35 C> programs.
36 C>
37  FUNCTION idn30(ADN30,L30)
38 
39 
40 
41  COMMON /hrdwrd/ nbytw,nbitw,iord(8)
42 
43  CHARACTER*(*) adn30
44  CHARACTER*128 bort_str
45 
46 C----------------------------------------------------------------------
47 C----------------------------------------------------------------------
48 
49  IF(len(adn30).LT.l30) goto 900
50  IF(l30.EQ.5) THEN
51  READ(adn30,'(I5)') idn30
52  IF(idn30.LT.0 .OR. idn30.GT.65535) goto 901
53  ELSEIF(l30.EQ.6) THEN
54  idn30 = ifxy(adn30)
55  ELSE
56  goto 902
57  ENDIF
58 
59 C EXITS
60 C -----
61 
62  RETURN
63 900 WRITE(bort_str,'("BUFRLIB: IDN30 - FUNCTION INPUT STRING ",A,'//
64  . '" CHARACTER LENGTH (",I4,") IS TOO SHORT (< L30,",I5)')
65  . adn30,len(adn30),l30
66  CALL bort(bort_str)
67 901 WRITE(bort_str,'("BUFRLIB: IDN30 - DESCRIPTOR INTEGER '//
68  . 'REPRESENTATION, IDN30 (",I8,"), IS OUTSIDE 16-BIT RANGE '//
69  . '(0-65535)")') idn30
70  CALL bort(bort_str)
71 902 WRITE(bort_str,'("BUFRLIB: IDN30 - FUNCTION INPUT STRING ",A,'//
72  . '" CHARACTER LENGTH (",I4,") MUST BE EITHER 5 OR 6")')
73  . adn30,l30
74  CALL bort(bort_str)
75  END
function idn30(ADN30, L30)
THIS FUNCTION CONVERTS A DESCRIPTOR FROM ITS FIVE OR SIX CHARACTER ASCII REPRESENTATION TO ITS BIT-WI...
Definition: idn30.f:37
character *(*) function adn30(IDN, L30)
This function converts a descriptor from its bit-wise (integer) representation to its 5 or 6 characte...
Definition: adn30.f:27
function ifxy(ADSC)
THIS FUNCTION RETURNS THE INTEGER CORRESPONDING TO THE BIT-WISE REPRESENTATION OF AN INPUT CHARACTER ...
Definition: ifxy.f:49
subroutine bort(STR)
This subroutine calls subroutine errwrt() to log an error message, then calls subroutine bort_exit() ...
Definition: bort.f:23