/* $Header: oneDarray_to_vex.m,v 1.1 91/08/23 16:28:13 chu mp310d $

                    Copyright (c) 1991
                    MasPar Computer Corporation
                    All Rights Reserved

    This program has been licensed subject to restrictions
    on reproduction, use and disclosure and this notice
    does not imply that the program or the related ideas
    or algorithms are in the public domain.

	example to blockIn a fe f77 double precision array fe_a(n)
	into a vex in mplabb
	this is same for a fe c double 
*/

#include <mpl.h>

void oneDarray_to_vex(fe_a,be_a,n) 
register int n;		 	/* # of elements of 1-D array fe_a */
double *fe_a;			/* 1-D array fe_a */
register plural double *be_a;	/* mpl memory layers to hold fe_a */

{
   register int nba;		/* # of blocks - 1 */
   register int npa;		/* the remainder of blocks */
   int npaa;			/* # of rows of pe's - 1 */
   int npap;			/* the remainder of rows */
   
   register int j;		/* for loops index */

   nba = n>>lnproc;		/* nba = n / nproc */
   npa = n - (nba<<lnproc);	/* npa = n % nproc */

   for ( j=0; j<nba; j++ ) {
      blockIn(fe_a,be_a,0,0,nxproc,nyproc,sizeof(double));
      fe_a += nproc;
      be_a++;
   }

/*
   if ( npa > 0 ) {
      npaa = npa >> lnxproc;
      for ( j=0; j<npaa; j++ ) {
         blockIn(fe_a,be_a,0,j,nxproc,1,sizeof(double));
         fe_a += nxproc;
      }
      npap = npa - (npaa << lnxproc);
      if ( npap > 0 )
         blockIn(fe_a,be_a,0,npaa,npap,1,sizeof(double));
   }
*/
}
