Files and print units in a multitasking application

Fortran routines running in either the main task or a subtask can open files. However, when the task terminates, all the open files except the Language Environment message file are automatically closed.

If the standard print unit is the same unit number as the error message unit, it is in effect the Language Environment message file, and will stay open when the task terminates. If the standard print unit is different from the error message unit, the print unit will close, along with other Fortran files, at task termination. The unit numbers are set with the PRTUNIT and ERRUNIT runtime options.