type FUNCTION function-name (arg1, arg2, ..., argn) IMPLICIT NONE [specification part] [execution part] [subprogram part] END FUNCTION function-name
Here are some elaborations of the above syntax:
INTEGER FUNCTION Factorial(n)
LOGICAL FUNCTION TestSomething(a, b, c)
where arg1, arg2, ..., argn are left out. But, the pait of parenthesis must be there.type FUNCTION function-name () IMPLICIT NONE [specification part] [execution part] [subprogram part] END FUNCTION function-name
where the result of expression is stored to the name of the function.function-name = expression
However, the name of the function appear in the right-hand side of any expression. That is, the name of the function, used as a variable name, can only appear in the left-hand side of an expression. This is an artificial restriction in this course only.