plot_write_rmn Subroutine

private subroutine plot_write_rmn(pos_r, irvec, nrpts, num_wann, seedname, error, comm)

Uses

  • proc~~plot_write_rmn~~UsesGraph proc~plot_write_rmn plot_write_rmn module~w90_comms w90_comms proc~plot_write_rmn->module~w90_comms module~w90_constants w90_constants proc~plot_write_rmn->module~w90_constants module~w90_error w90_error proc~plot_write_rmn->module~w90_error module~w90_io w90_io proc~plot_write_rmn->module~w90_io module~w90_comms->module~w90_constants module~w90_error_base w90_error_base module~w90_comms->module~w90_error_base module~w90_error->module~w90_comms module~w90_error->module~w90_error_base module~w90_io->module~w90_constants

Write out the matrix elements of r

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: pos_r(:,:,:,:)
integer, intent(in) :: irvec(:,:)
integer, intent(in) :: nrpts
integer, intent(in) :: num_wann
character(len=50), intent(in) :: seedname
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Calls

proc~~plot_write_rmn~~CallsGraph proc~plot_write_rmn plot_write_rmn proc~io_date io_date proc~plot_write_rmn->proc~io_date proc~set_error_file set_error_file proc~plot_write_rmn->proc~set_error_file proc~comms_sync_error comms_sync_error proc~set_error_file->proc~comms_sync_error proc~set_base_error set_base_error proc~set_error_file->proc~set_base_error

Called by

proc~~plot_write_rmn~~CalledByGraph proc~plot_write_rmn plot_write_rmn proc~plot_main plot_main proc~plot_main->proc~plot_write_rmn proc~w90_plot w90_plot proc~w90_plot->proc~plot_main program~wannier wannier program~wannier->proc~w90_plot

Source Code

  subroutine plot_write_rmn(pos_r, irvec, nrpts, num_wann, seedname, error, comm)
    !================================================!
    !
    !! Write out the matrix elements of r
    !
    !================================================!

    use w90_comms, only: w90_comm_type
    use w90_constants, only: dp
    use w90_error, only: w90_error_type, set_error_file
    use w90_io, only: io_date

    implicit none

    ! arguments
    type(w90_error_type), allocatable, intent(out) :: error
    type(w90_comm_type), intent(in) :: comm

    integer, intent(in) :: nrpts
    integer, intent(in) :: irvec(:, :)
    integer, intent(in) :: num_wann
    complex(kind=dp), intent(in) :: pos_r(:, :, :, :)
    character(len=50), intent(in) :: seedname

    ! local variables
    integer :: loop_rpt, m, n, file_unit, ierr
    character(len=33) :: header
    character(len=9)  :: cdate, ctime

    open (newunit=file_unit, file=trim(seedname)//'_r.dat', form='formatted', status='unknown', &
          iostat=ierr)
    if (ierr /= 0) then
      call set_error_file(error, 'Error: plot_write_rmn: problem opening file '//trim(seedname)//'_r.dat', comm)
      return
    end if

    call io_date(cdate, ctime)
    header = 'written on '//cdate//' at '//ctime
    write (file_unit, *) header ! Date and time
    write (file_unit, *) num_wann
    write (file_unit, *) nrpts

    do loop_rpt = 1, nrpts
      do m = 1, num_wann
        do n = 1, num_wann
          write (file_unit, '(5I5,6F12.6)') irvec(:, loop_rpt), n, m, pos_r(n, m, loop_rpt, :)
        end do
      end do
    end do

    close (file_unit)
  end subroutine plot_write_rmn