NCEPLIBS-w3emc  2.11.0
w3ai38.f
Go to the documentation of this file.
1 C> @file
2 C> @brief EBCDIC to ASCII
3 C> @author Armand Desmarais @date 1982-11-29
4 
5 C> Convert EBCDIC to ASCII by character.
6 C> This subroutine can be replaced by cray utility subroutine
7 C> uscctc. See manual sr-2079 page 3-15. cray utility tr
8 C> can also be used for ASCII, EBCDIC conversion. See manual sr-2079
9 C> page 9-35.
10 C>
11 C> Program history log:
12 C> - Armand Desmarais 1982-11-29
13 C> - Ralph Jones 1988-03-31 Change logic so it works like a
14 C> ibm370 translate instruction.
15 C> - Ralph Jones 1988-08-22 Changes for microsoft fortran 4.10.
16 C> - Ralph Jones 1988-09-04 Change tables to 128 character set.
17 C> - Ralph Jones 1990-01-31 Convert to cray cft77 fortran
18 C> cray does not allow char*1 to be set to hex.
19 C> - Stephen Gilbert 98-12-21 Replaced Function ICHAR with mova2i.
20 C>
21 C> @param[inout] IE (in) Character*1 array of EBCDIC data (out) ASCII data
22 C> @param[in] NC Integer, contains character count to convert.
23 C>
24 C> @note Software version of ibm370 translate instruction, by
25 C> changing the two tables we could do a 64, 96, 128 ASCII
26 C> character set, change lower case to upper, etc.
27 C> aea converts data at a rate of 1.5 million characters per sec.
28 C> cray utility usccti convert ASCII to IBM EBCDIC
29 C> cray utility uscctc convert IBM EBCDIC to ASCII
30 C> they convert data at a rate of 2.1 million characters per sec.
31 C> cray utility tr will also do a ASCII, EBCDIC conversion.
32 C> tr convert data at a rate of 5.4 million characters per sec.
33 C> tr is in library /usr/lib/libcos.a add to segldr card.
34 C>
35 C> @author Armand Desmarais @date 1982-11-29
36  SUBROUTINE w3ai38 (IE, NC )
37 C
38  INTEGER(8) IASCII(32)
39 C
40  CHARACTER*1 IE(*)
41  CHARACTER*1 ASCII(0:255)
42 C
43  equivalence(iascii(1),ascii(0))
44 C
45 C*** ASCII CONTAINS ASCII CHARACTERS, AS PUNCHED ON IBM029
46 C
47  DATA iascii/
48  & z'000102030009007F',z'0000000B0C0D0E0F',
49  & z'1011120000000000',z'1819000000000000',
50  & z'00001C000A001700',z'0000000000050607',
51  & z'00001600001E0004',z'000000001415001A',
52  & z'2000600000000000',z'0000602E3C282B00',
53  & z'2600000000000000',z'000021242A293B5E',
54  & z'2D2F000000000000',z'00007C2C255F3E3F',
55  & z'0000000000000000',z'00603A2340273D22',
56  & z'2061626364656667',z'6869202020202020',
57  & z'206A6B6C6D6E6F70',z'7172202020202020',
58  & z'207E737475767778',z'797A2020205B2020',
59  & z'0000000000000000',z'00000000005D0000',
60  & z'7B41424344454647',z'4849202020202020',
61  & z'7D4A4B4C4D4E4F50',z'5152202020202020',
62  & z'5C20535455565758',z'595A202020202020',
63  & z'3031323334353637',z'3839202020202020'/
64 C
65  IF (nc .LE. 0) RETURN
66 C
67 C*** CONVERT STRING ... EBCDIC TO ASCII, NC CHARACTERS
68 C
69  DO 20 j = 1, nc
70  ie(j) = ascii(mova2i(ie(j)))
71  20 CONTINUE
72 C
73  RETURN
74  END
integer function mova2i(a)
This Function copies a bit string from a Character*1 variable to an integer variable.
Definition: mova2i.f:25
subroutine w3ai38(IE, NC)
Convert EBCDIC to ASCII by character.
Definition: w3ai38.f:37