I am trying to do two-dimensional DFTs using the Intel MKL (Math Kernal Library). I can't figure out how to use mkl_alloc to allocate a two-dimensional matrix (a rank two array) in Fortran. The form of mkl_alloc is
a_ptr = mkl_malloc( alloc_size, alignment )
where, alloc_size is an integer, and a_ptr is a Fortran pointer. Because alloc_size is a single integer, the output a_ptr must be a pointer to an array (a rank one array). I would like to associate the output of mkl_malloc with a rank two array, darray(N1,N2). I cannot (as far as I can tell) equate two pointers that correspond to arrays of different rank. This is really frustrating because I have a lot of code using the form darray(i,j) rather than the form array(i+N1*j).
I have considered using the newarray = RESHAPE(oldarray,newdim) function to convert the array dimensions, but I am not aware of any guarantee regarding the alignment of the result.
I've been banging my head against this for a couple days. Any help would be greatly appreciated.