subroutine ps_PseudoWf_Get(ps,i,&
l,j,n,set,energy_level,annotation,func)
type(ps_t), intent(in), target :: ps
integer, intent(in) :: i
integer, intent(out), optional :: set
integer, intent(out), optional :: l
real(dp), intent(out), optional :: j
integer, intent(out), optional :: n
real(dp), intent(out), optional :: energy_level
type(ps_annotation_t), intent(out), optional :: annotation
type(ps_radfunc_t), intent(out), optional :: func
type(wf_table_t), pointer :: q(:)
q => ps%wf_table
call check_index(i,size(q),"wf")
if (present(set)) then
set = q(i)%p%set
endif
if (present(l)) then
l = l_of_sym(q(i)%p%l,"wf")
endif
if (present(n)) then
n = q(i)%p%n
endif
if (present(j)) then
if (q(i)%p%j < 0.0) then
j = -1.0_dp
! Maybe optional status flag raised?
else
j = q(i)%p%j
endif
endif
if (present(energy_level)) then
! Will return a very large positive value if the attribute energy_level is not
! present in the file
energy_level = q(i)%p%energy_level
endif
if (present(annotation)) then
annotation = q(i)%p%parent_group%annotation
endif
if (present(func)) then
func = q(i)%p%Phi
endif
end subroutine ps_PseudoWf_Get