subroutine srtrpa(modblk,cts,ictn,i1,i2,jflag) c c this subroutine sorts data for a given head and given mass in c terms of instrument rpa setting. c c input arguments are: c modblk see sentgs input subroutine c i1 - start sample index of data to be included c i2 - stop sample index. i1, i2 are in range [1,512] c output arguments, in addition to cts, ctn, c jflag - set to 0 if no data added to arrays, otherwise 1 c c the arrays cts(nang) and ictn(nang) are updated appropriately c note *** before this routine is called, the information in the c following common blocks must be defined c common updated by calling c ------ ------------------ c rpamsh getmod. contains instrument rpa, ims settings c i7flgs deffgs. contains instrument mode flags. c c v1.0 jfe johnson 25 jul 82 c v1.1 jfej 17 aug 82 added idcodc call c v1.2 jl green 14 sept 82 added electrometer code c integer*2 idat(2812),icde(512,2),jcr(512,2) integer*2 kcel(512) integer*4 idcodc, ic integer*4 jrpa(512),jmsh(512),modblk(8) integer*4 ictn(32) real cts(32) equivalence (icde(1,1),idat(1789)) equivalence (jcr(1,1),idat(253)) equivalence (kcel(1),idat(1277)) common/rpamsh/jrpa,jmsh common/maf1/idat c jflag=0 c c first call refang, to define phase angle reference c call refang(degsam,ramang) c if(modblk(1).eq.4)go to 1000 if(modblk(1).eq.1)go to 601 c z head processing idet=(modblk(1)-2)*2+modblk(2) do 630 i=i1,i2 irp=isclrp(jrpa(i)) if(irp.lt.1)go to 630 c check this sample is in the angle range required iang=isangl(degsam,ramang,i) if(iang.lt.modblk(7).or.iang.gt.modblk(8))go to 630 c check that this mass is in the range required if(jmsh(i).lt.modblk(3).or.jmsh(i).gt.modblk(4))go to 630 c check we have data for this z head detector ich=igtzms(idet,i) if(ich.le.0)go to 630 jflag=1 cts(irp)=cts(irp)+idcodc(icde(i,ich),ic) ictn(irp)=ictn(irp)+ic 630 continue 610 continue go to 9000 c 601 continue c radial head processing do 700 i=i1,i2 irp=isclrp(jrpa(i)) if(irp.lt.1)go to 700 c check this sample is in the angle range required iang=isangl(degsam,ramang,i) if(iang.lt.modblk(7).or.iang.gt.modblk(8))go to 700 c check that this mass is in the range required if(jmsh(i).lt.modblk(3).or.jmsh(i).gt.modblk(4))go to 700 jflag=1 cts(irp)=cts(irp)+idcodc(jcr(i,modblk(2)),ic) ictn(irp)=ictn(irp)+ic 700 continue go to 9000 c c the electrometer channel c 1000 continue do 2000 i=i1,i2 irp=isclrp(jrpa(i)) if(irp.lt.1) go to 2000 c checking for angle range iang=isangl(degsam,ramang,i) if(iang.lt.modblk(7).or.iang.gt.modblk(8)) go to 2000 jflag=1 cts(irp)=cts(irp)+idcodc(kcel(i),ic) ictn(irp)=ictn(irp)+ic 2000 continue c 9000 continue return end