NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ai38.f
Go to the documentation of this file.
1C> @file
2C> @brief EBCDIC to ASCII
3C> @author Armand Desmarais @date 1982-11-29
4
5C> Convert EBCDIC to ASCII by character.
6C> This subroutine can be replaced by cray utility subroutine
7C> uscctc. See manual sr-2079 page 3-15. cray utility tr
8C> can also be used for ASCII, EBCDIC conversion. See manual sr-2079
9C> page 9-35.
10C>
11C> Program history log:
12C> - Armand Desmarais 1982-11-29
13C> - Ralph Jones 1988-03-31 Change logic so it works like a
14C> ibm370 translate instruction.
15C> - Ralph Jones 1988-08-22 Changes for microsoft fortran 4.10.
16C> - Ralph Jones 1988-09-04 Change tables to 128 character set.
17C> - Ralph Jones 1990-01-31 Convert to cray cft77 fortran
18C> cray does not allow char*1 to be set to hex.
19C> - Stephen Gilbert 98-12-21 Replaced Function ICHAR with mova2i.
20C>
21C> @param[inout] IE (in) Character*1 array of EBCDIC data (out) ASCII data
22C> @param[in] NC Integer, contains character count to convert.
23C>
24C> @note Software version of ibm370 translate instruction, by
25C> changing the two tables we could do a 64, 96, 128 ASCII
26C> character set, change lower case to upper, etc.
27C> aea converts data at a rate of 1.5 million characters per sec.
28C> cray utility usccti convert ASCII to IBM EBCDIC
29C> cray utility uscctc convert IBM EBCDIC to ASCII
30C> they convert data at a rate of 2.1 million characters per sec.
31C> cray utility tr will also do a ASCII, EBCDIC conversion.
32C> tr convert data at a rate of 5.4 million characters per sec.
33C> tr is in library /usr/lib/libcos.a add to segldr card.
34C>
35C> @author Armand Desmarais @date 1982-11-29
36 SUBROUTINE w3ai38 (IE, NC )
37C
38 INTEGER(8) IASCII(32)
39C
40 CHARACTER*1 IE(*)
41 CHARACTER*1 ASCII(0:255)
42C
43 equivalence(iascii(1),ascii(0))
44C
45C*** ASCII CONTAINS ASCII CHARACTERS, AS PUNCHED ON IBM029
46C
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'/
64C
65 IF (nc .LE. 0) RETURN
66C
67C*** CONVERT STRING ... EBCDIC TO ASCII, NC CHARACTERS
68C
69 DO 20 j = 1, nc
70 ie(j) = ascii(mova2i(ie(j)))
71 20 CONTINUE
72C
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