Hello there,
I am working on a simulation which needs a calculator to call some Python models I made. My strategy is to use Fortran i/o functions to write export values, call Python programs through command prompt and read their outputs as import values from Fortran. I don't have too much experience working with Fortran, here is my code:
open(unit=1, file="in.txt")
open(unit=2, file="bioprox.txt")
open(unit=3, file="bioult.txt")
open(unit=4, file="biosul.txt")
write(1,*) WATER, ACID, BIOMASS
write(2,'(1x,f4.2)') BIOPROX
write(3,'(1x,f6.3)') BIOULT
write(4,'(1x,f4.2)') BIOSUL
close(1)
close(2)
close(3)
close(4)
This works fine, but when I tried to call terminal I get some errors. If I add the following statement:
call execute_command_line("mkdir hey")
****TERMINAL ERROR
COULD NOT LOAD DYNAMIC LOAD MODULE
********************************************************************
* ERROR SEVERITY LEVEL OF 0 IS <= ABORT LEVEL OF 0 *
* EXECUTION IS TERMINATED: SIMULATION WILL NOT BE EXECUTED *
********************************************************************
! Errors while processing input specifications
An if I use system calling:
call system("mkdir hey")
*** SEVERE ERROR
ERROR DURING DYNAMIC LINK OF USER ROUTINE(S) OR IN-LINE FORTRAN
PLEASE CHECK FILE _3340afg.ld FOR LINKER MESSAGES.
*** SEVERE ERROR
COULD NOT RESOLVE USER OR IN-LINE FORTRAN SUBROUTINE(S):
SUBROUTINE "ZZFORT" IS MISSING
*** SEVERE ERROR
PROGRAM TERMINATED DUE TO UNRESOLVED ROUTINES
! Errors while processing input specifications
And checking the linker file:
_3340afg.txt : error LNK2019: símbolo externo _SYSTEM@8 sin resolver al que se hace referencia en la función _ZZFORT
_3340afg.dll : fatal error LNK1120: 1 externos sin resolver
Link failure, status = 1120
Any clue of what is wrong? Is it possible to do what I am trying?
Thanks!!
Miguel