LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gfortran v4.4.1 run in linux machine gives runtime error (https://www.linuxquestions.org/questions/programming-9/gfortran-v4-4-1-run-in-linux-machine-gives-runtime-error-831417/)

ladhikari 09-10-2010 11:47 AM

gfortran v4.4.1 run in linux machine gives runtime error
 
Hi,
I am new to both linux and fortran programming. I am trying to read from an external file, but it gives this error message:

Fortran runtime error: Bad integer for item 1 in list input

Part of the code that has the problem is:

open(unit=3,file=&
'../../../../../../atrain_data/prfdata/temp_pres_cld_profile_for_CRTM2006-06-15T200163.dat',FORM='formatted')
read(3,*)bsepos
read(3,*)toppos
write(3,*)bsepos
write(3,*)toppos
do 200 i1=1,102
read(3,*)presprf(i1)
write(3,*)presprf(i1)
200 continue
do 150 i2=1,101
read(3,*)preslyr(i2),templyr(i2)
write(3,*)preslyr(i2),templyr(i2)
150 continue
do 100 i3=1,7
read(3,*)modisBtemp(i3)
write(3,*)modisBtemp(i3)
100 continue
close(3)


All the variables have been declared before and there is no problem with that. The problem (error message) is in the (first) line that deals with open(unit=3,file='..//').

Any help will be greatly appreciated.
Thanks,
ladhikari

hda7 09-11-2010 07:36 AM

Can you list the part that declares the variables (so we can tell what type they are)?

Also, that error (I think) means the input that is being read for an integer variable is not formatted as an integer. Check your input file.

ladhikari 09-11-2010 12:19 PM

Thank you hda7. I figures out the main problem was with the input/output discrepancy. I rewrote the data in a column and was able to read.

Ladhikari


All times are GMT -5. The time now is 11:46 AM.