I encounter an issue when calling "inquire" statement on one file and reading another one. Here is an example :
program test implicit none character(100) :: fdata, fresult, dummy integer :: uin, uout logical :: i_opened fdata = "datatest.dat" fresult = "resultest.dat" open (newunit = uin, file = fdata, form='formatted', status = 'old') inquire(FILE=fresult, OPENED=I_OPENED, NUMBER = uout) read(uin,*) dummy endprogram test
When I run that program, there is the following error :
severe (40): recursive I/O operation, unit -129 file unknown
This problem can be solved by placing the "inquire" statement before opening the fdata file, but i don't understand why. Can anyone explain this to me ?