When you pass a string to a Fortran routine you should also pass the length 
of the string (tipically as an integer passed by value as the last 
element). 

The latest C interoperability features of Fortran will give you a more safe 
and portable way to do it consistently.

:-) 


Il giorno lunedì 2 febbraio 2015 19:05:19 UTC+1, benjamin kary ha scritto:
>
> I have a Fortran module which parses a complicated input file to populate 
> a workspace with all the variables I need for a certain task.  I have 
> decimated the fortran code to try and get a single parsing command to 
> work.  The input to the Fortran function "em_data_read_input" is a string 
> containing the name of the input file.  The Fortran function returns a 
> variable "freq" of type REAL(kind=8).  The following causes the julia 
> kernel to restart with no error message:
>
> test = ccall( (:__global_variables_MOD_emdata_read_input, "libglobvar"), 
> Float64, (Ptr{Int8},), "csem3dfwd.in" )
>
> Is there anything obviously wrong with what I'm trying to do?
>
> Thanks,
>
> Ben
>
>

Reply via email to