integer*4 function igtzms (idet, isampl) c c----------------------------------------------------------------------- c c This routine accesses the decoded w7 flags in /i7flgs/, which must c previously defined by a call to deffgs, and returns a function c value for sample isampl. c c----------------------------------------------------------------------- c c values of idet define the z head detector as follows c +z low idet= 1 c +z high idet= 2 c -z low idet= 3 c -z high idet= 4 c c----------------------------------------------------------------------- c integer*2 iaz(8), iiz(8), itr(8), iztog(4), i7flgs(8,22), * jtable(9,2,4) c integer*4 idet, isampl c common/i7flgs/i7flgs c data iztog /32,16,8,4/, * jtable /1,1,1,0,0,0,1,1,0, * 0,1,1,0,1,0,0,0,0, * 0,2,0,1,1,0,0,0,0, * 1,2,0,1,0,0,1,1,0, * 2,0,0,2,0,1,2,2,0, * 0,0,0,2,2,1,0,0,0, * 0,0,2,0,2,2,0,0,0, * 2,0,2,0,0,2,2,2,0/ c equivalence (i7flgs(1,4), iiz), * (i7flgs(1,9), iaz), * (i7flgs(1,2), itr) c c----------------------------------------------------------------------- c *** here we determine the 8 second block number *** c----------------------------------------------------------------------- c i = 1 + (isampl-1) / 64 c c----------------------------------------------------------------------- c *** determine appropriate flags for this second *** c----------------------------------------------------------------------- c inz = iiz(i) + 1 if ((inz. lt. 1) .or. (inz .gt. 8)) inz = 9 ialz = iaz(i) + 1 if ((ialz .lt. 1) .or. (ialz .gt. 8)) ialz = 9 it = itr(i) + 1 if ((it .ge. 1) .and. (it. le. 4)) then itog = iztog(it) else inz = 9 ialz = 9 it = 1 itog = iztog(it) end if c c----------------------------------------------------------------------- c *** determine the sample within the second *** c----------------------------------------------------------------------- c isam = 1 + mod(isampl-1, 64) c c----------------------------------------------------------------------- c *** how many blocks of itog samples are we thru at this sample ? * c----------------------------------------------------------------------- c jtog = 1 + (isam - 1) / itog c c----------------------------------------------------------------------- c *** use elements *,1,* for odd blocks, *,2,* for even *** c----------------------------------------------------------------------- c k = mod(jtog, 2) + 1 igtzms = jtable(inz, 1, idet) if (k .eq. 1) igtzms = jtable(ialz, 2, idet) c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c return end