input_reader_special Subroutine

public subroutine input_reader_special(common_data, seedname, istdout, istderr, ierr)

Uses

  • proc~~input_reader_special~~UsesGraph proc~input_reader_special input_reader_special module~w90_error w90_error proc~input_reader_special->module~w90_error module~w90_error_base w90_error_base proc~input_reader_special->module~w90_error_base module~w90_readwrite w90_readwrite proc~input_reader_special->module~w90_readwrite module~w90_wannier90_readwrite w90_wannier90_readwrite proc~input_reader_special->module~w90_wannier90_readwrite module~w90_error->module~w90_error_base module~w90_comms w90_comms module~w90_error->module~w90_comms module~w90_readwrite->module~w90_comms module~w90_constants w90_constants module~w90_readwrite->module~w90_constants module~w90_types w90_types module~w90_readwrite->module~w90_types module~w90_wannier90_readwrite->module~w90_error module~w90_wannier90_readwrite->module~w90_readwrite module~w90_wannier90_readwrite->module~w90_constants module~w90_wannier90_readwrite->module~w90_types module~w90_wannier90_types w90_wannier90_types module~w90_wannier90_readwrite->module~w90_wannier90_types module~w90_comms->module~w90_error_base module~w90_comms->module~w90_constants module~w90_types->module~w90_constants module~w90_wannier90_types->module~w90_constants

Read key variables from main input (.win) file; of use by wannier90.x only

Arguments

Type IntentOptional Attributes Name
type(lib_common_type), intent(inout) :: common_data
character(len=*), intent(in) :: seedname
integer, intent(in) :: istdout
integer, intent(in) :: istderr
integer, intent(out) :: ierr

Calls

proc~~input_reader_special~~CallsGraph proc~input_reader_special input_reader_special proc~prterr prterr proc~input_reader_special->proc~prterr proc~set_error_alloc set_error_alloc proc~input_reader_special->proc~set_error_alloc proc~w90_readwrite_clean_infile w90_readwrite_clean_infile proc~input_reader_special->proc~w90_readwrite_clean_infile proc~w90_readwrite_in_file w90_readwrite_in_file proc~input_reader_special->proc~w90_readwrite_in_file proc~w90_wannier90_readwrite_read_special w90_wannier90_readwrite_read_special proc~input_reader_special->proc~w90_wannier90_readwrite_read_special interface~comms_no_sync_bcast comms_no_sync_bcast proc~prterr->interface~comms_no_sync_bcast interface~comms_no_sync_recv comms_no_sync_recv proc~prterr->interface~comms_no_sync_recv interface~comms_no_sync_send comms_no_sync_send proc~prterr->interface~comms_no_sync_send proc~mpirank mpirank proc~prterr->proc~mpirank proc~mpisize mpisize proc~prterr->proc~mpisize proc~comms_sync_error comms_sync_error proc~set_error_alloc->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_alloc->proc~set_base_error proc~set_error_dealloc set_error_dealloc proc~w90_readwrite_clean_infile->proc~set_error_dealloc proc~set_error_input set_error_input proc~w90_readwrite_clean_infile->proc~set_error_input proc~w90_readwrite_clear_keywords w90_readwrite_clear_keywords proc~w90_readwrite_clean_infile->proc~w90_readwrite_clear_keywords proc~w90_readwrite_in_file->proc~set_error_alloc proc~set_error_file set_error_file proc~w90_readwrite_in_file->proc~set_error_file proc~utility_lowercase utility_lowercase proc~w90_readwrite_in_file->proc~utility_lowercase proc~w90_wannier90_readwrite_read_special->proc~set_error_alloc proc~utility_inverse_mat utility_inverse_mat proc~w90_wannier90_readwrite_read_special->proc~utility_inverse_mat proc~w90_readwrite_read_atoms w90_readwrite_read_atoms proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_atoms proc~w90_readwrite_read_distk w90_readwrite_read_distk proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_distk proc~w90_readwrite_read_exclude_bands w90_readwrite_read_exclude_bands proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_exclude_bands proc~w90_readwrite_read_kmesh_data w90_readwrite_read_kmesh_data proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_kmesh_data proc~w90_readwrite_read_kpoints w90_readwrite_read_kpoints proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_kpoints proc~w90_readwrite_read_lattice w90_readwrite_read_lattice proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_lattice proc~w90_readwrite_read_mp_grid w90_readwrite_read_mp_grid proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_mp_grid proc~w90_readwrite_read_num_bands w90_readwrite_read_num_bands proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_num_bands proc~w90_readwrite_read_num_wann w90_readwrite_read_num_wann proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_num_wann proc~w90_readwrite_read_system w90_readwrite_read_system proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_system proc~w90_readwrite_read_total_bands w90_readwrite_read_total_bands proc~w90_wannier90_readwrite_read_special->proc~w90_readwrite_read_total_bands proc~w90_wannier90_readwrite_read_explicit_kpts w90_wannier90_readwrite_read_explicit_kpts proc~w90_wannier90_readwrite_read_special->proc~w90_wannier90_readwrite_read_explicit_kpts proc~w90_wannier90_readwrite_read_projections w90_wannier90_readwrite_read_projections proc~w90_wannier90_readwrite_read_special->proc~w90_wannier90_readwrite_read_projections proc~comms_no_sync_bcast_char comms_no_sync_bcast_char interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_char proc~comms_no_sync_bcast_cmplx comms_no_sync_bcast_cmplx interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_cmplx proc~comms_no_sync_bcast_int comms_no_sync_bcast_int interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_int proc~comms_no_sync_bcast_logical comms_no_sync_bcast_logical interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_logical proc~comms_no_sync_bcast_real comms_no_sync_bcast_real interface~comms_no_sync_bcast->proc~comms_no_sync_bcast_real proc~comms_no_sync_recv_char comms_no_sync_recv_char interface~comms_no_sync_recv->proc~comms_no_sync_recv_char proc~comms_no_sync_recv_cmplx comms_no_sync_recv_cmplx interface~comms_no_sync_recv->proc~comms_no_sync_recv_cmplx proc~comms_no_sync_recv_int comms_no_sync_recv_int interface~comms_no_sync_recv->proc~comms_no_sync_recv_int proc~comms_no_sync_recv_logical comms_no_sync_recv_logical interface~comms_no_sync_recv->proc~comms_no_sync_recv_logical proc~comms_no_sync_recv_real comms_no_sync_recv_real interface~comms_no_sync_recv->proc~comms_no_sync_recv_real proc~comms_no_sync_send_char comms_no_sync_send_char interface~comms_no_sync_send->proc~comms_no_sync_send_char proc~comms_no_sync_send_cmplx comms_no_sync_send_cmplx interface~comms_no_sync_send->proc~comms_no_sync_send_cmplx proc~comms_no_sync_send_int comms_no_sync_send_int interface~comms_no_sync_send->proc~comms_no_sync_send_int proc~comms_no_sync_send_logical comms_no_sync_send_logical interface~comms_no_sync_send->proc~comms_no_sync_send_logical proc~comms_no_sync_send_real comms_no_sync_send_real interface~comms_no_sync_send->proc~comms_no_sync_send_real proc~set_error_dealloc->proc~comms_sync_error proc~set_error_dealloc->proc~set_base_error proc~set_error_file->proc~comms_sync_error proc~set_error_file->proc~set_base_error proc~set_error_input->proc~comms_sync_error proc~set_error_input->proc~set_base_error proc~utility_inv3 utility_inv3 proc~utility_inverse_mat->proc~utility_inv3 proc~w90_readwrite_clear_keywords->proc~set_error_alloc proc~w90_readwrite_clear_keywords->proc~set_error_dealloc proc~clear_block clear_block proc~w90_readwrite_clear_keywords->proc~clear_block proc~w90_readwrite_get_keyword w90_readwrite_get_keyword proc~w90_readwrite_clear_keywords->proc~w90_readwrite_get_keyword proc~w90_readwrite_get_keyword_vector w90_readwrite_get_keyword_vector proc~w90_readwrite_clear_keywords->proc~w90_readwrite_get_keyword_vector proc~w90_readwrite_get_range_vector w90_readwrite_get_range_vector proc~w90_readwrite_clear_keywords->proc~w90_readwrite_get_range_vector proc~w90_readwrite_read_atoms->proc~set_error_alloc proc~w90_readwrite_read_atoms->proc~set_error_dealloc proc~w90_readwrite_read_atoms->proc~set_error_input proc~readwrite_get_atoms readwrite_get_atoms proc~w90_readwrite_read_atoms->proc~readwrite_get_atoms proc~utility_cart_to_frac utility_cart_to_frac proc~w90_readwrite_read_atoms->proc~utility_cart_to_frac proc~w90_readwrite_get_block_length w90_readwrite_get_block_length proc~w90_readwrite_read_atoms->proc~w90_readwrite_get_block_length proc~w90_readwrite_read_atoms->proc~w90_readwrite_get_keyword_vector proc~w90_readwrite_get_vector_length w90_readwrite_get_vector_length proc~w90_readwrite_read_atoms->proc~w90_readwrite_get_vector_length proc~w90_readwrite_set_atoms w90_readwrite_set_atoms proc~w90_readwrite_read_atoms->proc~w90_readwrite_set_atoms proc~w90_readwrite_read_distk->proc~set_error_alloc proc~w90_readwrite_read_distk->proc~mpirank proc~w90_readwrite_read_distk->proc~mpisize proc~w90_readwrite_read_distk->proc~set_error_input proc~set_error_fatal set_error_fatal proc~w90_readwrite_read_distk->proc~set_error_fatal proc~w90_readwrite_read_distk->proc~w90_readwrite_get_range_vector proc~w90_readwrite_read_exclude_bands->proc~set_error_alloc proc~w90_readwrite_read_exclude_bands->proc~set_error_input proc~w90_readwrite_read_exclude_bands->proc~w90_readwrite_get_range_vector proc~w90_readwrite_read_kmesh_data->proc~set_error_alloc proc~w90_readwrite_read_kmesh_data->proc~set_error_input proc~w90_readwrite_read_kmesh_data->proc~w90_readwrite_get_keyword proc~w90_readwrite_read_kmesh_data->proc~w90_readwrite_get_range_vector proc~w90_readwrite_read_kpoints->proc~set_error_alloc proc~w90_readwrite_read_kpoints->proc~set_error_dealloc proc~w90_readwrite_get_keyword_block w90_readwrite_get_keyword_block proc~w90_readwrite_read_kpoints->proc~w90_readwrite_get_keyword_block proc~w90_readwrite_read_lattice->proc~set_error_input proc~w90_readwrite_read_lattice->proc~w90_readwrite_get_keyword_block proc~w90_readwrite_read_mp_grid->proc~set_error_input proc~w90_readwrite_read_mp_grid->proc~w90_readwrite_get_keyword_vector proc~w90_readwrite_read_num_bands->proc~set_error_input proc~w90_readwrite_read_num_bands->proc~w90_readwrite_get_keyword proc~w90_readwrite_read_num_wann->proc~set_error_input proc~w90_readwrite_read_num_wann->proc~w90_readwrite_get_keyword proc~w90_readwrite_read_system->proc~set_error_input proc~w90_readwrite_read_system->proc~w90_readwrite_get_keyword proc~w90_readwrite_read_total_bands->proc~w90_readwrite_get_keyword proc~w90_wannier90_readwrite_read_explicit_kpts->proc~set_error_alloc proc~w90_wannier90_readwrite_read_explicit_kpts->proc~set_error_dealloc proc~w90_wannier90_readwrite_read_explicit_kpts->proc~set_error_input proc~w90_wannier90_readwrite_read_explicit_kpts->proc~w90_readwrite_get_block_length proc~w90_wannier90_readwrite_read_explicit_kpts->proc~w90_readwrite_get_keyword_block proc~w90_wannier90_readwrite_read_projections->proc~set_error_alloc proc~w90_wannier90_readwrite_read_projections->proc~set_error_dealloc proc~w90_wannier90_readwrite_read_projections->proc~set_error_input proc~w90_wannier90_readwrite_read_projections->proc~w90_readwrite_get_block_length proc~w90_wannier90_readwrite_read_projections->proc~w90_readwrite_get_keyword proc~w90_readwrite_get_projections w90_readwrite_get_projections proc~w90_wannier90_readwrite_read_projections->proc~w90_readwrite_get_projections proc~w90_wannier90_readwrite_read_projections->proc~w90_readwrite_get_range_vector proc~clear_block->proc~set_error_input proc~readwrite_get_atoms->proc~set_error_alloc proc~readwrite_get_atoms->proc~set_error_input proc~readwrite_get_atoms->proc~utility_inverse_mat proc~readwrite_get_atoms->proc~utility_cart_to_frac proc~readwrite_get_atoms->proc~w90_readwrite_get_block_length proc~utility_frac_to_cart utility_frac_to_cart proc~readwrite_get_atoms->proc~utility_frac_to_cart proc~set_error_fatal->proc~comms_sync_error proc~set_error_fatal->proc~set_base_error proc~w90_readwrite_get_block_length->proc~set_error_input proc~w90_readwrite_get_keyword->proc~set_error_input proc~w90_readwrite_get_keyword->proc~set_error_fatal proc~w90_readwrite_get_keyword_block->proc~set_error_input proc~w90_readwrite_get_keyword_block->proc~set_error_fatal proc~w90_readwrite_get_keyword_vector->proc~set_error_input proc~w90_readwrite_get_keyword_vector->proc~set_error_fatal proc~w90_readwrite_get_projections->proc~set_error_alloc proc~w90_readwrite_get_projections->proc~set_error_input proc~w90_readwrite_get_projections->proc~utility_cart_to_frac proc~utility_string_to_coord utility_string_to_coord proc~w90_readwrite_get_projections->proc~utility_string_to_coord proc~utility_strip utility_strip proc~w90_readwrite_get_projections->proc~utility_strip proc~w90_readwrite_get_range_vector->proc~set_error_input proc~w90_readwrite_get_range_vector->proc~w90_readwrite_get_keyword_vector proc~w90_readwrite_get_range_vector->proc~w90_readwrite_get_vector_length proc~w90_readwrite_get_vector_length->proc~set_error_input proc~w90_readwrite_get_vector_length->proc~set_error_fatal proc~w90_readwrite_set_atoms->proc~set_error_alloc proc~w90_readwrite_set_atoms->proc~utility_lowercase proc~utility_string_to_coord->proc~set_error_input

Called by

proc~~input_reader_special~~CalledByGraph proc~input_reader_special input_reader_special program~wannier wannier program~wannier->proc~input_reader_special

Source Code

  subroutine input_reader_special(common_data, seedname, istdout, istderr, ierr)
    !! Read key variables from main input (.win) file; of use by wannier90.x only

    use w90_error_base, only: w90_error_type
    use w90_error, only: set_error_input, set_error_fatal, set_error_alloc
    use w90_readwrite, only: w90_readwrite_in_file, w90_readwrite_clean_infile
    use w90_wannier90_readwrite, only: w90_wannier90_readwrite_read_special

    implicit none

    ! arguments
    character(len=*), intent(in) :: seedname
    integer, intent(in) :: istdout, istderr
    integer, intent(out) :: ierr
    type(lib_common_type), intent(inout) :: common_data

    ! local variables
    type(w90_error_type), allocatable :: error

    ierr = 0

    ! read data from .win file to internal string array
    call w90_readwrite_in_file(common_data%settings, seedname, error, common_data%comm)
    if (allocated(error)) then
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if

    call w90_wannier90_readwrite_read_special(common_data%settings, common_data%atom_data, &
                                              common_data%kmesh_input, common_data%kmesh_info, &
                                              common_data%kpt_latt, common_data%wann_control, &
                                              common_data%proj, common_data%proj_input, &
                                              common_data%select_proj, common_data%w90_system, &
                                              common_data%w90_calculation, &
                                              common_data%real_lattice, common_data%physics%bohr, &
                                              common_data%mp_grid, common_data%num_bands, &
                                              common_data%exclude_bands, common_data%num_kpts, &
                                              common_data%num_proj, common_data%num_wann, &
                                              common_data%gamma_only, common_data%lhasproj, &
                                              common_data%use_bloch_phases, &
                                              common_data%dist_kpoints, istdout, error, &
                                              common_data%comm)
    if (allocated(error)) then
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if

    common_data%seedname = seedname

    if (common_data%num_bands > common_data%num_wann) then
      allocate (common_data%dis_manifold%ndimwin(common_data%num_kpts), stat=ierr)
      if (ierr /= 0) then
        call set_error_alloc(error, &
                             'Error allocating ndimwin in input_reader_special() call', common_data%comm)
        call prterr(error, ierr, istdout, istderr, common_data%comm)
        return
      end if
      allocate (common_data%dis_manifold%nfirstwin(common_data%num_kpts), stat=ierr)
      if (ierr /= 0) then
        call set_error_alloc(error, &
                             'Error allocating nfirstwin in input_reader_special() call', common_data%comm)
        call prterr(error, ierr, istdout, istderr, common_data%comm)
        return
      end if
      allocate (common_data%dis_manifold%lwindow(common_data%num_bands, common_data%num_kpts), stat=ierr)
      if (ierr /= 0) then
        call set_error_alloc(error, &
                             'Error allocating lwindow in input_reader_special() call', common_data%comm)
        call prterr(error, ierr, istdout, istderr, common_data%comm)
        return
      end if
    end if
    allocate (common_data%wannier_data%centres(3, common_data%num_wann), stat=ierr)
    if (ierr /= 0) then
      call set_error_alloc(error, &
                           'Error allocating wannier_centres in input_reader_special() call', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if
    common_data%wannier_data%centres = 0.0_dp
    allocate (common_data%wannier_data%spreads(common_data%num_wann), stat=ierr)
    if (ierr /= 0) then
      call set_error_alloc(error, &
                           'Error in allocating wannier_spreads in input_reader_special() call', common_data%comm)
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if
    common_data%wannier_data%spreads = 0.0_dp

    ! remove any remaining acceptable keywords; anything that remains is an input error
    call w90_readwrite_clean_infile(common_data%settings, istdout, seedname, error, common_data%comm)
    if (allocated(error)) then
      call prterr(error, ierr, istdout, istderr, common_data%comm)
      return
    end if

    if (allocated(common_data%settings%in_data)) deallocate (common_data%settings%in_data)
  end subroutine input_reader_special