Calculate the metric for a lattice
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | lattice(3,3) | |||
| real(kind=dp), | intent(out) | :: | metric(3,3) |
subroutine utility_metric(lattice, metric) !================================================! ! !! Calculate the metric for a lattice ! !================================================ implicit none real(kind=dp), intent(in) :: lattice(3, 3) real(kind=dp), intent(out) :: metric(3, 3) integer :: i, j, l metric = 0.0_dp do j = 1, 3 do i = 1, j do l = 1, 3 metric(i, j) = metric(i, j) + lattice(i, l)*lattice(j, l) end do if (i .lt. j) then metric(j, i) = metric(i, j) end if end do end do end subroutine utility_metric