[Scilab-users] scilab-fortran issues

Eduardo Torrecillas eduardo.torrecillas at gmail.com
Mon Jan 20 18:14:19 CET 2014


Hi Paul,

Thank you for the reply and for the suggestion!

Regards,


On Mon, Jan 20, 2014 at 8:23 AM, Paul Bignier <
paul.bignier at scilab-enterprises.com> wrote:

>
> Hello Eduardo,
>
> The call() primitive is not (yet?) suited for string matrices, because
> there is a confusion about the "size" of it: right now, the gateway detects
> the size of a scalar string, but when it is a matrix, each element can have
> a proper size (buffer) and there is also the matrix size itself.
> To avoid this confusion, the gateway only allows scalar strings, so the
> "size" of the argument actually represents its length (for instance,
> ident="STR1" will be detected as having a 4x1 size).
>
> This is documented in the help page<http://help.scilab.org/docs/5.4.1/en_US/call.html>,
> the arguments can be "real matrices" or [scalar] "strings".
>
> So my only suggestion at the moment is to pass ident as the concatenation
> of its elements, and to split it (or iterate on its length) in the Fortran
> routine. ident = "STR1"+"STR2"+"STR3"+...
>
> Hope this helps, otherwise feel free to report a bug on
> http://bugzilla.scilab.org/
> Regards,
> Paul
>
>
>
> On 01/15/2014 09:01 PM, Eduardo Torrecillas wrote:
>
>    Hello all,
>
> I am very used to dynamic linking scilab and Fortran, and call the
> external function by the "call" function in SciLab.
>
>  Although, this is the first time I try to send string matrices as fortran
> arguments, and I can't get it working. Maybe any of you can please help?
>
>  I want to pass a column-vector where each row contains a 4-char string.
> Example:
>
>  ident=['STR1';'STR2';'STR3';...]
>
>  Now the F90 code I'm trying:
>
>  subroutine fhdg_dist(napt,ident,ret_val)
> implicit none
> INTEGER,INTENT(IN)::napt
> character(len=4),intent(in),dimension(napt,1)::ident
>  integer,intent(out)::ret_val
>
>  ret_val=0
>
>  end subroutine fhdg_dist
>
>
>  the call statement:
>
> [ret_val]=call('fhdg_dist',napt,1,'i',ident,2,'c','out',[1,1],3,'i')
>
>  So, even if I'm not trying to use the matrix data, when calling the
> external function with this call, I get "incompatible dimensions" message.
>
> Any clues, please?
>
> Regards.
>
>
> --
> Eduardo Torrecillas
> AER-09
>
>
> _______________________________________________
> users mailing listusers at lists.scilab.orghttp://lists.scilab.org/mailman/listinfo/users
>
>
> --
> Paul BIGNIER
> Scilab Engineer & Xcos Developer
> -----------------------------------------------------------
> Scilab Enterprises
> 143bis rue Yves Le Coz - 78000 Versailles, France
> Phone: +33.1.80.77.04.69http://www.scilab-enterprises.com
>
>


-- 
Eduardo Torrecillas
AER-09
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140120/c384ab52/attachment.htm>


More information about the users mailing list