Arguments' INTENT

Syntax

We have met INTENT(IN) in function's discussion. It indicates that an argument will receives some input from outside of the function and its value will not, actually cannot, be changed within the function. Since a subroutine cannot return a value through its name, it must return the computation results, if any, through its argument. Therefore, we have three cases to consider: An argument must be declared with INTENT(IN), INTENT(OUT) or INTENT(INOUT).

Examples

Here are some examples: