1      subroutine argos_diana_center_ref(x)
2c
3c $Id$
4c
5      implicit none
6c
7#include "argos_diana_common.fh"
8#include "mafdecls.fh"
9#include "msgids.fh"
10#include "rtdb.fh"
11c
12      real*8 x(nsa,3)
13      integer i,j
14c
15c     center and fold
16c
17      if(me.eq.0.and.icent.gt.0) then
18      if(.not.ltop) call md_abort('No topology for center',0)
19      call argos_diana_center_fold(x,x,int_mb(i_imol),0)
20      endif
21c
22c     broadcast coordinates to all nodes
23c
24      if(np.gt.1) then
25      call ga_brdcst(mag_d02,x(1,1),3*nsa*ma_sizeof(mt_dbl,1,mt_byte),0)
26      endif
27c
28      do 1 j=1,3
29      xsmin(j)=x(1,j)
30      xsmax(j)=x(1,j)
31      do 1 i=2,nsa
32      xsmin(j)=min(xsmin(j),x(i,j))
33      xsmax(j)=max(xsmax(j),x(i,j))
34    1 continue
35c
36c      xsmin=xsmin-0.5d0
37c      xsmax=xsmax+0.5d0
38c
39      return
40      end
41