I am attempting to store DP data to a binary file as single precision. The DP data is inside multiple loops in a fortran code called EPW. When I format the data and create the binary file as formatted, the output.bin stores the desired data. However, when I try
Thank you for taking the time to respond.I have declared file_unit as an integer. I assumed that using “newunit” in the open statement would automatically assign a negative number to file_unit. I checked this number after opening and before writing (AI suggestion) and it was -129.
Is the OPEN in the same procedure/scope as where you write? When you said you checked it before the write did you check it at the line above the write or possibly in some other scope? Are you sure the error is from this write statement?
I am using the intel/2023.2.1 module on Rorqual cluster of AllianceCanada. Even though the EPW code was compiled with openmpi, I am running it serially.
Replacing file_unit with 100 results in the following compilation error:
transport.f90(180): error #7838: A scalar default-integer variable is required in this context. [100]
open(newunit=100, file='output.bin', status='replace', access='stream', form='unformatted')
-----------------^
compilation aborted for transport.f90
The opening is done inside the first outer loop. The structure is as follows:
1. Outermost loop 1 in file ephwann_shuffle.f90
2. the above calls transport.f90 where the opening and printing is done
3. For first index of loop 1 in transport.f90, open the binary file
4. Three other loops in transport.f90
5. write in the innermost loop