Read (and allocate) excluded_bands list "exclude_bands"
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(settings_type), | intent(inout) | :: | settings | |||
| integer, | intent(inout), | allocatable | :: | exclude_bands(:) | ||
| integer, | intent(out) | :: | num_exclude_bands | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine w90_readwrite_read_exclude_bands(settings, exclude_bands, num_exclude_bands, error, & comm) !! Read (and allocate) excluded_bands list "exclude_bands" use w90_error, only: w90_error_type, set_error_input, set_error_alloc implicit none integer, allocatable, intent(inout) :: exclude_bands(:) integer, intent(out) :: num_exclude_bands type(settings_type), intent(inout) :: settings type(w90_comm_type), intent(in) :: comm type(w90_error_type), allocatable, intent(out) :: error integer :: ierr logical :: found = .false. num_exclude_bands = 0 call w90_readwrite_get_range_vector(settings, 'exclude_bands', found, num_exclude_bands, & .true., error, comm) if (allocated(error)) return if (found) then if (num_exclude_bands < 1) then call set_error_input(error, 'Error: problem reading exclude_bands', comm) return end if allocate (exclude_bands(num_exclude_bands), stat=ierr) if (ierr /= 0) then call set_error_alloc(error, & 'Error allocating exclude_bands in w90_readwrite_read_exclude_bands', comm) return end if call w90_readwrite_get_range_vector(settings, 'exclude_bands', found, num_exclude_bands, & .false., error, comm, exclude_bands) if (allocated(error)) return if (any(exclude_bands < 1)) then call set_error_input(error, 'Error: exclude_bands must contain positive numbers', comm) return end if end if end subroutine w90_readwrite_read_exclude_bands