|
|
|
@ -67,23 +67,19 @@ module mode_calc
|
|
|
|
|
calculated = 0
|
|
|
|
|
do i = 1, atom_num
|
|
|
|
|
do j = 1, 6
|
|
|
|
|
calculated(j) = calculated(j) + virial_atom(j, i)
|
|
|
|
|
calculated(j) = calculated(j) - virial_atom(j, i)
|
|
|
|
|
end do
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
!Sum the nodal virials
|
|
|
|
|
do i = 1, ele_num
|
|
|
|
|
avg_virial(:) = 0
|
|
|
|
|
do inod = 1, ng_node(lat_ele(i))
|
|
|
|
|
do ibasis = 1, basisnum(lat_ele(i))
|
|
|
|
|
do j = 1,6
|
|
|
|
|
avg_virial(j) = avg_virial(j) + virial_node(j,ibasis,inod,i)/(basisnum(lat_ele(i))*ng_node(lat_ele(i)))
|
|
|
|
|
calculated(j) = calculated(j) - virial_node(j,ibasis,inod,i)*(size_ele(i)**3)/ng_node(lat_ele(i))
|
|
|
|
|
end do
|
|
|
|
|
end do
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
!Now add the total virial from the element
|
|
|
|
|
calculated = calculated + avg_virial*(esize**3.0_dp)
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
!Now calculate the total box virial and convert to GPa
|
|
|
|
|