1 SUBROUTINE CHRTRNA
(STR
,CHR
,N
)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE COPIES A SPECIFIED NUMBER OF CHARACTERS
9 C FROM A CHARACTER ARRAY INTO A CHARACTER STRING. THE DIFFERENCE
10 C BETWEEN THIS SUBROUTINE AND BUFR ARCHIVE LIBRARY SUBROUTINE CHRTRN
11 C IS THAT, IN THIS SUBROUTINE, THE INPUT CHARACTER ARRAY IS ASSUMED
12 C TO BE IN ASCII; THUS, FOR CASES WHERE THE NATIVE MACHINE IS EBCDIC,
13 C AN ASCII TO EBCDIC TRANSLATION IS DONE ON THE FINAL STRING BEFORE
16 C PROGRAM HISTORY LOG:
17 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
18 C 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
19 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
21 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED HISTORY
24 C USAGE: CALL CHRTRNA (STR, CHR, N)
25 C INPUT ARGUMENT LIST:
26 C CHR - CHARACTER*1: N-WORD CHARACTER ARRAY IN ASCII
27 C N - INTEGER: NUMBER OF CHARACTERS TO COPY
29 C OUTPUT ARGUMENT LIST:
30 C STR - CHARACTER*(*): CHARACTER STRING IN ASCII OR EBCDIC,
31 C DEPENDING ON NATIVE MACHINE
34 C THIS ROUTINE CALLS: IPKM IUPM
35 C THIS ROUTINE IS CALLED BY: ICHKSTR STBFDX
36 C Normally not called by any application
40 C LANGUAGE: FORTRAN 77
41 C MACHINE: PORTABLE TO ALL PLATFORMS
45 COMMON /CHARAC
/ IASCII
,IATOE
(0:255),IETOA
(0:255)
50 C----------------------------------------------------------------------
51 C----------------------------------------------------------------------
53 C Loop on N characters of CHR
58 C If this is an EBCDIC machine, then translate the character
59 C from ASCII -> EBCDIC.
61 IF(IASCII
.EQ
.0) CALL IPKM
(STR
(I
:I
),1,IATOE
(IUPM
(STR
(I
:I
),8)))