[cig-commits] r15528 - mc/3D/CitcomS/trunk/lib

tan2 at geodynamics.org tan2 at geodynamics.org
Tue Aug 11 10:47:36 PDT 2009


Author: tan2
Date: 2009-08-11 10:47:36 -0700 (Tue, 11 Aug 2009)
New Revision: 15528

Modified:
   mc/3D/CitcomS/trunk/lib/Global_operations.c
Log:
Add gather_r() to gather all radial coordinates

Modified: mc/3D/CitcomS/trunk/lib/Global_operations.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Global_operations.c	2009-08-11 17:35:23 UTC (rev 15527)
+++ mc/3D/CitcomS/trunk/lib/Global_operations.c	2009-08-11 17:47:36 UTC (rev 15528)
@@ -36,6 +36,7 @@
 #endif
 
 void calc_cbase_at_tp(float , float , float *);
+void myerror(struct All_variables *E,char *message);
 
 /* ===============================================
    strips horizontal average from nodal field X.
@@ -1023,3 +1024,24 @@
     return;
 
 }
+
+
+void gather_r(struct All_variables *E, double *r)
+{
+    /* Gather the radial coordinate and concatnate
+     * them together as a 1d array. */
+
+    const int m = 1;
+    int n = E->parallel.nprocz;
+
+    /* send all r coordiante except the top node, which is the
+       same as the bottom node of the next processor. */
+    MPI_Allgather(&(E->sx[m][3][1]), E->lmesh.noz-1, MPI_DOUBLE,
+                  &(r[1]), E->lmesh.noz-1, MPI_DOUBLE,
+                  E->parallel.vertical_comm);
+
+    /* add the top most nodes of all processors */
+    r[E->mesh.noz] = E->sphere.ro;
+
+    return;
+}



More information about the CIG-COMMITS mailing list