Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28988 Discussions

opening a file in a new directory under Linux Intel Fortran compiler

Suo_H_
Beginner
469 Views

Hi,

I have a basic question about creating and opening a file in a new directory under Linux Intel Fortran compiler.
I used to be able to do this by specifying the path and having STATUS='unknown' under windows CVF compiler. But it seems the Intel compiler has a differnt support for this feature?

This is the part of the fortran code that is relevant to the problem:
part of my code is:

filename = '/output/lat'//trim(adjust(clat))//'_lon'//trim(adjust(clon))//'_CT7'

OPEN(UNIT=77,FILE=trim(filename),STATUS='UNKNOWN') 

and the error is:

forrtl: No such file or directory
forrtl: severe (29): file not found, unit 77, file /output/lat89_lon200_CT7

0 Kudos
2 Replies
mecej4
Honored Contributor III
469 Views
Whether on Windows or Linux, you must first create the directory (if it does not already exist) before creating a file in the directory. To create a root-level directory such as /output you may require filesystem permissions that ordinary users are not usually in possession of.
0 Kudos
Suo_H_
Beginner
469 Views
mecej4 wrote:

Whether on Windows or Linux, you must first create the directory (if it does not already exist) before creating a file in the directory.

To create a root-level directory such as /output you may require filesystem permissions that ordinary users are not usually in possession of.

Thank you so much!! the problem solved.
0 Kudos
Reply