module transformmodule
contains
subroutine transform(rx,ry,rz)

	implicit none
    double precision, dimension(:), intent(inout) :: rx,ry,rz
    integer p1,p2,e1,e2,n1,n2,m,i,j
    double precision comx,comy,comz,mp,mne,d1,d2,d3,d4,d5,d6,r1
    double precision :: d7(18)


mp=1836.1526    !proton/electron mass ratio
mne=1838.684    !neutron/electron mass ratio

p1=7
p2=12
e1=1
e2=6
n1=13
n2=18


!Center of Mass
comx=(rx(7)*mp+rx(8)*mp+rx(9)*mp+rx(10)*mp+rx(11)*mp+rx(12)*mp+rx(13)*mne+rx(14)*mne+rx(15)*mne+rx(16)*mne+rx(17)*mne+rx(18)*mne)/&
        (6.0*mp+6.0*mne)
comy=(ry(7)*mp+ry(8)*mp+ry(9)*mp+ry(10)*mp+ry(11)*mp+ry(12)*mp+ry(13)*mne+ry(14)*mne+ry(15)*mne+ry(16)*mne+ry(17)*mne+ry(18)*mne)/&
        (6.0*mp+6.0*mne)
comz=(rz(7)*mp+rz(8)*mp+rz(9)*mp+rz(10)*mp+rz(11)*mp+rz(12)*mp+rz(13)*mne+rz(14)*mne+rz(15)*mne+rz(16)*mne+rz(17)*mne+rz(18)*mne)/&
        (6.0*mp+6.0*mne)




!transforming nucleus coordinates to com of nucleus

do i=1,18

    !transforming all coordinates to com of nucleus
    rx(i)=rx(i)-comx
    ry(i)=ry(i)-comy
    rz(i)=rz(i)-comz

end do



end subroutine transform
end module transformmodule
	  
