w90_get_proj Subroutine

public subroutine w90_get_proj(common_data, n, site, l, m, s, rad, x, z, sqa, zona, istdout, istderr, ierr)

Uses

  • proc~~w90_get_proj~2~~UsesGraph proc~w90_get_proj~2 w90_get_proj module~w90_error w90_error proc~w90_get_proj~2->module~w90_error module~w90_comms w90_comms module~w90_error->module~w90_comms module~w90_error_base w90_error_base module~w90_error->module~w90_error_base module~w90_comms->module~w90_error_base module~w90_constants w90_constants module~w90_comms->module~w90_constants

probes library data object and returns arrays describing a list of projections projectors defined either in .win file or passed (using same syntax) through w90_setopt array arguments assumed allocated at call array arguments must have length >= number of projectors (checked here)

Arguments

Type IntentOptional Attributes Name
type(lib_common_type), intent(in), target :: common_data

library data object

integer, intent(inout) :: n

number of projectors, angular, orbital and spin numbers

real(kind=dp), intent(inout) :: site(:,:)

projector origin (kind, site of kind)

integer, intent(inout) :: l(:)

number of projectors, angular, orbital and spin numbers

integer, intent(inout) :: m(:)

number of projectors, angular, orbital and spin numbers

integer, intent(inout) :: s(:)

number of projectors, angular, orbital and spin numbers

integer, intent(inout) :: rad(:)

radial function defining projector

real(kind=dp), intent(inout) :: x(:,:)

spin quantisation axis, z- an x-axes

real(kind=dp), intent(inout) :: z(:,:)

spin quantisation axis, z- an x-axes

real(kind=dp), intent(inout) :: sqa(:,:)

spin quantisation axis, z- an x-axes

real(kind=dp), intent(inout) :: zona(:)

spin quantisation axis, z- an x-axes

integer, intent(in) :: istdout
integer, intent(in) :: istderr
integer, intent(out) :: ierr

ierr returned > 0 in case of error


Calls

proc~~w90_get_proj~2~~CallsGraph proc~w90_get_proj~2 w90_get_proj proc~prterr prterr proc~w90_get_proj~2->proc~prterr proc~set_error_fatal set_error_fatal proc~w90_get_proj~2->proc~set_error_fatal interface~comms_no_sync_bcast comms_no_sync_bcast proc~prterr->interface~comms_no_sync_bcast interface~comms_no_sync_recv comms_no_sync_recv proc~prterr->interface~comms_no_sync_recv interface~comms_no_sync_send comms_no_sync_send proc~prterr->interface~comms_no_sync_send proc~mpirank mpirank proc~prterr->proc~mpirank proc~mpisize mpisize proc~prterr->proc~mpisize proc~comms_sync_error comms_sync_error proc~set_error_fatal->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_fatal->proc~set_base_error proc~comms_no_sync_bcast_char comms_no_sync_bcast_char interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_char proc~comms_no_sync_bcast_cmplx comms_no_sync_bcast_cmplx interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_cmplx proc~comms_no_sync_bcast_int comms_no_sync_bcast_int interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_int proc~comms_no_sync_bcast_logical comms_no_sync_bcast_logical interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_logical proc~comms_no_sync_bcast_real comms_no_sync_bcast_real interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_real proc~comms_no_sync_recv_char comms_no_sync_recv_char interface~comms_no_sync_recv->proc~comms_no_sync_recv_char proc~comms_no_sync_recv_cmplx comms_no_sync_recv_cmplx interface~comms_no_sync_recv->proc~comms_no_sync_recv_cmplx proc~comms_no_sync_recv_int comms_no_sync_recv_int interface~comms_no_sync_recv->proc~comms_no_sync_recv_int proc~comms_no_sync_recv_logical comms_no_sync_recv_logical interface~comms_no_sync_recv->proc~comms_no_sync_recv_logical proc~comms_no_sync_recv_real comms_no_sync_recv_real interface~comms_no_sync_recv->proc~comms_no_sync_recv_real proc~comms_no_sync_send_char comms_no_sync_send_char interface~comms_no_sync_send->proc~comms_no_sync_send_char proc~comms_no_sync_send_cmplx comms_no_sync_send_cmplx interface~comms_no_sync_send->proc~comms_no_sync_send_cmplx proc~comms_no_sync_send_int comms_no_sync_send_int interface~comms_no_sync_send->proc~comms_no_sync_send_int proc~comms_no_sync_send_logical comms_no_sync_send_logical interface~comms_no_sync_send->proc~comms_no_sync_send_logical proc~comms_no_sync_send_real comms_no_sync_send_real interface~comms_no_sync_send->proc~comms_no_sync_send_real

Called by

proc~~w90_get_proj~2~~CalledByGraph proc~w90_get_proj~2 w90_get_proj proc~w90_get_proj w90_get_proj proc~w90_get_proj->proc~w90_get_proj~2

Source Code

  subroutine w90_get_proj(common_data, n, site, l, m, s, rad, x, z, sqa, zona, istdout, istderr, ierr)
    !! probes library data object and returns arrays describing a list of projections
    !! projectors defined either in .win file or passed (using same syntax) through w90_setopt
    !! array arguments assumed allocated at call
    !! array arguments must have length >= number of projectors (checked here)
    use w90_error, only: w90_error_type, set_error_fatal
    implicit none
    integer, intent(in) :: istdout, istderr
    integer, intent(inout) :: n, l(:), m(:), s(:)
    !! number of projectors, angular, orbital and spin numbers
    integer, intent(inout) :: rad(:)
    !! radial function defining projector
    integer, intent(out) :: ierr
    !! ierr returned > 0 in case of error
    real(kind=dp), intent(inout) :: site(:, :)
    !! projector origin (kind, site of kind)
    real(kind=dp), intent(inout) :: sqa(:, :), z(:, :), x(:, :), zona(:)
    !! spin quantisation axis, z- an x-axes
    type(lib_common_type), intent(in), target :: common_data
    !! library data object

    ! local variables
    integer :: ip
    type(proj_type), pointer :: proj
    type(w90_error_type), allocatable :: error

    ierr = 0

    if (.not. allocated(common_data%proj_input)) then
      call set_error_fatal(error, &
                           'Error: projectors are not setup in Wannier90 library when requested via get_proj()', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if

    n = size(common_data%proj_input)

    ! check allocation of main output arrays
    if (size(l) < n) then
      call set_error_fatal(error, 'Error: array argument l in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    else if (size(m) < n) then
      call set_error_fatal(error, 'Error: array argument m in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    else if (size(s) < n) then
      call set_error_fatal(error, 'Error: array argument s in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    else if (size(site, 2) < n) then
      call set_error_fatal(error, 'Error: array argument site in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    else if (size(sqa, 2) < n) then
      call set_error_fatal(error, 'Error: array argument sqa in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    else if (size(sqa, 2) < n) then
      call set_error_fatal(error, 'Error: array argument sqa in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    else if (size(z, 2) < n) then
      call set_error_fatal(error, 'Error: array argument z in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    elseif (size(x, 2) < n) then
      call set_error_fatal(error, 'Error: array argument x in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    else if (size(rad) < n) then
      call set_error_fatal(error, 'Error: array argument rad in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if
    if (size(zona) < n) then
      call set_error_fatal(error, 'Error: array argument zona in get_proj() call is insufficiently sized', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if

    do ip = 1, n
      proj => common_data%proj_input(ip)
      l(ip) = proj%l
      m(ip) = proj%m
      s(ip) = proj%s
      site(1:3, ip) = proj%site(1:3)
      sqa(1:3, ip) = proj%s_qaxis(1:3)
      z(1:3, ip) = proj%z(1:3)
      x(1:3, ip) = proj%x(1:3)
      rad(ip) = proj%radial
      zona(ip) = proj%zona
    end do
  end subroutine w90_get_proj