I have a short snipped of code that works fine with older version of pgf95 and does not work correctly with pgf12.2. Here is the reproducer code :
integer ,allocatable,dimension(:) :: refimax,refjmax,refkmax
open(11,file='test.grid.in',status='new',form='unformatted')
write(11) 2
write(11) 1,2,3,4,5,6
close(11)
open(11,file='test.grid.in',status='old',form='unformatted')
allocate(refimax(1),refjmax(1),refkmax(1))
ng=1
read(11,err=7)refimax(1),refjmax(1),refkmax(1)
write(*,*) ' single grid format detected'
goto 8
7 continue
write(*,*) ' multiple grid format detected'
rewind(11)
deallocate(refimax,refjmax,refkmax)
read(11)ng
allocate(refimax(ng),refjmax(ng),refkmax(ng))
read(11)(refimax(ig),refjmax(ig),refkmax(ig),ig=1,ng)
8 continue
stop
end
This type of code is very common in CFD codes reading grid files.
When I run this code with 12.2 I get :
multiple grid format detected
PGFIO-F-219/unformatted read/unit=11/attempt to read/write past end of record.
File name = test.grid.in unformatted, sequential access record = 1
In source file testit2.f, at line number 17
Thanx,
Bernie