In PGI fortran some options are not available, which are available in standard intel fortran
For example, one can search whether a directory exists are not
using the command inquire(directory=“directory name”, exist =“value”) in intel fortran
But in PGI fortran one cannot find such a thing.
If the directory does not exist, one can create the directory using makedirqq in intel fortran. That option is not available in pgi fortran
One can open a file with buffered = Yes or not bufferesize, blocsize in intel fortran. But it is not available in pgi fortran.
Thanks for the request. After talking with our Compiler Architect, we don’t see a compelling reason to add #1 and #3. For #1, you should be able to use “file” instead of “directory”. For #3 where not sure the purpose other then this is an old VAX extension no longer relevant. If you want a way to control the I/O buffering behavior, take a look at the “setvbuf” 3f routine.
#2, makedirqq, seem reasonable to add to our DFLIB support. I have added TPR#18240 and sent it to the appropriate compiler engineer.
Just keep in mind that those are compiler extensions and not (yet) standard Fortran. If you want to write portable code, it’s a good idea to avoid compiler extensions or language features that are very new or obsolete.
I cannot find documentation on the return value of makedirqq().
When I use it as described in the Intel documentation (here, for example:Development Tools), the return value fails to detect that the directory was successfully created.
That is to say, when I execute the following code, and the directory in question does not exist, then my code hits the “stop” statement:
inquire(file=trim(temp_directory),exist=iexist)
if (.not. iexist) then
iexist = makedirqq(trim(temp_directory))
if (iexist) then
write(*,*) 'Created temp directory.'
else
write(*,*) 'Temp directory '//trim(temp_directory)//' did not exist and could not be created.' // i2a(iexist)
stop
endif
endif