subroutine ReadPopsHeadv3(iunithead, tPop64Bit, tPopHPHF, tPopLz, iPopLenof_Sign, iPopNel, &
iPopAllTotWalkers, PopDiagSft, PopSumNoatHF, PopAllSumENum, iPopIter, &
PopNIfD, PopNIfSgn, PopNIfFlag, PopNIfTot)
integer, intent(in) :: iunithead
logical, intent(out) :: tPop64Bit, tPopLz, tPopHPHF
integer, intent(out) :: iPopLenof_sign, iPopNel, iPopIter, PopNIfD, PopNIfSgn, PopNIfFlag, PopNIfTot
integer(int64), intent(out) :: iPopAllTotWalkers
real(dp), intent(out) :: PopDiagSft(inum_runs)
real(dp), dimension(lenof_sign/inum_runs), intent(out) :: PopSumNoatHF
HElement_t(dp), intent(out) :: PopAllSumENum(inum_runs)
character(len=24) :: junk, junk2, junk3, junk4, junk5
integer :: PopsVersion
integer :: PopNifY
PopsVersion = FindPopsfileVersion(iunithead)
if (PopsVersion /= 3) call stop_all("ReadPopsfileHeadv3", "Wrong popsfile version for this routine.")
PopDiagSft = 0
PopAllSumENum = 0
if (iProcIndex == root) then
read (iunithead, '(A12,L5,A8,L5,A8,L5,A13,I5,A7,I6)') junk, tPop64Bit, junk2, tPopHPHF, junk3, &
tPopLz, junk4, iPopLenof_sign, junk5, iPopNEl
read (iunithead, *) iPopAllTotWalkers
read (iunithead, *) PopDiagSft(1)
read (iunithead, *) PopSumNoatHF
read (iunithead, *) PopAllSumENum(1)
read (iunithead, *) iPopIter
read (iunithead, *) PopNIfD
read (iunithead, *) PopNifY
read (iunithead, *) PopNIfSgn
read (iunithead, *) PopNIfFlag
read (iunithead, *) PopNIfTot
endif
!Broadcast the read in values from the header to all nodes.
call MPIBCast(tPop64Bit)
call MPIBCast(tPopHPHF)
call MPIBCast(tPopLz)
call MPIBCast(iPopLenof_sign)
call MPIBCast(iPopNEl)
call MPIBCast(iPopAllTotWalkers)
call MPIBCast(PopDiagSft)
call MPIBCast(PopSumNoatHF)
call MPIBCast(PopAllSumENum)
call MPIBCast(iPopIter)
call MPIBCast(PopNIfD)
call MPIBCast(PopNIfSgn)
call MPIBCast(PopNIfFlag)
call MPIBCast(PopNIfTot)
end subroutine ReadPopsHeadv3