Skip to content

Commit

Permalink
Fixes for library-mode run of Wannier90 (multiple runs would crash be…
Browse files Browse the repository at this point in the history
…cause arrays were reallocated when already allocated). Suggested by S. Ponce.
  • Loading branch information
giovannipizzi committed May 27, 2016
1 parent 58b03d4 commit 7806fab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ subroutine param_read ( )
fermi_energy_step=(fermi_energy_max-fermi_energy_min)/(nfermi-1)
endif
!
if (allocated(fermi_energy_list)) deallocate(fermi_energy_list)
allocate(fermi_energy_list(nfermi),stat=ierr)
if (ierr/=0) call io_error(&
'Error allocating fermi_energy_read in param_read')
Expand Down Expand Up @@ -1630,6 +1631,7 @@ subroutine param_read ( )
if(kubo_nfreq<=1) kubo_nfreq=2
kubo_freq_step=(kubo_freq_max-kubo_freq_min)/(kubo_nfreq-1)
!
if (allocated(kubo_freq_list)) deallocate(kubo_freq_list)
allocate(kubo_freq_list(kubo_nfreq),stat=ierr)
if (ierr/=0)&
call io_error('Error allocating kubo_freq_list in param_read')
Expand Down

0 comments on commit 7806fab

Please sign in to comment.