Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: FORTRAN mex files
Replies: 1   Last Post: Jun 20, 1996 11:42 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mr W P Brown

Posts: 1
Registered: 12/7/04
FORTRAN mex files
Posted: Jun 20, 1996 6:21 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


Can anyone help me with the following problem? Please be patient as
I have to carefully explain what I am trying to do.

DETAILS:
MATLAB version 4.2.
UNIX operating system.


BACKGROUND:
I have a FORTRAN subroutine which requires three arguments to
read from a formatted ascii data file (data.dat). I've incorporated this
subroutine into a stand-alone program which compiles without any
problem. Upon execution, an array of numbers are produced.

I want to interface this FORTRAN subroutine with MATLAB.
I've amended and renamed the gateway program yprimeg.f
(provided as an example) in the following way:
1. commented out matrix creation for a return argument
2. commented out the statement which copies the output stored in the
local array to matrix output.

At the matlab prompt, typing,

!fmex file.f fileg.f

produces

/usr/.../fmex[310]: 0: not found.
-----------------------------------------------------------
file.f:
file:
other subroutines:
fileg.f:
mexfunction:

(I get "/usr/.../fmex[310]: 0: not found." when I use yprime.f and
yprimeg.f. MATLAB accepts yprime(t,y) without any problems).

Yet, when I type file(a,b,c), MATLAB returns

*** FORTRAN I/O ERROR 933: END (OR BEGIN) OF FILE WITH NO "END=" SPECIFIER
FILE: /users/.../data.dat, UNIT: 1
( 0) 0xc11a166c io_ded + 0x37c [/usr/lib/.../libcl.sl]
etc

Now I've included an "END=" specifier in the READ statement of the subroutine,
and the same error message is returned when I follow the above procedure.


QUESTION:
The question is: if the stand-alone FORTRAN program compiles and runs without
any problems, and !fmex file.f fileg.f looks OK, then why does the program
fall over when I pass down the same arguments that I use in the stand-alone
FORTRAN program?


If this makes any sense and you can help, please email to the address below:

wayneb@astro.warwick.ac.uk


Thanks in advance,


W. Brown





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.