Info
This question is closed. Reopen it to edit or answer.
Suggestions for running FORTRAN source code through MATLAB; mex finds too many errors
1 view (last 30 days)
Show older comments
Hi all,
I am interested in running a FORTRAN source code through MATLAB. I want to use either mex or f2matlab to do this, but in either case, I'm getting errors.
- mex specifically states: "??? Error using ==> mex at 222; Unable to complete successfully."
Does this mean that need to make edits to the FORTRAN code line-by-line, or should I try a different compiler, or something else entirely?
- f2matlab gives me the error:
"??? Attempted to access temp(0); index must be a positive integer or logical.
Error in ==> changeoperator_f at 69
temp=find(~isspace(funstr{i}));
temp=temp(temp<loc);
temp=temp(length(temp));"
, etc. I can't find where in particular this is an issue in the FORTRAN code. Am I using this function incorrectly?
I've read through just about all the mathworks questions on this sort of topic, but I just don't have enough experience with running FORTRAN files to know where to start fixing these errors. Anyone have any immediate suggestions for resources or where to go next? (Keeping in mind that I'm not terrible with MATLAB, but the C/FORTRAN side to this is pretty new to me.)
The FORTRAN code in question is a USDA soil model (SHAW) and is located in the zip file at the bottom of this page in the code file: http://www.ars.usda.gov/Research/docs.htm?docid=16931
7 Comments
Jan
on 14 Apr 2015
And this means, that it is not a problem of errors in the fortran code, but mex is missing the compiler.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!