postw90 Program

Uses

  • program~~postw90~~UsesGraph program~postw90 postw90 module~w90_postw90_common w90_postw90_common program~postw90->module~w90_postw90_common module~w90_berry w90_berry program~postw90->module~w90_berry module~w90_boltzwann w90_boltzwann program~postw90->module~w90_boltzwann module~w90_constants w90_constants program~postw90->module~w90_constants module~w90_kpath w90_kpath program~postw90->module~w90_kpath module~w90_spin w90_spin program~postw90->module~w90_spin module~w90_kmesh w90_kmesh program~postw90->module~w90_kmesh module~w90_dos w90_dos program~postw90->module~w90_dos module~w90_io w90_io program~postw90->module~w90_io module~w90_kslice w90_kslice program~postw90->module~w90_kslice module~w90_gyrotropic w90_gyrotropic program~postw90->module~w90_gyrotropic module~w90_geninterp w90_geninterp program~postw90->module~w90_geninterp module~w90_comms w90_comms program~postw90->module~w90_comms module~w90_parameters w90_parameters program~postw90->module~w90_parameters module~w90_postw90_common->module~w90_constants module~w90_postw90_common->module~w90_comms module~w90_berry->module~w90_constants module~w90_boltzwann->module~w90_postw90_common module~w90_boltzwann->module~w90_constants module~w90_boltzwann->module~w90_dos module~w90_boltzwann->module~w90_io module~w90_boltzwann->module~w90_comms module~w90_boltzwann->module~w90_parameters module~w90_utility w90_utility module~w90_boltzwann->module~w90_utility module~w90_kpath->module~w90_constants module~w90_spin->module~w90_constants module~w90_kmesh->module~w90_constants module~w90_kmesh->module~w90_comms module~w90_kmesh->module~w90_parameters module~w90_dos->module~w90_constants module~w90_io->module~w90_constants module~w90_gyrotropic->module~w90_berry module~w90_gyrotropic->module~w90_constants module~w90_geninterp->module~w90_postw90_common module~w90_geninterp->module~w90_constants module~w90_geninterp->module~w90_io module~w90_geninterp->module~w90_comms module~w90_geninterp->module~w90_parameters module~w90_wan_ham w90_wan_ham module~w90_geninterp->module~w90_wan_ham module~w90_get_oper w90_get_oper module~w90_geninterp->module~w90_get_oper module~w90_geninterp->module~w90_utility module~w90_comms->module~w90_constants module~w90_comms->module~w90_io module~w90_parameters->module~w90_constants module~w90_parameters->module~w90_io module~w90_wan_ham->module~w90_constants module~w90_get_oper->module~w90_constants module~w90_utility->module~w90_constants

The postw90 program


Calls

program~~postw90~~CallsGraph program~postw90 postw90 proc~io_commandline io_commandline program~postw90->proc~io_commandline proc~io_time io_time program~postw90->proc~io_time interface~comms_bcast comms_bcast program~postw90->interface~comms_bcast proc~comms_end comms_end program~postw90->proc~comms_end proc~comms_barrier comms_barrier program~postw90->proc~comms_barrier proc~param_write_header param_write_header program~postw90->proc~param_write_header proc~param_postw90_write param_postw90_write program~postw90->proc~param_postw90_write proc~pw90common_wanint_data_dist pw90common_wanint_data_dist program~postw90->proc~pw90common_wanint_data_dist proc~param_read param_read program~postw90->proc~param_read proc~kmesh_get kmesh_get program~postw90->proc~kmesh_get proc~pw90common_wanint_param_dist pw90common_wanint_param_dist program~postw90->proc~pw90common_wanint_param_dist proc~pw90common_wanint_setup pw90common_wanint_setup program~postw90->proc~pw90common_wanint_setup proc~comms_setup comms_setup program~postw90->proc~comms_setup proc~io_file_unit io_file_unit program~postw90->proc~io_file_unit 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~io_date io_date proc~param_write_header->proc~io_date proc~param_get_smearing_type param_get_smearing_type proc~param_postw90_write->proc~param_get_smearing_type proc~param_get_convention_type param_get_convention_type proc~param_postw90_write->proc~param_get_convention_type proc~parameters_gyro_write_task parameters_gyro_write_task proc~param_postw90_write->proc~parameters_gyro_write_task proc~pw90common_wanint_data_dist->interface~comms_bcast 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~io_error io_error proc~param_read->proc~io_error 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~kmesh_get->proc~io_error proc~kmesh_supercell_sort kmesh_supercell_sort proc~kmesh_get->proc~kmesh_supercell_sort proc~kmesh_shell_fixed kmesh_shell_fixed proc~kmesh_get->proc~kmesh_shell_fixed proc~kmesh_shell_automatic kmesh_shell_automatic proc~kmesh_get->proc~kmesh_shell_automatic proc~kmesh_shell_from_file kmesh_shell_from_file proc~kmesh_get->proc~kmesh_shell_from_file proc~pw90common_wanint_param_dist->interface~comms_bcast proc~pw90common_wanint_setup->interface~comms_bcast proc~pw90common_wanint_setup->proc~io_file_unit proc~wigner_seitz wigner_seitz proc~pw90common_wanint_setup->proc~wigner_seitz proc~comms_setup_vars comms_setup_vars proc~comms_setup->proc~comms_setup_vars proc~param_in_file->proc~io_file_unit proc~utility_lowercase utility_lowercase proc~param_in_file->proc~utility_lowercase 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~internal_maxloc internal_maxloc proc~kmesh_supercell_sort->proc~internal_maxloc proc~param_get_projections->proc~io_error proc~utility_string_to_coord utility_string_to_coord proc~param_get_projections->proc~utility_string_to_coord proc~utility_strip utility_strip proc~param_get_projections->proc~utility_strip proc~get_module_kmesh->proc~internal_set_kmesh proc~kmesh_shell_fixed->proc~io_error dgesvd dgesvd proc~kmesh_shell_fixed->dgesvd proc~kmesh_shell_automatic->proc~io_error proc~kmesh_shell_automatic->dgesvd proc~param_get_keyword_vector->proc~io_error proc~param_get_atoms->proc~io_error proc~param_get_atoms->proc~param_get_block_length proc~kmesh_shell_from_file->proc~io_file_unit proc~kmesh_shell_from_file->proc~io_error proc~kmesh_shell_from_file->dgesvd

Contents

Source Code


Variables

Type AttributesNameInitial
integer :: nkp
integer :: len_seedname
logical :: have_gamma
real(kind=dp) :: time0
real(kind=dp) :: time1
real(kind=dp) :: time2
character(len=9) :: stat
character(len=9) :: pos
logical :: wpout_found
logical :: werr_found
logical :: dryrun
character(len=50) :: prog

Source Code

program postw90
  !! The postw90 program
  use w90_constants, only: dp, eps6
  use w90_parameters
  use w90_io

  use w90_kmesh
  use w90_comms, only: on_root, num_nodes, comms_setup, comms_end, comms_bcast, comms_barrier
  use w90_postw90_common, only: pw90common_wanint_setup, pw90common_wanint_get_kpoint_file, &
    pw90common_wanint_param_dist, pw90common_wanint_data_dist

  ! These modules deal with the interpolation of specific physical properties
  !
  use w90_dos
  use w90_berry
  use w90_gyrotropic
  use w90_spin
  use w90_kpath
  use w90_kslice

  use w90_boltzwann
  use w90_geninterp

  implicit none

  integer       :: nkp, len_seedname
  logical       :: have_gamma
  real(kind=dp) :: time0, time1, time2
  character(len=9) :: stat, pos
  logical :: wpout_found, werr_found, dryrun
  character(len=50) :: prog

  ! Put some descriptive comments here
  !
  call comms_setup

  library = .false.
  ispostw90 = .true.

  if (on_root) then
    time0 = io_time()
    prog = 'postw90'
    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
    ! If an error file (generated by postw90) exists, I delete it
    ! Note: I do it only for the error file generated from the root node;
    ! If error files generated by other nodes exist, I don't do anything for them
    inquire (file=trim(seedname)//'.node_00000.werr', exist=werr_found)
    if (werr_found) then
      stdout = io_file_unit()
      open (unit=stdout, file=trim(seedname)//'.node_00000.werr', status='old', position='append')
      close (stdout, status='delete')
    end if

    inquire (file=trim(seedname)//'.wpout', exist=wpout_found)
    if (wpout_found) then
      stat = 'old'
    else
      stat = 'replace'
    endif
    pos = 'append'

    stdout = io_file_unit()
    open (unit=stdout, file=trim(seedname)//'.wpout', 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
  end if

  ! Read onto the root node all the input parameters from seendame.win,
  ! as well as the energy eigenvalues on the ab-initio q-mesh from seedname.eig
  !
  if (on_root) then
    call param_read
    call param_postw90_write
    time1 = io_time()
    write (stdout, '(1x,a25,f11.3,a)') &
      'Time to read parameters  ', time1 - time0, ' (sec)'

    if (.not. effective_model) then
      ! Check if the q-mesh includes the gamma point
      !
      have_gamma = .false.
      do nkp = 1, num_kpts
        if (all(abs(kpt_latt(:, nkp)) < eps6)) have_gamma = .true.
      end do
      if (.not. have_gamma) write (stdout, '(1x,a)') &
        'Ab-initio does not include Gamma. Interpolation may be incorrect!!!'
      !
      ! Need nntot, wb, and bk to evaluate WF matrix elements of
      ! the position operator in reciprocal space. Also need
      ! nnlist to compute the additional matrix elements entering
      ! the orbital magnetization
      !
      call kmesh_get
      time2 = io_time()
      write (stdout, '(1x,a25,f11.3,a)') &
        'Time to get kmesh        ', time2 - time1, ' (sec)'
    endif

    ! GP, May 10, 2012: for the moment I leave this commented
    ! since we need first to tune that routine so that it doesn't
    ! print the memory information related to wannier90.x.
    ! Note that the code for the memory estimation for the
    ! Boltzwann routine is already there.
    !       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 a subset of the parameters to the other nodes
  !
  call pw90common_wanint_param_dist

  if (.not. effective_model) then
    !
    ! Read files seedname.chk (overlap matrices, unitary matrices for
    ! both disentanglement and maximal localization, etc.)
    !
    if (on_root) call param_read_chkpt()
    !
    ! Distribute the information in the um and chk files to the other nodes
    !
    ! Ivo: For interpolation purposes we do not need u_matrix_opt and
    !      u_matrix separately, only their product v_matrix, and this
    !      is what is distributed now
    !
    call pw90common_wanint_data_dist
    !
  end if

  ! Read list of k-points in irreducible BZ and their weights
  !
  ! Should this be done on root node only?
  !
  if (wanint_kpoint_file) call pw90common_wanint_get_kpoint_file

  ! Setup a number of common variables for all interpolation tasks
  !
  call pw90common_wanint_setup

  if (on_root) then
    time1 = io_time()
    write (stdout, '(/1x,a25,f11.3,a)') &
      'Time to read and process .chk    ', time1 - time2, ' (sec)'
  endif
  !
  ! Now perform one or more of the following tasks

  ! ---------------------------------------------------------------
  ! Density of states calculated using a uniform interpolation mesh
  ! ---------------------------------------------------------------
  !
  if (dos .and. index(dos_task, 'dos_plot') > 0) call dos_main

! find_fermi_level commented for the moment in dos.F90
!  if(dos .and. index(dos_task,'find_fermi_energy')>0) call find_fermi_level

  ! --------------------------------------------------------------------
  ! Bands, Berry curvature, or orbital magnetization plot along a k-path
  ! --------------------------------------------------------------------
  !
  if (kpath) call k_path

  ! ---------------------------------------------------------------------------
  ! Bands, Berry curvature, or orbital magnetization plot on a slice in k-space
  ! ---------------------------------------------------------------------------
  !
  if (kslice) call k_slice

  ! --------------------
  ! Spin magnetic moment
  ! --------------------
  !
  if (spin_moment) call spin_get_moment

  ! -------------------------------------------------------------------
  ! dc Anomalous Hall conductivity and eventually (if 'mcd' string also
  ! present in addition to 'ahe', e.g., 'ahe+mcd') dichroic optical
  ! conductivity, both calculated on the same (adaptively-refined) mesh
  ! -------------------------------------------------------------------
  !
  ! ---------------------------------------------------------------
  ! Absorptive dichroic optical conductivity & JDOS on uniform mesh
  ! ---------------------------------------------------------------
  !
  ! -----------------------------------------------------------------
  ! Absorptive ordinary optical conductivity & JDOS on a uniform mesh
  ! -----------------------------------------------------------------
  !
  ! -----------------------------------------------------------------
  ! Orbital magnetization
  ! -----------------------------------------------------------------
  !
  if (berry) call berry_main
  ! -----------------------------------------------------------------
  ! Boltzmann transport coefficients (BoltzWann module)
  ! -----------------------------------------------------------------
  !
  if (on_root) then
    time1 = io_time()
  endif

  if (geninterp) call geninterp_main

  if (boltzwann) call boltzwann_main

  if (gyrotropic) call gyrotropic_main

  if (on_root .and. boltzwann) then
    time2 = io_time()
    write (stdout, '(/1x,a,f11.3,a)') &
      'Time for BoltzWann (Boltzmann transport) ', time2 - time1, ' (sec)'
  endif

  ! I put a barrier here before calling the final time printing routines,
  ! just to be sure that all processes have arrived here.
  call comms_barrier
  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: postw90 exiting'
    close (stdout)
  end if

  call comms_end

end program postw90