c calculate threshold current c given the status word, the scid, and the clock c calculate the threshold current, the capacitor setting, the gain setting c the instrument mode, and jtlmod as determined from the status word c subroutine thresh(fact,icap,igain,ipls, * ityp,lstat,idsc,jclk) c integer l1x integer*2 lstat,jclk,idsc,ipls,ityp,kmod real cap(2),gain(2),clock(3),V0(2) data cap /0.15,1.15/ data gain /2.,20/ data clock /0.03,0.21,0.93/ data V0 /453.,372./ c c decode status word to get icap and igan c note I have to use thresh with l1x here because my status word on the c spl file is 16 bits, a repeat of the 8 bit status word and I need to c isolate that into one 8 bit word c icg = l1x(lstat) ityp = mod(icg,16) c new icpgn = mod(icg/16,4) icap = mod(icpgn,2) igain = icpgn/2 fact = V0(idsc)*CAP(ICAP+1)/(GAIN(IGAiN+1)*CLOCK(JCLK)) write(6,17) lstat,icg,icg,fact,icpgn,ityp,igain,icap,jclk 17 format("thresh",2z9,i5,f10.2,8i5) return end