FUNCTION should only be used where all the necessary information for the function to execute is obtained from the calling arguments and where that execution results in an unambiguous return value and no alteration to the argument values. In all other cases SUBROUTINE should be used.