NCEPLIBS-w3emc  2.11.0
w3fi47.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Convert label to off. no. 85 format (cray)
3 C> @author Ralph Jones @date 1985-07-31
4 
5 C> Converts a office note 85 label in IBM370 format
6 C> to office note 85 cray format. All EBCDIC characters are
7 C> converted to ASCII. Converts binary or coded label.
8 C>
9 C> Program history log:
10 C> - Ralph Jones 1985-07-31
11 C> - Ralph Jones 1989-10-24 Convert to cray cft77 fortran
12 C> - Boi Vuong 2002-10-15 Replaced function ichar with mova2i
13 C>
14 C> @param[in] ILABEL 4 words (32 bytes) characters are in EBCDIc or
15 C> binary.
16 C> @param[out] NLABEL 4 words (32 bytes), characters are in ASCII or
17 C> binary.
18 C>
19 C> @author Ralph Jones @date 1985-07-31
20  SUBROUTINE w3fi47(ILABEL,NLABEL)
21 C
22  CHARACTER*1 ILABEL(32)
23  CHARACTER*1 NLABEL(32)
24 C
25 C TEST FOR CODED LABEL, IF SO, CONVERT ALL CHARACTERS
26 C TEST FOR EBCDIC C, 195 IN DECIMAL
27 C
28  IF (mova2i(ilabel(7)).EQ.195) THEN
29 C
30  CALL aea(nlabel(1),ilabel(1),32)
31 C
32  ELSE
33 C
34 C BINARY LABEL, CONVERT BYTES 1-8, 21-30 TO ASCII
35 C
36  CALL aea(nlabel(1),ilabel(1),8)
37 C
38 C MOVE BYTES 9 TO 20
39 C
40  DO 10 i = 9,20
41  nlabel(i) = ilabel(i)
42  10 CONTINUE
43 C
44 C CONVERT WASHINGTON TO ASCII
45 C
46  CALL aea(nlabel(21),ilabel(21),10)
47 C
48 C TEST BYTES 31 AND 32 FOR BINARY ZERO, IF NOT ZERO
49 C CONVERT TO ASCII
50 C
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
56 C
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
62 C
63  ENDIF
64 C
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