Submitted by Rachel Elsey on Tue, 08/02/2016 - 03:18
Hi,
I've been gfortran to build simple user functions in a dll's (actually simple user functions which call complex functions in legacy fortran code)
At the moment I have created just the main step function such as a simple example below.
I have some complex things working really well and I have got a long way just using this.
subroutine test1(param, insig, outsig)<br> !GCC$ ATTRIBUTES STDCALL, DLLEXPORT::test1<br> !==========================================================<br> !*<br> !* input(s): insig(1) = Input 1<br> !* insig(2) = Input 2<br> !* output(s): outsig(1) = Result<br> !* parameters: param(1) = Not Used<br> !*<br> !==========================================================<br> real*8 :: param(1), insig(2), outsig(2)<br> integer :: i<br> outsig(1) = (insig(1) + insig(2))/2.0<br> end subroutine
and built it with ...
gfortran -shared -fno-underscoring test1.f90 -o test1.dll
... and it works well.
However, when I add the further subroutines to the library e.g. test1SS to do some initialisation on the first step (at the moment I am passing in the step count as a parameter and using this to trigger initialisation) or try to create some parameters for the block I get stuck. It seems that although the functions are in the dll, VISSIM does not recognise them.
Does anyone have a working example in gfortran they can show me were they have done such things?
Best Regards
Rachel