From 142303d6bbd383e02b0ebbfa7c68285caa29b0f4 Mon Sep 17 00:00:00 2001 From: Jerome Jackson Date: Fri, 8 Oct 2021 15:32:39 +0100 Subject: [PATCH] use consistent name for communicator (comm, not w90comm) --- .gitignore | 1 + src/comms.F90 | 292 ++++++++++++++-------------- src/disentangle.F90 | 2 +- src/postw90/dos.F90 | 2 +- src/postw90/geninterp.F90 | 2 +- src/postw90/postw90_common.F90 | 344 ++++++++++++++++----------------- src/wannier_prog.F90 | 30 +-- 7 files changed, 337 insertions(+), 336 deletions(-) diff --git a/.gitignore b/.gitignore index 504bb9297..4e7318d5a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ make.inc w90chk2chk.x w90spn2spn.x libwannier.a +libwan2.a libwannier.so libwannier.dylib *~ diff --git a/src/comms.F90 b/src/comms.F90 index 2b84983de..4a23fa67b 100644 --- a/src/comms.F90 +++ b/src/comms.F90 @@ -71,7 +71,7 @@ module w90_comms #endif end type - type, public :: w90statustype + type, public :: w90stat_type #ifdef MPI08 type(mpi_status) :: stat ! f08 mpi interface #elif MPI90 @@ -147,22 +147,22 @@ module w90_comms contains ! mpi rank function for convenience - integer function mpirank(w90comm) - type(w90comm_type), intent(in) :: w90comm + integer function mpirank(comm) + type(w90comm_type), intent(in) :: comm integer :: ierr #ifdef MPI - call mpi_comm_rank(w90comm%comm, mpirank, ierr) + call mpi_comm_rank(comm%comm, mpirank, ierr) #else mpirank = 0 #endif end function ! mpi size function for convenience - integer function mpisize(w90comm) - type(w90comm_type), intent(in) :: w90comm + integer function mpisize(comm) + type(w90comm_type), intent(in) :: comm integer :: ierr #ifdef MPI - call mpi_comm_size(w90comm%comm, mpisize, ierr) + call mpi_comm_size(comm%comm, mpisize, ierr) #else mpisize = 1 #endif @@ -221,20 +221,20 @@ subroutine comms_end end subroutine comms_end - subroutine comms_barrier(w90comm) + subroutine comms_barrier(comm) !! A barrier to synchronise all nodes implicit none - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_barrier(w90comm%comm, ierr) + call mpi_barrier(comm%comm, ierr) #endif end subroutine comms_barrier - subroutine comms_bcast_int(array, size, stdout, seedname, w90comm) + subroutine comms_bcast_int(array, size, stdout, seedname, comm) !! Send integar array from root node to all nodes implicit none @@ -242,12 +242,12 @@ subroutine comms_bcast_int(array, size, stdout, seedname, w90comm) integer, intent(in) :: size integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_bcast(array, size, MPI_INTEGER, root_id, w90comm%comm, ierr) + call mpi_bcast(array, size, MPI_INTEGER, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_bcast_int', stdout, seedname) @@ -255,7 +255,7 @@ subroutine comms_bcast_int(array, size, stdout, seedname, w90comm) #endif end subroutine comms_bcast_int - subroutine comms_bcast_real(array, size, stdout, seedname, w90comm) + subroutine comms_bcast_real(array, size, stdout, seedname, comm) !! Send real array from root node to all nodes implicit none @@ -263,12 +263,12 @@ subroutine comms_bcast_real(array, size, stdout, seedname, w90comm) integer, intent(in) :: size integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_bcast(array, size, MPI_DOUBLE_PRECISION, root_id, w90comm%comm, ierr) + call mpi_bcast(array, size, MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_bcast_real', stdout, seedname) @@ -277,7 +277,7 @@ subroutine comms_bcast_real(array, size, stdout, seedname, w90comm) end subroutine comms_bcast_real - subroutine comms_bcast_logical(array, size, stdout, seedname, w90comm) + subroutine comms_bcast_logical(array, size, stdout, seedname, comm) !! Send logical array from root node to all nodes implicit none @@ -285,12 +285,12 @@ subroutine comms_bcast_logical(array, size, stdout, seedname, w90comm) integer, intent(in) :: size integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_bcast(array, size, MPI_LOGICAL, root_id, w90comm%comm, ierr) + call mpi_bcast(array, size, MPI_LOGICAL, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_bcast_logical', stdout, seedname) @@ -299,7 +299,7 @@ subroutine comms_bcast_logical(array, size, stdout, seedname, w90comm) end subroutine comms_bcast_logical - subroutine comms_bcast_char(array, size, stdout, seedname, w90comm) + subroutine comms_bcast_char(array, size, stdout, seedname, comm) !! Send character array from root node to all nodes implicit none @@ -307,12 +307,12 @@ subroutine comms_bcast_char(array, size, stdout, seedname, w90comm) integer, intent(in) :: size integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_bcast(array, size, MPI_CHARACTER, root_id, w90comm%comm, ierr) + call mpi_bcast(array, size, MPI_CHARACTER, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_bcast_char', stdout, seedname) @@ -321,7 +321,7 @@ subroutine comms_bcast_char(array, size, stdout, seedname, w90comm) end subroutine comms_bcast_char - subroutine comms_bcast_cmplx(array, size, stdout, seedname, w90comm) + subroutine comms_bcast_cmplx(array, size, stdout, seedname, comm) !! Send character array from root node to all nodes implicit none @@ -330,12 +330,12 @@ subroutine comms_bcast_cmplx(array, size, stdout, seedname, w90comm) integer, intent(in) :: size integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_bcast(array, size, MPI_DOUBLE_COMPLEX, root_id, w90comm%comm, ierr) + call mpi_bcast(array, size, MPI_DOUBLE_COMPLEX, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_bcast_cmplx', stdout, seedname) @@ -346,7 +346,7 @@ end subroutine comms_bcast_cmplx !--------- SEND ---------------- - subroutine comms_send_logical(array, size, to, stdout, seedname, w90comm) + subroutine comms_send_logical(array, size, to, stdout, seedname, comm) !! Send logical array to specified node implicit none @@ -356,12 +356,12 @@ subroutine comms_send_logical(array, size, to, stdout, seedname, w90comm) integer, intent(in) :: to integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_send(array, size, MPI_LOGICAL, to, mpi_send_tag, w90comm%comm, ierr) + call mpi_send(array, size, MPI_LOGICAL, to, mpi_send_tag, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_send_logical', stdout, seedname) @@ -370,7 +370,7 @@ subroutine comms_send_logical(array, size, to, stdout, seedname, w90comm) end subroutine comms_send_logical - subroutine comms_send_int(array, size, to, stdout, seedname, w90comm) + subroutine comms_send_int(array, size, to, stdout, seedname, comm) !! Send integer array to specified node implicit none @@ -379,12 +379,12 @@ subroutine comms_send_int(array, size, to, stdout, seedname, w90comm) integer, intent(in) :: to integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_send(array, size, MPI_INTEGER, to, mpi_send_tag, w90comm%comm, ierr) + call mpi_send(array, size, MPI_INTEGER, to, mpi_send_tag, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_send_int', stdout, seedname) @@ -393,7 +393,7 @@ subroutine comms_send_int(array, size, to, stdout, seedname, w90comm) end subroutine comms_send_int - subroutine comms_send_char(array, size, to, stdout, seedname, w90comm) + subroutine comms_send_char(array, size, to, stdout, seedname, comm) !! Send character array to specified node implicit none @@ -402,12 +402,12 @@ subroutine comms_send_char(array, size, to, stdout, seedname, w90comm) integer, intent(in) :: to integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_send(array, size, MPI_CHARACTER, to, mpi_send_tag, w90comm%comm, ierr) + call mpi_send(array, size, MPI_CHARACTER, to, mpi_send_tag, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_send_char', stdout, seedname) @@ -416,7 +416,7 @@ subroutine comms_send_char(array, size, to, stdout, seedname, w90comm) end subroutine comms_send_char - subroutine comms_send_real(array, size, to, stdout, seedname, w90comm) + subroutine comms_send_real(array, size, to, stdout, seedname, comm) !! Send real array to specified node implicit none @@ -425,12 +425,12 @@ subroutine comms_send_real(array, size, to, stdout, seedname, w90comm) integer, intent(in) :: to integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_send(array, size, MPI_DOUBLE_PRECISION, to, mpi_send_tag, w90comm%comm, ierr) + call mpi_send(array, size, MPI_DOUBLE_PRECISION, to, mpi_send_tag, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_send_real', stdout, seedname) @@ -439,7 +439,7 @@ subroutine comms_send_real(array, size, to, stdout, seedname, w90comm) end subroutine comms_send_real - subroutine comms_send_cmplx(array, size, to, stdout, seedname, w90comm) + subroutine comms_send_cmplx(array, size, to, stdout, seedname, comm) !! Send complex array to specified node implicit none @@ -448,12 +448,12 @@ subroutine comms_send_cmplx(array, size, to, stdout, seedname, w90comm) integer, intent(in) :: to integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr - call mpi_send(array, size, MPI_DOUBLE_COMPLEX, to, mpi_send_tag, w90comm%comm, ierr) + call mpi_send(array, size, MPI_DOUBLE_COMPLEX, to, mpi_send_tag, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_send_cmplx', stdout, seedname) @@ -464,7 +464,7 @@ end subroutine comms_send_cmplx !--------- RECV ---------------- - subroutine comms_recv_logical(array, size, from, stdout, seedname, w90comm) + subroutine comms_recv_logical(array, size, from, stdout, seedname, comm) !! Receive logical array from specified node implicit none @@ -473,13 +473,13 @@ subroutine comms_recv_logical(array, size, from, stdout, seedname, w90comm) integer, intent(in) :: from integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI - type(w90statustype) :: status + type(w90stat_type) :: status integer :: ierr - call mpi_recv(array, size, MPI_LOGICAL, from, mpi_send_tag, w90comm%comm, status%stat, ierr) + call mpi_recv(array, size, MPI_LOGICAL, from, mpi_send_tag, comm%comm, status%stat, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_recv_logical', stdout, seedname) @@ -488,7 +488,7 @@ subroutine comms_recv_logical(array, size, from, stdout, seedname, w90comm) end subroutine comms_recv_logical - subroutine comms_recv_int(array, size, from, stdout, seedname, w90comm) + subroutine comms_recv_int(array, size, from, stdout, seedname, comm) !! Receive integer array from specified node implicit none @@ -497,13 +497,13 @@ subroutine comms_recv_int(array, size, from, stdout, seedname, w90comm) integer, intent(in) :: from integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI - type(w90statustype) :: status + type(w90stat_type) :: status integer :: ierr - call mpi_recv(array, size, MPI_INTEGER, from, mpi_send_tag, w90comm%comm, status%stat, ierr) + call mpi_recv(array, size, MPI_INTEGER, from, mpi_send_tag, comm%comm, status%stat, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_recv_int', stdout, seedname) @@ -512,7 +512,7 @@ subroutine comms_recv_int(array, size, from, stdout, seedname, w90comm) end subroutine comms_recv_int - subroutine comms_recv_char(array, size, from, stdout, seedname, w90comm) + subroutine comms_recv_char(array, size, from, stdout, seedname, comm) !! Receive character array from specified node implicit none @@ -521,13 +521,13 @@ subroutine comms_recv_char(array, size, from, stdout, seedname, w90comm) integer, intent(in) :: from integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI - type(w90statustype) :: status + type(w90stat_type) :: status integer :: ierr - call mpi_recv(array, size, MPI_CHARACTER, from, mpi_send_tag, w90comm%comm, status%stat, ierr) + call mpi_recv(array, size, MPI_CHARACTER, from, mpi_send_tag, comm%comm, status%stat, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_recv_char', stdout, seedname) @@ -536,7 +536,7 @@ subroutine comms_recv_char(array, size, from, stdout, seedname, w90comm) end subroutine comms_recv_char - subroutine comms_recv_real(array, size, from, stdout, seedname, w90comm) + subroutine comms_recv_real(array, size, from, stdout, seedname, comm) !! Receive real array from specified node implicit none @@ -545,13 +545,13 @@ subroutine comms_recv_real(array, size, from, stdout, seedname, w90comm) integer, intent(in) :: from integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI - type(w90statustype) :: status + type(w90stat_type) :: status integer :: ierr - call mpi_recv(array, size, MPI_DOUBLE_PRECISION, from, mpi_send_tag, w90comm%comm, & + call mpi_recv(array, size, MPI_DOUBLE_PRECISION, from, mpi_send_tag, comm%comm, & status%stat, ierr) if (ierr .ne. MPI_SUCCESS) then @@ -561,7 +561,7 @@ subroutine comms_recv_real(array, size, from, stdout, seedname, w90comm) end subroutine comms_recv_real - subroutine comms_recv_cmplx(array, size, from, stdout, seedname, w90comm) + subroutine comms_recv_cmplx(array, size, from, stdout, seedname, comm) !! Receive complex array from specified node implicit none @@ -570,13 +570,13 @@ subroutine comms_recv_cmplx(array, size, from, stdout, seedname, w90comm) integer, intent(in) :: from integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI - type(w90statustype) :: status + type(w90stat_type) :: status integer :: ierr - call mpi_recv(array, size, MPI_DOUBLE_COMPLEX, from, mpi_send_tag, w90comm%comm, & + call mpi_recv(array, size, MPI_DOUBLE_COMPLEX, from, mpi_send_tag, comm%comm, & status%stat, ierr) if (ierr .ne. MPI_SUCCESS) then @@ -586,21 +586,21 @@ subroutine comms_recv_cmplx(array, size, from, stdout, seedname, w90comm) end subroutine comms_recv_cmplx - subroutine comms_reduce_int(array, size, op, stdout, seedname, w90comm) + subroutine comms_reduce_int(array, size, op, stdout, seedname, comm) !! Reduce integer data to root node implicit none integer, intent(inout) :: array integer, intent(in) :: size character(len=*), intent(in) :: op - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm integer, intent(in) :: stdout character(len=50), intent(in) :: seedname #ifdef MPI integer :: ierr integer :: rank - rank = mpirank(w90comm) + rank = mpirank(comm) ! note, JJ 23/2/2021 ! previously this routine alloc'd/used/dealloc'd a temp array @@ -614,17 +614,17 @@ subroutine comms_reduce_int(array, size, op, stdout, seedname, w90comm) select case (op) case ('SUM') if (rank == root_id) then - call mpi_reduce(MPI_IN_PLACE, array, size, MPI_INTEGER, MPI_SUM, root_id, w90comm%comm, & + call mpi_reduce(MPI_IN_PLACE, array, size, MPI_INTEGER, MPI_SUM, root_id, comm%comm, & ierr) else - call mpi_reduce(array, array, size, MPI_INTEGER, MPI_SUM, root_id, w90comm%comm, ierr) + call mpi_reduce(array, array, size, MPI_INTEGER, MPI_SUM, root_id, comm%comm, ierr) endif case ('PRD') if (rank == root_id) then - call mpi_reduce(MPI_IN_PLACE, array, size, MPI_INTEGER, MPI_PROD, root_id, w90comm%comm, & + call mpi_reduce(MPI_IN_PLACE, array, size, MPI_INTEGER, MPI_PROD, root_id, comm%comm, & ierr) else - call mpi_reduce(array, array, size, MPI_INTEGER, MPI_PROD, root_id, w90comm%comm, ierr) + call mpi_reduce(array, array, size, MPI_INTEGER, MPI_PROD, root_id, comm%comm, ierr) endif case default call io_error('Unknown operation in comms_reduce_int', stdout, seedname) @@ -637,7 +637,7 @@ subroutine comms_reduce_int(array, size, op, stdout, seedname, w90comm) end subroutine comms_reduce_int - subroutine comms_reduce_real(array, size, op, stdout, seedname, w90comm) + subroutine comms_reduce_real(array, size, op, stdout, seedname, comm) !! Reduce real data to root node implicit none @@ -645,47 +645,47 @@ subroutine comms_reduce_real(array, size, op, stdout, seedname, w90comm) real(kind=dp), intent(inout) :: array integer, intent(in) :: size character(len=*), intent(in) :: op - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm integer, intent(in) :: stdout character(len=50), intent(in) :: seedname #ifdef MPI integer :: ierr integer :: rank - rank = mpirank(w90comm) + rank = mpirank(comm) select case (op) case ('SUM') if (rank == root_id) then call mpi_reduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_SUM, root_id, & - w90comm%comm, ierr) + comm%comm, ierr) else - call mpi_reduce(array, array, size, MPI_DOUBLE_PRECISION, MPI_SUM, root_id, w90comm%comm, & + call mpi_reduce(array, array, size, MPI_DOUBLE_PRECISION, MPI_SUM, root_id, comm%comm, & ierr) endif case ('PRD') if (rank == root_id) then call mpi_reduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_PROD, root_id, & - w90comm%comm, ierr) + comm%comm, ierr) else - call mpi_reduce(array, array, size, MPI_DOUBLE_PRECISION, MPI_PROD, root_id, w90comm%comm, & + call mpi_reduce(array, array, size, MPI_DOUBLE_PRECISION, MPI_PROD, root_id, comm%comm, & ierr) endif case ('MIN') if (rank == root_id) then call mpi_reduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_MIN, root_id, & - w90comm%comm, ierr) + comm%comm, ierr) else - call mpi_reduce(array, array, size, MPI_DOUBLE_PRECISION, MPI_MIN, root_id, w90comm%comm, & + call mpi_reduce(array, array, size, MPI_DOUBLE_PRECISION, MPI_MIN, root_id, comm%comm, & ierr) endif case ('MAX') if (rank == root_id) then call mpi_reduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_MAX, root_id, & - w90comm%comm, ierr) + comm%comm, ierr) else - call mpi_reduce(array, array, size, MPI_DOUBLE_PRECISION, MPI_MAX, root_id, w90comm%comm, & + call mpi_reduce(array, array, size, MPI_DOUBLE_PRECISION, MPI_MAX, root_id, comm%comm, & ierr) endif case default @@ -700,7 +700,7 @@ subroutine comms_reduce_real(array, size, op, stdout, seedname, w90comm) end subroutine comms_reduce_real - subroutine comms_reduce_cmplx(array, size, op, stdout, seedname, w90comm) + subroutine comms_reduce_cmplx(array, size, op, stdout, seedname, comm) !! Reduce complex data to root node implicit none @@ -708,31 +708,31 @@ subroutine comms_reduce_cmplx(array, size, op, stdout, seedname, w90comm) complex(kind=dp), intent(inout) :: array integer, intent(in) :: size character(len=*), intent(in) :: op - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm integer, intent(in) :: stdout character(len=50), intent(in) :: seedname #ifdef MPI integer :: ierr integer :: rank - rank = mpirank(w90comm) + rank = mpirank(comm) select case (op) case ('SUM') if (rank == root_id) then call mpi_reduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_COMPLEX, MPI_SUM, root_id, & - w90comm%comm, ierr) + comm%comm, ierr) else - call mpi_reduce(array, array, size, MPI_DOUBLE_COMPLEX, MPI_SUM, root_id, w90comm%comm, & + call mpi_reduce(array, array, size, MPI_DOUBLE_COMPLEX, MPI_SUM, root_id, comm%comm, & ierr) end if case ('PRD') if (rank == root_id) then call mpi_reduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_COMPLEX, MPI_PROD, root_id, & - w90comm%comm, ierr) + comm%comm, ierr) else - call mpi_reduce(array, array, size, MPI_DOUBLE_COMPLEX, MPI_PROD, root_id, w90comm%comm, & + call mpi_reduce(array, array, size, MPI_DOUBLE_COMPLEX, MPI_PROD, root_id, comm%comm, & ierr) end if case default @@ -748,7 +748,7 @@ subroutine comms_reduce_cmplx(array, size, op, stdout, seedname, w90comm) end subroutine comms_reduce_cmplx - subroutine comms_allreduce_real(array, size, op, stdout, seedname, w90comm) + subroutine comms_allreduce_real(array, size, op, stdout, seedname, comm) !! Reduce real data to all nodes implicit none @@ -758,7 +758,7 @@ subroutine comms_allreduce_real(array, size, op, stdout, seedname, w90comm) character(len=*), intent(in) :: op integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr @@ -766,16 +766,16 @@ subroutine comms_allreduce_real(array, size, op, stdout, seedname, w90comm) select case (op) case ('SUM') - call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_SUM, w90comm%comm, & + call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_SUM, comm%comm, & ierr) case ('PRD') - call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_PROD, w90comm%comm, & + call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_PROD, comm%comm, & ierr) case ('MIN') - call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_MIN, w90comm%comm, & + call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_MIN, comm%comm, & ierr) case ('MAX') - call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_MAX, w90comm%comm, & + call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_PRECISION, MPI_MAX, comm%comm, & ierr) case default call io_error('Unknown operation in comms_allreduce_real', stdout, seedname) @@ -789,7 +789,7 @@ subroutine comms_allreduce_real(array, size, op, stdout, seedname, w90comm) end subroutine comms_allreduce_real - subroutine comms_allreduce_cmplx(array, size, op, stdout, seedname, w90comm) + subroutine comms_allreduce_cmplx(array, size, op, stdout, seedname, comm) !! Reduce complex data to all nodes implicit none @@ -798,7 +798,7 @@ subroutine comms_allreduce_cmplx(array, size, op, stdout, seedname, w90comm) character(len=*), intent(in) :: op integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr @@ -806,10 +806,10 @@ subroutine comms_allreduce_cmplx(array, size, op, stdout, seedname, w90comm) select case (op) case ('SUM') - call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_COMPLEX, MPI_SUM, w90comm%comm, & + call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_COMPLEX, MPI_SUM, comm%comm, & ierr) case ('PRD') - call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_COMPLEX, MPI_PROD, w90comm%comm, & + call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_COMPLEX, MPI_PROD, comm%comm, & ierr) case default call io_error('Unknown operation in comms_allreduce_cmplx', stdout, seedname) @@ -824,7 +824,7 @@ subroutine comms_allreduce_cmplx(array, size, op, stdout, seedname, w90comm) end subroutine comms_allreduce_cmplx subroutine comms_gatherv_real_1(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather real data to root node (for arrays of rank 1) implicit none @@ -835,13 +835,13 @@ subroutine comms_gatherv_real_1(array, localcount, rootglobalarray, counts, disp integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_PRECISION, rootglobalarray, counts, & - displs, MPI_DOUBLE_PRECISION, root_id, w90comm%comm, ierr) + displs, MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_real_1', stdout, seedname) @@ -854,7 +854,7 @@ subroutine comms_gatherv_real_1(array, localcount, rootglobalarray, counts, disp end subroutine comms_gatherv_real_1 subroutine comms_gatherv_real_2(array, localcount, rootglobalarray, counts, displs, & - stdout, seedname, w90comm) + stdout, seedname, comm) !! Gather real data to root node (for arrays of rank 2) implicit none @@ -865,13 +865,13 @@ subroutine comms_gatherv_real_2(array, localcount, rootglobalarray, counts, disp integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_PRECISION, rootglobalarray, counts, & - displs, MPI_DOUBLE_PRECISION, root_id, w90comm%comm, ierr) + displs, MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_real_2', stdout, seedname) @@ -884,7 +884,7 @@ subroutine comms_gatherv_real_2(array, localcount, rootglobalarray, counts, disp end subroutine comms_gatherv_real_2 subroutine comms_gatherv_real_3(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather real data to root node (for arrays of rank 3) implicit none @@ -895,13 +895,13 @@ subroutine comms_gatherv_real_3(array, localcount, rootglobalarray, counts, disp integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_PRECISION, rootglobalarray, counts, & - displs, MPI_DOUBLE_PRECISION, root_id, w90comm%comm, ierr) + displs, MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_real_3', stdout, seedname) @@ -915,7 +915,7 @@ subroutine comms_gatherv_real_3(array, localcount, rootglobalarray, counts, disp end subroutine comms_gatherv_real_3 subroutine comms_gatherv_real_2_3(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather real data to root node (for arrays of rank 2 and 3, respectively) implicit none @@ -926,13 +926,13 @@ subroutine comms_gatherv_real_2_3(array, localcount, rootglobalarray, counts, di integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_PRECISION, rootglobalarray, counts, displs, & - MPI_DOUBLE_PRECISION, root_id, w90comm%comm, ierr) + MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_real_2_3', stdout, seedname) @@ -952,7 +952,7 @@ end subroutine comms_gatherv_real_2_3 ! function comms_array_split subroutine comms_gatherv_cmplx_1(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather complex data to root node (for arrays of rank 1) implicit none @@ -963,13 +963,13 @@ subroutine comms_gatherv_cmplx_1(array, localcount, rootglobalarray, counts, dis integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_COMPLEX, rootglobalarray, counts, displs, & - MPI_DOUBLE_COMPLEX, root_id, w90comm%comm, ierr) + MPI_DOUBLE_COMPLEX, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_cmplx_1', stdout, seedname) @@ -983,7 +983,7 @@ subroutine comms_gatherv_cmplx_1(array, localcount, rootglobalarray, counts, dis end subroutine comms_gatherv_cmplx_1 subroutine comms_gatherv_cmplx_2(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather complex data to root node (for arrays of rank 2) implicit none @@ -994,13 +994,13 @@ subroutine comms_gatherv_cmplx_2(array, localcount, rootglobalarray, counts, dis integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_COMPLEX, rootglobalarray, counts, displs, & - MPI_DOUBLE_COMPLEX, root_id, w90comm%comm, ierr) + MPI_DOUBLE_COMPLEX, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_cmplx_2', stdout, seedname) @@ -1014,7 +1014,7 @@ subroutine comms_gatherv_cmplx_2(array, localcount, rootglobalarray, counts, dis end subroutine comms_gatherv_cmplx_2 subroutine comms_gatherv_cmplx_3(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather complex data to root node (for arrays of rank 3) implicit none @@ -1025,13 +1025,13 @@ subroutine comms_gatherv_cmplx_3(array, localcount, rootglobalarray, counts, dis integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_COMPLEX, rootglobalarray, counts, displs, & - MPI_DOUBLE_COMPLEX, root_id, w90comm%comm, ierr) + MPI_DOUBLE_COMPLEX, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_cmplx_3', stdout, seedname) @@ -1045,7 +1045,7 @@ subroutine comms_gatherv_cmplx_3(array, localcount, rootglobalarray, counts, dis end subroutine comms_gatherv_cmplx_3 subroutine comms_gatherv_cmplx_3_4(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather complex data to root node (for arrays of rank 3 and 4, respectively) implicit none @@ -1056,13 +1056,13 @@ subroutine comms_gatherv_cmplx_3_4(array, localcount, rootglobalarray, counts, d integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_COMPLEX, rootglobalarray, counts, displs, & - MPI_DOUBLE_COMPLEX, root_id, w90comm%comm, ierr) + MPI_DOUBLE_COMPLEX, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_cmplx_3_4', stdout, seedname) @@ -1076,7 +1076,7 @@ subroutine comms_gatherv_cmplx_3_4(array, localcount, rootglobalarray, counts, d end subroutine comms_gatherv_cmplx_3_4 subroutine comms_gatherv_cmplx_4(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather complex data to root node (for arrays of rank 4) implicit none @@ -1087,13 +1087,13 @@ subroutine comms_gatherv_cmplx_4(array, localcount, rootglobalarray, counts, dis integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_DOUBLE_COMPLEX, rootglobalarray, counts, displs, & - MPI_DOUBLE_COMPLEX, root_id, w90comm%comm, ierr) + MPI_DOUBLE_COMPLEX, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_cmplx_4', stdout, seedname) @@ -1107,7 +1107,7 @@ subroutine comms_gatherv_cmplx_4(array, localcount, rootglobalarray, counts, dis end subroutine comms_gatherv_cmplx_4 subroutine comms_gatherv_logical(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Gather real data to root node implicit none @@ -1118,13 +1118,13 @@ subroutine comms_gatherv_logical(array, localcount, rootglobalarray, counts, dis integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_gatherv(array, localcount, MPI_LOGICAL, rootglobalarray, counts, displs, & - MPI_LOGICAL, root_id, w90comm%comm, ierr) + MPI_LOGICAL, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_gatherv_logical', stdout, seedname) @@ -1136,7 +1136,7 @@ subroutine comms_gatherv_logical(array, localcount, rootglobalarray, counts, dis end subroutine comms_gatherv_logical subroutine comms_scatterv_real_1(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Scatter real data from root node (array of rank 1) implicit none @@ -1147,13 +1147,13 @@ subroutine comms_scatterv_real_1(array, localcount, rootglobalarray, counts, dis integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_scatterv(rootglobalarray, counts, displs, MPI_DOUBLE_PRECISION, array, localcount, & - MPI_DOUBLE_PRECISION, root_id, w90comm%comm, ierr) + MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_scatterv_real_1', stdout, seedname) @@ -1167,7 +1167,7 @@ subroutine comms_scatterv_real_1(array, localcount, rootglobalarray, counts, dis end subroutine comms_scatterv_real_1 subroutine comms_scatterv_real_2(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Scatter real data from root node (array of rank 2) implicit none @@ -1178,13 +1178,13 @@ subroutine comms_scatterv_real_2(array, localcount, rootglobalarray, counts, dis integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_scatterv(rootglobalarray, counts, displs, MPI_DOUBLE_PRECISION, array, localcount, & - MPI_DOUBLE_PRECISION, root_id, w90comm%comm, ierr) + MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_scatterv_real_2', stdout, seedname) @@ -1198,7 +1198,7 @@ subroutine comms_scatterv_real_2(array, localcount, rootglobalarray, counts, dis end subroutine comms_scatterv_real_2 subroutine comms_scatterv_real_3(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Scatter real data from root node (array of rank 3) implicit none @@ -1209,13 +1209,13 @@ subroutine comms_scatterv_real_3(array, localcount, rootglobalarray, counts, dis integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_scatterv(rootglobalarray, counts, displs, MPI_DOUBLE_PRECISION, array, localcount, & - MPI_DOUBLE_PRECISION, root_id, w90comm%comm, ierr) + MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_scatterv_real_3', stdout, seedname) @@ -1228,7 +1228,7 @@ subroutine comms_scatterv_real_3(array, localcount, rootglobalarray, counts, dis end subroutine comms_scatterv_real_3 - subroutine comms_scatterv_cmplx_4(array, localcount, rootglobalarray, counts, displs, stdout, seedname, w90comm) + subroutine comms_scatterv_cmplx_4(array, localcount, rootglobalarray, counts, displs, stdout, seedname, comm) !! Scatter complex data from root node (array of rank 4) implicit none @@ -1239,13 +1239,13 @@ subroutine comms_scatterv_cmplx_4(array, localcount, rootglobalarray, counts, di integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_scatterv(rootglobalarray, counts, displs, MPI_DOUBLE_COMPLEX, array, localcount, & - MPI_DOUBLE_COMPLEX, root_id, w90comm%comm, ierr) + MPI_DOUBLE_COMPLEX, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_scatterv_cmplx_4', stdout, seedname) @@ -1259,7 +1259,7 @@ subroutine comms_scatterv_cmplx_4(array, localcount, rootglobalarray, counts, di end subroutine comms_scatterv_cmplx_4 subroutine comms_scatterv_int_1(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Scatter integer data from root node (array of rank 1) implicit none @@ -1270,13 +1270,13 @@ subroutine comms_scatterv_int_1(array, localcount, rootglobalarray, counts, disp integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_scatterv(rootglobalarray, counts, displs, MPI_INTEGER, array, localcount, & - MPI_INTEGER, root_id, w90comm%comm, ierr) + MPI_INTEGER, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_scatterv_real', stdout, seedname) @@ -1290,7 +1290,7 @@ subroutine comms_scatterv_int_1(array, localcount, rootglobalarray, counts, disp end subroutine comms_scatterv_int_1 subroutine comms_scatterv_int_2(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Scatter integer data from root node (array of rank 2) implicit none @@ -1302,13 +1302,13 @@ subroutine comms_scatterv_int_2(array, localcount, rootglobalarray, counts, disp integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_scatterv(rootglobalarray, counts, displs, MPI_INTEGER, array, localcount, & - MPI_INTEGER, root_id, w90comm%comm, ierr) + MPI_INTEGER, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_scatterv_int_2', stdout, seedname) @@ -1322,7 +1322,7 @@ subroutine comms_scatterv_int_2(array, localcount, rootglobalarray, counts, disp end subroutine comms_scatterv_int_2 subroutine comms_scatterv_int_3(array, localcount, rootglobalarray, counts, displs, stdout, & - seedname, w90comm) + seedname, comm) !! Scatter integer data from root node (array of rank 3) implicit none @@ -1334,13 +1334,13 @@ subroutine comms_scatterv_int_3(array, localcount, rootglobalarray, counts, disp integer, intent(in) :: displs(0:) integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: w90comm + type(w90comm_type), intent(in) :: comm #ifdef MPI integer :: ierr call mpi_scatterv(rootglobalarray, counts, displs, MPI_INTEGER, array, localcount, & - MPI_INTEGER, root_id, w90comm%comm, ierr) + MPI_INTEGER, root_id, comm%comm, ierr) if (ierr .ne. MPI_SUCCESS) then call io_error('Error in comms_scatterv_int_3', stdout, seedname) diff --git a/src/disentangle.F90 b/src/disentangle.F90 index f116feca3..f4ac3116f 100644 --- a/src/disentangle.F90 +++ b/src/disentangle.F90 @@ -72,7 +72,7 @@ subroutine dis_main(dis_control, dis_spheres, dis_manifold, kmesh_info, kpt_latt real(kind=dp), intent(in) :: kpt_latt(:, :) type(print_output_type), intent(in) :: print_output type(sitesym_data_type), intent(inout) :: sym - type(w90comm_type), intent(in) :: comm + type(w90comm_type), intent(in) :: comm character(len=50), intent(in) :: seedname diff --git a/src/postw90/dos.F90 b/src/postw90/dos.F90 index 7951cb980..20ff4cfb0 100644 --- a/src/postw90/dos.F90 +++ b/src/postw90/dos.F90 @@ -77,7 +77,7 @@ subroutine dos_main(pw90_berry, dis_manifold, dos_data, kpoint_dist, kpt_latt, p type(wannier_data_type), intent(in) :: wannier_data type(ws_distance_type), intent(inout) :: ws_distance type(wigner_seitz_type), intent(inout) :: wigner_seitz - type(w90comm_type), intent(in) :: comm + type(w90comm_type), intent(in) :: comm complex(kind=dp), allocatable, intent(inout) :: HH_R(:, :, :) complex(kind=dp), allocatable, intent(inout) :: SS_R(:, :, :, :) diff --git a/src/postw90/geninterp.F90 b/src/postw90/geninterp.F90 index 4e51d4ba2..c78a87e16 100644 --- a/src/postw90/geninterp.F90 +++ b/src/postw90/geninterp.F90 @@ -95,7 +95,7 @@ subroutine geninterp_main(dis_manifold, pw90_geninterp, kpt_latt, pw90_band_deri type(wannier_data_type), intent(in) :: wannier_data type(ws_distance_type), intent(inout) :: ws_distance type(wigner_seitz_type), intent(inout) :: wigner_seitz - type(w90comm_type), intent(in) :: comm + type(w90comm_type), intent(in) :: comm complex(kind=dp), allocatable, intent(inout) :: HH_R(:, :, :) complex(kind=dp), intent(in) :: v_matrix(:, :, :), u_matrix(:, :, :) diff --git a/src/postw90/postw90_common.F90 b/src/postw90/postw90_common.F90 index 54b8c5829..d86f81101 100644 --- a/src/postw90/postw90_common.F90 +++ b/src/postw90/postw90_common.F90 @@ -83,7 +83,7 @@ module w90_postw90_common ! Public procedures have names starting with wanint_ subroutine pw90common_wanint_setup(num_wann, verbose, real_lattice, mp_grid, effective_model, & - ws_vec, stdout, seedname, world) + ws_vec, stdout, seedname, comm) !! Setup data ready for interpolation use w90_constants, only: dp !, cmplx_0 use w90_io, only: io_error, io_file_unit @@ -99,12 +99,12 @@ subroutine pw90common_wanint_setup(num_wann, verbose, real_lattice, mp_grid, eff integer, intent(in) :: stdout logical, intent(in) :: effective_model character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: world + type(w90comm_type), intent(in) :: comm integer :: ierr, ir, file_unit, num_wann_loc logical :: on_root = .false. - if (mpirank(world) == 0) on_root = .true. + if (mpirank(comm) == 0) on_root = .true. ! Find nrpts, the number of points in the Wigner-Seitz cell ! @@ -122,9 +122,9 @@ subroutine pw90common_wanint_setup(num_wann, verbose, real_lattice, mp_grid, eff read (file_unit, *) ws_vec%nrpts close (file_unit) endif - call comms_bcast(ws_vec%nrpts, 1, stdout, seedname, world) + call comms_bcast(ws_vec%nrpts, 1, stdout, seedname, comm) else - call wigner_seitz(verbose, real_lattice, mp_grid, ws_vec, stdout, seedname, .true., world) + call wigner_seitz(verbose, real_lattice, mp_grid, ws_vec, stdout, seedname, .true., comm) endif ! Now can allocate several arrays @@ -150,7 +150,7 @@ subroutine pw90common_wanint_setup(num_wann, verbose, real_lattice, mp_grid, eff ! where the Wannier functions live ! call wigner_seitz(verbose, real_lattice, mp_grid, ws_vec, stdout, seedname, & - .false., world) + .false., comm) ! ! Convert from reduced to Cartesian coordinates ! @@ -168,7 +168,7 @@ subroutine pw90common_wanint_setup(num_wann, verbose, real_lattice, mp_grid, eff end subroutine pw90common_wanint_setup !===========================================================! - subroutine pw90common_wanint_get_kpoint_file(kpoints, stdout, seedname, world) + subroutine pw90common_wanint_get_kpoint_file(kpoints, stdout, seedname, comm) !===========================================================! ! ! !! read kpoints from kpoint.dat and distribute @@ -183,15 +183,15 @@ subroutine pw90common_wanint_get_kpoint_file(kpoints, stdout, seedname, world) type(kpoint_dist_type), intent(inout) :: kpoints integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: world + type(w90comm_type), intent(in) :: comm ! local variables integer :: loop_nodes, loop_kpt, i, ierr, my_node_id, num_nodes, k_unit real(kind=dp) :: sum logical :: on_root = .false. - my_node_id = mpirank(world) - num_nodes = mpisize(world) + my_node_id = mpirank(comm) + num_nodes = mpisize(comm) if (my_node_id == 0) on_root = .true. @@ -200,7 +200,7 @@ subroutine pw90common_wanint_get_kpoint_file(kpoints, stdout, seedname, world) open (unit=k_unit, file='kpoint.dat', status='old', form='formatted', err=106) read (k_unit, *) kpoints%num_int_kpts end if - call comms_bcast(kpoints%num_int_kpts, 1, stdout, seedname, world) + call comms_bcast(kpoints%num_int_kpts, 1, stdout, seedname, comm) allocate (kpoints%num_int_kpts_on_node(0:num_nodes - 1)) kpoints%num_int_kpts_on_node(:) = kpoints%num_int_kpts/num_nodes @@ -225,9 +225,9 @@ subroutine pw90common_wanint_get_kpoint_file(kpoints, stdout, seedname, world) end do call comms_send(kpoints%int_kpts(1, 1), 3*kpoints%num_int_kpts_on_node(loop_nodes), & - loop_nodes, stdout, seedname, world) + loop_nodes, stdout, seedname, comm) call comms_send(kpoints%weight(1), kpoints%num_int_kpts_on_node(loop_nodes), loop_nodes, & - stdout, seedname, world) + stdout, seedname, comm) end do do loop_kpt = 1, kpoints%num_int_kpts_on_node(0) read (k_unit, *) (kpoints%int_kpts(i, loop_kpt), i=1, 3), kpoints%weight(loop_kpt) @@ -238,9 +238,9 @@ subroutine pw90common_wanint_get_kpoint_file(kpoints, stdout, seedname, world) if (.not. on_root) then call comms_recv(kpoints%int_kpts(1, 1), 3*kpoints%num_int_kpts_on_node(my_node_id), 0, & - stdout, seedname, world) + stdout, seedname, comm) call comms_recv(kpoints%weight(1), kpoints%num_int_kpts_on_node(my_node_id), 0, & - stdout, seedname, world) + stdout, seedname, comm) end if return @@ -256,7 +256,7 @@ subroutine pw90common_wanint_param_dist(verbose, rs_region, kmesh_info, kpt_latt pw90_calcs, scissors_shift, effective_model, pw90_spin, & pw90_ham, kpath, kslice, dos_data, berry, spin_hall, & gyrotropic, geninterp, boltz, eig_found, stdout, & - seedname, world) + seedname, comm) !===========================================================! ! ! !! distribute the parameters across processors @@ -303,137 +303,137 @@ subroutine pw90common_wanint_param_dist(verbose, rs_region, kmesh_info, kpt_latt logical, intent(inout) :: effective_model integer, intent(in) :: stdout character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: world + type(w90comm_type), intent(in) :: comm integer :: ierr integer :: iprintroot integer :: fermi_n logical :: on_root = .false. - if (mpirank(world) == 0) on_root = .true. + if (mpirank(comm) == 0) on_root = .true. - call comms_bcast(effective_model, 1, stdout, seedname, world) - call comms_bcast(eig_found, 1, stdout, seedname, world) + call comms_bcast(effective_model, 1, stdout, seedname, comm) + call comms_bcast(eig_found, 1, stdout, seedname, comm) if (.not. effective_model) then - call comms_bcast(mp_grid(1), 3, stdout, seedname, world) - call comms_bcast(num_kpts, 1, stdout, seedname, world) - call comms_bcast(num_bands, 1, stdout, seedname, world) + call comms_bcast(mp_grid(1), 3, stdout, seedname, comm) + call comms_bcast(num_kpts, 1, stdout, seedname, comm) + call comms_bcast(num_bands, 1, stdout, seedname, comm) endif - call comms_bcast(num_wann, 1, stdout, seedname, world) - call comms_bcast(verbose%timing_level, 1, stdout, seedname, world) + call comms_bcast(num_wann, 1, stdout, seedname, comm) + call comms_bcast(verbose%timing_level, 1, stdout, seedname, comm) !______________________________________ !JJ fixme maybe? not so pretty solution to setting iprint to zero on non-root processes iprintroot = verbose%iprint verbose%iprint = 0 - call comms_bcast(verbose%iprint, 1, stdout, seedname, world) + call comms_bcast(verbose%iprint, 1, stdout, seedname, comm) if (on_root) verbose%iprint = iprintroot !______________________________________ - call comms_bcast(rs_region%ws_distance_tol, 1, stdout, seedname, world) - call comms_bcast(rs_region%ws_search_size(1), 3, stdout, seedname, world) + call comms_bcast(rs_region%ws_distance_tol, 1, stdout, seedname, comm) + call comms_bcast(rs_region%ws_search_size(1), 3, stdout, seedname, comm) ! 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, stdout, seedname, world) - !call comms_bcast(recip_lattice(1, 1), 9, stdout, seedname, world) + call comms_bcast(real_lattice(1, 1), 9, stdout, seedname, comm) + !call comms_bcast(recip_lattice(1, 1), 9, stdout, seedname, comm) !call comms_bcast(real_metric(1, 1), 9) !call comms_bcast(recip_metric(1, 1), 9) - !call comms_bcast(cell_volume, 1, stdout, seedname, world) - call comms_bcast(dos_data%energy_step, 1, stdout, seedname, world) - call comms_bcast(dos_data%smearing%use_adaptive, 1, stdout, seedname, world) - call comms_bcast(dos_data%smearing%type_index, 1, stdout, seedname, world) - call comms_bcast(dos_data%kmesh%spacing, 1, stdout, seedname, world) - call comms_bcast(dos_data%kmesh%mesh(1), 3, stdout, seedname, world) - call comms_bcast(dos_data%smearing%adaptive_max_width, 1, stdout, seedname, world) - call comms_bcast(dos_data%smearing%fixed_width, 1, stdout, seedname, world) - call comms_bcast(dos_data%smearing%adaptive_prefactor, 1, stdout, seedname, world) - call comms_bcast(dos_data%num_project, 1, stdout, seedname, world) - - call comms_bcast(pw90_calcs%berry, 1, stdout, seedname, world) - call comms_bcast(berry%task, len(berry%task), stdout, seedname, world) - call comms_bcast(berry%kmesh%spacing, 1, stdout, seedname, world) - call comms_bcast(berry%kmesh%mesh(1), 3, stdout, seedname, world) - call comms_bcast(berry%curv_adpt_kmesh, 1, stdout, seedname, world) - call comms_bcast(berry%curv_adpt_kmesh_thresh, 1, stdout, seedname, world) - call comms_bcast(berry%curv_unit, len(berry%curv_unit), stdout, seedname, world) + !call comms_bcast(cell_volume, 1, stdout, seedname, comm) + call comms_bcast(dos_data%energy_step, 1, stdout, seedname, comm) + call comms_bcast(dos_data%smearing%use_adaptive, 1, stdout, seedname, comm) + call comms_bcast(dos_data%smearing%type_index, 1, stdout, seedname, comm) + call comms_bcast(dos_data%kmesh%spacing, 1, stdout, seedname, comm) + call comms_bcast(dos_data%kmesh%mesh(1), 3, stdout, seedname, comm) + call comms_bcast(dos_data%smearing%adaptive_max_width, 1, stdout, seedname, comm) + call comms_bcast(dos_data%smearing%fixed_width, 1, stdout, seedname, comm) + call comms_bcast(dos_data%smearing%adaptive_prefactor, 1, stdout, seedname, comm) + call comms_bcast(dos_data%num_project, 1, stdout, seedname, comm) + + call comms_bcast(pw90_calcs%berry, 1, stdout, seedname, comm) + call comms_bcast(berry%task, len(berry%task), stdout, seedname, comm) + call comms_bcast(berry%kmesh%spacing, 1, stdout, seedname, comm) + call comms_bcast(berry%kmesh%mesh(1), 3, stdout, seedname, comm) + call comms_bcast(berry%curv_adpt_kmesh, 1, stdout, seedname, comm) + call comms_bcast(berry%curv_adpt_kmesh_thresh, 1, stdout, seedname, comm) + call comms_bcast(berry%curv_unit, len(berry%curv_unit), stdout, seedname, comm) ! Tsirkin - call comms_bcast(pw90_calcs%gyrotropic, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%task, len(gyrotropic%task), stdout, seedname, world) - call comms_bcast(gyrotropic%kmesh%spacing, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%kmesh%mesh(1), 3, stdout, seedname, world) - call comms_bcast(gyrotropic%eigval_max, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%nfreq, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%degen_thresh, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%num_bands, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%box(1, 1), 9, stdout, seedname, world) - call comms_bcast(gyrotropic%box_corner(1), 3, stdout, seedname, world) - call comms_bcast(gyrotropic%smearing%use_adaptive, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%smearing%fixed_width, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%smearing%type_index, 1, stdout, seedname, world) - call comms_bcast(gyrotropic%smearing%max_arg, 1, stdout, seedname, world) - - call comms_bcast(system%spinors, 1, stdout, seedname, world) - - call comms_bcast(spin_hall%freq_scan, 1, stdout, seedname, world) - call comms_bcast(spin_hall%alpha, 1, stdout, seedname, world) - call comms_bcast(spin_hall%beta, 1, stdout, seedname, world) - call comms_bcast(spin_hall%gamma, 1, stdout, seedname, world) - call comms_bcast(spin_hall%bandshift, 1, stdout, seedname, world) - call comms_bcast(spin_hall%bandshift_firstband, 1, stdout, seedname, world) - call comms_bcast(spin_hall%bandshift_energyshift, 1, stdout, seedname, world) - - call comms_bcast(berry%kubo_smearing%use_adaptive, 1, stdout, seedname, world) - call comms_bcast(berry%kubo_smearing%adaptive_prefactor, 1, stdout, seedname, world) - call comms_bcast(berry%kubo_smearing%adaptive_max_width, 1, stdout, seedname, world) - call comms_bcast(berry%kubo_smearing%fixed_width, 1, stdout, seedname, world) - call comms_bcast(berry%kubo_smearing%type_index, 1, stdout, seedname, world) - call comms_bcast(berry%kubo_eigval_max, 1, stdout, seedname, world) - call comms_bcast(berry%kubo_nfreq, 1, stdout, seedname, world) + call comms_bcast(pw90_calcs%gyrotropic, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%task, len(gyrotropic%task), stdout, seedname, comm) + call comms_bcast(gyrotropic%kmesh%spacing, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%kmesh%mesh(1), 3, stdout, seedname, comm) + call comms_bcast(gyrotropic%eigval_max, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%nfreq, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%degen_thresh, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%num_bands, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%box(1, 1), 9, stdout, seedname, comm) + call comms_bcast(gyrotropic%box_corner(1), 3, stdout, seedname, comm) + call comms_bcast(gyrotropic%smearing%use_adaptive, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%smearing%fixed_width, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%smearing%type_index, 1, stdout, seedname, comm) + call comms_bcast(gyrotropic%smearing%max_arg, 1, stdout, seedname, comm) + + call comms_bcast(system%spinors, 1, stdout, seedname, comm) + + call comms_bcast(spin_hall%freq_scan, 1, stdout, seedname, comm) + call comms_bcast(spin_hall%alpha, 1, stdout, seedname, comm) + call comms_bcast(spin_hall%beta, 1, stdout, seedname, comm) + call comms_bcast(spin_hall%gamma, 1, stdout, seedname, comm) + call comms_bcast(spin_hall%bandshift, 1, stdout, seedname, comm) + call comms_bcast(spin_hall%bandshift_firstband, 1, stdout, seedname, comm) + call comms_bcast(spin_hall%bandshift_energyshift, 1, stdout, seedname, comm) + + call comms_bcast(berry%kubo_smearing%use_adaptive, 1, stdout, seedname, comm) + call comms_bcast(berry%kubo_smearing%adaptive_prefactor, 1, stdout, seedname, comm) + call comms_bcast(berry%kubo_smearing%adaptive_max_width, 1, stdout, seedname, comm) + call comms_bcast(berry%kubo_smearing%fixed_width, 1, stdout, seedname, comm) + call comms_bcast(berry%kubo_smearing%type_index, 1, stdout, seedname, comm) + call comms_bcast(berry%kubo_eigval_max, 1, stdout, seedname, comm) + call comms_bcast(berry%kubo_nfreq, 1, stdout, seedname, comm) fermi_n = 0 if (on_root) then if (allocated(fermi_energy_list)) fermi_n = size(fermi_energy_list) endif - call comms_bcast(fermi_n, 1, stdout, seedname, world) - call comms_bcast(dos_data%energy_min, 1, stdout, seedname, world) - call comms_bcast(dos_data%energy_max, 1, stdout, seedname, world) - call comms_bcast(pw90_spin%kmesh%spacing, 1, stdout, seedname, world) - call comms_bcast(pw90_spin%kmesh%mesh(1), 3, stdout, seedname, world) - call comms_bcast(berry%wanint_kpoint_file, 1, stdout, seedname, world) - call comms_bcast(dis_window%win_min, 1, stdout, seedname, world) - call comms_bcast(dis_window%win_max, 1, stdout, seedname, world) - call comms_bcast(berry%sc_eta, 1, stdout, seedname, world) - call comms_bcast(berry%sc_w_thr, 1, stdout, seedname, world) - call comms_bcast(berry%sc_phase_conv, 1, stdout, seedname, world) + call comms_bcast(fermi_n, 1, stdout, seedname, comm) + call comms_bcast(dos_data%energy_min, 1, stdout, seedname, comm) + call comms_bcast(dos_data%energy_max, 1, stdout, seedname, comm) + call comms_bcast(pw90_spin%kmesh%spacing, 1, stdout, seedname, comm) + call comms_bcast(pw90_spin%kmesh%mesh(1), 3, stdout, seedname, comm) + call comms_bcast(berry%wanint_kpoint_file, 1, stdout, seedname, comm) + call comms_bcast(dis_window%win_min, 1, stdout, seedname, comm) + call comms_bcast(dis_window%win_max, 1, stdout, seedname, comm) + call comms_bcast(berry%sc_eta, 1, stdout, seedname, comm) + call comms_bcast(berry%sc_w_thr, 1, stdout, seedname, comm) + call comms_bcast(berry%sc_phase_conv, 1, stdout, seedname, comm) ! ---------------------------------------------- ! ! New input variables in development ! - !call comms_bcast(verbose%devel_flag, len(verbose%devel_flag), stdout, seedname, world) - call comms_bcast(pw90_calcs%spin_moment, 1, stdout, seedname, world) - call comms_bcast(pw90_spin%axis_polar, 1, stdout, seedname, world) - call comms_bcast(pw90_spin%axis_azimuth, 1, stdout, seedname, world) - call comms_bcast(pw90_calcs%spin_decomp, 1, stdout, seedname, world) - call comms_bcast(pw90_ham%use_degen_pert, 1, stdout, seedname, world) - call comms_bcast(pw90_ham%degen_thr, 1, stdout, seedname, world) - call comms_bcast(system%num_valence_bands, 1, stdout, seedname, world) - call comms_bcast(pw90_calcs%dos, 1, stdout, seedname, world) - call comms_bcast(dos_data%task, len(dos_data%task), stdout, seedname, world) - call comms_bcast(pw90_calcs%kpath, 1, stdout, seedname, world) - call comms_bcast(kpath%task, len(kpath%task), stdout, seedname, world) - call comms_bcast(kpath%bands_colour, len(kpath%bands_colour), stdout, seedname, world) - call comms_bcast(pw90_calcs%kslice, 1, stdout, seedname, world) - call comms_bcast(kslice%task, len(kslice%task), stdout, seedname, world) - call comms_bcast(kslice%corner(1), 3, stdout, seedname, world) - call comms_bcast(kslice%b1(1), 3, stdout, seedname, world) - call comms_bcast(kslice%b2(1), 3, stdout, seedname, world) - call comms_bcast(kslice%kmesh2d(1), 2, stdout, seedname, world) + !call comms_bcast(verbose%devel_flag, len(verbose%devel_flag), stdout, seedname, comm) + call comms_bcast(pw90_calcs%spin_moment, 1, stdout, seedname, comm) + call comms_bcast(pw90_spin%axis_polar, 1, stdout, seedname, comm) + call comms_bcast(pw90_spin%axis_azimuth, 1, stdout, seedname, comm) + call comms_bcast(pw90_calcs%spin_decomp, 1, stdout, seedname, comm) + call comms_bcast(pw90_ham%use_degen_pert, 1, stdout, seedname, comm) + call comms_bcast(pw90_ham%degen_thr, 1, stdout, seedname, comm) + call comms_bcast(system%num_valence_bands, 1, stdout, seedname, comm) + call comms_bcast(pw90_calcs%dos, 1, stdout, seedname, comm) + call comms_bcast(dos_data%task, len(dos_data%task), stdout, seedname, comm) + call comms_bcast(pw90_calcs%kpath, 1, stdout, seedname, comm) + call comms_bcast(kpath%task, len(kpath%task), stdout, seedname, comm) + call comms_bcast(kpath%bands_colour, len(kpath%bands_colour), stdout, seedname, comm) + call comms_bcast(pw90_calcs%kslice, 1, stdout, seedname, comm) + call comms_bcast(kslice%task, len(kslice%task), stdout, seedname, comm) + call comms_bcast(kslice%corner(1), 3, stdout, seedname, comm) + call comms_bcast(kslice%b1(1), 3, stdout, seedname, comm) + call comms_bcast(kslice%b2(1), 3, stdout, seedname, comm) + call comms_bcast(kslice%kmesh2d(1), 2, stdout, seedname, comm) call comms_bcast(kslice%fermi_lines_colour, len(kslice%fermi_lines_colour), stdout, seedname, & - world) - call comms_bcast(berry%transl_inv, 1, stdout, seedname, world) - call comms_bcast(system%num_elec_per_state, 1, stdout, seedname, world) - call comms_bcast(scissors_shift, 1, stdout, seedname, world) + comm) + call comms_bcast(berry%transl_inv, 1, stdout, seedname, comm) + call comms_bcast(system%num_elec_per_state, 1, stdout, seedname, comm) + call comms_bcast(scissors_shift, 1, stdout, seedname, comm) ! ! Do these have to be broadcasted? (Plots done on root node only) ! @@ -444,40 +444,40 @@ subroutine pw90common_wanint_param_dist(verbose, rs_region, kmesh_info, kpt_latt ! if(allocated(bands_label)) & ! call comms_bcast(bands_label(:),len(bands_label(1))*bands_num_spec_points) ! ---------------------------------------------- - call comms_bcast(pw90_calcs%geninterp, 1, stdout, seedname, world) - call comms_bcast(geninterp%alsofirstder, 1, stdout, seedname, world) - call comms_bcast(geninterp%single_file, 1, stdout, seedname, world) + call comms_bcast(pw90_calcs%geninterp, 1, stdout, seedname, comm) + call comms_bcast(geninterp%alsofirstder, 1, stdout, seedname, comm) + call comms_bcast(geninterp%single_file, 1, stdout, seedname, comm) ! [gp-begin, Apr 12, 2012] ! BoltzWann variables - call comms_bcast(pw90_calcs%boltzwann, 1, stdout, seedname, world) - call comms_bcast(boltz%calc_also_dos, 1, stdout, seedname, world) - call comms_bcast(boltz%dir_num_2d, 1, stdout, seedname, world) - call comms_bcast(boltz%dos_energy_step, 1, stdout, seedname, world) - call comms_bcast(boltz%dos_energy_min, 1, stdout, seedname, world) - call comms_bcast(boltz%dos_energy_max, 1, stdout, seedname, world) - call comms_bcast(boltz%dos_smearing%use_adaptive, 1, stdout, seedname, world) - call comms_bcast(boltz%dos_smearing%fixed_width, 1, stdout, seedname, world) - call comms_bcast(boltz%dos_smearing%adaptive_prefactor, 1, stdout, seedname, world) - call comms_bcast(boltz%dos_smearing%adaptive_max_width, 1, stdout, seedname, world) - call comms_bcast(boltz%mu_min, 1, stdout, seedname, world) - call comms_bcast(boltz%mu_max, 1, stdout, seedname, world) - call comms_bcast(boltz%mu_step, 1, stdout, seedname, world) - call comms_bcast(boltz%temp_min, 1, stdout, seedname, world) - call comms_bcast(boltz%temp_max, 1, stdout, seedname, world) - call comms_bcast(boltz%temp_step, 1, stdout, seedname, world) - call comms_bcast(boltz%kmesh%spacing, 1, stdout, seedname, world) - call comms_bcast(boltz%kmesh%mesh(1), 3, stdout, seedname, world) - call comms_bcast(boltz%tdf_energy_step, 1, stdout, seedname, world) - call comms_bcast(boltz%relax_time, 1, stdout, seedname, world) - call comms_bcast(boltz%tdf_smearing%use_adaptive, 1, stdout, seedname, world) - call comms_bcast(boltz%tdf_smearing%fixed_width, 1, stdout, seedname, world) - call comms_bcast(boltz%tdf_smearing%type_index, 1, stdout, seedname, world) - call comms_bcast(boltz%dos_smearing%type_index, 1, stdout, seedname, world) - call comms_bcast(boltz%bandshift, 1, stdout, seedname, world) - call comms_bcast(boltz%bandshift_firstband, 1, stdout, seedname, world) - call comms_bcast(boltz%bandshift_energyshift, 1, stdout, seedname, world) + call comms_bcast(pw90_calcs%boltzwann, 1, stdout, seedname, comm) + call comms_bcast(boltz%calc_also_dos, 1, stdout, seedname, comm) + call comms_bcast(boltz%dir_num_2d, 1, stdout, seedname, comm) + call comms_bcast(boltz%dos_energy_step, 1, stdout, seedname, comm) + call comms_bcast(boltz%dos_energy_min, 1, stdout, seedname, comm) + call comms_bcast(boltz%dos_energy_max, 1, stdout, seedname, comm) + call comms_bcast(boltz%dos_smearing%use_adaptive, 1, stdout, seedname, comm) + call comms_bcast(boltz%dos_smearing%fixed_width, 1, stdout, seedname, comm) + call comms_bcast(boltz%dos_smearing%adaptive_prefactor, 1, stdout, seedname, comm) + call comms_bcast(boltz%dos_smearing%adaptive_max_width, 1, stdout, seedname, comm) + call comms_bcast(boltz%mu_min, 1, stdout, seedname, comm) + call comms_bcast(boltz%mu_max, 1, stdout, seedname, comm) + call comms_bcast(boltz%mu_step, 1, stdout, seedname, comm) + call comms_bcast(boltz%temp_min, 1, stdout, seedname, comm) + call comms_bcast(boltz%temp_max, 1, stdout, seedname, comm) + call comms_bcast(boltz%temp_step, 1, stdout, seedname, comm) + call comms_bcast(boltz%kmesh%spacing, 1, stdout, seedname, comm) + call comms_bcast(boltz%kmesh%mesh(1), 3, stdout, seedname, comm) + call comms_bcast(boltz%tdf_energy_step, 1, stdout, seedname, comm) + call comms_bcast(boltz%relax_time, 1, stdout, seedname, comm) + call comms_bcast(boltz%tdf_smearing%use_adaptive, 1, stdout, seedname, comm) + call comms_bcast(boltz%tdf_smearing%fixed_width, 1, stdout, seedname, comm) + call comms_bcast(boltz%tdf_smearing%type_index, 1, stdout, seedname, comm) + call comms_bcast(boltz%dos_smearing%type_index, 1, stdout, seedname, comm) + call comms_bcast(boltz%bandshift, 1, stdout, seedname, comm) + call comms_bcast(boltz%bandshift_firstband, 1, stdout, seedname, comm) + call comms_bcast(boltz%bandshift_energyshift, 1, stdout, seedname, comm) ! [gp-end] - call comms_bcast(rs_region%use_ws_distance, 1, stdout, seedname, world) + call comms_bcast(rs_region%use_ws_distance, 1, stdout, seedname, comm) ! 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 @@ -513,16 +513,16 @@ subroutine pw90common_wanint_param_dist(verbose, rs_region, kmesh_info, kpt_latt endif end if - if (fermi_n > 0) call comms_bcast(fermi_energy_list(1), fermi_n, stdout, seedname, world) - call comms_bcast(gyrotropic%freq_list(1), gyrotropic%nfreq, stdout, seedname, world) - call comms_bcast(gyrotropic%band_list(1), gyrotropic%num_bands, stdout, seedname, world) - call comms_bcast(berry%kubo_freq_list(1), berry%kubo_nfreq, stdout, seedname, world) - call comms_bcast(dos_data%project(1), dos_data%num_project, stdout, seedname, world) + if (fermi_n > 0) call comms_bcast(fermi_energy_list(1), fermi_n, stdout, seedname, comm) + call comms_bcast(gyrotropic%freq_list(1), gyrotropic%nfreq, stdout, seedname, comm) + call comms_bcast(gyrotropic%band_list(1), gyrotropic%num_bands, stdout, seedname, comm) + call comms_bcast(berry%kubo_freq_list(1), berry%kubo_nfreq, stdout, seedname, comm) + call comms_bcast(dos_data%project(1), dos_data%num_project, stdout, seedname, comm) if (.not. effective_model) then if (eig_found) then - call comms_bcast(eigval(1, 1), num_bands*num_kpts, stdout, seedname, world) + call comms_bcast(eigval(1, 1), num_bands*num_kpts, stdout, seedname, comm) end if - call comms_bcast(kpt_latt(1, 1), 3*num_kpts, stdout, seedname, world) + call comms_bcast(kpt_latt(1, 1), 3*num_kpts, stdout, seedname, comm) endif ! kmesh: only nntot,wb, and bk are needed to evaluate the WF matrix @@ -532,8 +532,8 @@ subroutine pw90common_wanint_param_dist(verbose, rs_region, kmesh_info, kpt_latt if (.not. effective_model) then - call comms_bcast(kmesh_info%nnh, 1, stdout, seedname, world) - call comms_bcast(kmesh_info%nntot, 1, stdout, seedname, world) + call comms_bcast(kmesh_info%nnh, 1, stdout, seedname, comm) + call comms_bcast(kmesh_info%nntot, 1, stdout, seedname, comm) if (.not. on_root) then allocate (kmesh_info%nnlist(num_kpts, kmesh_info%nntot), stat=ierr) @@ -556,12 +556,12 @@ subroutine pw90common_wanint_param_dist(verbose, rs_region, kmesh_info, kpt_latt call io_error('Error in allocating bk in pw90common_wanint_param_dist', stdout, seedname) end if - call comms_bcast(kmesh_info%nnlist(1, 1), num_kpts*kmesh_info%nntot, stdout, seedname, world) - call comms_bcast(kmesh_info%neigh(1, 1), num_kpts*kmesh_info%nntot/2, stdout, seedname, world) - call comms_bcast(kmesh_info%nncell(1, 1, 1), 3*num_kpts*kmesh_info%nntot, stdout, seedname, world) - call comms_bcast(kmesh_info%wb(1), kmesh_info%nntot, stdout, seedname, world) - call comms_bcast(kmesh_info%bka(1, 1), 3*kmesh_info%nntot/2, stdout, seedname, world) - call comms_bcast(kmesh_info%bk(1, 1, 1), 3*kmesh_info%nntot*num_kpts, stdout, seedname, world) + call comms_bcast(kmesh_info%nnlist(1, 1), num_kpts*kmesh_info%nntot, stdout, seedname, comm) + call comms_bcast(kmesh_info%neigh(1, 1), num_kpts*kmesh_info%nntot/2, stdout, seedname, comm) + call comms_bcast(kmesh_info%nncell(1, 1, 1), 3*num_kpts*kmesh_info%nntot, stdout, seedname, comm) + call comms_bcast(kmesh_info%wb(1), kmesh_info%nntot, stdout, seedname, comm) + call comms_bcast(kmesh_info%bka(1, 1), 3*kmesh_info%nntot/2, stdout, seedname, comm) + call comms_bcast(kmesh_info%bk(1, 1, 1), 3*kmesh_info%nntot*num_kpts, stdout, seedname, comm) endif @@ -571,7 +571,7 @@ end subroutine pw90common_wanint_param_dist subroutine pw90common_wanint_data_dist(num_wann, num_kpts, num_bands, u_matrix_opt, u_matrix, & dis_window, wann_data, scissors_shift, v_matrix, & num_valence_bands, have_disentangled, stdout, seedname, & - world) + comm) !===========================================================! ! ! !! Distribute the um and chk files @@ -596,12 +596,12 @@ subroutine pw90common_wanint_data_dist(num_wann, num_kpts, num_bands, u_matrix_o real(kind=dp), intent(in) :: scissors_shift character(len=50), intent(in) :: seedname - type(w90comm_type), intent(in) :: world + type(w90comm_type), intent(in) :: comm integer :: ierr, loop_kpt, m, i, j logical :: on_root = .false. - if (mpirank(world) == 0) on_root = .true. + if (mpirank(comm) == 0) on_root = .true. if (.not. on_root) then ! wannier_centres is allocated in param_read, so only on root node @@ -610,7 +610,7 @@ subroutine pw90common_wanint_data_dist(num_wann, num_kpts, num_bands, u_matrix_o allocate (wann_data%centres(3, num_wann), stat=ierr) if (ierr /= 0) call io_error('Error allocating wannier_centres in pw90common_wanint_data_dist', stdout, seedname) end if - call comms_bcast(wann_data%centres(1, 1), 3*num_wann, stdout, seedname, world) + call comms_bcast(wann_data%centres(1, 1), 3*num_wann, stdout, seedname, comm) ! ------------------- ! Ivo: added 8april11 @@ -646,7 +646,7 @@ subroutine pw90common_wanint_data_dist(num_wann, num_kpts, num_bands, u_matrix_o if (allocated(u_matrix)) deallocate (u_matrix) endif endif - call comms_bcast(v_matrix(1, 1, 1), num_bands*num_wann*num_kpts, stdout, seedname, world) + call comms_bcast(v_matrix(1, 1, 1), num_bands*num_wann*num_kpts, stdout, seedname, comm) if (num_valence_bands > 0 .and. abs(scissors_shift) > 1.0e-7_dp) then if (.not. on_root .and. .not. allocated(u_matrix)) then @@ -654,7 +654,7 @@ subroutine pw90common_wanint_data_dist(num_wann, num_kpts, num_bands, u_matrix_o if (ierr /= 0) & call io_error('Error allocating u_matrix in pw90common_wanint_data_dist', stdout, seedname) endif - call comms_bcast(u_matrix(1, 1, 1), num_wann*num_wann*num_kpts, stdout, seedname, world) + call comms_bcast(u_matrix(1, 1, 1), num_wann*num_wann*num_kpts, stdout, seedname, comm) endif ! if (.not.on_root .and. .not.allocated(m_matrix)) then @@ -664,7 +664,7 @@ subroutine pw90common_wanint_data_dist(num_wann, num_kpts, num_bands, u_matrix_o ! endif ! call comms_bcast(m_matrix(1,1,1,1),num_wann*num_wann*nntot*num_kpts) - call comms_bcast(have_disentangled, 1, stdout, seedname, world) + call comms_bcast(have_disentangled, 1, stdout, seedname, comm) if (have_disentangled) then if (.not. on_root) then @@ -693,8 +693,8 @@ subroutine pw90common_wanint_data_dist(num_wann, num_kpts, num_bands, u_matrix_o end if ! call comms_bcast(u_matrix_opt(1,1,1),num_bands*num_wann*num_kpts) - call comms_bcast(dis_window%lwindow(1, 1), num_bands*num_kpts, stdout, seedname, world) - call comms_bcast(dis_window%ndimwin(1), num_kpts, stdout, seedname, world) + call comms_bcast(dis_window%lwindow(1, 1), num_bands*num_kpts, stdout, seedname, comm) + call comms_bcast(dis_window%ndimwin(1), num_kpts, stdout, seedname, comm) end if end subroutine pw90common_wanint_data_dist @@ -1661,7 +1661,7 @@ end subroutine pw90common_fourier_R_to_k_vec_dadb_TB_conv !================================! subroutine wigner_seitz(verbose, real_lattice, mp_grid, ws_vec, stdout, seedname, & - count_pts, world) + count_pts, comm) !================================! !! Calculates a grid of lattice vectors r that fall inside (and eventually !! on the surface of) the Wigner-Seitz supercell centered on the @@ -1682,7 +1682,7 @@ subroutine wigner_seitz(verbose, real_lattice, mp_grid, ws_vec, stdout, seedname ! arguments type(print_output_type), intent(in) :: verbose - type(w90comm_type), intent(in) :: world + type(w90comm_type), intent(in) :: comm type(wigner_seitz_type), intent(inout) :: ws_vec integer, intent(in) :: mp_grid(3) integer, intent(in) :: stdout @@ -1696,7 +1696,7 @@ subroutine wigner_seitz(verbose, real_lattice, mp_grid, ws_vec, stdout, seedname integer :: n1, n2, n3, i1, i2, i3, icnt, i, j, ir real(kind=dp) :: real_metric(3, 3) logical :: on_root = .false. - if (mpirank(world) == 0) on_root = .true. + if (mpirank(comm) == 0) on_root = .true. if (verbose%timing_level > 1 .and. on_root) & call io_stopwatch('postw90_common: wigner_seitz', 1, stdout, seedname) diff --git a/src/wannier_prog.F90 b/src/wannier_prog.F90 index 8c3971020..aa7471dcd 100644 --- a/src/wannier_prog.F90 +++ b/src/wannier_prog.F90 @@ -125,7 +125,7 @@ program wannier type(sitesym_data_type) :: sym type(ham_logical_type) :: hmlg - type(w90comm_type) :: w90comm + type(w90comm_type) :: comm integer :: num_bands !! Number of bands @@ -217,13 +217,13 @@ program wannier logical :: have_disentangled, disentanglement #ifdef MPI - w90comm%comm = MPI_COMM_WORLD + comm%comm = MPI_COMM_WORLD call mpi_init(ierr) if (ierr .ne. 0) call io_error('MPI initialisation error', stdout, seedname) ! JJ, fixme, what are stdout, seedname here? unassigned! #endif - num_nodes = mpisize(w90comm) - my_node_id = mpirank(w90comm) + num_nodes = mpisize(comm) + my_node_id = mpirank(comm) if (my_node_id == 0) on_root = .true. time0 = io_time() @@ -233,9 +233,9 @@ program wannier call io_commandline(prog, dryrun, seedname) len_seedname = len(seedname) end if - call comms_bcast(len_seedname, 1, stdout, seedname, w90comm) - call comms_bcast(seedname, len_seedname, stdout, seedname, w90comm) - call comms_bcast(dryrun, 1, stdout, seedname, w90comm) + call comms_bcast(len_seedname, 1, stdout, seedname, comm) + call comms_bcast(seedname, len_seedname, stdout, seedname, comm) + call comms_bcast(dryrun, 1, stdout, seedname, comm) if (on_root) then stdout = io_file_unit() @@ -317,7 +317,7 @@ program wannier wannier_data, wannier_plot, ws_region, w90_calculation, eigval, real_lattice, & symmetrize_eps, mp_grid, kpoint_path%num_points_first_segment, num_bands, & num_kpts, num_proj, num_wann, eig_found, cp_pp, gamma_only, have_disentangled, & - lhasproj, lsitesymmetry, use_bloch_phases, seedname, stdout, w90comm) + lhasproj, lsitesymmetry, use_bloch_phases, seedname, stdout, comm) disentanglement = (num_bands > num_wann) if (gamma_only .and. num_nodes > 1) & call io_error('Gamma point branch is serial only at the moment', stdout, seedname) @@ -339,7 +339,7 @@ program wannier endif call param_chkpt_dist(dis_manifold, wannier_data, u_matrix, u_matrix_opt, & omega%invariant, num_bands, num_kpts, num_wann, & - checkpoint, have_disentangled, seedname, stdout, w90comm) + checkpoint, have_disentangled, seedname, stdout, comm) if (lsitesymmetry) call sitesym_read(sym, num_bands, num_kpts, num_wann, seedname, stdout) ! update this to read on root and bcast - JRY if (lsitesymmetry) sym%symmetrize_eps = symmetrize_eps ! for the time being, copy value from w90_parameters (JJ) @@ -391,11 +391,11 @@ program wannier call overlap_allocate(a_matrix, m_matrix, m_matrix_local, m_matrix_orig, m_matrix_orig_local, & u_matrix, u_matrix_opt, kmesh_info%nntot, num_bands, num_kpts, num_wann, & - print_output%timing_level, seedname, stdout, w90comm) + print_output%timing_level, seedname, stdout, comm) call overlap_read(kmesh_info, select_projection, sym, a_matrix, m_matrix, m_matrix_local, & m_matrix_orig, m_matrix_orig_local, u_matrix, u_matrix_opt, num_bands, & num_kpts, num_proj, num_wann, print_output%timing_level, cp_pp, & - gamma_only, lsitesymmetry, use_bloch_phases, seedname, stdout, w90comm) + gamma_only, lsitesymmetry, use_bloch_phases, seedname, stdout, comm) time1 = io_time() if (on_root) write (stdout, '(/1x,a25,f11.3,a)') 'Time to read overlaps ', time1 - time2, & ' (sec)' @@ -407,7 +407,7 @@ program wannier call dis_main(dis_control, dis_spheres, dis_manifold, kmesh_info, kpt_latt, sym, print_output, a_matrix, & m_matrix, m_matrix_local, m_matrix_orig, m_matrix_orig_local, u_matrix, & u_matrix_opt, eigval, real_lattice, omega%invariant, num_bands, & - num_kpts, num_wann, gamma_only, lsitesymmetry, stdout, seedname, w90comm) + num_kpts, num_wann, gamma_only, lsitesymmetry, stdout, seedname, comm) have_disentangled = .true. time2 = io_time() if (on_root) write (stdout, '(1x,a25,f11.3,a)') 'Time to disentangle bands', time2 - time1, & @@ -435,13 +435,13 @@ program wannier real_lattice, wannier_centres_translated, irvec, mp_grid, & ndegen, shift_vec, nrpts, num_bands, num_kpts, num_proj, num_wann, rpt_origin, & band_plot%mode, transport%mode, have_disentangled, lsitesymmetry, seedname, & - stdout, w90comm) + stdout, comm) else call wann_main_gamma(atom_data, dis_manifold, exclude_bands, kmesh_info, kpt_latt, output_file, & wann_control, omega, w90_system, print_output, wannier_data, m_matrix, & u_matrix, u_matrix_opt, eigval, real_lattice, mp_grid, & num_bands, num_kpts, num_wann, have_disentangled, & - real_space_ham%translate_home_cell, seedname, stdout, w90comm) + real_space_ham%translate_home_cell, seedname, stdout, comm) end if time1 = io_time() @@ -494,7 +494,7 @@ program wannier call hamiltonian_dealloc(hmlg, ham_k, ham_r, wannier_centres_translated, irvec, ndegen, & stdout, seedname) call overlap_dealloc(a_matrix, m_matrix, m_matrix_local, m_matrix_orig, m_matrix_orig_local, & - u_matrix, u_matrix_opt, seedname, stdout, w90comm) + u_matrix, u_matrix_opt, seedname, stdout, comm) call kmesh_dealloc(kmesh_info, stdout, seedname) call param_w90_dealloc(atom_data, band_plot, dis_spheres, dis_manifold, exclude_bands, & kmesh_input, kpt_latt, wann_control, proj_input, input_proj, &