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)
| Type | Intent | Optional | 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 |
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