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