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

Home » Public Forums » archive » Passing string from IDL to Fortran
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Passing string from IDL to Fortran [message #90466] Tue, 03 March 2015 11:15 Go to previous message
Sir Loin Steak is currently offline  Sir Loin Steak
Messages: 42
Registered: January 2012
Member
Hi all,

I am calling a Fortran subroutine from IDL, and it has been set up in a way that the filepath to some data is passed in via the argument list. So, in the subroutine we have:

character*(*),intent(in) :: dset ! path to datafiles

I initially just passed the string as normal from IDL via the call_external routine, which didn't work. Then I read it should be converted to byte before being used, so I did:

filepath = '/path_to_files/'
byte_filepath = byte(filepath)

and then passed byte_filepath via call_external to the Fortran subroutine. However, this doesn't work either (from the Fortran routine when I do print*, len_trim(dset) it gives a value of 0).

Can anyone offer any help? I have searched online and on this newsgroup and it seems to be a common query, but one which I can find no answer to. I don't need to alter the filepath or anything in Fortran - I just want to specify it in IDL and then pass it to Fortran.

For now I have just hardcoded the filepath into the Fortran routine and deleted it from the argument list, but I would like to know how to get it done using call_external. (I'm using Red Hat if that makes a difference to the solution).

Cheers,

Liam
[Message index]
 
Read Message
Read Message
Previous Topic: VOMITEVOLE PEZZO DI MERDA PIER LUIGI BOSCHI DI BANCA ETRURIA ED AREZZO (OLTRE CHE MEGALAVA CASH MAFIOSO) SU INPUT DI VERMI BERLUSCORROTTI MARIA ELENA BOSCHI E MATTEO RENZI HA PASSATO INSIDER SU BANCHE POPOLARI A NAZIPORCO DAVIDE SERRA DI ALGEBRIS E..
Next Topic: FG Bug -- Legend/Cleanup

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

Current Time: Wed Oct 08 14:08:22 PDT 2025

Total time taken to generate the page: 0.00240 seconds