Skip to content

Commit

Permalink
fixed projwfc reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Ponet committed Jun 7, 2021
1 parent cb6ee9e commit 048c259
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/inputAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ function gencalc_wan(nscf::DFInput{QE}, structure::AbstractStructure, Emin, wanf
This generally gives errors because of omitted kpoints, needed for pw2wannier90.x"
end
wanflags = wanflags != nothing ? SymAnyDict(wanflags) : SymAnyDict()
if issoccalc(nscf)
wanflags[:spinors] = true
end

nwann = nprojections(structure)
@info "num_wann=$nwann (inferred from provided projections)."
Expand Down
6 changes: 3 additions & 3 deletions src/qe/fileio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ function qe_read_projwfc(filename::String)
nkstot = parse(Int, split(lines[i_prob_sizes + 4])[3])
npwx = parse(Int, split(lines[i_prob_sizes + 5])[3])
nkb = parse(Int, split(lines[i_prob_sizes + 6])[3])
state_tuple = NamedTuple{(:atom_id, :wfc_id, :j, :l, :m), Tuple{Int, Int, Float64, Float64, Float64}}
state_tuple = NamedTuple{(:atom_id, :wfc_id, :l, :j, :m), Tuple{Int, Int, Float64, Float64, Float64}}
states = state_tuple[]
istart = findfirst(x -> x == "Atomic states used for projection", lines) + 2
for i = 1:natomwfc
l = replace_multiple(lines[i + istart], "(" => " ", ")" => " ", "," => "", "=" => " ", ":" => "", "#" => " ") |> split
if length(l) == 11 #spinpolarized
push!(states, state_tuple((parse.(Int,(l[4], l[7]))..., 0.0, parse.(Float64,( l[9], l[11]))...)))
push!(states, state_tuple((parse.(Int,(l[4], l[7]))..., parse(Float64, l[9]), 0.0, parse(Float64, l[11]))))
else #not spin polarized
push!(states, state_tuple((parse.(Int,(l[4], l[7]))..., parse.(Float64, (l[9], l[11], l[13]))...)))
end
Expand Down Expand Up @@ -507,7 +507,7 @@ end

function qe_read_hp_output(input::DFInput{QE})
out = Dict()
open(outfilename(input), "r") do f
open(outpath(input), "r") do f
while !eof(f)
line = readline(f)
if occursin("will be perturbed", line)
Expand Down

0 comments on commit 048c259

Please sign in to comment.