- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi,
I have 6 Fortran Subroutines named:
1. LU.f90
2. IDENTITY.f90
3. JACOBIAN.f90
4. BROY.f90
5. TR.f90
6. USER2.f90
The last one (USER2.f90) is the final one where all other subroutines have been called in one or other. I need to compile all of them and run the code. I compiled them in the Command prompt window using Intel (R) 64 Visual Studio 2013.
I DID THIS> ifort LU.f90 IDENTITY.f90 JACOBIAN.f90 BROY.f90 TR.f90 USER2.f90 <enter>
This created the .obj files. I need to know the next steps to Run the code. Please help me.
Also, there is a message that comes when I compile the codes: error LNK2019: unresolved external symbol MAIN__ referenced in function main.
Please help me how to resolve this issue. It's urgent but I am stuck at this step. Your help would be highly appreciated.
Thanks
Geetanjali
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Please attach a copy of USER2.f90. What you have done should work, but none of the sources you compiled contain a Fortran main program. You can't run a collection of subroutines - there needs to be a main program (which is not a subroutine, function, module or BLOCK DATA subprogram) that calls one or more subroutines/functions.
If USER2.f90 is just a subroutine with no arguments that starts the process going, then you may be able to resolve it by simply removing the SUBROUTINE statement from that file.
I also recommend that you put the file with the main program first in the list of sources, as it will be used to name the executable.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi Steve,
The USER2.f90 has the following:
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
As far as creating a main program is concerned, how should I create one.
Should I just create a Program named MAIN
PROGRAM Main
IMPLICIT NONE
Call USER2
END PROGRAM
Would this work?
Thakns
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
LU.exe is your executable. As I wrote earlier, the default is to name the executable after the first file listed in the build command. This is why I suggested putting USER2.f90 first in the list. As an alternative, you could add
/EXE:USER2.exe
to the ifort command you used to do the build.
Your suggested edit in post 4 would almost have worked, except that the END statement should not include the keyword PROGRAM. You could use just "END" or "END Main".
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Just type "user2.exe" (without the quotes) at that command prompt.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
You have a programming error, probably an array index is going outside of the dimension range. I suggest you recompile all the source files with these two options added to the command:
/traceback /check:all
When you run the rebuilt program this should tell you where the error occurs.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I also suggest adding /warn:interface to the ifort command in addition to what gib suggested. This may reveal other errors.
It may be that you need to learn how to build and debug the application within Visual Studio. The documentation has a "Getting Started" section to lead you through this.

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite