Now that we have looked at a number of features of your program, it occurs to me that FORALL, PURE functions and putting a trivial function in a DLL are all, perhaps, mere distractions.
Each of these features makes the program harder to write, build and debug. It should be clear that none of those features are needed for the simple goal of doubling the elements of a one-dimensional array of reals.
Furthermore, FORALL has been declared 'obsolescent'; see section B.3.13 of http://j3-fortran.org/doc/year/15/15-007.pdf . Language features labeled 'obsolescent' should probably not be used in new code that you write now.
It would be most useful if you would write a description of what you want to do with your ultimate program. What is the true nature of the function that you want to put in a DLL? Why is it necessary to make your code parallel?
As with any engineering project, it is good to assess the various choices available and select a small subset which you then investigate/develop farther, rather than make an injudicious choice now and spend a lot of effort later on getting things to work properly and efficiently.