force(j,i+nres)=anorm_distr(x,sig2,lowb2,highb2)
enddo
enddo
force(j,i+nres)=anorm_distr(x,sig2,lowb2,highb2)
enddo
enddo
do j=1,3
stochforc(j,i)=stochforc(j,i)+force(j,i+nres+1)
ff(j)=ff(j)+force(j,i+nres+1)
do j=1,3
stochforc(j,i)=stochforc(j,i)+force(j,i+nres+1)
ff(j)=ff(j)+force(j,i+nres+1)
c------------------------------------------------------------------
subroutine setup_fricmat
implicit real*8 (a-h,o-z)
c------------------------------------------------------------------
subroutine setup_fricmat
implicit real*8 (a-h,o-z)
call MPI_Bcast(10,1,MPI_INTEGER,king,FG_COMM,IERROR)
call MPI_Bcast(10,1,MPI_INTEGER,king,FG_COMM,IERROR)
c print *,"Processor",myrank,
c & " BROADCAST iorder in SETUP_FRICMAT"
endif
c licznik=licznik+1
c write (iout,*) "setup_fricmat licznik",licznik
c print *,"Processor",myrank,
c & " BROADCAST iorder in SETUP_FRICMAT"
endif
c licznik=licznik+1
c write (iout,*) "setup_fricmat licznik",licznik
c Scatter the friction matrix
call MPI_Scatterv(fricmat(1,1),nginv_counts(0),
& nginv_start(0),MPI_DOUBLE_PRECISION,fcopy(1,1),
& myginv_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)
c Scatter the friction matrix
call MPI_Scatterv(fricmat(1,1),nginv_counts(0),
& nginv_start(0),MPI_DOUBLE_PRECISION,fcopy(1,1),
& myginv_ng_count,MPI_DOUBLE_PRECISION,king,FG_COMM,IERROR)