Thanks all you guys,
Actually I have found the problem, but in a very crazy way that you may not believe. I only changed the name of PAF(), PPAF() and ncomp to AF(), AAF() and nc , respectively. That’s it. But, I have found another crazy problem. However, regarding to your questions just let me to explain more about the variables, arrays and the program.
All com(), comp(), mmw(), TTc(), PPc(), AAF(), mw(), Tc(), Pc(), mf(), AF() are arrays, this is their declaration:
character(len=15) com(16), comp(nc)
real mft, mmw(16), MWg, TTc(16), PPc(16), AAF(16)
real mw(nc), Tc(nc), Pc(nc), mf(nc), AF(nc)
The program has been designed to read some components from a data file, and then compares with the entered ones. If the components are equal the program should pick up the rest of information related to that component and write them in a new file for the rest of program.
These are the components should be compared.
comp(1)='N2'
comp(2)='CH4'
comp(3)='C2H6'
comp(4)='C3H8'
comp(5)='i-C4H10'
comp(6)='n-C4H10'
comp(7)='i-C5H12'
comp(8)='n-C5H12'
comp(9)='C6H14'
comp(10)='C7+'
And this is the ‘do loop’ for that execuation.
do k=1, nc
do i=1, 16
if(comp(k).eq.com(i))then
comp(k)=com(i)
mw(k)=mmw(i)
MWg=MWg+mf(k)*mw(k) !MWg: lbm/lbm.mol
mft=mft+mf(k)
Tc(k)=TTc(i)
Pc(k)=PPc(i)
AF(k)=AAF(i)
write (50, '(A15, A, 5(f15.3,A), f15.3)') comp(k),',',mf(k),',',mw(k),',',mf(k)*mw(k),',',Tc(k),',',Pc(k),',',AF(k)
if(comp(k).eq.'N2')yn2=mf(k)
if(comp(k).eq.'CO2')yco=mf(k)
if(comp(k).eq.'H2S')yh2s=mf(k)
endif
enddo
enddo
However, the program do not bring back the component ‘CH4’ and it also bring ‘E=H6’ instead of ‘C2H6’. But, for the rest of components, there is not any problem.
Therefore, I would appreciate if give me some suggestions regarding this problem.
Regards,
Nemat