Fortran /
WritingToAFileWriting to a file in Fortran involves 3 steps: 1 - Opening a fileBefore putting content into a file, it must be open. A general opening statement would look like:
where 2 - Writing to a file
where It is also possible to write multiple values from a vector or matrix by using an implicit loop: write(unit, format) (vec(i), i = 1, ni) write(unit, format) (mat(:,j), j=1,nj 3 - Closing the fileOnce the writing is done, it is good practice to close the file with:
|