In this discussion we concluded that this approach was not standard conforming.
You cannot ask the compiler to check the number of arguments without checking the types, it’s all or nothing.
If your big chunk of memory is a static array, then you can use the equivalence
feature:
integer :: iwork(N) ! N being known at compile time
real :: rwork(N)
equivalence(iwork,rwork)
Then iwork
and rwork
share the same memory location