I have some code that used to work fine, and spontaneously stopped working
It is designed to read in a file
SUBROUTINE RDPD1( iyy )
USE utils
USE FUNCTIONS
INCLUDE '..\\dims.inc'
INCLUDE '..\\moddef.inc'
INCLUDE '..\\testdef.inc'
INCLUDE '..\\options.inc'
INCLUDE '..\\read.inc'
INCLUDE '..\\ps12\\spacepd.inc'
INTEGER :: spin,znin,stat,iyy
REAL :: rbuf1,rbuf2,rbuf3,rbuf4
CHARACTER(len=8) :: progunit
! logical :: lexist,lopened,lnamed ! integer :: inumber ! character :: lseq,lunform,lread
integer(kind=3) :: addr
logical(kind=3) :: mode
integer(kind=2) :: IC
progunit='RDSPPD '
rdunit=77
rdfile='sppd'//c2dfyr(JYEAR,iyy)//tstinp(iyy)//'.itm'
CALL rdOpen(rdunit,rdfile,progunit)
block='SPPD11'
if (lfdblk(block,rdunit,rdfile)) then
DO sp=1,mxsp
IF( ldfsp(JISSP,sp).AND.idfsp(JISUNDER,sp)==0 )THEN
DO zn=1,mxzf
IF( zonedef(zn,JZTF) )THEN
**** READ(UNIT=rdunit,FMT='(2(1x,I4),4(1x,G11.0))',ERR=9999, $ IOSTAT=stat) spin,znin,rbuf1,rbuf2,rbuf3,rbuf4 **** IF( stat<0 )THEN CALL unexpectedeob(rdunit,rdfile,progunit,block) ELSEIF( stat>0 )THEN CALL errorreadingblock(rdunit,rdfile,progunit,stat,block) ELSE CALL checkSpZnOrder(sp,spin,zn,znin,progunit ) spznpd(sp,zn,JSPPDA )=rbuf1 spznpd(sp,zn,JSPSURV)=rbuf2 spznpd(sp,zn,JSPNEW )=rbuf3 spznpd(sp,zn,JSPPDV) =rbuf4 ENDIF ENDIF ENDDO ! loop over zones ENDIF ENDDO ! loop over space categories end if
CLOSE(rdunit)
RETURN
9999 call Access_details@(addr,mode,ic)
ENDSUBROUTINE
The error reported is
100f28d4 IOSTART__ [+0214] RDPD1 - in file rdsppd.for at line 50 [+0308] RUNPS2 - in file runps2.for at line 17 [+00b4] main - in file ps12.for at line 63 [+04ce]
which when debugged dies before I can get an IOSTAT on it, its driving me bananas! Astrixs mark the error line, the thing that bugs me is that it reads from the file earlier on, and the format string is correct i'm sure! Any help/ideas would be gratefully received!