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: }
     44: /*-------------------------------------------------------------*/