NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fi47.f
Go to the documentation of this file.
1C> @file
2C> @brief Convert label to off. no. 85 format (cray)
3C> @author Ralph Jones @date 1985-07-31
4
5C> Converts a office note 85 label in IBM370 format
6C> to office note 85 cray format. All EBCDIC characters are
7C> converted to ASCII. Converts binary or coded label.
8C>
9C> Program history log:
10C> - Ralph Jones 1985-07-31
11C> - Ralph Jones 1989-10-24 Convert to cray cft77 fortran
12C> - Boi Vuong 2002-10-15 Replaced function ichar with mova2i
13C>
14C> @param[in] ILABEL 4 words (32 bytes) characters are in EBCDIc or
15C> binary.
16C> @param[out] NLABEL 4 words (32 bytes), characters are in ASCII or
17C> binary.
18C>
19C> @author Ralph Jones @date 1985-07-31
20 SUBROUTINE w3fi47(ILABEL,NLABEL)
21C
22 CHARACTER*1 ILABEL(32)
23 CHARACTER*1 NLABEL(32)
24C
25C TEST FOR CODED LABEL, IF SO, CONVERT ALL CHARACTERS
26C TEST FOR EBCDIC C, 195 IN DECIMAL
27C
28 IF (mova2i(ilabel(7)).EQ.195) THEN
29C
30 CALL aea(nlabel(1),ilabel(1),32)
31C
32 ELSE
33C
34C BINARY LABEL, CONVERT BYTES 1-8, 21-30 TO ASCII
35C
36 CALL aea(nlabel(1),ilabel(1),8)
37C
38C MOVE BYTES 9 TO 20
39C
40 DO 10 i = 9,20
41 nlabel(i) = ilabel(i)
42 10 CONTINUE
43C
44C CONVERT WASHINGTON TO ASCII
45C
46 CALL aea(nlabel(21),ilabel(21),10)
47C
48C TEST BYTES 31 AND 32 FOR BINARY ZERO, IF NOT ZERO
49C CONVERT TO ASCII
50C
51 IF (mova2i(ilabel(31)).EQ.0) THEN
52 nlabel(31) = char(0)
53 ELSE
54 CALL aea(nlabel(31),ilabel(31),1)
55 ENDIF
56C
57 IF (mova2i(ilabel(32)).EQ.0) THEN
58 nlabel(32) = char(0)
59 ELSE
60 CALL aea(nlabel(32),ilabel(32),1)
61 ENDIF
62C
63 ENDIF
64C
65 RETURN
66 END
subroutine aea(ia, ie, nc)
Program history log:
Definition aea.f:41
integer function mova2i(a)
This Function copies a bit string from a Character*1 variable to an integer variable.
Definition mova2i.f:25
subroutine w3fi47(ilabel, nlabel)
Converts a office note 85 label in IBM370 format to office note 85 cray format.
Definition w3fi47.f:21