Help on use Module and Interface in Fortran 95

From: D Marty (nath.domi_at_tele2.fr)
Date: 02/22/05


Date: 21 Feb 2005 15:39:45 -0800

Hello,

I don't know very well Fortran 95, I would like to have some advise on
the following problem.

I build "file.dll" in view to call it with VBA (MS Excel), and I would
like to do the folowing code:

vba:
Declare Sub TITI Lib "file.dll" (ByRef N As Long, ByRef V As Double)

Sub TOTO()
Dim V() As Double, N As Long
call SUB1(N,V(1))
end

F77:
subroutine SUB1(N,V(N))
integer N
real V()
common N,V(N)
...
end subroutine

In fortran 77 this it is impossible because the array V() must have a
fixed size in the common block.

I don't know if it is possible with Frotran 95 using Module and
Interface to do this. If somebody know, I'am very interested learn how
to do.

I use Gfortran to obtain the "file.dll"

gfortran -o file.dll -s -shared -mrtd file.f95

Thank you very much.

Dominique Marty



Relevant Pages

  • Re: f77 and dynamic arrays in common blocks
    ... declare a single large 1-D array of fixed size, ... subroutine or functions, but in the subroutine or function you declare ... the element-addressing can be done in relatively simple fortran or C. ... things) can then be put in a common block, ...
    (comp.lang.fortran)
  • Re: Fortran based MEX w/ COMMON/SAVE
    ... I believe dat (pointer to the array) and the ... SAVE at the begining of each subroutine is a bit unusual to me. ... > to unload it if there isn't a Fortran END or STOP statement. ... interaction w/ Matlab). ...
    (comp.soft-sys.matlab)
  • Re: Help Constructing Fictional Cross-Religious Movement
    ... You know how to do something in Fortran that I ... >don't know how to do despite being pretty familiar with it, COBOL ... > subroutine point ... >was finding a programming problem that seemed reasonably amenable to ...
    (rec.arts.sf.composition)
  • Re: Callbacks - Delphi and CVF
    ... | I have a FORTRAN DLL that does the computations and takes about hours ... | want to be able to access the callback functions address from every ... | subroutine in the fortran dll. ... SUBROUTINE ReportProgress ...
    (comp.lang.fortran)
  • Re: Callbacks - Delphi and CVF
    ... | I have a FORTRAN DLL that does the computations and takes about hours ... | want to be able to access the callback functions address from every ... | subroutine in the fortran dll. ... SUBROUTINE ReportProgress ...
    (comp.lang.fortran)