Read parameters and calculate derived values
Note on parallelization: this function should be called from the root node only!
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(settings_type), | intent(inout) | :: | settings | |||
| type(atom_data_type), | intent(inout) | :: | atom_data | |||
| type(kmesh_input_type), | intent(inout) | :: | kmesh_input | |||
| type(kmesh_info_type), | intent(inout) | :: | kmesh_info | |||
| real(kind=dp), | intent(inout), | allocatable | :: | kpt_latt(:,:) | ||
| type(wann_control_type), | intent(inout) | :: | wann_control | |||
| type(proj_type), | intent(inout), | allocatable | :: | proj(:) | ||
| type(proj_type), | intent(inout), | allocatable | :: | proj_input(:) | ||
| type(select_projection_type), | intent(inout) | :: | select_proj | |||
| type(w90_system_type), | intent(inout) | :: | w90_system | |||
| type(w90_calculation_type), | intent(inout) | :: | w90_calculation | |||
| real(kind=dp), | intent(inout) | :: | real_lattice(3,3) | |||
| real(kind=dp), | intent(in) | :: | bohr | |||
| integer, | intent(inout) | :: | mp_grid(3) | |||
| integer, | intent(inout) | :: | num_bands | |||
| integer, | intent(inout), | allocatable | :: | exclude_bands(:) | ||
| integer, | intent(inout) | :: | num_kpts | |||
| integer, | intent(inout) | :: | num_proj | |||
| integer, | intent(inout) | :: | num_wann | |||
| logical, | intent(inout) | :: | gamma_only | |||
| logical, | intent(inout) | :: | lhasproj | |||
| logical, | intent(inout) | :: | use_bloch_phases | |||
| integer, | intent(inout), | allocatable | :: | distk(:) | ||
| integer, | intent(in) | :: | stdout | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine w90_wannier90_readwrite_read_special(settings, atom_data, kmesh_input, kmesh_info, & kpt_latt, wann_control, proj, proj_input, & select_proj, w90_system, w90_calculation, & real_lattice, bohr, mp_grid, num_bands, & exclude_bands, num_kpts, num_proj, num_wann, & gamma_only, lhasproj, use_bloch_phases, distk, & stdout, error, comm) !================================================! ! !! Read parameters and calculate derived values !! !! Note on parallelization: this function should be called !! from the root node only! !! ! !================================================ use w90_constants, only: w90_physical_constants_type use w90_utility, only: utility_recip_lattice, utility_inverse_mat implicit none ! arguments type(atom_data_type), intent(inout) :: atom_data type(kmesh_info_type), intent(inout) :: kmesh_info type(kmesh_input_type), intent(inout) :: kmesh_input type(proj_type), allocatable, intent(inout) :: proj(:), proj_input(:) type(select_projection_type), intent(inout) :: select_proj type(settings_type), intent(inout) :: settings type(w90_comm_type), intent(in) :: comm type(w90_error_type), allocatable, intent(out) :: error type(w90_system_type), intent(inout) :: w90_system type(wann_control_type), intent(inout) :: wann_control type(w90_calculation_type), intent(inout) :: w90_calculation !check if really needed?? integer, allocatable, intent(inout) :: exclude_bands(:) integer, allocatable, intent(inout) :: distk(:) integer, intent(inout) :: mp_grid(3) integer, intent(inout) :: num_bands integer, intent(inout) :: num_kpts integer, intent(inout) :: num_proj integer, intent(inout) :: num_wann integer, intent(in) :: stdout real(kind=dp), allocatable, intent(inout) :: kpt_latt(:, :) real(kind=dp), intent(in) :: bohr real(kind=dp), intent(inout) :: real_lattice(3, 3) logical, intent(inout) :: lhasproj logical, intent(inout) :: use_bloch_phases logical, intent(inout) :: gamma_only ! local variables logical :: disentanglement real(kind=dp) :: inv_lattice(3, 3) integer :: ip, ierr integer :: num_exclude_bands, total_bands call w90_readwrite_read_lattice(settings, real_lattice, bohr, error, comm) if (allocated(error)) return call w90_readwrite_read_atoms(settings, atom_data, real_lattice, bohr, error, comm) if (allocated(error)) return call w90_readwrite_read_num_wann(settings, num_wann, error, comm) if (allocated(error)) return call w90_readwrite_read_exclude_bands(settings, exclude_bands, num_exclude_bands, error, comm) if (allocated(error)) return total_bands = 0 call w90_readwrite_read_total_bands(settings, total_bands, error, comm) if (allocated(error)) return if (total_bands > 0) then num_bands = total_bands - num_exclude_bands else call w90_readwrite_read_num_bands(settings, .false., num_bands, num_wann, error, comm) if (allocated(error)) return end if disentanglement = (num_bands > num_wann) call w90_readwrite_read_mp_grid(settings, .false., mp_grid, num_kpts, error, comm) if (allocated(error)) return call w90_readwrite_read_distk(settings, distk, num_kpts, stdout, error, comm) if (allocated(error)) return call w90_readwrite_read_kmesh_data(settings, kmesh_input, error, comm) if (allocated(error)) return call w90_readwrite_read_kpoints(settings, .false., kpt_latt, num_kpts, mp_grid, bohr, error, & comm) if (allocated(error)) return call w90_wannier90_readwrite_read_explicit_kpts(settings, w90_calculation, kmesh_info, & num_kpts, bohr, error, comm) if (allocated(error)) return call w90_readwrite_read_system(settings, w90_system, error, comm) if (allocated(error)) return num_proj = num_wann !default, no projections specified call utility_inverse_mat(real_lattice, inv_lattice) call w90_wannier90_readwrite_read_projections(settings, proj, proj_input, use_bloch_phases, & lhasproj, wann_control%guiding_centres%enable, & select_proj, num_proj, atom_data, inv_lattice, & num_wann, gamma_only, w90_system%spinors, bohr, & stdout, error, comm) if (allocated(error)) return if (allocated(proj)) then allocate (wann_control%guiding_centres%centres(3, num_proj), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, 'Error in allocating ann_control%guiding_centres%centres & & in w90_wannier90_readwrite_read_special', comm) return end if do ip = 1, num_proj wann_control%guiding_centres%centres(:, ip) = proj(ip)%site(:) end do end if end subroutine w90_wannier90_readwrite_read_special