Execution proceeds as follows:
The file associated with the specified unit is determined.
The format, if specified, is established. The file is positioned appropriately prior to data transfer.
If the output list is not empty, data is transferred from the list to the file.
Data is edited according to the format, if specified.
In the second form of namelist-directed WRITE, the data is transferred from the items of the specified namelist group according to the rules of namelist-directed output.
The file is repositioned appropriately after the data transfer.
If ios is specified, and no error occurs, it is set to zero; otherwise, it is set to a positive value.
If s is specified and an error occurs, control is transferred to s.