I am confused by the use of the 'iostat' argument in open file. As it's said, when the open command succeeds, the 'iostat' gets a value of 0.
open(unit=99, file='vel_zcor22.txt', status='old', iostat=ierr, err=100)
100 if(ierr .ne. 0) then
print*, 'open file error'
endif
print*, ierr
Why is not the 'iostat' used to tell the state rather than the 'ierr'. As my understanding of assignment operator, the 'ierr' transfers its value to 'iostat'. So what is the role of the 'ierr' playing in this procedure?