Hey guys,
Seriously new to fortran here. I'm using Mac OS X 10.6 and gfortran (also tried out g77 to see if there were any differences). I've been asked by my professor to compile the program "mobcal": but I'm having some difficulty doing so. The problem lies in this area of code
c
c To make it easier to run batches of programs the following
c information is now entered from a file
c
c 1. file for input
c 2. file for output
c 3. random number seed
c
c filen1='gly3h1'
c filen2='temp.out'
c i2=96
c
c From a file
c
open(20,file='mobcal.run')
read(20,'(a30)') filen1
read(20,'(a30)') filen2
read(20,*) i2
close (20)
The main problem here is that I receive an end of file error at line 122 (the open command) when running the executable (i.e. gfortran/g77 will *compile* it with no problem, but then it won't run). Now from what I've read, this is generally a problem that can be solved by fixing the line breaks in the mobcal.run file, and I've even downloaded an app that fixes these things to make sure, and still I get the same error. Any clues, guys?
Also, following the example, I choose a10A1 for filen1 as a10A1.mfj is the input file, but I receive errors if I call filen2 'a10A1.out', the error being about the period. I'm wondering that if I call filen1 and filen2 both a10A1, is the compiler going to know that one of them is an input and the other output? This is a less taxing question however, as I can't really get to here until I've got the program reading this .run!
Thanks for reading!
Seriously new to fortran here. I'm using Mac OS X 10.6 and gfortran (also tried out g77 to see if there were any differences). I've been asked by my professor to compile the program "mobcal": but I'm having some difficulty doing so. The problem lies in this area of code
c
c To make it easier to run batches of programs the following
c information is now entered from a file
c
c 1. file for input
c 2. file for output
c 3. random number seed
c
c filen1='gly3h1'
c filen2='temp.out'
c i2=96
c
c From a file
c
open(20,file='mobcal.run')
read(20,'(a30)') filen1
read(20,'(a30)') filen2
read(20,*) i2
close (20)
The main problem here is that I receive an end of file error at line 122 (the open command) when running the executable (i.e. gfortran/g77 will *compile* it with no problem, but then it won't run). Now from what I've read, this is generally a problem that can be solved by fixing the line breaks in the mobcal.run file, and I've even downloaded an app that fixes these things to make sure, and still I get the same error. Any clues, guys?
Also, following the example, I choose a10A1 for filen1 as a10A1.mfj is the input file, but I receive errors if I call filen2 'a10A1.out', the error being about the period. I'm wondering that if I call filen1 and filen2 both a10A1, is the compiler going to know that one of them is an input and the other output? This is a less taxing question however, as I can't really get to here until I've got the program reading this .run!
Thanks for reading!