help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: f95 syntax and octave


From: Alexander Barth
Subject: Re: f95 syntax and octave
Date: Tue, 28 Nov 2006 10:40:35 -0500
User-agent: Thunderbird 1.5.0.7 (X11/20060913)

Hi Gorazd,

Yes, you can call Fortran 95 code from Octave. You might want to take a look to 
my optimal
interpolation module: http://ocgmod1.marine.usf.edu/OI/

In this implementation, I used two wrappers:

C++ wrapper
    |
Fortran subroutine wrapper with explicit shape matrices (optiminterp_f77.f)
    |
Fortran subroutine with assumed shape matrices (optimal_interpolation.F)

I don't know if there is any (portable) way to call Fortran subroutines from 
C++ with assumed shape
directly. You would have to deal with low level the array descriptors with are 
quite compiler dependent.

The Fortran 2003 standard ease the interoperability between Fortran and C (look 
for the
ISO_C_BINDING module). It gives you some control, how the subroutine is named 
in a object file (with
BIND). Unfortunately, few compiler implement this standard (g95 is a notable 
exception). As far as I
know, the 2003 standard, don't let you call subroutines with assumed shape 
arguments.

I would be interested to know if some one succeeds to use only one wrapper.

Since octave 2.9.9 (I think), mkoctfile recognizes free formated Fortran code 
(with .f90 or .F90
file extension).

Regards,
Alex

Gorazd Brumen wrote:
> Hi all,
> 
> Can I use the fortran 95 syntax when making an .oct file through the c++
> code, i.e. I write a wrapper c++ code that calls a fortran 95 subroutine?
> 
> Regards,
> Gorazd
> 


-- 
_______________________________________________________________

  Alexander Barth

  Ocean Circulation Group
  University of South Florida
  College of Marine Science
  140 Seventh Avenue South
  St. Petersburg, Florida  33701
  USA

  Phone: +1-727-553-3508     FAX:   +1-727-553-1189

_______________________________________________________________


reply via email to

[Prev in Thread] Current Thread [Next in Thread]