[Scilab-Dev] use basout in fortran program

ycollet at freesurf.fr ycollet at freesurf.fr
Wed May 6 13:31:50 CEST 2009


Thanks to allan, the problem is solved.
If you have a format with / inside (return). This doesn't work with
buffered print (write(buffer,720)). You must split the FORMAT into pieces.
One FORMAT for ONE LINE !

So,

720   FORMAT (/5X,12HTHREE-POINT /13HINTERPOLATION)

becomes

720   FORMAT (5X,12HTHREE-POINT )
721   FORMAT (13HINTERPOLATION)

And you call several time the BASOUT function.
Another thing with f2c:

With f2c the common is considered as "local" the dll toolbox and the
"local" common overrides the common from an external dll.

So, use:
setenv('F2C_IMPORT_COMMON','YES')

Thanks again allan,

YC

> Hello,
>
> I use first f2c to convert my code to c
> Then, I use ilib_for_link. Under windows.
> The include "stack.h" is here, just after the SUBROUTINE keyword.
> Everything works fine without the call basout (with write(6,...))
> But once I add the call basout, scilab hangs.
> I think the character buffer is large enough to handle the formated
> strings.
> The other difference I see wrt the fortran code in the optimization
> toolbox is the shape of the format:
>
> 720   FORMAT (/5X,25HTHREE-POINT INTERPOLATION)
>
> there is no quote. Is this needed ? Maybe to produce some kind of 0
> terminated strings ?
>
> YC
>
>
>> Hi,
>>
>> How do you build your fortran code ?
>>
>> With scilab ilib_for_link function or a separate makefile ?
>> Windows or linux ?
>>
>> Fortran code built with intel fortran or f2c ?
>>
>> iop_ symbol is exported.
>>
>> If you want to use iop from fortran, you need to include "stack.h"
>>
>> Allan
>>
>>
>> -----Message d'origine-----
>> De : ycollet at freesurf.fr [mailto:ycollet at freesurf.fr]
>> Envoyé : mardi 5 mai 2009 16:21
>> À : dev at lists.scilab.org
>> Objet : Re: [Scilab-Dev] use basout in fortran program
>>
>> I included a small test in my fortran code:
>>
>>       WRITE(6,666) IO
>>       WRITE(6,666) WTE
>>
>>  666  FORMAT (5X,'PARAM =',I5)
>>
>> And, when I launch the good scilab command, it hangs at WRITE(6,666) WTE
>> The WTE variable is defined in the stack.h iop common.
>> It seems that I can't access wte ?
>> This is certainly a link problem. How do I link to the iop.wte common
>> variable ?
>>
>> YC
>>
>>
>>
>>
>>
>
>
>





More information about the dev mailing list