@@ -710,8 +710,34 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
710710 this ->psi [0 ].size ());
711711 }
712712
713+ // ----------------------------------------------------------
714+ // ! 4) Compute density of states (DOS)
715+ // ----------------------------------------------------------
716+ if (PARAM.inp .out_dos )
717+ {
718+ int istep_in = -1 ;
719+ if (PARAM.inp .out_freq_ion >0 ) // default value of out_freq_ion is 0
720+ {
721+ if (istep % PARAM.inp .out_freq_ion == 0 )
722+ {
723+ istep_in=istep;
724+ }
725+ }
726+ ModuleIO::write_dos_pw (ucell,
727+ this ->pelec ->ekb ,
728+ this ->pelec ->wg ,
729+ this ->kv ,
730+ PARAM.inp .nbands ,
731+ istep_in,
732+ this ->pelec ->eferm ,
733+ PARAM.inp .dos_edelta_ev ,
734+ PARAM.inp .dos_scale ,
735+ PARAM.inp .dos_sigma ,
736+ GlobalV::ofs_running);
737+ }
738+
713739 // ------------------------------------------------------------------
714- // 4 ) calculate band-decomposed (partial) charge density in pw basis
740+ // 5 ) calculate band-decomposed (partial) charge density in pw basis
715741 // ------------------------------------------------------------------
716742 if (PARAM.inp .out_pchg .size () > 0 )
717743 {
@@ -745,7 +771,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
745771 }
746772
747773 // ------------------------------------------------------------------
748- // ! 5 ) calculate Wannier functions in pw basis
774+ // ! 6 ) calculate Wannier functions in pw basis
749775 // ------------------------------------------------------------------
750776 if (PARAM.inp .calculation == " nscf" && PARAM.inp .towannier90 )
751777 {
@@ -763,7 +789,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
763789 }
764790
765791 // ------------------------------------------------------------------
766- // ! 6 ) calculate Berry phase polarization in pw basis
792+ // ! 7 ) calculate Berry phase polarization in pw basis
767793 // ------------------------------------------------------------------
768794 if (PARAM.inp .calculation == " nscf" && berryphase::berry_phase_flag && ModuleSymmetry::Symmetry::symm_flag != 1 )
769795 {
@@ -774,7 +800,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
774800 }
775801
776802 // ------------------------------------------------------------------
777- // 7 ) write spin constrian results in pw basis
803+ // 8 ) write spin constrian results in pw basis
778804 // spin constrain calculations, write atomic magnetization and magnetic force.
779805 // ------------------------------------------------------------------
780806 if (PARAM.inp .sc_mag_switch )
@@ -786,7 +812,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
786812 }
787813
788814 // ------------------------------------------------------------------
789- // 8 ) write onsite occupations for charge and magnetizations
815+ // 9 ) write onsite occupations for charge and magnetizations
790816 // ------------------------------------------------------------------
791817 if (PARAM.inp .onsite_radius > 0 )
792818 { // float type has not been implemented
@@ -878,24 +904,7 @@ void ESolver_KS_PW<T, Device>::after_all_runners(UnitCell& ucell)
878904 ESolver_KS<T, Device>::after_all_runners (ucell);
879905
880906 // ----------------------------------------------------------
881- // ! 2) Compute density of states (DOS)
882- // ----------------------------------------------------------
883- if (PARAM.inp .out_dos )
884- {
885- ModuleIO::write_dos_pw (ucell,
886- this ->pelec ->ekb ,
887- this ->pelec ->wg ,
888- this ->kv ,
889- PARAM.inp .nbands ,
890- this ->pelec ->eferm ,
891- PARAM.inp .dos_edelta_ev ,
892- PARAM.inp .dos_scale ,
893- PARAM.inp .dos_sigma ,
894- GlobalV::ofs_running);
895- }
896-
897- // ----------------------------------------------------------
898- // ! 3) Compute LDOS
907+ // ! 2) Compute LDOS
899908 // ----------------------------------------------------------
900909 if (PARAM.inp .out_ldos [0 ])
901910 {
@@ -906,7 +915,7 @@ void ESolver_KS_PW<T, Device>::after_all_runners(UnitCell& ucell)
906915 }
907916
908917 // ----------------------------------------------------------
909- // ! 4 ) Calculate the spillage value,
918+ // ! 3 ) Calculate the spillage value,
910919 // ! which are used to generate numerical atomic orbitals
911920 // ----------------------------------------------------------
912921 if (PARAM.inp .basis_type == " pw" && PARAM.inp .out_spillage )
@@ -929,7 +938,7 @@ void ESolver_KS_PW<T, Device>::after_all_runners(UnitCell& ucell)
929938 }
930939
931940 // ----------------------------------------------------------
932- // ! 5 ) Print out electronic wave functions in real space
941+ // ! 4 ) Print out electronic wave functions in real space
933942 // ----------------------------------------------------------
934943 if (PARAM.inp .out_wfc_norm .size () > 0 || PARAM.inp .out_wfc_re_im .size () > 0 )
935944 {
@@ -960,7 +969,7 @@ void ESolver_KS_PW<T, Device>::after_all_runners(UnitCell& ucell)
960969 }
961970
962971 // ----------------------------------------------------------
963- // ! 6 ) Use Kubo-Greenwood method to compute conductivities
972+ // ! 5 ) Use Kubo-Greenwood method to compute conductivities
964973 // ----------------------------------------------------------
965974 if (PARAM.inp .cal_cond )
966975 {
0 commit comments