Discussion Overview
The discussion revolves around how to open an arbitrary number of files in a DO loop using FORTRAN, specifically focusing on constructing filenames dynamically based on the loop iterator. Participants also address related issues such as appending data to existing files without overwriting previous content.
Discussion Character
- Technical explanation
- Exploratory
- Homework-related
Main Points Raised
- One participant seeks guidance on how to construct filenames within a DO loop using the loop iterator.
- Another participant provides a sample code snippet that demonstrates how to format the filename using a WRITE statement.
- A participant clarifies that they are using FORTRAN90 and inquires about adding a file extension to the filename.
- Further clarification is provided on how to include the file extension in the filename format and the necessary adjustments to the character length.
- A new participant raises a question about writing to an existing file without deleting previous data.
- Responses suggest using the ENDFILE statement and opening the file with the 'append' access option to achieve this goal.
Areas of Agreement / Disagreement
Participants generally agree on the methods for constructing filenames and appending data to files, but there are multiple approaches suggested for handling file access and formatting, indicating a lack of consensus on the best method.
Contextual Notes
Some limitations include the dependence on specific FORTRAN versions and the need for adjustments in character lengths for filenames, which may vary based on individual implementations.
Who May Find This Useful
This discussion may be useful for programmers working with FORTRAN, particularly those looking to manage file I/O operations within loops or needing to append data to existing files.