Hello Maria,
This is very complicated unless it is very heavy, I give you the very heavy solution, written for 2D, but for 3D just add a loop on planes:
You need to know the global number of points, let's call it NGLOB (for instance it is the maximum over all processors of MESH%KNOLG%I(I) for I=1 to local number of points. Compute it over every processor, then NGLOB=P_IMAX(NGLOB).
Then:
DO I=1,NGLOB
ILOC=0
DO J=1,NPOIN
! Is this point in the sub-domain ?
IF(MESH%KNOLG%I(J).EQ.I) ILOC=J
ENDDO
IF(ILOC.GT.0) THEN
VALUE= your averaged value at point ILOC
ELSE
VALUE=0.D0
ENDIF
! this will get the non zero value where it is, be it positive or negative
! if it is in 2 or more sub-domains, no problem
IF(NCSIZE.GT.1) VALUE=P_DMIN(VALUE)+P_DMAX(VALUE)
! Only processor 0 will write
IF(IPID.EQ.0) THEN
WRITE(LU,T3DRFO) 'POINT ',I,' VALUE : ',VALUE
ENDIF
ENDDO
Not tested, just to give you the main idea, I hope it works,
Have a nice week-end,
Jean-Michel