subroutine swap(np,wtp) c---swap coordinates of particle np with particle ngood c---------------------------------------------------------------------- save c include 'param_sz.h' include 'constcom.h' include 'coordcom.h' include 'ncordscom.h' include 'pcordcom.h' include 'syscom.h' include 'ucom.h' c common/aswap/acor(7,imaa) common/back/bmax,byz0,byzs,pzowmin,pzowmax,iback common/jones/ajones,zjones,zcath(imaa) common/part/nparticle(imaa) common/pnum/ipnum(imaa) dimension xyz(7) c-------------------------------------------------------------------------- c* xyz(1)=x xyz(2)=bgx xyz(3)=y xyz(4)=bgy xyz(5)=z xyz(6)=bgz xyz(7)=rne c c for back bombardment if(iback.eq.1) then if(xyz(7).le.1.and.xyz(6).le.0.) then write(nback1) xyz(1),xyz(2),xyz(3),xyz(4),xyz(5),xyz(6), 1 erest*(gamma-1.),phizero(np),wtp endif endif if(np.eq.ngood)return c real t do 10 i=1,6 cord(i,np)=cord(i,ngood) cord(i,ngood)=xyz(i) 10 continue do 20 j=1,7 ! alpha magnet atmp=acor(j,np) acor(j,np)=acor(j,ngood) acor(j,ngood)=atmp 20 continue cord(7,np)=cord(7,ngood) cord(7,ngood)=xyz(7) wt=weight(np) weight(np)=weight(ngood) weight(ngood)=wt ph=phizero(np) phizero(np)=phizero(ngood) phizero(ngood)=ph iparticle=nparticle(np) nparticle(np)=nparticle(ngood) nparticle(ngood)=iparticle gam(np)=gam(ngood) gam(ngood)=gamma it=ipnum(np) ipnum(np)=ipnum(ngood) ipnum(ngood)=it t=zcath(np) zcath(np)=zcath(ngood) zcath(ngood)=t return end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*