module testCommon interface subroutine fooC(outVal, ioArr) bind(C, name="fooC") use iso_c_binding integer (c_int), intent(inout) :: outVal type (c_ptr), value :: ioArr end subroutine fooC end interface end module subroutine fooF() bind(C, name='fooFortran') use iso_c_binding use testCommon implicit none real (c_double), target, allocatable :: shp(:,:,:) integer :: arrLen = 3 allocate(shp(arrLen,arrLen,arrLen)) shp(1,:,1) = 1.111 write(*,*) 'Fortran: shp(1,:,1) before fooC', shp(1,:,1) call fooC(arrLen, c_loc(shp(1,:,1)) ) write(*,*) 'Fortran: shp(1,:,1) after fooC', shp(1,:,1) deallocate(shp) end