Read key variables from main input (.win) file; of use by wannier90.x only
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(lib_common_type), | intent(inout) | :: | common_data | |||
| character(len=*), | intent(in) | :: | seedname | |||
| integer, | intent(in) | :: | istdout | |||
| integer, | intent(in) | :: | istderr | |||
| integer, | intent(out) | :: | ierr |
subroutine input_reader_special(common_data, seedname, istdout, istderr, ierr) !! Read key variables from main input (.win) file; of use by wannier90.x only use w90_error_base, only: w90_error_type use w90_error, only: set_error_input, set_error_fatal, set_error_alloc use w90_readwrite, only: w90_readwrite_in_file, w90_readwrite_clean_infile use w90_wannier90_readwrite, only: w90_wannier90_readwrite_read_special implicit none ! arguments character(len=*), intent(in) :: seedname integer, intent(in) :: istdout, istderr integer, intent(out) :: ierr type(lib_common_type), intent(inout) :: common_data ! local variables type(w90_error_type), allocatable :: error ierr = 0 ! read data from .win file to internal string array call w90_readwrite_in_file(common_data%settings, seedname, error, common_data%comm) if (allocated(error)) then call prterr(error, ierr, istdout, istderr, common_data%comm) return end if call w90_wannier90_readwrite_read_special(common_data%settings, common_data%atom_data, & common_data%kmesh_input, common_data%kmesh_info, & common_data%kpt_latt, common_data%wann_control, & common_data%proj, common_data%proj_input, & common_data%select_proj, common_data%w90_system, & common_data%w90_calculation, & common_data%real_lattice, common_data%physics%bohr, & common_data%mp_grid, common_data%num_bands, & common_data%exclude_bands, common_data%num_kpts, & common_data%num_proj, common_data%num_wann, & common_data%gamma_only, common_data%lhasproj, & common_data%use_bloch_phases, & common_data%dist_kpoints, istdout, error, & common_data%comm) if (allocated(error)) then call prterr(error, ierr, istdout, istderr, common_data%comm) return end if common_data%seedname = seedname if (common_data%num_bands > common_data%num_wann) then allocate (common_data%dis_manifold%ndimwin(common_data%num_kpts), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, & 'Error allocating ndimwin in input_reader_special() call', common_data%comm) call prterr(error, ierr, istdout, istderr, common_data%comm) return end if allocate (common_data%dis_manifold%nfirstwin(common_data%num_kpts), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, & 'Error allocating nfirstwin in input_reader_special() call', common_data%comm) call prterr(error, ierr, istdout, istderr, common_data%comm) return end if allocate (common_data%dis_manifold%lwindow(common_data%num_bands, common_data%num_kpts), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, & 'Error allocating lwindow in input_reader_special() call', common_data%comm) call prterr(error, ierr, istdout, istderr, common_data%comm) return end if end if allocate (common_data%wannier_data%centres(3, common_data%num_wann), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, & 'Error allocating wannier_centres in input_reader_special() call', common_data%comm) call prterr(error, ierr, istdout, istderr, common_data%comm) return end if common_data%wannier_data%centres = 0.0_dp allocate (common_data%wannier_data%spreads(common_data%num_wann), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, & 'Error in allocating wannier_spreads in input_reader_special() call', common_data%comm) call prterr(error, ierr, istdout, istderr, common_data%comm) return end if common_data%wannier_data%spreads = 0.0_dp ! remove any remaining acceptable keywords; anything that remains is an input error call w90_readwrite_clean_infile(common_data%settings, istdout, seedname, error, common_data%comm) if (allocated(error)) then call prterr(error, ierr, istdout, istderr, common_data%comm) return end if if (allocated(common_data%settings%in_data)) deallocate (common_data%settings%in_data) end subroutine input_reader_special