Using MPI_Shared memory with multidimensional arrays

Hi,

I am trying use shared mpi mem (per Node) for allocating a N-Dimensional array. Following a simple example* I can get a C pointer (1d) to the shared memory location. My question is how can I best “map” or “wrap” the N-Dim Fortran array (used later on) to this C-pointer without using additional memory or tmp variables. Can you share an example? (or adapt the one on the link)

*https://stackoverflow.com/questions/24797298/mpi-fortran-code-how-to-share-data-on-node-via-openmp (the title of the thread is missleading)

Thanks!,
Sebastian

This seems to be the answer:

call C_F_POINTER (C_LOC(rank1_array), rank3_array, [3,2,4])