Read a group of variables defining the system "spinors" -- coupled spins "num_elec_per_state" -- spin degeneracy "num_valence_bands"
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(settings_type), | intent(inout) | :: | settings | |||
| type(w90_system_type), | intent(inout) | :: | w90_system | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine w90_readwrite_read_system(settings, w90_system, error, comm) !! Read a group of variables defining the system !! "spinors" -- coupled spins !! "num_elec_per_state" -- spin degeneracy !! "num_valence_bands" use w90_error, only: w90_error_type, set_error_input implicit none 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 logical :: found, ltmp integer :: itmp ltmp = .false. ! by default our WF are not spinors call w90_readwrite_get_keyword(settings, 'spinors', found, error, comm, l_value=ltmp) if (allocated(error)) return if (found) then w90_system%spinors = ltmp else w90_system%spinors = .false. end if ! We need to know if the bands are double degenerate due to spin, e.g. when calculating DOS if (w90_system%spinors) then w90_system%num_elec_per_state = 1 else w90_system%num_elec_per_state = 2 ! the default end if call w90_readwrite_get_keyword(settings, 'num_elec_per_state', found, error, comm, & i_value=itmp) if (allocated(error)) return if (found) then if (itmp /= 1 .and. itmp /= 2) then call set_error_input(error, 'Error: num_elec_per_state can be only 1 or 2', comm) return else if (w90_system%spinors .and. itmp /= 1) then call set_error_input(error, 'Error: when spinors = T num_elec_per_state must be 1', comm) return else w90_system%num_elec_per_state = itmp end if end if end if call w90_readwrite_get_keyword(settings, 'num_valence_bands', found, error, comm, & i_value=w90_system%num_valence_bands) if (allocated(error)) return if (found .and. (w90_system%num_valence_bands .le. 0)) then call set_error_input(error, 'Error: num_valence_bands should be greater than zero', comm) return end if end subroutine w90_readwrite_read_system