w90_readwrite_clean_infile Subroutine

public subroutine w90_readwrite_clean_infile(settings, stdout, seedname, error, comm)

Uses

  • proc~~w90_readwrite_clean_infile~~UsesGraph proc~w90_readwrite_clean_infile w90_readwrite_clean_infile module~w90_error w90_error proc~w90_readwrite_clean_infile->module~w90_error module~w90_comms w90_comms module~w90_error->module~w90_comms module~w90_error_base w90_error_base module~w90_error->module~w90_error_base module~w90_comms->module~w90_error_base module~w90_constants w90_constants module~w90_comms->module~w90_constants

Arguments

Type IntentOptional Attributes Name
type(settings_type), intent(inout) :: settings
integer, intent(in) :: stdout
character(len=*), intent(in) :: seedname
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~w90_readwrite_clean_infile~~CallsGraph proc~w90_readwrite_clean_infile w90_readwrite_clean_infile 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~comms_sync_error comms_sync_error proc~set_error_dealloc->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_dealloc->proc~set_base_error proc~set_error_input->proc~comms_sync_error proc~set_error_input->proc~set_base_error proc~w90_readwrite_clear_keywords->proc~set_error_dealloc proc~clear_block clear_block proc~w90_readwrite_clear_keywords->proc~clear_block proc~set_error_alloc set_error_alloc proc~w90_readwrite_clear_keywords->proc~set_error_alloc 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~clear_block->proc~set_error_input proc~set_error_alloc->proc~comms_sync_error proc~set_error_alloc->proc~set_base_error proc~w90_readwrite_get_keyword->proc~set_error_input proc~set_error_fatal set_error_fatal proc~w90_readwrite_get_keyword->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_range_vector->proc~set_error_input proc~w90_readwrite_get_range_vector->proc~w90_readwrite_get_keyword_vector proc~w90_readwrite_get_vector_length w90_readwrite_get_vector_length proc~w90_readwrite_get_range_vector->proc~w90_readwrite_get_vector_length proc~set_error_fatal->proc~comms_sync_error proc~set_error_fatal->proc~set_base_error proc~w90_readwrite_get_vector_length->proc~set_error_input proc~w90_readwrite_get_vector_length->proc~set_error_fatal

Called by

proc~~w90_readwrite_clean_infile~~CalledByGraph proc~w90_readwrite_clean_infile w90_readwrite_clean_infile proc~input_reader_special input_reader_special proc~input_reader_special->proc~w90_readwrite_clean_infile proc~w90_input_reader~2 w90_input_reader proc~w90_input_reader~2->proc~w90_readwrite_clean_infile program~postw90 postw90 program~postw90->proc~w90_readwrite_clean_infile proc~w90_input_reader w90_input_reader proc~w90_input_reader->proc~w90_input_reader~2 program~wannier wannier program~wannier->proc~input_reader_special program~wannier->proc~w90_input_reader~2

Source Code

  subroutine w90_readwrite_clean_infile(settings, stdout, seedname, error, comm)
    use w90_error, only: w90_error_type, set_error_input, set_error_dealloc
    implicit none
    integer, intent(in) :: stdout
    character(len=*), intent(in)  :: seedname
    type(w90_error_type), allocatable, intent(out) :: error
    type(w90_comm_type), intent(in) :: comm
    type(settings_type), intent(inout) :: settings

    integer :: loop, ierr

    ! filter out any remaining accepted keywords from both wannier90.x and postw90.x sets
    ! assumes settings%in_data is allocated
    call w90_readwrite_clear_keywords(settings, error, comm)
    if (allocated(error)) return

    if (any(len_trim(settings%in_data(:)) > 0)) then
      write (stdout, '(1x,a)') 'The following section of file '//trim(seedname)//'.win contained unrecognised keywords'
      write (stdout, *)
      do loop = 1, settings%num_lines
        if (len_trim(settings%in_data(loop)) > 0) then
          write (stdout, '(1x,a)') trim(settings%in_data(loop))
        end if
      end do
      write (stdout, *)
      call set_error_input(error, 'Unrecognised keyword(s) in input file, see also output file', comm)
      return
    end if

    deallocate (settings%in_data, stat=ierr)
    if (ierr /= 0) then
      call set_error_dealloc(error, 'Error deallocating in_data in w90_readwrite_clean_infile', comm)
      return
    end if
    settings%num_lines = 0
  end subroutine w90_readwrite_clean_infile