- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I am working on an optimization code, in which an external program should provide a data file, to be read by Fortran. My question is: how could I execute the external program during the Fortran run?
Thanks,
Paulo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paulo,
You can call any command using SYSTEMQQ, which takes as an argument the command that you would use in a command or batch file.
Obviously, you would need to make sure your Fortran program closes any files needed, then you can call the program with a statement like
CALL SYSTEMQQ("C:\foldername\myprogram.exe argument1 argument2")
Then, when the program has completed, you can open the files to be analysed by your Fortran program.
Regards,
David
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
EXECUTE_COMMAND_LINE would be more portable, but you'd need to find a replacement for Wordpad on Linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>> but you'd need to find a replacement for Wordpad on Linux
export dboggs_EDITOR=gedit
IOW use an environment variable to provide the (partial) string for the EXECUTE_COMMAND_LINE.
You still have to work out issues regarding option switches and/or path separators /, \.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »