Read the number of bands ("num_bands") If not specified (and exclude_bands and total_bands are not both provided), defaults to num_wann
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(settings_type), | intent(inout) | :: | settings | |||
| logical, | intent(in) | :: | pw90_effective_model | |||
| integer, | intent(inout) | :: | num_bands | |||
| integer, | intent(in) | :: | num_wann | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine w90_readwrite_read_num_bands(settings, pw90_effective_model, num_bands, num_wann, & error, comm) !! Read the number of bands ("num_bands") !! If not specified (and exclude_bands and total_bands are not both provided), defaults to num_wann use w90_error, only: w90_error_type, set_error_input implicit none integer, intent(in) :: num_wann integer, intent(inout) :: num_bands logical, intent(in) :: pw90_effective_model type(settings_type), intent(inout) :: settings type(w90_comm_type), intent(in) :: comm type(w90_error_type), allocatable, intent(out) :: error integer :: i_temp logical :: found call w90_readwrite_get_keyword(settings, 'num_bands', found, error, comm, i_value=i_temp) if (allocated(error)) return ! in the pw90_effective_model case, this variable is ignored if (.not. pw90_effective_model) then if (found) then num_bands = i_temp if (num_bands < num_wann) then call set_error_input(error, & 'Error: num_bands must be greater than or equal to num_wann', comm) return end if else num_bands = num_wann end if end if end subroutine w90_readwrite_read_num_bands