wannier Program

Uses

  • program~~wannier~~UsesGraph program~wannier wannier module~w90_transport w90_transport program~wannier->module~w90_transport module~w90_disentangle w90_disentangle program~wannier->module~w90_disentangle module~w90_constants w90_constants program~wannier->module~w90_constants module~w90_overlap w90_overlap program~wannier->module~w90_overlap module~w90_hamiltonian w90_hamiltonian program~wannier->module~w90_hamiltonian module~w90_kmesh w90_kmesh program~wannier->module~w90_kmesh module~w90_io w90_io program~wannier->module~w90_io module~w90_sitesym w90_sitesym program~wannier->module~w90_sitesym module~w90_wannierise w90_wannierise program~wannier->module~w90_wannierise module~w90_plot w90_plot program~wannier->module~w90_plot module~w90_comms w90_comms program~wannier->module~w90_comms module~w90_parameters w90_parameters program~wannier->module~w90_parameters module~w90_transport->module~w90_constants module~w90_disentangle->module~w90_constants module~w90_disentangle->module~w90_io module~w90_disentangle->module~w90_sitesym module~w90_disentangle->module~w90_comms module~w90_disentangle->module~w90_parameters module~w90_overlap->module~w90_constants module~w90_overlap->module~w90_io module~w90_overlap->module~w90_comms module~w90_overlap->module~w90_parameters module~w90_hamiltonian->module~w90_constants module~w90_hamiltonian->module~w90_comms module~w90_kmesh->module~w90_constants module~w90_kmesh->module~w90_comms module~w90_kmesh->module~w90_parameters module~w90_io->module~w90_constants module~w90_sitesym->module~w90_constants module~w90_sitesym->module~w90_io module~w90_wannierise->module~w90_constants module~w90_wannierise->module~w90_comms module~w90_comms->module~w90_constants module~w90_comms->module~w90_io module~w90_parameters->module~w90_constants module~w90_parameters->module~w90_io

The main Wannier90 program


Calls

program~~wannier~~CallsGraph program~wannier wannier proc~io_commandline io_commandline program~wannier->proc~io_commandline interface~comms_bcast comms_bcast program~wannier->interface~comms_bcast proc~param_read param_read program~wannier->proc~param_read proc~io_error io_error program~wannier->proc~io_error proc~param_dealloc param_dealloc program~wannier->proc~param_dealloc proc~kmesh_dealloc kmesh_dealloc program~wannier->proc~kmesh_dealloc proc~hamiltonian_dealloc hamiltonian_dealloc program~wannier->proc~hamiltonian_dealloc proc~io_date io_date program~wannier->proc~io_date proc~param_write param_write program~wannier->proc~param_write proc~dis_main dis_main program~wannier->proc~dis_main proc~wann_main_gamma wann_main_gamma program~wannier->proc~wann_main_gamma proc~overlap_read overlap_read program~wannier->proc~overlap_read proc~plot_main plot_main program~wannier->proc~plot_main proc~param_write_header param_write_header program~wannier->proc~param_write_header proc~comms_setup comms_setup program~wannier->proc~comms_setup proc~io_file_unit io_file_unit program~wannier->proc~io_file_unit proc~param_memory_estimate param_memory_estimate program~wannier->proc~param_memory_estimate proc~overlap_allocate overlap_allocate program~wannier->proc~overlap_allocate proc~wann_main wann_main program~wannier->proc~wann_main proc~param_dist param_dist program~wannier->proc~param_dist proc~io_time io_time program~wannier->proc~io_time proc~overlap_dealloc overlap_dealloc program~wannier->proc~overlap_dealloc proc~comms_end comms_end program~wannier->proc~comms_end proc~param_chkpt_dist param_chkpt_dist program~wannier->proc~param_chkpt_dist proc~tran_dealloc tran_dealloc program~wannier->proc~tran_dealloc proc~tran_main tran_main program~wannier->proc~tran_main proc~comms_bcast_char comms_bcast_char interface~comms_bcast->proc~comms_bcast_char proc~comms_bcast_cmplx comms_bcast_cmplx interface~comms_bcast->proc~comms_bcast_cmplx proc~comms_bcast_int comms_bcast_int interface~comms_bcast->proc~comms_bcast_int proc~comms_bcast_real comms_bcast_real interface~comms_bcast->proc~comms_bcast_real proc~comms_bcast_logical comms_bcast_logical interface~comms_bcast->proc~comms_bcast_logical proc~param_read->proc~io_error proc~param_read->proc~io_file_unit proc~param_in_file param_in_file proc~param_read->proc~param_in_file proc~param_get_range_vector param_get_range_vector proc~param_read->proc~param_get_range_vector proc~param_get_keyword_block param_get_keyword_block proc~param_read->proc~param_get_keyword_block proc~param_get_centre_constraints param_get_centre_constraints proc~param_read->proc~param_get_centre_constraints proc~get_smearing_index get_smearing_index proc~param_read->proc~get_smearing_index proc~param_get_projections param_get_projections proc~param_read->proc~param_get_projections proc~get_module_kmesh get_module_kmesh proc~param_read->proc~get_module_kmesh proc~utility_metric utility_metric proc~param_read->proc~utility_metric proc~param_get_block_length param_get_block_length proc~param_read->proc~param_get_block_length proc~param_get_keyword_vector param_get_keyword_vector proc~param_read->proc~param_get_keyword_vector proc~param_get_keyword param_get_keyword proc~param_read->proc~param_get_keyword proc~param_get_keyword_kpath param_get_keyword_kpath proc~param_read->proc~param_get_keyword_kpath proc~param_uppercase param_uppercase proc~param_read->proc~param_uppercase proc~internal_set_kmesh internal_set_kmesh proc~param_read->proc~internal_set_kmesh proc~param_get_atoms param_get_atoms proc~param_read->proc~param_get_atoms proc~param_get_vector_length param_get_vector_length proc~param_read->proc~param_get_vector_length proc~dis_main->proc~io_file_unit proc~dis_windows dis_windows proc~dis_main->proc~dis_windows proc~dis_extract_gamma dis_extract_gamma proc~dis_main->proc~dis_extract_gamma proc~dis_extract dis_extract proc~dis_main->proc~dis_extract proc~dis_proj_froz dis_proj_froz proc~dis_main->proc~dis_proj_froz proc~dis_project dis_project proc~dis_main->proc~dis_project proc~comms_array_split comms_array_split proc~dis_main->proc~comms_array_split proc~wann_main_gamma->proc~io_time proc~wann_phases wann_phases proc~wann_main_gamma->proc~wann_phases proc~wann_check_unitarity wann_check_unitarity proc~wann_main_gamma->proc~wann_check_unitarity proc~param_write_chkpt param_write_chkpt proc~wann_main_gamma->proc~param_write_chkpt proc~wann_spread_copy wann_spread_copy proc~wann_main_gamma->proc~wann_spread_copy proc~utility_zgemm utility_zgemm proc~wann_main_gamma->proc~utility_zgemm proc~wann_omega_gamma wann_omega_gamma proc~wann_main_gamma->proc~wann_omega_gamma proc~overlap_read->proc~io_error proc~overlap_read->proc~io_file_unit proc~overlap_project_gamma overlap_project_gamma proc~overlap_read->proc~overlap_project_gamma proc~overlap_project overlap_project proc~overlap_read->proc~overlap_project proc~overlap_read->proc~comms_array_split proc~hamiltonian_get_hr hamiltonian_get_hr proc~plot_main->proc~hamiltonian_get_hr proc~hamiltonian_setup hamiltonian_setup proc~plot_main->proc~hamiltonian_setup proc~ws_write_vec ws_write_vec proc~plot_main->proc~ws_write_vec proc~param_write_header->proc~io_date proc~comms_setup_vars comms_setup_vars proc~comms_setup->proc~comms_setup_vars proc~overlap_allocate->proc~comms_array_split proc~wann_main->proc~io_error proc~wann_main->proc~io_file_unit proc~wann_main->proc~hamiltonian_get_hr proc~wann_main->proc~hamiltonian_setup proc~io_wallclocktime io_wallclocktime proc~wann_main->proc~io_wallclocktime proc~wann_domega wann_domega proc~wann_main->proc~wann_domega proc~wann_main->proc~wann_phases proc~wann_main->proc~wann_check_unitarity proc~wann_main->proc~wann_spread_copy proc~wann_omega wann_omega proc~wann_main->proc~wann_omega proc~wann_main->proc~comms_array_split proc~param_dist->interface~comms_bcast proc~param_chkpt_dist->interface~comms_bcast proc~tran_cut_hr_one_dim tran_cut_hr_one_dim proc~tran_main->proc~tran_cut_hr_one_dim proc~tran_lcr_2c2_sort tran_lcr_2c2_sort proc~tran_main->proc~tran_lcr_2c2_sort proc~tran_main->proc~hamiltonian_get_hr proc~tran_bulk tran_bulk proc~tran_main->proc~tran_bulk proc~tran_main->proc~hamiltonian_setup proc~tran_lcr_2c2_build_ham tran_lcr_2c2_build_ham proc~tran_main->proc~tran_lcr_2c2_build_ham proc~tran_lcr tran_lcr proc~tran_main->proc~tran_lcr proc~tran_find_integral_signatures tran_find_integral_signatures proc~tran_main->proc~tran_find_integral_signatures proc~tran_parity_enforce tran_parity_enforce proc~tran_main->proc~tran_parity_enforce proc~tran_reduce_hr tran_reduce_hr proc~tran_main->proc~tran_reduce_hr proc~tran_get_ht tran_get_ht proc~tran_main->proc~tran_get_ht proc~tran_lcr_2c2_sort->proc~io_error proc~tran_lcr_2c2_sort->proc~tran_cut_hr_one_dim proc~tran_lcr_2c2_sort->proc~tran_reduce_hr proc~check_and_sort_similar_centres check_and_sort_similar_centres proc~tran_lcr_2c2_sort->proc~check_and_sort_similar_centres proc~group group proc~tran_lcr_2c2_sort->proc~group proc~sort sort proc~tran_lcr_2c2_sort->proc~sort proc~master_sort_and_group master_sort_and_group proc~tran_lcr_2c2_sort->proc~master_sort_and_group proc~param_in_file->proc~io_file_unit proc~utility_lowercase utility_lowercase proc~param_in_file->proc~utility_lowercase proc~dis_windows->proc~io_error 10 10 proc~dis_windows->10 proc~dis_extract_gamma->proc~io_error proc~dis_extract_gamma->proc~io_time dspevx dspevx proc~dis_extract_gamma->dspevx proc~param_get_keyword_block->proc~io_error proc~param_get_centre_constraint_from_column param_get_centre_constraint_from_column proc~param_get_centre_constraints->proc~param_get_centre_constraint_from_column proc~tran_bulk->proc~io_date proc~tran_bulk->proc~io_file_unit proc~tran_read_htx tran_read_htX proc~tran_bulk->proc~tran_read_htx proc~tran_green tran_green proc~tran_bulk->proc~tran_green zgemm zgemm proc~tran_bulk->zgemm proc~tran_transfer tran_transfer proc~tran_bulk->proc~tran_transfer proc~hamiltonian_wigner_seitz hamiltonian_wigner_seitz proc~hamiltonian_setup->proc~hamiltonian_wigner_seitz proc~sitesym_symmetrize_gradient sitesym_symmetrize_gradient proc~wann_domega->proc~sitesym_symmetrize_gradient proc~utility_inv3 utility_inv3 proc~wann_phases->proc~utility_inv3 proc~wann_check_unitarity->proc~io_error proc~param_get_projections->proc~io_error proc~utility_strip utility_strip proc~param_get_projections->proc~utility_strip proc~utility_string_to_coord utility_string_to_coord proc~param_get_projections->proc~utility_string_to_coord proc~ws_write_vec->proc~io_date proc~ws_write_vec->proc~io_file_unit proc~tran_lcr_2c2_build_ham->proc~io_error proc~tran_lcr_2c2_build_ham->proc~io_date proc~tran_lcr_2c2_build_ham->proc~io_file_unit proc~tran_lcr_2c2_build_ham->proc~tran_cut_hr_one_dim proc~tran_lcr_2c2_build_ham->proc~tran_reduce_hr proc~tran_lcr->proc~io_error proc~tran_lcr->proc~io_date proc~tran_lcr->proc~io_file_unit proc~tran_read_htxy tran_read_htXY proc~tran_lcr->proc~tran_read_htxy proc~tran_lcr->proc~tran_read_htx zgbsv zgbsv proc~tran_lcr->zgbsv proc~tran_lcr->proc~tran_green proc~tran_lcr->zgemm proc~tran_lcr->proc~tran_transfer proc~tran_read_htc tran_read_htC proc~tran_lcr->proc~tran_read_htc proc~get_module_kmesh->proc~internal_set_kmesh proc~param_write_chkpt->proc~io_date proc~param_write_chkpt->proc~io_file_unit proc~utility_zgemm->zgemm proc~tran_find_integral_signatures->proc~io_error proc~tran_find_integral_signatures->proc~io_file_unit proc~overlap_project_gamma->proc~io_error dgemm dgemm proc~overlap_project_gamma->dgemm dgesvd dgesvd proc~overlap_project_gamma->dgesvd proc~param_get_keyword_vector->proc~io_error proc~dis_extract->proc~io_error proc~dis_extract->proc~io_wallclocktime proc~dis_extract->proc~comms_array_split interface~comms_allreduce comms_allreduce proc~dis_extract->interface~comms_allreduce zhpevx zhpevx proc~dis_extract->zhpevx proc~sitesym_symmetrize_zmatrix sitesym_symmetrize_zmatrix proc~dis_extract->proc~sitesym_symmetrize_zmatrix proc~dis_proj_froz->proc~io_error proc~tran_reduce_hr->proc~io_error proc~overlap_project->proc~io_error proc~overlap_project->proc~comms_array_split proc~wann_omega->interface~comms_allreduce proc~param_get_atoms->proc~io_error proc~param_get_atoms->proc~param_get_block_length proc~dis_project->proc~io_error proc~tran_get_ht->proc~io_date proc~tran_get_ht->proc~io_file_unit proc~tran_read_htxy->proc~io_file_unit proc~tran_read_htx->proc~io_file_unit proc~check_and_sort_similar_centres->proc~io_error proc~comms_allreduce_real comms_allreduce_real interface~comms_allreduce->proc~comms_allreduce_real proc~comms_allreduce_cmplx comms_allreduce_cmplx interface~comms_allreduce->proc~comms_allreduce_cmplx proc~hamiltonian_wigner_seitz->proc~io_error proc~tran_green->proc~io_error proc~tran_green->zgemm zgesv zgesv proc~tran_green->zgesv proc~tran_transfer->proc~io_error zcopy zcopy proc~tran_transfer->zcopy zaxpy zaxpy proc~tran_transfer->zaxpy proc~tran_transfer->zgesv proc~master_sort_and_group->proc~group proc~master_sort_and_group->proc~sort proc~tran_read_htc->proc~io_file_unit

Contents

Source Code


Variables

Type AttributesNameInitial
real(kind=dp) :: time0
real(kind=dp) :: time1
real(kind=dp) :: time2
character(len=9) :: stat
character(len=9) :: pos
character(len=9) :: cdate
character(len=9) :: ctime
logical :: wout_found
logical :: dryrun
integer :: len_seedname
character(len=50) :: prog

Source Code

program wannier
  !! The main Wannier90 program

  use w90_constants
  use w90_parameters
  use w90_io
  use w90_hamiltonian
  use w90_kmesh
  use w90_disentangle
  use w90_overlap
  use w90_wannierise
  use w90_plot
  use w90_transport
  use w90_comms, only: on_root, num_nodes, comms_setup, comms_end, comms_bcast, my_node_id
  use w90_sitesym !YN:

  implicit none

  real(kind=dp) time0, time1, time2
  character(len=9) :: stat, pos, cdate, ctime
  logical :: wout_found, dryrun
  integer :: len_seedname
  character(len=50) :: prog

  call comms_setup

  library = .false.

  time0 = io_time()

  if (on_root) then
    prog = 'wannier90'
    call io_commandline(prog, dryrun)
    len_seedname = len(seedname)
  end if
  call comms_bcast(len_seedname, 1)
  call comms_bcast(seedname, len_seedname)
  call comms_bcast(dryrun, 1)

  if (on_root) then
    stdout = io_file_unit()
    open (unit=stdout, file=trim(seedname)//'.werr')
    call io_date(cdate, ctime)
    write (stdout, *) 'Wannier90: Execution started on ', cdate, ' at ', ctime

    call param_read
    close (stdout, status='delete')

    if (restart .eq. ' ') then
      stat = 'replace'
      pos = 'rewind'
    else
      inquire (file=trim(seedname)//'.wout', exist=wout_found)
      if (wout_found) then
        stat = 'old'
      else
        stat = 'replace'
      endif
      pos = 'append'
    endif

    stdout = io_file_unit()
    open (unit=stdout, file=trim(seedname)//'.wout', status=trim(stat), position=trim(pos))
    call param_write_header()
    if (num_nodes == 1) then
#ifdef MPI
      write (stdout, '(/,1x,a)') 'Running in serial (with parallel executable)'
#else
      write (stdout, '(/,1x,a)') 'Running in serial (with serial executable)'
#endif
    else
      write (stdout, '(/,1x,a,i3,a/)') &
        'Running in parallel on ', num_nodes, ' CPUs'
    endif
    call param_write()

    time1 = io_time()
    write (stdout, '(1x,a25,f11.3,a)') 'Time to read parameters  ', time1 - time0, ' (sec)'

    if (.not. explicit_nnkpts) call kmesh_get
    time2 = io_time()
    write (stdout, '(1x,a25,f11.3,a)') &
      'Time to get kmesh        ', time2 - time1, ' (sec)'

    call param_memory_estimate
  end if

  if (dryrun) then
    if (on_root) then
      write (stdout, *) ' '
      write (stdout, *) '                       ==============================='
      write (stdout, *) '                                   DRYRUN             '
      write (stdout, *) '                       No problems found with win file'
      write (stdout, *) '                       ==============================='
    endif
    stop
  endif

  ! We now distribute the parameters to the other nodes
  call param_dist
  if (gamma_only .and. num_nodes > 1) &
    call io_error('Gamma point branch is serial only at the moment')

  if (transport .and. tran_read_ht) goto 3003

  ! Sort out restarts
  if (restart .eq. ' ') then  ! start a fresh calculation
    if (on_root) write (stdout, '(1x,a/)') 'Starting a new Wannier90 calculation ...'
  else                      ! restart a previous calculation
    if (on_root) call param_read_chkpt()
    call param_chkpt_dist
    if (lsitesymmetry) call sitesym_read()   ! update this to read on root and bcast - JRY

    select case (restart)
    case ('default')    ! continue from where last checkpoint was written
      if (on_root) write (stdout, '(/1x,a)', advance='no') 'Resuming a previous Wannier90 calculation '
      if (checkpoint .eq. 'postdis') then
        if (on_root) write (stdout, '(a/)') 'from wannierisation ...'
        goto 1001         ! go to wann_main
      elseif (checkpoint .eq. 'postwann') then
        if (on_root) write (stdout, '(a/)') 'from plotting ...'
        goto 2002         ! go to plot_main
      else
        if (on_root) write (stdout, '(/a/)')
        call io_error('Value of checkpoint not recognised in wann_prog')
      endif
    case ('wannierise') ! continue from wann_main irrespective of value of last checkpoint
      if (on_root) write (stdout, '(1x,a/)') 'Restarting Wannier90 from wannierisation ...'
      goto 1001
    case ('plot')       ! continue from plot_main irrespective of value of last checkpoint
      if (on_root) write (stdout, '(1x,a/)') 'Restarting Wannier90 from plotting routines ...'
      goto 2002
    case ('transport')   ! continue from tran_main irrespective of value of last checkpoint
      if (on_root) write (stdout, '(1x,a/)') 'Restarting Wannier90 from transport routines ...'
      goto 3003
    case default        ! for completeness... (it is already trapped in param_read)
      call io_error('Value of restart not recognised in wann_prog')
    end select
  endif

  if (postproc_setup) then
    if (on_root) call kmesh_write()
    call kmesh_dealloc()
    call param_dealloc()
    if (on_root) write (stdout, '(1x,a25,f11.3,a)') 'Time to write kmesh      ', io_time(), ' (sec)'
    if (on_root) write (stdout, '(/a)') ' Exiting... '//trim(seedname)//'.nnkp written.'
    call comms_end
    stop
  endif

  if (lsitesymmetry) call sitesym_read()   ! update this to read on root and bcast - JRY
  call overlap_allocate()
  call overlap_read()

  time1 = io_time()
  if (on_root) write (stdout, '(/1x,a25,f11.3,a)') 'Time to read overlaps    ', time1 - time2, ' (sec)'

  have_disentangled = .false.

  if (disentanglement) then
    call dis_main()
    have_disentangled = .true.
    time2 = io_time()
    if (on_root) write (stdout, '(1x,a25,f11.3,a)') 'Time to disentangle bands', time2 - time1, ' (sec)'
  endif

  if (on_root) call param_write_chkpt('postdis')
!~  call param_write_um

1001 time2 = io_time()

  if (.not. gamma_only) then
    call wann_main()
  else
    call wann_main_gamma()
  end if

  time1 = io_time()
  if (on_root) write (stdout, '(1x,a25,f11.3,a)') 'Time for wannierise      ', time1 - time2, ' (sec)'

  if (on_root) call param_write_chkpt('postwann')

2002 continue
  if (on_root) then
    ! I call the routine always; the if statements to decide if/what
    ! to plot are inside the function
    time2 = io_time()
    call plot_main()
    time1 = io_time()
    ! Now time is always printed, even if no plotting is done/required, but
    ! it shouldn't be a problem.
    write (stdout, '(1x,a25,f11.3,a)') 'Time for plotting        ', time1 - time2, ' (sec)'
  endif

3003 continue
  if (on_root) then
    time2 = io_time()
    if (transport) then
      call tran_main()
      time1 = io_time()
      write (stdout, '(1x,a25,f11.3,a)') 'Time for transport       ', time1 - time2, ' (sec)'
      if (tran_read_ht) goto 4004
    end if
  endif

  call tran_dealloc()
  call hamiltonian_dealloc()
  call overlap_dealloc()
  call kmesh_dealloc()
  call param_dealloc()
  if (lsitesymmetry) call sitesym_dealloc() !YN:

4004 continue

  if (on_root) then
    write (stdout, '(1x,a25,f11.3,a)') 'Total Execution Time     ', io_time(), ' (sec)'

    if (timing_level > 0) call io_print_timings()

    write (stdout, *)
    write (stdout, '(1x,a)') 'All done: wannier90 exiting'

    close (stdout)
  endif

  call comms_end

end program wannier