5 * Revision 1.2 1996/04/18 16:10:46 mclareni
6 * Incorporate changes from J.Zoll for version 3.77
8 * Revision 1.1.1.1 1996/03/06 10:47:11 mclareni
12 #include "zebra/pilot.h"
13 #if !defined(CERNLIB_FQXISN)
14 SUBROUTINE FZOCV (MS,MT)
16 C- Convert for output with copy
17 C- from source in native to target in exchange data format
19 #include "zebra/quest.inc"
20 #include "zebra/mzioc.inc"
21 C-------------- End CDE --------------
22 DIMENSION MS(99), MT(99)
26 EQUIVALENCE (THDB,THIS)
27 EQUIVALENCE (ITHA,THA,THIS(1)), (ITHB,THB,THIS(2))
29 C---- Conversion Control in /MZIOC/ :
31 C- for a given call translation source MS -> target MT is done
32 C- either for a complete batch of NWFOTT words
33 C- if NWFODN.EQ.0 and NWFOAV.GE.NWFOTT
35 C- or for the first instalment of a batch of NWFOTT words
36 C- if NWFODN.EQ.0 and NWFOAV.LT.NWFOTT
38 C- or for a new instalment of N=MIN(NWFOAV,NWFOTT-NWFODN)
39 C- words, if NWFODN.NE.0
41 C- * marks words to be initialized by the caller
42 C- only for the call at the beginning of a new batch
44 C- NWFOAV number of words available in the buffer to receive
46 C- set by the caller whenever a new lot of data
47 C- becomes available for conversion (new buffer)
48 C- counted down by FZOCV
49 C- * NWFOTT total number of words in the batch to be done,
50 C- maybe in several instalments
51 C- * NWFODN number of words in the batch already done
52 C- set to zero by the caller at start of batch
53 C- (in fact MZIOCR sets it to zero)
54 C- NWFORE n.w. remaining to be done for the pending batch
55 C- set by FZOCV, zero if end of batch
57 C- IFOCON remembers the last conversion problem
58 C- (1) error code if -ve, expected type if +ve
59 C- (2) location of the word
60 C- (3) content of the word
63 C- (1+2) saves type and word-count for re-entry
65 C- * JFOEND position of last sector plus 1
66 C- * JFOREP position of repeat sector descr.
67 C- JFOCUR position of current sector description
69 C- * MFO(JFO+1) t= sector type as in format
70 C- * +2) c= word count as in format
71 C- c > 0 : no. of words
72 C- c = 0 : dynamic sector
73 C- c < 0 : indefinite sector, rest of the bank
75 C- JMT # of words done so far for the current call
76 C- JMS # of words done so far for the current batch
78 #include "fzocvd1.inc"
79 #include "fzocvd2.inc"
83 IF (NWFODN.NE.0) GO TO 30
86 JMTEX = MIN (NWFORE,NWFOAV)
92 C------ Start next sector
94 21 ITYPE = MFO(JFOCUR+1)
95 IF (ITYPE.EQ.7) GO TO 24
110 C-- Self-describing sector
113 ITYPE = MOD (IWORD,16)
121 IF (ITYPE.GE.8) GO TO 27
122 IF (NWSEC.EQ.0) GO TO 29
123 IF (NWSEC.GT.0) GO TO 31
125 C-- Faulty sector control word
131 C-- Rest of the bank is unused
137 C-- RE-ENTRY TO CONTINUE
139 30 JMTEX = MIN (NWFORE,NWFOAV)
144 C------ CONVERSION LOOPS
146 31 NWDO = MIN (NWSEC,JMTEX-JMT)
147 IF (NWDO.EQ.0) GO TO 801
148 IF (ITYPE.LE.0) GO TO 91
149 GO TO (101,201,301,401,501,101,101), ITYPE
151 C-- Rest of the bank unused
153 91 CALL VZERO (MT(JMT+1),NWDO)
162 #include "fzocvfi.inc"
167 #include "fzocvff.inc"
170 C-- D - double precision
172 401 NDPN = (NWDO+1) / 2
174 #include "fzocvfd.inc"
175 IF (NWDODB.EQ.NWDO) GO TO 801
176 IF (NWDODB.GT.NWSEC) GO TO 471
177 IF (NWDODB.GT.NWFORE) GO TO 471
181 C-- Error : odd number of double-precision words
193 #include "fzocvfh.inc"
198 #include "fzocvjf.inc"
201 #include "fzocvfai.inc"
203 C------ END OF SECTOR
205 801 NWFORE = NWFOTT - JMS
206 IF (JMT.GE.JMTEX) GO TO 804
208 IF (JFOCUR.LT.JFOEND) GO TO 21
212 C-- Data or buffer exhausted
215 NWFOAV = NWFOAV - JMT
216 IF (NWFORE.EQ.0) RETURN
218 C-- Ready for re-entry
222 MFOSAV(2) = NWSEC - NWDO
225 * ==================================================
226 #include "zebra/qcardl.inc"