Actual source code: f90_hpux.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->cookie        = F90_COOKIE;
 17:   ptr->sd            = size;
 18:   ptr->ndim          = F90_1D_ID;
 19:   ptr->dim[0].extent = len;
 20:   ptr->dim[0].mult   = size;
 21:   ptr->dim[0].lower  = start;
 22:   return(0);
 23: }

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

 35:   PetscDataTypeGetSize(type,&size);
 36:   ptr->addr          = array;
 37:   ptr->cookie        = F90_COOKIE;
 38:   ptr->sd            = size;
 39:   ptr->ndim          = F90_2D_ID;
 40:   ptr->dim[0].extent = len1;
 41:   ptr->dim[0].mult   = size;
 42:   ptr->dim[0].lower  = start1;
 43:   ptr->dim[1].extent = len2;
 44:   ptr->dim[1].mult   = len1*size;
 45:   ptr->dim[1].lower  = start2;
 46:   return(0);
 47: }

 51: PetscErrorCode F90Array3dCreate(void *array,PetscDataType type,PetscInt start1,PetscInt len1,PetscInt start2,PetscInt len2,PetscInt start3,PetscInt len3,F90Array3d *ptr)
 52: {
 54:   PetscInt size;

 59:   PetscDataTypeGetSize(type,&size);
 60:   ptr->addr          = array;
 61:   ptr->cookie        = F90_COOKIE;
 62:   ptr->sd            = size;
 63:   ptr->ndim          = F90_3D_ID;
 64:   ptr->dim[0].extent = len1;
 65:   ptr->dim[0].mult   = size;
 66:   ptr->dim[0].lower  = start1;
 67:   ptr->dim[1].extent = len2;
 68:   ptr->dim[1].mult   = len1*size;
 69:   ptr->dim[1].lower  = start2;
 70:   ptr->dim[2].extent = len3;
 71:   ptr->dim[2].mult   = len2*len1*size;
 72:   ptr->dim[2].lower  = start3;
 73:   return(0);
 74: }

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

 86:   PetscDataTypeGetSize(type,&size);
 87:   ptr->addr          = array;
 88:   ptr->cookie        = F90_COOKIE;
 89:   ptr->sd            = size;
 90:   ptr->ndim          = F90_4D_ID;
 91:   ptr->dim[0].extent = len1;
 92:   ptr->dim[0].mult   = size;
 93:   ptr->dim[0].lower  = start1;
 94:   ptr->dim[1].extent = len2;
 95:   ptr->dim[1].mult   = len1*size;
 96:   ptr->dim[1].lower  = start2;
 97:   ptr->dim[2].extent = len3;
 98:   ptr->dim[2].mult   = len2*len1*size;
 99:   ptr->dim[2].lower  = start3;
100:   ptr->dim[3].extent = len4;
101:   ptr->dim[3].mult   = len3*len2*len1*size;
102:   ptr->dim[3].lower  = start4;
103:   return(0);
104: }
105: /*-------------------------------------------------------------*/