Actual source code: f90_nag.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          = (Pointer)array;
     16:   ptr->offset        = -size;
     17:   ptr->dim[0].extent = len;
     18:   ptr->dim[0].mult   = size;
     19:   ptr->dim[0].lower  = start;

     21:   return(0);
     22: }

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

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

     46: /*-------------------------------------------------------------*/