1 FUNCTION ADN30
(IDN
,L30
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS FUNCTION CONVERTS A DESCRIPTOR FROM ITS BIT-WISE
9 C (INTEGER) REPRESENTATION TO ITS FIVE OR SIX CHARACTER ASCII
12 C PROGRAM HISTORY LOG:
13 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
14 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
15 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
17 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
19 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
20 C DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
21 C MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
22 C TERMINATES ABNORMALLY
24 C USAGE: ADN30 (IDN, L30)
25 C INPUT ARGUMENT LIST:
26 C IDN - INTEGER: BIT-WISE REPRESENTATION OF DESCRIPTOR (FXY)
28 C L30 - INTEGER: LENGTH OF ADN30 (NUMBER OF CHARACTERS, 5 OR
31 C OUTPUT ARGUMENT LIST:
32 C ADN30 - CHARACTER*(*): CHARACTER FORM OF DESCRIPTOR (FXY
36 C THIS ROUTINE CALLS: BORT
37 C THIS ROUTINE IS CALLED BY: CADN30 DXINIT ISTDESC NEMTBD
38 C NUMTAB RDMTBB RDMTBD READS3
39 C SEQSDX SNTBDE UFBQCD UPDS3
41 C Normally not called by any application
45 C LANGUAGE: FORTRAN 77
46 C MACHINE: PORTABLE TO ALL PLATFORMS
50 COMMON /HRDWRD
/ NBYTW
,NBITW
,IORD
(8)
53 CHARACTER*128 BORT_STR
55 C----------------------------------------------------------------------
56 C----------------------------------------------------------------------
58 IF(LEN
(ADN30
).LT
.L30
) GOTO 900
59 IF(IDN
.LT
.0 .OR
. IDN
.GT
.65535) GOTO 901
61 WRITE(ADN30
,'(I5)') IDN
64 IDX
= ISHFT
(ISHFT
(IDN
,NBITW
-14),-(NBITW
-6))
65 IDY
= ISHFT
(ISHFT
(IDN
,NBITW
- 8),-(NBITW
-8))
66 WRITE(ADN30
,'(I1,I2,I3)') IDF
,IDX
,IDY
72 IF(ADN30
(I
:I
).EQ
.' ') ADN30
(I
:I
) = '0'
79 900 CALL BORT
('BUFRLIB: ADN30 - FUNCTION RETURN STRING TOO SHORT')
80 901 CALL BORT
('BUFRLIB: ADN30 - INTEGER REPRESENTATION OF '//
81 . 'DESCRIPTOR OUT OF 16-BIT RANGE')
82 902 WRITE(BORT_STR
,'("BUFRLIB: ADN30 - CHARACTER LENGTH (",I4,") '//
83 . 'MUST BE EITHER 5 OR 6")') L30