subroutine srtang (modblk, cts, ctss, ictn, nang, is, ie, jflag) c c---------------------------------------------------------------------- c c This subroutine sorts data for a given head and given mass in c terms of instrument spin phase angle. c c---------------------------------------------------------------------- c c input arguments are: c c modblk processing limits and parameters c nang number of angle bins for one spin c is start sample index of data to be included c ie stop sample index. is, ie are in range [1,512] c c---------------------------------------------------------------------- c c output arguments are: c c cts accumulated counts c ctss accumulated counts**2 c ictn accumulates number of samples c jflag set to 0 if no data added to arrays, otherwise 1 c c the arrays cts(nang), ctss(nang) and ictn(nang) are updated appropriately c c---------------------------------------------------------------------- c c following common blocks must be defined c c common updated by calling c ------ ------------------ c rpamsh getmd1. contains instrument rpa, ims settings c i7flgs deffgs. contains instrument mode flags. c c---------------------------------------------------------------------- c integer*2 icde(512,2), idat(2812), jcr(512,2), kcel(512) c integer*4 i, iang, iangln, ic, ictn(nang), idcodc, ie, is, jflag, * jmsh(512), jrpa(512), modblk(8), nang c real cts(nang), ctss(nang) c common /maf1/idat, * /rpamsh/jrpa, jmsh c equivalence (icde(1,1), idat(1789)), * (jcr(1,1), idat(253)), * (kcel(1), idat(1277)) c c---------------------------------------------------------------------- c *** set the have data flag *** c---------------------------------------------------------------------- c jflag = 0 c c---------------------------------------------------------------------- c *** first call refang, to define phase angle reference *** c---------------------------------------------------------------------- c call refang (degsam, ramang) c c---------------------------------------------------------------------- c *** collect the data *** c---------------------------------------------------------------------- c if (modblk(1) .eq. 1) then c c---------------------------------------------------------------------- c *** radial head processing *** c---------------------------------------------------------------------- c c----------------------------------------------------------------------- c *** loop through the samples to process *** c----------------------------------------------------------------------- c do 100 i = is, ie c c---------------------------------------------------------------------- c *** check that rpa setting is in the required range *** c---------------------------------------------------------------------- c if(jrpa(i).lt.modblk(5) .or. jrpa(i).gt.modblk(6))go to 100 c c---------------------------------------------------------------------- c *** check that this mass is in the range required *** c---------------------------------------------------------------------- c if(jmsh(i).lt.modblk(3) .or. jmsh(i).gt.modblk(4))go to 100 c c---------------------------------------------------------------------- c *** save the data *** c---------------------------------------------------------------------- c jflag = 1 iang = iangln(degsam, ramang, nang, i) cnt = idcodc(jcr(i,modblk(2)), ic) cts(iang) = cts(iang) + cnt ctss(iang) = ctss(iang) + cnt**2 ictn(iang) = ictn(iang) + ic 100 continue c c---------------------------------------------------------------------- c *** end radial head processing *** c---------------------------------------------------------------------- c else end if c c---------------------------------------------------------------------- c---------------------------------------------------------------------- c return end