I generally try to adhere to the single responsibility principle. The procedure you show violates that principle by doing formatting and output. Thus, in my projects I have procedures that do formatting and only produce strings. Where those strings go is a decision made elsewhere.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Equivalent of str function (from python) in Fortran | 10 | 1595 | February 1, 2022 | |
|
Call Fortran with IO from Python
|
4 | 180 | October 31, 2024 | |
| Performance: Writing to stdout vs output_unit | 5 | 1358 | August 28, 2020 | |
| Writing to screen and file at the same time/line | 9 | 1241 | August 25, 2022 | |
|
Derived type for file
|
2 | 477 | October 30, 2020 |