release memory from allocated parameters
subroutine param_dealloc
!==================================================================!
! !
!! release memory from allocated parameters
! !
!===================================================================
use w90_io, only: io_error
implicit none
integer :: ierr
if (allocated(ndimwin)) then
deallocate (ndimwin, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating ndimwin in param_dealloc')
end if
if (allocated(lwindow)) then
deallocate (lwindow, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating lwindow in param_dealloc')
end if
if (allocated(eigval)) then
deallocate (eigval, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating eigval in param_dealloc')
endif
if (allocated(shell_list)) then
deallocate (shell_list, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating shell_list in param_dealloc')
endif
if (allocated(kpt_latt)) then
deallocate (kpt_latt, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating kpt_latt in param_dealloc')
endif
if (allocated(kpt_cart)) then
deallocate (kpt_cart, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating kpt_cart in param_dealloc')
endif
if (allocated(bands_label)) then
deallocate (bands_label, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating bands_label in param_dealloc')
end if
if (allocated(bands_spec_points)) then
deallocate (bands_spec_points, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating bands_spec_points in param_dealloc')
end if
if (allocated(atoms_label)) then
deallocate (atoms_label, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating atoms_label in param_dealloc')
end if
if (allocated(atoms_symbol)) then
deallocate (atoms_symbol, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating atoms_symbol in param_dealloc')
end if
if (allocated(atoms_pos_frac)) then
deallocate (atoms_pos_frac, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating atom_pos_frac in param_dealloc')
end if
if (allocated(atoms_pos_cart)) then
deallocate (atoms_pos_cart, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating atoms_pos_cart in param_dealloc')
end if
if (allocated(atoms_species_num)) then
deallocate (atoms_species_num, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating atoms_species_num in param_dealloc')
end if
if (allocated(input_proj_site)) then
deallocate (input_proj_site, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_site in param_dealloc')
end if
if (allocated(input_proj_l)) then
deallocate (input_proj_l, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_l in param_dealloc')
end if
if (allocated(input_proj_m)) then
deallocate (input_proj_m, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_m in param_dealloc')
end if
if (allocated(input_proj_s)) then
deallocate (input_proj_s, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_s in param_dealloc')
end if
if (allocated(input_proj_s_qaxis)) then
deallocate (input_proj_s_qaxis, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_s_qaxis in param_dealloc')
end if
if (allocated(input_proj_z)) then
deallocate (input_proj_z, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_z in param_dealloc')
end if
if (allocated(input_proj_x)) then
deallocate (input_proj_x, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_x in param_dealloc')
end if
if (allocated(input_proj_radial)) then
deallocate (input_proj_radial, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_radial in param_dealloc')
end if
if (allocated(input_proj_zona)) then
deallocate (input_proj_zona, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating input_proj_zona in param_dealloc')
end if
if (allocated(proj_site)) then
deallocate (proj_site, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_site in param_dealloc')
end if
if (allocated(proj_l)) then
deallocate (proj_l, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_l in param_dealloc')
end if
if (allocated(proj_m)) then
deallocate (proj_m, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_m in param_dealloc')
end if
if (allocated(proj_s)) then
deallocate (proj_s, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_s in param_dealloc')
end if
if (allocated(proj_s_qaxis)) then
deallocate (proj_s_qaxis, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_s_qaxis in param_dealloc')
end if
if (allocated(proj_z)) then
deallocate (proj_z, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_z in param_dealloc')
end if
if (allocated(proj_x)) then
deallocate (proj_x, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_x in param_dealloc')
end if
if (allocated(proj_radial)) then
deallocate (proj_radial, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_radial in param_dealloc')
end if
if (allocated(proj_zona)) then
deallocate (proj_zona, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating proj_zona in param_dealloc')
end if
if (allocated(wannier_plot_list)) then
deallocate (wannier_plot_list, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating wannier_plot_list in param_dealloc')
end if
if (allocated(exclude_bands)) then
deallocate (exclude_bands, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating exclude_bands in param_dealloc')
end if
if (allocated(wannier_centres)) then
deallocate (wannier_centres, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating wannier_centres in param_dealloc')
end if
if (allocated(wannier_spreads)) then
deallocate (wannier_spreads, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating wannier_spreads in param_dealloc')
endif
if (allocated(bands_plot_project)) then
deallocate (bands_plot_project, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating bands_plot_project in param_dealloc')
endif
if (allocated(dos_project)) then
deallocate (dos_project, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating dos_project in param_dealloc')
endif
if (allocated(fermi_energy_list)) then
deallocate (fermi_energy_list, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating fermi_energy_list in param_dealloc')
endif
if (allocated(kubo_freq_list)) then
deallocate (kubo_freq_list, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating kubo_freq_list in param_dealloc')
endif
if (allocated(dis_spheres)) then
deallocate (dis_spheres, stat=ierr)
if (ierr /= 0) call io_error('Error in deallocating dis_spheres in param_dealloc')
endif
if (allocated(ccentres_frac)) then
deallocate (ccentres_frac, stat=ierr)
if (ierr /= 0) call io_error('Error deallocating ccentres_frac in param_dealloc')
endif
if (allocated(ccentres_cart)) then
deallocate (ccentres_cart, stat=ierr)
if (ierr /= 0) call io_error('Error deallocating ccentres_cart in param_dealloc')
end if
return
end subroutine param_dealloc