c c ------------------------------------------------ c subroutine CSL(rodrvec,toler,sigmin,sigma) c c ADR 19 vi 99 c c NOW FOR SIGMA analysis; form a misorientation matrix from the results c c NEEDS READSIGMAS to be executed before CSL is called c real qq(3,3,50),oc(50) integer numsigs,i common /m2/ qq,oc,numsigs c real rodrvec(4),s1,s2,s3,u(3,3) real rj1,rj2,rj3,rnorm,rb,rn1,rn2,rn3,rn4,rn5 real axis(3),qsig(3,3),cresult(3,3) real sigmin,toler,sigma,pi,pi2,degrad real rodr(4) c pi=4.*atan(1.) pi2=0.5*pi degrad=180./pi sigmin=180.0 sigma=0.0 c do 10, i=1,3 axis(i)=rodrvec(i) 10 continue c call axisang2rot(axis,rodrvec(4),u) c do 3000, ijk=1,numsigs c write(*,*) 'working on sigma = ',int(oc(ijk)) c do 20, i=1,3 do 20,j=1,3 20 qsig(i,j)=qq(i,j,ijk) c c write(*,320) (u(1,j1),j1=1,3),(qsig(1,j1),j1=1,3) c write(*,320) (u(2,j1),j1=1,3),(qsig(2,j1),j1=1,3) c write(*,320) (u(3,j1),j1=1,3),(qsig(3,j1),j1=1,3) 320 format(x,3(x,f8.3),6x,3(x,f8.3)) call axbt2c(u,qsig,cresult) rnorm=(cresult(1,1)+cresult(2,2)+cresult(3,3)-1.)/2. c rnorm has the trace of the resulting rotation matrix if(rnorm.lt.-1.) rnorm=-1. if(rnorm.gt.1.) rnorm=1. rn4=acos(rnorm) c RN4 has the magnitude of rotation in radians c c call m2r(cresult,rodr,det) c write(*,190) rodr(4)*180./pi c & ,rodr(1),rodr(2),rodr(3) 190 format(' after combining: angle, vector....',4f9.3) c rb=(15.0*1./sqrt(oc(ijk))) c RB is for Brandon's criterion in degrees rn5=rn4*degrad/rb c outputs CSL and deviation c if (rn5.lt.1.0) then if (rn5.lt.toler) then c write(2,*) 'Sigma is ',int(oc(ijk)),'; V/Vm = ',rn5 c write(*,*) 'Sigma is ',int(oc(ijk)),'; V/Vm = ',rn5 endif c if((rn5.lt.toler).and.(rn5.lt.sigmin)) then sigma=oc(ijk) sigmin=rn5 endif 3000 continue return end c c ------------------- c