bug fix on restart

This commit is contained in:
zx199323 2021-03-22 15:37:37 -07:00
parent b6c32d2803
commit bc13cd9f4d
3 changed files with 29 additions and 8 deletions

View File

@ -1468,7 +1468,7 @@
CALL fermi_carrier_indabs(itemp, etemp_fca, ef0_fca)
ENDDO
ENDIF
CALL indabs_main(iq, totq, first_cycle)
CALL indabs_main(iq, totq, first_cycle, iq_restart)
ENDIF
!
! Conductivity ---------------------------------------------------------
@ -1856,10 +1856,16 @@
IF (ierr /= 0) CALL errore('ephwann_shuffle', 'Error deallocating dos', 1)
ENDIF
!
IF (lindabs .AND. indabs_fca .AND. (.NOT. scattering)) THEN
IF (lindabs .AND. (.NOT. scattering)) THEN
IF (indabs_fca) THEN
DEALLOCATE(ef0_fca, STAT = ierr)
IF (ierr /= 0) CALL errore('ephwann_shuffle', 'Error deallocating ef0_fca', 1)
ENDIF
DEALLOCATE(epsilon2_abs, STAT = ierr)
IF (ierr /= 0) CALL errore('ephwann_shuffle', 'Error deallocating epsilon2_abs', 1)
DEALLOCATE(epsilon2_abs_lorenz, STAT = ierr)
IF (ierr /= 0) CALL errore('ephwann_shuffle', 'Error deallocating epsilon2_abs_lorenz', 1)
ENDIF
!
CALL stop_clock('ephwann')
!

View File

@ -1366,7 +1366,7 @@
CALL fermi_carrier_indabs(itemp, etemp_fca, ef0_fca)
ENDDO
ENDIF
CALL indabs_main(iq, totq, first_cycle)
CALL indabs_main(iq, totq, first_cycle, iq_restart)
ENDIF
!
! Conductivity ---------------------------------------------------------
@ -1688,9 +1688,15 @@
ENDIF
!
IF (lindabs .AND. indabs_fca .AND. (.NOT. scattering)) THEN
IF (indabs_fca) THEN
DEALLOCATE(ef0_fca, STAT = ierr)
IF (ierr /= 0) CALL errore('ephwann_shuffle', 'Error deallocating ef0_fca', 1)
ENDIF
DEALLOCATE(epsilon2_abs, STAT = ierr)
IF (ierr /= 0) CALL errore('ephwann_shuffle', 'Error deallocating epsilon2_abs', 1)
DEALLOCATE(epsilon2_abs_lorenz, STAT = ierr)
IF (ierr /= 0) CALL errore('ephwann_shuffle', 'Error deallocating epsilon2_abs_lorenz', 1)
ENDIF
!
CALL stop_clock('ephwann')
!

View File

@ -20,7 +20,7 @@
CONTAINS
!
!-----------------------------------------------------------------------
SUBROUTINE indabs_main(iq, totq, first_cycle)
SUBROUTINE indabs_main(iq, totq, first_cycle, iq_restart)
!-----------------------------------------------------------------------
!!
!! Main routine for phonon assisted absorption
@ -47,6 +47,8 @@
!
INTEGER, INTENT(in) :: iq
!! Q-point index
INTEGER, INTENT(in) :: iq_restart
!! Restart q points, determine if initialization
LOGICAL, INTENT(inout) :: first_cycle
!! Use to determine weather this is the first cycle after restart
INTEGER, INTENT(in) :: totq
@ -191,6 +193,13 @@
!
nksqtotf = nktotf ! odd-even for k,k+q
!
IF (iq = iq_restart) THEN
ALLOCATE(omegap(nomega), STAT = ierr)
IF (ierr /= 0) CALL errore('indabs', 'Error allocating omegap', 1)
DO iw = 1, nomega
omegap(iw) = omegamin + (iw - 1) * omegastep
ENDDO
ENDIF
DO itemp = 1, nstemp
IF (first_cycle .and. itemp == nstemp) THEN
first_cycle = .false.