Hi,
The aim of my project is to call the subroutines (or functions) of Fortran from Java.
The solutions: I have installed Inter(R) Visual Fortran on Microsoft Visual Studio 2013, and build new project of Dynamic-link Library, and then added the subroutines written in fortran90. The compiling is successful. After that, copy the *.dll into the project directory of Java. Finally, use JNA(Java Native Access )to call Fortran from Java.
Some weird behaviours: The calling can't run successful if the subroutines contains input stream of text. The error message is as follows:
---------Visual Fortran run-time error----------------------------------
forrtl:severe(39):error during read, unit -4, file CONIN$
Image PC Routine Line Source
libifcoremd.dll 6D32FA8A Unknown Unknown Unknown
---------------------------------------------------------------------------------
I guess that the reason is some files can't be opened in Fortran subroutines because of the wrong directory.
How can I set the constant work directory in Fortran so that the read-write operation worked in this directory?