Read band plotting path variables: "kpoint_path" and "bands_num_points"
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(settings_type), | intent(inout) | :: | settings | |||
| type(kpoint_path_type), | intent(inout) | :: | kpoint_path | |||
| logical, | intent(out) | :: | path_found | |||
| logical, | intent(in) | :: | bands_plot | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine w90_readwrite_read_kpath(settings, kpoint_path, path_found, bands_plot, error, comm) !! Read band plotting path variables: "kpoint_path" and "bands_num_points" use w90_error, only: w90_error_type, set_error_input, set_error_alloc, set_error_dealloc implicit none logical, intent(in) :: bands_plot logical, intent(out) :: path_found type(kpoint_path_type), intent(inout) :: kpoint_path type(settings_type), intent(inout) :: settings type(w90_comm_type), intent(in) :: comm type(w90_error_type), allocatable, intent(out) :: error integer :: i_temp, ierr, bands_num_spec_points logical :: found path_found = .false. bands_num_spec_points = 0 call w90_readwrite_get_block_length(settings, 'kpoint_path', path_found, i_temp, error, comm) if (allocated(error)) return if (path_found) then bands_num_spec_points = i_temp*2 if (allocated(kpoint_path%labels)) then deallocate (kpoint_path%labels, stat=ierr) if (ierr /= 0) then call set_error_dealloc(error, 'Error deallocating kpoint_path%labels & & in w90_readwrite_read_kpath', comm) return end if end if allocate (kpoint_path%labels(bands_num_spec_points), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, 'Error allocating kpoint_path%labels in & & w90_readwrite_read_kpath', comm) return end if if (allocated(kpoint_path%points)) then deallocate (kpoint_path%points, stat=ierr) if (ierr /= 0) then call set_error_dealloc(error, 'Error deallocating kpoint_path%points in & & w90_readwrite_read_kpath', comm) return end if end if allocate (kpoint_path%points(3, bands_num_spec_points), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, 'Error allocating kpoint_path%points& & in w90_readwrite_read_kpath', comm) return end if call w90_readwrite_get_keyword_kpath(settings, kpoint_path, error, comm) if (allocated(error)) return end if call w90_readwrite_get_keyword(settings, 'bands_num_points', found, error, comm, & i_value=kpoint_path%num_points_first_segment) if (allocated(error)) return if (bands_plot) then if (kpoint_path%num_points_first_segment < 0) then call set_error_input(error, 'Error: bands_num_points must be positive', comm) return end if end if end subroutine w90_readwrite_read_kpath