View previous topic :: View next topic |
Author |
Message |
jill.blouse
Joined: 13 Nov 2012 Posts: 4
|
Posted: Wed Nov 14, 2012 9:35 am Post subject: Some error messages |
|
|
Hi, I am totally new in the FORTRAN world and therefore understanding this language together with some warnings and error messages becomes harder and harder.
I tried to find the meaning of different errors, but was not successful enough.
After starting the compiling, I got the only red-error message as "*** No main program supplied" and the compilation failed without showing any result.
What should I do? what is the problem? |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Wed Nov 14, 2012 9:51 am Post subject: |
|
|
You need one and only one main program.
Here is a template for a working program
Code: |
! External subroutine, not in a module
SUBROUTINE AAA()
END SUBROUTINE AAA
! Module with subroutine
MODULE XXX
CONTAINS
SUBROUTINE BBB
END SUBROUTINE BBB
END MODULE XXX
! Main program
PROGRAM NNN
USE XXX, ONLY: BBB
CALL AAA
CALL BBB
END PROGRAM NNN
|
_________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
jill.blouse
Joined: 13 Nov 2012 Posts: 4
|
Posted: Wed Nov 14, 2012 10:13 am Post subject: |
|
|
Thanks, but the point is that I need just to write one subroutine. I am going to use it later in another software. I mean to say that, I do not have any program. It is just one subroutine and thats all. Does FTN95 compile just one subroutine without any program? |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Wed Nov 14, 2012 11:38 am Post subject: |
|
|
I see.
Are you using Plato, FTN95 Express (the free Visual studio Shell plug in), or the command line?
In Plato Build>Compile or Control-F7 compiles without trying to link to create a program. This will produce a .OBJ file that can be linked to your program later.
Are you going to supply your subroutine as source code for the other software? If so this is all you need to do to check it will compile. However, you may want to write a simple main program which calls the subroutine so you can test it. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
jill.blouse
Joined: 13 Nov 2012 Posts: 4
|
Posted: Wed Nov 14, 2012 1:26 pm Post subject: |
|
|
Thanks david good idea  |
|
Back to top |
|
 |
|