Actual source code: f90_intel.c

      1: #define PETSC_DLL
      2: /*-------------------------------------------------------------*/

      6: PetscErrorCode PETSC_DLLEXPORT 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->size          = len;
     17:   ptr->sd            = size;
     18:   ptr->cookie        = size;
     19:   ptr->ndim          = 1;
     20:   ptr->dim[0].lower  = start;
     21:   ptr->dim[0].upper  = len+start;
     22:   ptr->dim[0].mult   = 1;
     23:   ptr->addr_d        = (void*)((long)array -(ptr->dim[0].lower*ptr->dim[0].mult));
     24:   return(0);
     25: }

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

     37:   PetscDataTypeGetSize(type,&size);
     38:   ptr->addr          = array;
     39:   ptr->size          = len1*len2;
     40:   ptr->sd            = size;
     41:   ptr->cookie        = size;
     42:   ptr->ndim          = 2;
     43:   ptr->dim[0].lower  = start1;
     44:   ptr->dim[0].upper  = len1+start1;
     45:   ptr->dim[0].mult   = 1;
     46:   ptr->dim[1].lower  = start2;
     47:   ptr->dim[1].upper  = len2+start2;
     48:   ptr->dim[1].mult   = len1;
     49:   ptr->addr_d        = (void*)((long)array -(ptr->dim[0].lower*ptr->dim[0].mult+ptr->dim[1].lower*ptr->dim[1].mult));
     50:   return(0);
     51: }
     52: /*-------------------------------------------------------------*/