Actual source code: f90_intel8.c

  1: #define PETSC_DLL

  3: /*-------------------------------------------------------------*/

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

 15:   PetscDataTypeGetSize(type,&size);
 16:   ptr->addr          = array;
 17:   ptr->sd            = size;
 18:   ptr->ndim          = 1;
 19:   ptr->a             = F90_COOKIE7;
 20:   ptr->b             = F90_COOKIE0;
 21:   ptr->dim[0].extent = len;
 22:   ptr->dim[0].mult   = size;
 23:   ptr->dim[0].lower  = start;
 24:   ptr->sum_d         = -(ptr->dim[0].lower*ptr->dim[0].mult);
 25:   return(0);
 26: }

 30: PetscErrorCode  F90Array2dCreate(void *array,PetscDataType type,PetscInt start1,PetscInt len1,PetscInt start2,PetscInt len2,F90Array2d *ptr)
 31: {
 33:   PetscInt size;

 38:   PetscDataTypeGetSize(type,&size);
 39:   ptr->addr          = array;
 40:   ptr->sd            = size;
 41:   ptr->ndim          = 2;
 42:   ptr->a             = F90_COOKIE7;
 43:   ptr->b             = F90_COOKIE0;
 44:   ptr->dim[0].extent = len1;
 45:   ptr->dim[0].mult   = size;
 46:   ptr->dim[0].lower  = start1;
 47:   ptr->dim[1].extent = len2;
 48:   ptr->dim[1].mult   = len1*size;
 49:   ptr->dim[1].lower  = start2;
 50:   ptr->sum_d         = -(ptr->dim[0].lower*ptr->dim[0].mult+ptr->dim[1].lower*ptr->dim[1].mult);
 51:   return(0);
 52: }

 56: PetscErrorCode  F90Array3dCreate(void *array,PetscDataType type,PetscInt start1,PetscInt len1,PetscInt start2,PetscInt len2,PetscInt start3,PetscInt len3,F90Array3d *ptr)
 57: {
 59:   PetscInt size;

 64:   PetscDataTypeGetSize(type,&size);
 65:   ptr->addr          = array;
 66:   ptr->sd            = size;
 67:   ptr->ndim          = 3;
 68:   ptr->a             = F90_COOKIE7;
 69:   ptr->b             = F90_COOKIE0;
 70:   ptr->dim[0].extent = len1;
 71:   ptr->dim[0].mult   = size;
 72:   ptr->dim[0].lower  = start1;
 73:   ptr->dim[1].extent = len2;
 74:   ptr->dim[1].mult   = len1*size;
 75:   ptr->dim[1].lower  = start2;
 76:   ptr->dim[2].extent = len3;
 77:   ptr->dim[2].mult   = len2*len1*size;
 78:   ptr->dim[2].lower  = start3;
 79:   ptr->sum_d         = -(ptr->dim[0].lower*ptr->dim[0].mult+
 80:                          ptr->dim[1].lower*ptr->dim[1].mult+
 81:                          ptr->dim[2].lower*ptr->dim[2].mult);
 82:   return(0);
 83: }

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

 95:   PetscDataTypeGetSize(type,&size);
 96:   ptr->addr          = array;
 97:   ptr->sd            = size;
 98:   ptr->ndim          = 4;
 99:   ptr->a             = F90_COOKIE7;
100:   ptr->b             = F90_COOKIE0;
101:   ptr->dim[0].extent = len1;
102:   ptr->dim[0].mult   = size;
103:   ptr->dim[0].lower  = start1;
104:   ptr->dim[1].extent = len2;
105:   ptr->dim[1].mult   = len1*size;
106:   ptr->dim[1].lower  = start2;
107:   ptr->dim[2].extent = len3;
108:   ptr->dim[2].mult   = len2*len1*size;
109:   ptr->dim[2].lower  = start3;
110:   ptr->dim[3].extent = len4;
111:   ptr->dim[3].mult   = len3*len2*len1*size;
112:   ptr->dim[3].lower  = start4;
113:   ptr->sum_d         = -(ptr->dim[0].lower*ptr->dim[0].mult+
114:                          ptr->dim[1].lower*ptr->dim[1].mult+
115:                          ptr->dim[2].lower*ptr->dim[2].mult+
116:                          ptr->dim[3].lower*ptr->dim[3].mult);
117:   return(0);
118: }
119: /*-------------------------------------------------------------*/