C_Allocate.c 426 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

#include <stdlib.h>
#include <stdio.h>
#include "ISO_Fortran_binding.h"

void C_Allocate ( CFI_cdesc_t *A_DV, CFI_cdesc_t *ShapeDV, int *Status )
  {
  int iE;
  int *nValues;
  
  // Error checking
  if ( A_DV->rank != ShapeDV->elem_len )
    {
    *Status = -1;
    return;
    }
  
  nValues = (int *) ShapeDV->base_addr;
  for ( iE = 0; iE < ShapeDV->elem_len; iE++ )
    printf("iD: %d - len: %d", iE, nValues[iE]);
  }