subroutine w90_wannier90_readwrite_read_local_kmesh(settings, pw90_calculation, pw90_berry, &
pw90_dos, pw90_spin, pw90_gyrotropic, &
pw90_boltzwann, recip_lattice, &
global_kmesh_set, global_kmesh, error, comm)
!================================================!
use w90_comms, only: w90_comm_type
implicit none
type(pw90_calculation_type), intent(in) :: pw90_calculation
type(pw90_berry_mod_type), intent(inout) :: pw90_berry
type(pw90_dos_mod_type), intent(inout) :: pw90_dos
type(pw90_spin_mod_type), intent(inout) :: pw90_spin
type(pw90_gyrotropic_type), intent(inout) :: pw90_gyrotropic
type(pw90_boltzwann_type), intent(inout) :: pw90_boltzwann
type(kmesh_spacing_type), intent(in) :: global_kmesh
type(w90_error_type), allocatable, intent(out) :: error
type(w90_comm_type), intent(in) :: comm
type(settings_type), intent(inout) :: settings
real(kind=dp), intent(in) :: recip_lattice(3, 3)
logical, intent(in) :: global_kmesh_set
! To be called after having read the global flag
call get_module_kmesh(settings, recip_lattice, global_kmesh_set, global_kmesh, error, comm, &
moduleprefix='boltz', should_be_defined=pw90_calculation%boltzwann, &
module_kmesh=pw90_boltzwann%kmesh)
if (allocated(error)) return
call get_module_kmesh(settings, recip_lattice, global_kmesh_set, global_kmesh, error, comm, &
moduleprefix='berry', should_be_defined=pw90_calculation%berry, &
module_kmesh=pw90_berry%kmesh)
if (allocated(error)) return
call get_module_kmesh(settings, recip_lattice, global_kmesh_set, global_kmesh, error, comm, &
moduleprefix='gyrotropic', &
should_be_defined=pw90_calculation%gyrotropic, &
module_kmesh=pw90_gyrotropic%kmesh)
if (allocated(error)) return
call get_module_kmesh(settings, recip_lattice, global_kmesh_set, global_kmesh, error, comm, &
moduleprefix='spin', should_be_defined=pw90_calculation%spin_moment, &
module_kmesh=pw90_spin%kmesh)
if (allocated(error)) return
call get_module_kmesh(settings, recip_lattice, global_kmesh_set, global_kmesh, error, comm, &
moduleprefix='dos', should_be_defined=pw90_calculation%dos, &
module_kmesh=pw90_dos%kmesh)
if (allocated(error)) return
end subroutine w90_wannier90_readwrite_read_local_kmesh