-   Linux - Software (
-   -   A question about compilation error (

sryzdn 04-02-2014 05:20 AM

A question about compilation error

I have a code written in fortran. When I compile it with gfortran, mpif90 or f95, I receive the following error:


open (is1, file='tmpfil',form='formatted',status='SCRATCH')
Error: The STATUS specified in OPEN statement at (1) cannot have the value SCRATCH if a FILE specifier is present
I don't know if here is the place to ask this question or I should be diverted somewhere else.
Please guide me on this.

shaticus 04-02-2014 08:32 AM

From the looks of it, the open function does not allow you to specify a file name when using status='SCRATCH'

if OLD or NEW is specified, the FILE= specifier must be designated. If SCRATCH is specified, the FILE= specifier cannot be specified.

'SCRATCH' -- For a file opened with STATUS='SCRATCH', a temporary file with a name of the form tmp.FAAAxnnnnn is opened. Any other STATUS specifier without an associated file name results in opening a file named 'fort.n', where n is the specified logical unit number. By default, a scratch file is deleted when closed or during normal termination. If the program aborts, then the file may not be deleted. To prevent deletion, CLOSE with STATUS='KEEP'.

Hope that helps,

sryzdn 04-02-2014 09:37 AM

1 Attachment(s)
Hi, I have enclosed the code. With some manipulations, I am receiving a new error:


At line 126 of file grid2cube.f (unit = 5, file = 'stdin')
Fortran runtime error: End of file
The input file of this code is generated by a bigger code and I can read the contents of the input to be able to see what is wrong with the input.

I would be extremely thankful if anyone help to solve this problem.

All times are GMT -5. The time now is 05:00 AM.