I have 6 Fortran Subroutines named:
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.
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.
The USER2.f90 has the following:
As far as creating a main program is concerned, how should I create one.
Should I just create a Program named MAIN
Would this work?
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
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".
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:
When you run the rebuilt program this should tell you where the error occurs.
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.