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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran 95 - 2 errors I can't fix.

Status
Not open for further replies.

Facktor

Programmer
Aug 28, 2010
7
BR
Hey guys. I'm trying to compile (using g95 compiler) this program but there are two errors I can't fix.

Code:
In file mone.f95:5

USE ims.f90
       1
Error: Syntax error in USE statement at (1)


In file mone.f95:52

read(10,*) (((Lixo, CotPap(j,i)), j=1, npapeis), i, nper+1)
           1
Error: Expected variable in READ statement at (1)

Thank you!
 
Wrong 2-level implicit loop in this statement. Where is the outer control var i=..,.. ? Probably you wanted i = 1,nper+1?..
 
The parameter to the use statement is the module name not the filename.
 
ArkM, you were right. The correct was "i = 1". I've got the same error though.


xwb, it seems you were right too. I'm sorry for been such a noob, but I don't even know what a module is.
It's kind of a library I have to pay or something?
 
Ok, now it seems the first error has been fixed by fixing the second one.

Code:
C:\>g95 mone.f95 -o mone.exe
In file mone.f95:5

USE ims
       1
Fatal Error: Can't open module file 'ims.mod' at (1) for reading: No such file or directory
 
you have to compile ims.f90 before building up mone.exe and even before compiling mone.f95

I suggest :

Code:
g95 -o mone.exe ims.f90 mone.f95

Notice the order : ims.f90 before mono.f95

It is also possible to split the work into 3 steps :
Code:
g95 -c ims.f90
g95 -c mone.f95
g95 -o mone.exe ims.o mone.o

The first step generate ims.o (object file) and ims.mod (module file)
The second step used ims.mod and generates mone.o
The third step links the two object files to build up the executable program
 
Actually, the correct term is "imls" and not "msl" as I've told you.

I googled it, and it seems it's a library. Which means I have to pay for it, right?


Thank you. You guys rock!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top