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