What does this error mean?
How do I fix it?
gfortran ./main.f95 -o main
f951: Warning: command line option ‘-Wformat=1’ is valid for C/C++/ObjC/ObjC++ but not for Fortran
f951: Warning: command line option ‘-Wformat-security’ is valid for C/C++/ObjC/ObjC++ but not for Fortran
f951: Warning: ‘-Werror=’ argument ‘-Werror=format-security’ is not valid for Fortran
./main
At line 14 of file ./main.f95 (unit = 100, file = 'data1.dat')
Fortran runtime error: End of file
Error termination. Backtrace:
#0 0x7f27e046eb90 in ???
#1 0x7f27e046f635 in ???
#2 0x7f27e046ffdb in ???
#3 0x7f27e0684c23 in ???
#4 0x7f27e067db82 in ???
#5 0x7f27e067f482 in ???
#6 0x7f27e0684015 in ???
#7 0x40137d in ???
#8 0x40114e in ???
#9 0x7f27e00fa78f in ???
#10 0x401189 in ???
at ../sysdeps/x86_64/start.S:120
#11 0xffffffffffffffff in ???
exit status 2
code there is :
program gaussseidel
implicit none
integer:: N,I,J,Kmax,S,K,M,W,NB
complex,Dimension(100,100)::Ya,Z,Ys
real,Dimension(100):: P,Q
complex,Dimension(100)::V
real::a,b,d,e
complex::SS,ST,Va,eps,DVamax
integer,dimension(100)::type
!ici commence mon programme
!c:saisie Dimension réseau
open(unit=100,file='data1.dat')
open(unit=200,file='result.res')
Read(100,*)N,NB
write(200,*)'le nombre=',N,' le nombre de branches=',NB
do I=1,N
do J=1,N
Ya(I,J)=0
enddo
enddo
write(200,*)'la matrice admittance'
do w=1,NB
Read(100,*)I,J,a,b,d,e
Z(I,J)=cmplx(a,b)
Ys(I,J)=cmplx(d,e)
if(real(Z(I,J))>0. .and. aimag(Z(I,J))>0.)then
Ya(I,J)=-1/Z(I,J)
else
Ya(I,J)=1e-6
endif
Ya(J,I)=Ya(I,J)
Z(J,I)=Z(I,J)
write(200,*)I,J,Ya(I,J)
enddo
!c:on calcul les élément de diagonale
write(200,*)'la matrice admittance, les élements diagonaux'
do I=1,N
Ya(I,I)=(0.,0.)
do J=1,N
if(Z(I,J)/=0)then
Ya(I,I)=Ya(I,I)+(-Ya(I,J)+Ys(I,J)/2)
endif
enddo
write(200,*)I,I,Ya(I,I)
enddo
DVamax=cmplx(-10000,-10000)
do I=1,N
V(I)=(1.,0.)
enddo
!c:initialisation des tensions
!c:ici commence la saisie des tableaux de planification
!c:saisie numéro nœud balancier
Read(100,*)S
write(200,*)S
type(S)=0
!c:saisie de type des nœud)
do I=1,N
if(I/=S)then
Read(100,*)type(I)
!c:si nœud est consommateur(c)
if(type(I)==2)then
Read(100,*)P(I),Q(I)
write(200,*)'aprés calcul de type',type(I),P(I),Q(I)
endif
if(type(I)==1)then
Read(100,*) a,b,P(I)
V(I)=cmplx(a,b)
write(200,*)'aprés calcul de type',type(I),V(I),P(I)
endif
V(I)=cmplx(1.,0.)
endif
enddo
!c:saisie de epsilon,Kmax
Read(100,*)a,b,Kmax
eps=cmplx(a,b)
write(200,*)a,b,Kmax
!c:ici commence le traitement
K=0
100 write(200,*) 'itération ',K
do I=1,N
if (I/=S)then
SS=(0.,0.)
do J=1,N
if(I/=J)then
SS=SS+Ya(I,J)*V(J)
endif
enddo
if(type(I)==1)then
ST=cmplx(0.,0.)
do J=1,N
ST=ST+Ya(I,J)*V(J)
enddo
Q(I)=aimag(V(I)*ST)
endif
Va=V(I)
V(I)=(1/Ya(I,I))*(cmplx(P(I),-Q(I))/V(I)-SS)
if(real(Va-V(I))>real(DVamax) .and. aimag(Va-V(I))>aimag(DVamax))then
DVamax=Va-V(I)
endif
endif
enddo
write(200,*)'DVamax=',cabs(DVamax),' eps=',cabs(eps)
do M=1,N
write(200,*)cabs(V(M)),-atan(aimag(V(M))/real(V(M)))
enddo
if(cabs(DVamax)>cabs(eps))then
K=K+1
if(K<=Kmax)then
Go to 100
else
write(200,*)'on diverge'
endif
else
!c:ici calculer puissance apparente du noeud Bilan
ST=cmplx(0.,0.)
do I=1,N
ST=ST+Ya(S,I)*V(S)
enddo
P(S)=Real(V(S)*ST)
Q(S)=aimag(V(S)*ST)
write(200,*) 'puissance apparente du noeud Bilan'
write(200,*)P(S),Q(S)
write(200,*)'vecteur tensions nodales'
do M=1,N
write(200,*)cabs(V(M)),-atan(aimag(V(M))/real(V(M)))
enddo
endif
end program
data1.dat is:
5, 7
1 2 0.0410 0.3146 0 0.07
1 3 0.042 0.321 0 0.0715
1 4 0.0309 0.273 0 0.0528
2 4 0.0238 0.1823 0 0.0405
2 5 0.0365 0.2806 0 0.0624
3 5 0.0573 0.4397 0 0.0978
4 5 0.0178 0.1367 0 0.0300
B 1 0
G 1.0 0.931
G 1.0 0.900
C 2.202 1.031
C 0.911 0.212
0.001 100
result.res file is empty