Actual source code: f90_solaris.c

  2: /*-------------------------------------------------------------*/

  6: PetscErrorCode F90Array1dCreate(void *array,PetscDataType type,PetscInt start,PetscInt len,F90Array1d *ptr)
  7: {
  9:   PetscInt size;

 14:   PetscDataTypeGetSize(type,&size);
 15:   ptr->addr      = array;
 16:   ptr->extent[0] = len;
 17:   ptr->mult[0]   = size;
 18:   ptr->lower[0]  = start;
 19:   ptr->addr_d    = (void*)((long)array - (ptr->lower[0]*ptr->mult[0]));
 20:   return(0);
 21: }

 25: PetscErrorCode F90Array2dCreate(void *array,PetscDataType type,PetscInt start1,PetscInt len1,PetscInt start2,PetscInt len2,F90Array2d *ptr)
 26: {
 28:   PetscInt size;

 33:   PetscDataTypeGetSize(type,&size);
 34:   ptr->addr      = array;
 35:   ptr->extent[0] = len1;
 36:   ptr->mult[0]   = size;
 37:   ptr->lower[0]  = start1;
 38:   ptr->extent[1] = len2;
 39:   ptr->mult[1]   = len1*size;
 40:   ptr->lower[1]  = start2;
 41:   ptr->addr_d    = (void*)((long)array -(ptr->lower[0]*ptr->mult[0]+ptr->lower[1]*ptr->mult[1]));
 42:   return(0);
 43: }

 47: PetscErrorCode F90Array3dCreate(void *array,PetscDataType type,PetscInt start1,PetscInt len1,PetscInt start2,PetscInt len2,PetscInt start3,PetscInt len3,F90Array3d *ptr)
 48: {
 50:   PetscInt size;

 55:   PetscDataTypeGetSize(type,&size);
 56:   ptr->addr      = array;
 57:   ptr->extent[0] = len1;
 58:   ptr->mult[0]   = size;
 59:   ptr->lower[0]  = start1;
 60:   ptr->extent[1] = len2;
 61:   ptr->mult[1]   = len1*size;
 62:   ptr->lower[1]  = start2;
 63:   ptr->extent[1] = len2;
 64:   ptr->mult[1]   = len1*size;
 65:   ptr->lower[1]  = start2;
 66:   ptr->extent[2] = len3;
 67:   ptr->mult[2]   = len2*len1*size;
 68:   ptr->lower[2]  = start3;
 69:   ptr->addr_d    = (void*)((long)array -(ptr->lower[0]*ptr->mult[0]+
 70:                                          ptr->lower[1]*ptr->mult[1]+
 71:                                          ptr->lower[2]*ptr->mult[2]));
 72:   return(0);
 73: }

 77: PetscErrorCode F90Array4dCreate(void *array,PetscDataType type,PetscInt start1,PetscInt len1,PetscInt start2,PetscInt len2,PetscInt start3,PetscInt len3,PetscInt start4,PetscInt len4,F90Array4d *ptr)
 78: {
 80:   PetscInt size;

 85:   PetscDataTypeGetSize(type,&size);
 86:   ptr->addr      = array;
 87:   ptr->extent[0] = len1;
 88:   ptr->mult[0]   = size;
 89:   ptr->lower[0]  = start1;
 90:   ptr->extent[1] = len2;
 91:   ptr->mult[1]   = len1*size;
 92:   ptr->lower[1]  = start2;
 93:   ptr->extent[1] = len2;
 94:   ptr->mult[1]   = len1*size;
 95:   ptr->lower[1]  = start2;
 96:   ptr->extent[2] = len3;
 97:   ptr->mult[2]   = len2*len1*size;
 98:   ptr->lower[2]  = start3;
 99:   ptr->extent[3] = len4;
100:   ptr->mult[3]   = len3*len2*len1*size;
101:   ptr->lower[3]  = start4;
102:   ptr->addr_d    = (void*)((long)array -(ptr->lower[0]*ptr->mult[0]+
103:                                          ptr->lower[1]*ptr->mult[1]+
104:                                          ptr->lower[2]*ptr->mult[2]+
105:                                          ptr->lower[3]*ptr->mult[3]));
106:   return(0);
107: }
108: /*-------------------------------------------------------------*/