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