Skip to content

Commit f8db2b9

Browse files
author
dyzheng
committed
Fix: DFT+U nscf calculation of nspin=1 and output onsite.dm with out_chg>=0
1 parent 9438146 commit f8db2b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/module_hamilt_lcao/module_dftu/dftu_io.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void DFTU::output(const UnitCell &ucell)
5555

5656
//Write onsite.dm
5757
std::ofstream ofdftu;
58-
if(PARAM.inp.out_chg[0]){
58+
if(PARAM.inp.out_chg[0] != -1){
5959
if(GlobalV::MY_RANK == 0){
6060
ofdftu.open(PARAM.globalv.global_out_dir + "onsite.dm");
6161
}
@@ -309,7 +309,7 @@ void DFTU::read_occup_m(const UnitCell& ucell,
309309

310310
if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 2)
311311
{
312-
for (int is = 0; is < 2; is++)
312+
for (int is = 0; is < PARAM.inp.nspin; is++)
313313
{
314314
ifdftu >> word;
315315
if (strcmp("spin", word) == 0)

0 commit comments

Comments
 (0)