Something wrong with reading charge density file in nscf calculations
Describe the bug
When I set calculation=nscf, even if the ABACUS-CHARGE-DENSITY.restart file exist in OUT.ABACUS, the programme cannot read it and throw a warning:
There must be something wrong here.
Expected behavior
No response
To Reproduce
No response
Environment
No response
Additional Context
No response
Task list for Issue attackers (only for developers)
- [ ] Verify the issue is not a duplicate.
- [ ] Describe the bug.
- [ ] Steps to reproduce.
- [ ] Expected behavior.
- [ ] Error message.
- [ ] Environment details.
- [ ] Additional context.
- [ ] Assign a priority level (low, medium, high, urgent).
- [ ] Assign the issue to a team member.
- [ ] Label the issue with relevant tags.
- [ ] Identify possible related issues.
- [ ] Create a unit test or automated test to reproduce the bug (if applicable).
- [ ] Fix the bug.
- [ ] Test the fix.
- [ ] Update documentation (if necessary).
- [ ] Close the issue and inform the reporter (if applicable).
I found that this will happens when setting different gamma_only value settings. (Running scf first to generate ABACUS-CHARGE-DENSITY.restart file and then nscf, K point is set to gamma for gamma_only=0)
And it is caused by code in source/source_io/rhog_io.cpp line 52-58:
Yes, as far as I know, this is a known problem of the function read_rhog. This would be triggered as long as a gamma-only calculation is queried.