Mecej4,
Here is the code. I have not changed much of it from my earlier dabbles.
winapp 300000,600000
Program DriverProgram
implicit none
double precision Temperature, Pressure, Z(10), K(10)
integer I
Temperature = 300.0d+00
Pressure = 1.01d+05
Z(1) = 0.50d+00
Z(2) = 0.25d+00
Z(3) = 0.20d+00
Z(4) = 0.05d+00
Z(5:10) = 0.0d+00
K = 0.0d+00
write (6,*) 'Main driver program calling Kvalues'
write (6,*) '.................................'
call GetK(Temperature, Pressure, Z, K)
write (6,*) '.................................'
write (6,*) 'Back to Driver Program'
write (6,*) 'Kvalues are as follows'
do I = 1, 10
write (6,*) 'Kvalue-',I
write (6,*) ' ',K(I)
enddo
call Dummycall(Temperature, Pressure, I)
stop
end
subroutine Dummycall (a, b, c)
implicit none
real * 8 a, b, c
write (6,*) 'I am from Dummy_call - Called from MainProgram'
call Ex3(a, b, c)
return
end
subroutine Ex3 (a, b, c)
implicit none
real * 8 a, b, c
write (6,*) 'I am from Ex3 - Called from Ex2'
call Ex4(a, b, c)
return
end
subroutine Ex4 (a, b, c)
implicit none
real * 8 a, b, c
write (6,*) 'I am from Ex4 - Called from Ex2'
return
end
subroutine GetK(Temperature, Pressure, Z, K)
implicit none
double precision Temperature, Pressure, Z(10), K(10)
integer I
write (6,*) 'I am from GetKvalues'
do I = 1, 10
K(I) = Temperature*Pressure*Z(I)*1.d-05
enddo
call Ex3(Temperature, Pressure, I)
write (6,*) 'Exiting GetKvalues'
return
end
I do acknowledge that, I can combine ALL the subroutines into 1 .for file and make a DLL of that .for. However, my actual programs are all several thousand lines, so that makes code maintenance troublesome.
My objective here is to make the routine DummyCall and GetK as 2 separate DLLs. For example, make GetK.dll without linking Ex3.obj and GetK.obj using slink. I am trying to recreate a situation where in my actual program, a DLL should be able to call other routines (that are not DLLs). Maybe I am doing something outright wrong.