Read the mandatory k-point mesh input ("mp_grid")
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(settings_type), | intent(inout) | :: | settings | |||
| logical, | intent(in) | :: | pw90_effective_model | |||
| integer, | intent(inout) | :: | mp_grid(3) | |||
| integer, | intent(inout) | :: | num_kpts | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine w90_readwrite_read_mp_grid(settings, pw90_effective_model, mp_grid, num_kpts, error, & comm) !! Read the mandatory k-point mesh input ("mp_grid") use w90_error, only: w90_error_type, set_error_input implicit none integer, intent(inout) :: mp_grid(3), num_kpts 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 :: iv_temp(3) logical :: found call w90_readwrite_get_keyword_vector(settings, 'mp_grid', found, 3, error, comm, & i_value=iv_temp) if (allocated(error)) return ! ignored in pw90_effective_model case if (.not. pw90_effective_model) then if (found) mp_grid = iv_temp if (.not. found) then call set_error_input(error, & 'Error: You must specify dimensions of the Monkhorst-Pack grid by setting mp_grid', comm) return elseif (any(mp_grid < 1)) then call set_error_input(error, 'Error: mp_grid must be greater than zero', comm) return end if num_kpts = mp_grid(1)*mp_grid(2)*mp_grid(3) end if end subroutine w90_readwrite_read_mp_grid