Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program Fails after Changing Input File

Status
Not open for further replies.

dac5039

Programmer
Aug 12, 2009
22
US
Hello,

The two attached .f95 scripts are identical, except for the data file which is read-in. I would really love it if someone could tell me why the 'ifinal.f95' scripts fails to produce results..?

Thanks,

Dave
 
That will be hard if you don't say anything about the kind of failure you get.

As you count he amount of lines to be read, check your second input file for lines that are being counted without having data, like a line with "<space><CR>
 
Hey Gerrit,

Maybe fail was the wrong word.. Both scripts run without crashing. However, once the 'ifinal.f95' script is finished, the results are all zero (incorrect). Strange, since I've only altered the data file name.

Thanks,

Dave
 
When the sources are the same and the input file is the same then it's logical that your error has nothing to do with Fortran.
You got an error in the ifinal.f95, because you try to use this file path which contains spaces:
'c:\documents and settings\owner\desktop\data\tdata.txt'
in the first example cleaner2.f95 you used normal file path without spaces:
'c:\perl\scripts\496\rescraped_trend_space.txt'
and therefore it worked.
So, to avoid such problems try to use normal paths without spaces or try to anclose names with spaces in "...", e.g.
c:\"documents and settings"\owner\desktop\data\tdata.txt
I'm not sure if it works in Fortran, because I try to avoid using long path names with spaces.
 
If your fortran cannot handle long files names, try this:

dir /x

you will will see the 8.3 char name that DOS uses. ie c:\docume~1.

soo.. you can open c:\docume~1\alluse~1\file,txt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top