[Scilab-Dev] Question about partial fix of bug #15523

Stéphane Mottelet stephane.mottelet at utc.fr
Wed Apr 11 15:40:43 CEST 2018


I forgot to give the path to the source file:

scilab/modules/differential_equations/src/fortran/rkf45.f

Le 11/04/2018 à 15:36, Stéphane Mottelet a écrit :
> Hello devs,
>
> As I said in http://bugzilla.scilab.org/show_bug.cgi?id=15523#c4, 
> there is a an easy fix to repair mode %ODEOPTIONS(1)=2 for the "rkf" 
> solver. In fact, lines 189-90 of this file
>
> if(itask.eq.1) then iflag=1
> if(itask.eq.2) then iflag=-1
>
> appear as completely *dumb* as fortran compilers (at least gfortran on 
> OSX) silently ignore the code following a "then" on the same line. The 
> following program :
>
>        program dumb_program
>           flag=0
>           if (flag.eq.0) then flag=1/flag
>           print *,flag
>        end program dumb_program
>
> gives the output
>
>    0.00000000
>
> Even by using -Wall no warning is produced at compilation. Anyway, 
> there are only two allowed forms:
>
> -short form:
>
> if (flag.eq.0) flag=1/flag
>
> -long form:
>
> if (flag.eq.0) then
>     flag=1/flag
> endif
>
> And the fixed program works as expected
>
>        program dumb_program
>           flag=0
>           if (flag.eq.0) flag=1/flag
>           print *,flag
>        end program dumb_program
>
> as the output is
>
>          Infinity
>
> Hence, my question is: can I create a small patch for "rkf" solver, 
> commited to 6.0 branch, and keep the improvements to 'rk' solver for 
> master ?
>
> S.
>
>

-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet




More information about the dev mailing list