NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ai39.f
Go to the documentation of this file.
1C> @file
2C> @brief Translate 'ASCII' field to 'EBCDIC'.
3C> @author Armand Desmarais @date 1993-10-06
4
5C> translate an 'ASCII' field to 'EBCDIC', all alphanumerics,
6C> special charcaters, fill scatter, brocken< clear, overcast, bell,
7C> ht and vt (for AFOS). space, '6D' to '5E' conversion (hdrology),
8C> changers were made to W3AI38 to give reverse table translation
9C>
10C> Program history log:
11C> - Ralph Jones 1993-10-06 Convert ibm370 assebler version to fortran.
12C> - Ralph Jones 1994-04-28 Changes for cray.
13C> - Stephen Gilbert 1998-12-21 Replaced Function ICHAR with mova2i.
14C>
15C> @param[inout] NFLD Character*1 array of (in) ASCII data (out) EBCDIC data.
16C> @param[in] N Integer, contains character count to convert.
17C>
18C> @note Software version of IBM370 translate instruction, by
19C> changing the table we could do a 64, 96, ASCII
20C> character set, change lower case to upper, etc.
21C> tr convert data at a rate of 5.4 million characters per sec.
22C> tr is in library /usr/lib/libcos.a add to segldr card.
23C>
24C> @author Armand Desmarais @date 1993-10-06
25 SUBROUTINE w3ai39 (NFLD, N)
26C
27 INTEGER(8) IEBCDC(32)
28C
29 CHARACTER*1 NFLD(*)
30 CHARACTER*1 EBCDIC(0:255)
31C
32 SAVE
33C
34 equivalence(iebcdc(1),ebcdic(0))
35C
36C*** EBCDIC CONTAINS HEX. REPRESENTATION OF EBCDIC CHARACTERS
37C
38C DATA IEBCDC/
39C & X'00010203372D2E2F',X'1605250B0C0D0E0F',
40C & X'101112003C3D3226',X'18193F2722003500',
41C & X'405A7F7B5B6C507D',X'4D5D5C4E6B604B61',
42C & X'F0F1F2F3F4F5F6F7',X'F8F97A5E4C7E6E6F',
43C & X'7CC1C2C3C4C5C6C7',X'C8C9D1D2D3D4D5D6',
44C & X'D7D8D9E2E3E4E5E6',X'E7E8E9ADE0BD5F6D',
45C & X'7981828384858687',X'8889919293949596',
46C & X'979899A2A3A4A5A6',X'A7A8A9C06AD0A107',
47C & 16*X'4040404040404040'/
48C
49C THIS TABLE IS THE SAME AS HDS ASSEMBLER VERSION
50C
51 DATA iebcdc/
52 & z'007D006C000000E0',z'00657C66004C0000',
53 & z'0000000000000000',z'0000000000005B00',
54 & z'40D07F7B5000506E',z'4D5D5C4F6B604B61',
55 & z'F0F1F2F3F4F5F6F7',z'F8F90000007E00C0',
56 & z'64C1C2C3C4C5C6C7',z'C8C9D1D2D3D4D5D6',
57 & z'D7D8D9E2E3E4E5E6',z'E7E8E90062636D00',
58 & z'0000000000000000',z'0000000000000000',
59 & z'0000000000000000',z'000000000000005F',
60 & 16 * z'0000000000000000'/
61C
62 IF (n .LE. 0) RETURN
63C
64C*** CONVERT STRING ... ASCII TO EBCDIC, N CHARACTERS
65C
66 DO 20 j = 1, n
67 nfld(j) = ebcdic(mova2i(nfld(j)))
68 20 CONTINUE
69C
70 RETURN
71 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 w3ai39(nfld, n)
translate an 'ASCII' field to 'EBCDIC', all alphanumerics, special charcaters, fill scatter,...
Definition w3ai39.f:26