subroutine PopulateData(user_struct) BIND(C,NAME="PopulateData")
!DEC$ ATTRIBUTES DLLEXPORT :: PopulateData 
!DEC$ ATTRIBUTES REFERENCE :: user_struct
use, intrinsic ::iso_c_binding
implicit none

type, bind(C) :: user_structure
	integer array_dim
	type(c_ptr)::parray
end type

type(user_structure),intent(inout) :: user_struct
integer i,n(1)
integer,pointer :: a(:)

n(1)=user_struct.array_dim

call c_f_pointer(user_struct.parray,a,n)

write(*,'(A,I2)') 'user_struct.array_dim=',user_struct.array_dim

do i=1,user_struct.array_dim	
	a(i)=100*i
	write(*,'(A,I2,A,I4)') 'user_struct.array(',i,')=',a(i)
end do

return 
end subroutine PopulateData