utility_metric Subroutine

public subroutine utility_metric(real_lat, recip_lat, real_metric, recip_metric)

Calculate the real and reciprical space metrics

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in) :: real_lat(3,3)
real(kind=dp), intent(in) :: recip_lat(3,3)
real(kind=dp), intent(out) :: real_metric(3,3)
real(kind=dp), intent(out) :: recip_metric(3,3)

Called by

proc~~utility_metric~~CalledByGraph proc~utility_metric utility_metric proc~param_read param_read proc~param_read->proc~utility_metric program~wannier wannier program~wannier->proc~param_read proc~wannier_run wannier_run proc~wannier_run->proc~param_read proc~wannier_setup wannier_setup proc~wannier_setup->proc~param_read program~postw90 postw90 program~postw90->proc~param_read

Contents

Source Code


Source Code

  subroutine utility_metric(real_lat, recip_lat, &
                            real_metric, recip_metric)
    !==================================================================!
    !                                                                  !
    !!  Calculate the real and reciprical space metrics
    !                                                                  !
    !===================================================================
    implicit none

    real(kind=dp), intent(in)  :: real_lat(3, 3)
    real(kind=dp), intent(in)  :: recip_lat(3, 3)
    real(kind=dp), intent(out) :: real_metric(3, 3)
    real(kind=dp), intent(out) :: recip_metric(3, 3)

    integer :: i, j, l

    real_metric = 0.0_dp; recip_metric = 0.0_dp

    do j = 1, 3
      do i = 1, j
        do l = 1, 3
          real_metric(i, j) = real_metric(i, j) + real_lat(i, l)*real_lat(j, l)
          recip_metric(i, j) = recip_metric(i, j) + recip_lat(i, l)*recip_lat(j, l)
        enddo
        if (i .lt. j) then
          real_metric(j, i) = real_metric(i, j)
          recip_metric(j, i) = recip_metric(i, j)
        endif
      enddo
    enddo

  end subroutine utility_metric