I have a reading problem in Fortran 90. I am trying to read 31488 rows of data. I am using the Portland Group Fortran 90 compiler.
My error message:
PGFIO-F-217 / list-direct read / unit = 14 / try to read the last end of the file. File name = / import / c / w / username / WRFV3 / SKILLSETS / Overestimations.txt in the format, sequential access record = 31489
The Fortran program thinks I have an extra line. I do not know where this is indicated in the code.
I attached the corresponding part of the code ... I searched high and low through this part of the code, I examined the text file to find out if the number of lines matches. I absolutely do not see where the problem is.
The compiler claims that the error is in the read statement ... when reading (14, *) this line of code in the do statement.
Please, help. Many thanks.
Program skillruss ! Purpose: to calculate skill scores implicit none integer :: i,j,nsite,ntime,iref,jj,csite ! nsite = number of observation sites, csites = number of chemical sites, ntime = number of hours parameter(nsite=32,csite=1,ntime=984) real :: Tob(nsite,ntime),RHo(nsite,ntime),diro(nsite,ntime) real :: raino(nsite,ntime),swo(nsite,ntime),po(nsite,ntime) real :: Tdo(nsite,ntime),vo(nsite,ntime) real :: Ts(nsite,ntime),RHs(nsite,ntime),dirs(nsite,ntime) real :: rains(nsite,ntime),sws(nsite,ntime),ps(nsite,ntime) real :: Tds(nsite,ntime),vs(nsite,ntime) real :: PMo(csite,ntime),PMs(csite,ntime) real :: pers(csite,ntime) real :: bias,rmse,sde,r,x,y,sx,sy,dw,isig real :: countn real :: nrmse,fac2,nstdev,mg,fb,nmse real :: biast(ntime),rmset(ntime),sdet(ntime) real :: rt(ntime),xt(ntime),yt(ntime) real :: sxt(ntime),syt(ntime),isigt(ntime),countt(ntime),dt(ntime) ! Open file to read the observational data open(14,file=& "/import/c/w/username/WRFV3/SKILLSETS/Overestimations.txt",& form="formatted",status="old") Tob= -999. RHo= -999. vo= -999. diro= -999. raino= -999. swo= -999. po= -999. Tdo= -999. do i=1,nsite do j=1,ntime read(14,*) Tob(i,j),RHo(i,j),vo(i,j),diro(i,j),raino(i,j),swo(i,j),& po(i,j),Tdo(i,j) if(vo(i,j) <=0.)diro(i,j)=-999. end do end do close(14)