Hey.
After searching for a while in books, here on stackoverflow and on the general web, I have found that it is difficult to find a straightforward explanation to the real differences between the fortran argument intents. The way I have understood it, is this:
- `intent(in)` -- The actual argument is copied to the dummy argument at entry.
- `intent(out)` -- The dummy argument points to the actual argument (they both point to the same place in memory).
- `intent(inout)` -- the dummy argument is created locally, and then copied to the actual argument when the procedure is finished.
If my understanding is correct, then I also want to know why one ever wants to use intent(out)
, since the intent(inout)
requires less work (no copying of data).