Calculates the reciprical lattice vectors and the cell volume Includes a check that the volume isn't almost 0 Use the first time the lattice is read to check its sensible
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | real_lat(3,3) | |||
| real(kind=dp), | intent(out) | :: | recip_lat(3,3) | |||
| real(kind=dp), | intent(out) | :: | volume | |||
| type(w90_error_type), | allocatable | :: | error | |||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine utility_recip_lattice(real_lat, recip_lat, volume, error, comm) !================================================! ! !! Calculates the reciprical lattice vectors and the cell volume !! Includes a check that the volume isn't almost 0 !! Use the first time the lattice is read to check its sensible ! !================================================ use w90_constants, only: dp, eps5 use w90_error, only: w90_error_type, set_error_fatal implicit none type(w90_error_type), allocatable :: error real(kind=dp), intent(in) :: real_lat(3, 3) real(kind=dp), intent(out) :: recip_lat(3, 3) real(kind=dp), intent(out) :: volume type(w90_comm_type), intent(in) :: comm call utility_recip_lattice_base(real_lat, recip_lat, volume) if (abs(volume) < eps5) then call set_error_fatal(error, ' Found almost zero Volume in utility_recip_lattice', comm) return end if return end subroutine utility_recip_lattice