comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL & FORTRAN problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL & FORTRAN problems [message #25330] Thu, 07 June 2001 07:12
William Luh is currently offline  William Luh
Messages: 3
Registered: May 2001
Junior Member
I have had no problem creating the wrapper dynamic link library and using
call_external. The problem is the result I get back from the fortran
routine is garbage. I tested the fortran program as a console stand-alone,
so there's no bug in the fortran code.

I am working with large image matricies and passing them as arguments to
the fortran subroutine by using call_external. I have created smaller test
programs (ie: a fortran subroutine that adds two matricies, which I call
from IDL using call_external, and the results are correct, so the problem
is not in getting the basics to work). Has anyone had any problems with
using fortran subroutines that pass something like 3 matricies of size
512x512?

I also checked to see that the matricies were being passed from
IDL to fortran correctly. I did this by writing a few entries of the
matrix (on the fortran side) to a file, and then checking the entries in
the file. And yes, I transposed the matricies in IDL before passing them
to the fortran subroutine. I also checked every argument by passing them
back from fortran to IDL in different "out" parameters to see if they were
being corrupted - they were fine.

The only difference between the original fortran standalone and the new
IDL-call-fortran version is that the fortran subroutine was called from a
fortran main which opened the image files. The IDL-call-fortran version
opens the image files in IDL first and then calls the subroutines. I
checked to make sure all the parameters were being passed correctly as
described in detail above. What else could be wrong? I'm using the DIGITAL
Fortran compiler (from Compaq) in Windows 98.

As a possible workaround, I tried to open the image files directly in
fortran so that I don't need to pass in such large matricies. However,
fortran complains saying the file is too large. I've also tried to wrap
the fortran file in a C program, and then just use spawn from IDL. Again,
fortran complains about file being too large (512x512 image) whenever it
is in a wrapper.

Thanks,
William
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: converting string to integer
Next Topic: Re: Plotting data over USGS DOQ images.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:15:59 PDT 2025

Total time taken to generate the page: 0.00523 seconds