pw90common_wanint_param_dist Subroutine

public subroutine pw90common_wanint_param_dist()

Uses

  • proc~~pw90common_wanint_param_dist~~UsesGraph proc~pw90common_wanint_param_dist pw90common_wanint_param_dist module~w90_constants w90_constants proc~pw90common_wanint_param_dist->module~w90_constants module~w90_parameters w90_parameters proc~pw90common_wanint_param_dist->module~w90_parameters module~w90_io w90_io proc~pw90common_wanint_param_dist->module~w90_io module~w90_parameters->module~w90_constants module~w90_parameters->module~w90_io module~w90_io->module~w90_constants

distribute the parameters across processors NOTE: we only send the ones postw90 uses, not all in w90

Arguments

None

Calls

proc~~pw90common_wanint_param_dist~~CallsGraph proc~pw90common_wanint_param_dist pw90common_wanint_param_dist interface~comms_bcast comms_bcast proc~pw90common_wanint_param_dist->interface~comms_bcast 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

Called by

proc~~pw90common_wanint_param_dist~~CalledByGraph proc~pw90common_wanint_param_dist pw90common_wanint_param_dist program~postw90 postw90 program~postw90->proc~pw90common_wanint_param_dist

Contents


Source Code

  subroutine pw90common_wanint_param_dist
    !===========================================================!
    !                                                           !
    !! distribute the parameters across processors
    !! NOTE: we only send the ones postw90 uses, not all in w90
    !                                                           !
    !===========================================================!

    use w90_constants, only: dp, cmplx_0, cmplx_i, twopi
    use w90_io, only: io_error, io_file_unit, io_date, io_time, &
      io_stopwatch
    use w90_parameters

    integer :: ierr

    call comms_bcast(effective_model, 1)
    call comms_bcast(eig_found, 1)

    if (.not. effective_model) then
      call comms_bcast(mp_grid(1), 3)
      call comms_bcast(num_kpts, 1)
      call comms_bcast(num_bands, 1)
    endif
    call comms_bcast(num_wann, 1)
    call comms_bcast(timing_level, 1)
    call comms_bcast(iprint, 1)
    call comms_bcast(ws_distance_tol, 1)
    call comms_bcast(ws_search_size(1), 3)
!    call comms_bcast(num_atoms,1)   ! Ivo: not used in postw90, right?
!    call comms_bcast(num_species,1) ! Ivo: not used in postw90, right?
    call comms_bcast(real_lattice(1, 1), 9)
    call comms_bcast(recip_lattice(1, 1), 9)
    call comms_bcast(real_metric(1, 1), 9)
    call comms_bcast(recip_metric(1, 1), 9)
    call comms_bcast(cell_volume, 1)
    call comms_bcast(dos_energy_step, 1)
    call comms_bcast(dos_adpt_smr, 1)
    call comms_bcast(dos_smr_index, 1)
    call comms_bcast(dos_kmesh_spacing, 1)
    call comms_bcast(dos_kmesh(1), 3)
    call comms_bcast(dos_adpt_smr_max, 1)
    call comms_bcast(dos_smr_fixed_en_width, 1)
    call comms_bcast(dos_adpt_smr_fac, 1)
    call comms_bcast(num_dos_project, 1)

    call comms_bcast(berry, 1)
    call comms_bcast(berry_task, len(berry_task))
    call comms_bcast(berry_kmesh_spacing, 1)
    call comms_bcast(berry_kmesh(1), 3)
    call comms_bcast(berry_curv_adpt_kmesh, 1)
    call comms_bcast(berry_curv_adpt_kmesh_thresh, 1)
    call comms_bcast(berry_curv_unit, len(berry_curv_unit))

! Tsirkin
    call comms_bcast(gyrotropic, 1)
    call comms_bcast(gyrotropic_task, len(gyrotropic_task))
    call comms_bcast(gyrotropic_kmesh_spacing, 1)
    call comms_bcast(gyrotropic_kmesh(1), 3)
    call comms_bcast(gyrotropic_smr_fixed_en_width, 1)
    call comms_bcast(gyrotropic_smr_index, 1)
    call comms_bcast(gyrotropic_eigval_max, 1)
    call comms_bcast(gyrotropic_nfreq, 1)
    call comms_bcast(gyrotropic_degen_thresh, 1)
    call comms_bcast(gyrotropic_num_bands, 1)
    call comms_bcast(gyrotropic_box(1, 1), 9)
    call comms_bcast(gyrotropic_box_corner(1), 3)
    call comms_bcast(gyrotropic_smr_max_arg, 1)
    call comms_bcast(gyrotropic_smr_fixed_en_width, 1)
    call comms_bcast(gyrotropic_smr_index, 1)

    call comms_bcast(spinors, 1)

    call comms_bcast(shc_freq_scan, 1)
    call comms_bcast(shc_alpha, 1)
    call comms_bcast(shc_beta, 1)
    call comms_bcast(shc_gamma, 1)
    call comms_bcast(shc_bandshift, 1)
    call comms_bcast(shc_bandshift_firstband, 1)
    call comms_bcast(shc_bandshift_energyshift, 1)

    call comms_bcast(kubo_adpt_smr, 1)
    call comms_bcast(kubo_adpt_smr_fac, 1)
    call comms_bcast(kubo_adpt_smr_max, 1)
    call comms_bcast(kubo_smr_fixed_en_width, 1)
    call comms_bcast(kubo_smr_index, 1)
    call comms_bcast(kubo_eigval_max, 1)
    call comms_bcast(kubo_nfreq, 1)
    call comms_bcast(nfermi, 1)
    call comms_bcast(dos_energy_min, 1)
    call comms_bcast(dos_energy_max, 1)
    call comms_bcast(spin_kmesh_spacing, 1)
    call comms_bcast(spin_kmesh(1), 3)
    call comms_bcast(wanint_kpoint_file, 1)
    call comms_bcast(dis_win_min, 1)
    call comms_bcast(dis_win_max, 1)
    call comms_bcast(sc_eta, 1)
    call comms_bcast(sc_w_thr, 1)
    call comms_bcast(sc_phase_conv, 1)
! ----------------------------------------------
!
! New input variables in development
!
    call comms_bcast(devel_flag, len(devel_flag))
    call comms_bcast(spin_moment, 1)
    call comms_bcast(spin_axis_polar, 1)
    call comms_bcast(spin_axis_azimuth, 1)
    call comms_bcast(spin_decomp, 1)
    call comms_bcast(use_degen_pert, 1)
    call comms_bcast(degen_thr, 1)
    call comms_bcast(num_valence_bands, 1)
    call comms_bcast(dos, 1)
    call comms_bcast(dos_task, len(dos_task))
    call comms_bcast(kpath, 1)
    call comms_bcast(kpath_task, len(kpath_task))
    call comms_bcast(kpath_bands_colour, len(kpath_bands_colour))
    call comms_bcast(kslice, 1)
    call comms_bcast(kslice_task, len(kslice_task))
    call comms_bcast(kslice_corner(1), 3)
    call comms_bcast(kslice_b1(1), 3)
    call comms_bcast(kslice_b2(1), 3)
    call comms_bcast(kslice_2dkmesh(1), 2)
    call comms_bcast(kslice_fermi_lines_colour, len(kslice_fermi_lines_colour))
    call comms_bcast(transl_inv, 1)
    call comms_bcast(num_elec_per_state, 1)
    call comms_bcast(scissors_shift, 1)
    !
    ! Do these have to be broadcasted? (Plots done on root node only)
    !
!    call comms_bcast(bands_num_points,1)
!    call comms_bcast(bands_num_spec_points,1)
!    if(allocated(bands_spec_points)) &
!         call comms_bcast(bands_spec_points(1,1),3*bands_num_spec_points)
!    if(allocated(bands_label)) &
!         call comms_bcast(bands_label(:),len(bands_label(1))*bands_num_spec_points)
! ----------------------------------------------
    call comms_bcast(geninterp, 1)
    call comms_bcast(geninterp_alsofirstder, 1)
    call comms_bcast(geninterp_single_file, 1)
    ! [gp-begin, Apr 12, 2012]
    ! BoltzWann variables
    call comms_bcast(boltzwann, 1)
    call comms_bcast(boltz_calc_also_dos, 1)
    call comms_bcast(boltz_2d_dir_num, 1)
    call comms_bcast(boltz_dos_energy_step, 1)
    call comms_bcast(boltz_dos_energy_min, 1)
    call comms_bcast(boltz_dos_energy_max, 1)
    call comms_bcast(boltz_dos_adpt_smr, 1)
    call comms_bcast(boltz_dos_smr_fixed_en_width, 1)
    call comms_bcast(boltz_dos_adpt_smr_fac, 1)
    call comms_bcast(boltz_dos_adpt_smr_max, 1)
    call comms_bcast(boltz_mu_min, 1)
    call comms_bcast(boltz_mu_max, 1)
    call comms_bcast(boltz_mu_step, 1)
    call comms_bcast(boltz_temp_min, 1)
    call comms_bcast(boltz_temp_max, 1)
    call comms_bcast(boltz_temp_step, 1)
    call comms_bcast(boltz_kmesh_spacing, 1)
    call comms_bcast(boltz_kmesh(1), 3)
    call comms_bcast(boltz_tdf_energy_step, 1)
    call comms_bcast(boltz_relax_time, 1)
    call comms_bcast(boltz_TDF_smr_fixed_en_width, 1)
    call comms_bcast(boltz_TDF_smr_index, 1)
    call comms_bcast(boltz_dos_smr_index, 1)
    call comms_bcast(boltz_bandshift, 1)
    call comms_bcast(boltz_bandshift_firstband, 1)
    call comms_bcast(boltz_bandshift_energyshift, 1)
    ! [gp-end]
    call comms_bcast(use_ws_distance, 1)

    ! These variables are different from the ones above in that they are
    ! allocatable, and in param_read they were allocated on the root node only
    !
    if (.not. on_root) then
      allocate (fermi_energy_list(nfermi), stat=ierr)
      if (ierr /= 0) call io_error( &
        'Error allocating fermi_energy_read in postw90_param_dist')
      allocate (kubo_freq_list(kubo_nfreq), stat=ierr)
      if (ierr /= 0) call io_error( &
        'Error allocating kubo_freq_list in postw90_param_dist')

      allocate (gyrotropic_band_list(gyrotropic_num_bands), stat=ierr)
      if (ierr /= 0) call io_error( &
        'Error allocating gyrotropic_band_list in postw90_param_dist')

      allocate (gyrotropic_freq_list(gyrotropic_nfreq), stat=ierr)
      if (ierr /= 0) call io_error( &
        'Error allocating gyrotropic_freq_list in postw90_param_dist')

      allocate (dos_project(num_dos_project), stat=ierr)
      if (ierr /= 0) &
        call io_error('Error allocating dos_project in postw90_param_dist')
      if (.not. effective_model) then
        if (eig_found) then
          allocate (eigval(num_bands, num_kpts), stat=ierr)
          if (ierr /= 0) &
            call io_error('Error allocating eigval in postw90_param_dist')
        end if
        allocate (kpt_latt(3, num_kpts), stat=ierr)
        if (ierr /= 0) &
          call io_error('Error allocating kpt_latt in postw90_param_dist')
      endif
    end if
    if (nfermi > 0) call comms_bcast(fermi_energy_list(1), nfermi)
    call comms_bcast(gyrotropic_freq_list(1), gyrotropic_nfreq)
    call comms_bcast(gyrotropic_band_list(1), gyrotropic_num_bands)
    call comms_bcast(kubo_freq_list(1), kubo_nfreq)
    call comms_bcast(dos_project(1), num_dos_project)
    if (.not. effective_model) then
      if (eig_found) then
        call comms_bcast(eigval(1, 1), num_bands*num_kpts)
      end if
      call comms_bcast(kpt_latt(1, 1), 3*num_kpts)
    endif

    ! kmesh: only nntot,wb, and bk are needed to evaluate the WF matrix
    ! elements of the position operator in reciprocal space. For the
    ! extra matrix elements entering the orbital magnetization, also
    ! need nnlist. In principle could only broadcast those four variables

    if (.not. effective_model) then

      call comms_bcast(nnh, 1)
      call comms_bcast(nntot, 1)

      if (.not. on_root) then
        allocate (nnlist(num_kpts, nntot), stat=ierr)
        if (ierr /= 0) &
          call io_error('Error in allocating nnlist in pw90common_wanint_param_dist')
        allocate (neigh(num_kpts, nntot/2), stat=ierr)
        if (ierr /= 0) &
          call io_error('Error in allocating neigh in pw90common_wanint_param_dist')
        allocate (nncell(3, num_kpts, nntot), stat=ierr)
        if (ierr /= 0) &
          call io_error('Error in allocating nncell in pw90common_wanint_param_dist')
        allocate (wb(nntot), stat=ierr)
        if (ierr /= 0) &
          call io_error('Error in allocating wb in pw90common_wanint_param_dist')
        allocate (bka(3, nntot/2), stat=ierr)
        if (ierr /= 0) &
          call io_error('Error in allocating bka in pw90common_wanint_param_dist')
        allocate (bk(3, nntot, num_kpts), stat=ierr)
        if (ierr /= 0) &
          call io_error('Error in allocating bk in pw90common_wanint_param_dist')
      end if

      call comms_bcast(nnlist(1, 1), num_kpts*nntot)
      call comms_bcast(neigh(1, 1), num_kpts*nntot/2)
      call comms_bcast(nncell(1, 1, 1), 3*num_kpts*nntot)
      call comms_bcast(wb(1), nntot)
      call comms_bcast(bka(1, 1), 3*nntot/2)
      call comms_bcast(bk(1, 1, 1), 3*nntot*num_kpts)

    endif

  end subroutine pw90common_wanint_param_dist