subroutine qkund(trans,cod,al,rho,kx,eps0,coup) implicit none real*8 trans(4,5),cod(6),cod1(6),al,rho,eps0 real*8 arho,theta,dp,kx logical coup dp = cod(6) arho = rho*sqrt(2.d0)*(1+dp) theta = al/arho cod1(1) = cod(1) cod1(2) = cod(2) cod1(3) = cod(3) cod1(4) = cod(4) cod1(3)=cod(3)+cod(4)*al cod1(4)=cod(4) cod1(1)=cod(1)*cos(theta)+cod(2)*arho*sin(theta) cod1(2)=-sin(theta)/arho*cod(1)+cod(2)*cos(theta) cod(1) = cod1(1) cod(2) = cod1(2) cod(3) = cod1(3) cod(4) = cod1(4) trans(3,3)=1.d0 trans(3,4)=al trans(3,1)=0.d0 trans(3,2)=0.d0 trans(3,5)=0.d0 trans(4,3)=0.d0 trans(4,4)=1.d0 trans(4,1)=0.d0 trans(4,2)=0.d0 trans(4,5)=0.d0 trans(1,3)=0.d0 trans(1,4)=0.d0 trans(1,1)=cos(theta) trans(1,2)=arho*sin(theta) trans(1,5)=0.d0 trans(2,3)=0.d0 trans(2,4)=0.d0 trans(2,1)=-sin(theta)/arho trans(2,2)=cos(theta) trans(2,5)=0.d0 coup=.true. return end