utility_im_tr Function

public function utility_im_tr(mat)

Uses

  • proc~~utility_im_tr~~UsesGraph proc~utility_im_tr utility_im_tr module~w90_constants w90_constants proc~utility_im_tr->module~w90_constants

Imaginary part of the trace

Arguments

Type IntentOptional AttributesName
complex(kind=dp), dimension(:, :):: mat

Return Value real(kind=dp)


Contents

Source Code


Source Code

  function utility_im_tr(mat)
    !=============================!
    !                             !
    !! Imaginary part of the trace
    !                             !
    !=============================!

    use w90_constants, only: dp, cmplx_0

    real(kind=dp)                    :: utility_im_tr
    complex(kind=dp), dimension(:, :) :: mat

    integer          :: i, mydim
    complex(kind=dp) :: cdum

    mydim = size(mat, 1)

    cdum = cmplx_0
    do i = 1, mydim
      cdum = cdum + mat(i, i)
    enddo
    utility_im_tr = aimag(cdum)

  end function utility_im_tr