help-octave
[Top][All Lists]
Advanced

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

More fortran to oct help


From: Zine Smith
Subject: More fortran to oct help
Date: Fri, 26 Mar 2004 14:35:25 -0800 (PST)

The help regarding T96 into Octave was great.  Thank
you.  I am having some trouble thought getting
everything to link and I have reached my end.  The ld
error I'm getting from mkoctfile and the wrapper c++
code is below.  Thank you for your help

Zine

-----Error------
$ mkoctfile tsyganenko96.cc T96.f
tsyganenko96.o(.text+0x107c): In function
`_Z4Ft96RK17octave_value_listi':
/home/SmithZB/dev/Tsyganenko/tsyganenko96.cc:48:
undefined reference to `_t96_'
collect2: ld returned 1 exit statu

---Wrapper-----
#include <octave/oct.h>
#include "defun-dld.h"
#include "error.h"
#include "f77-fcn.h"
#include "gripes.h"
#include "oct-obj.h"
#include "utils.h"

extern "C"
{
        int F77_FUNC (t96, T96_01) (const int& IOPT,
                        const double* PARMOD,
                        const double& PS,
                        const double& X,
                        const double& Y,
                        const double& Z,
                        const double& BX,
                        const double& BY,
                        const double& BZ);
}

DEFUN_DLD (t96, args, ,
        "- Loadable Function: [Bx, By, Bz] = t96 (PM, Ps, x,
y, z)\n\
        \n\
        Inputs: PM\t-\tArray(10) with Solar wind pressure in
nanopascals in PM(1)\n\
                Dst index in PM(2)\n\
                By of the IMF in PM(3)\n\
                & Bz of the IMFin PM(4)\n\
                Ps\t-\tGeotilt angle in radians\n\
                x,y,z\t-\tGSM position (RE)\n\
        Outputs: Bx,By,Bz\t-\tMagnetic field at x,y,z")
                        
{
        octave_value_list retval;
        const int dummy_integer = 0;
        Matrix PM;
        const double x=args(2).double_value(),
y=args(3).double_value(),
                z=args(4).double_value();
        const double Ps=args(1).double_value();
        double Bx, By, Bz;

        PM = args(0).matrix_value();

        F77_XFCN (t96, T96_01,
                     (dummy_integer, PM.fortran_vec(), Ps, x, y, z,
Bx, By, Bz));
        if (f77_exception_encountered)
        {
                error ("unrecoverable error in t96");
                return retval;
        }
        retval(0) = octave_value(Bx);
        retval(1) = octave_value(By);
        retval(2) = octave_value(Bz);
        return retval;
}

=====
Zine Smith 



__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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