Bonjour à tous,
Je souhaiterais convertir cet extrait de code en .f vers .f95:
do 40 i=0,ndisc
h = h0
tin = t(i)
30 continue
tout = t(i+1)
if (type.eq.'IDE') then
call mebdfi(n,tin,h,y,dy,tout,t(i+1),mf,idid,lout,
+ lwork,work,liwork,iwork,
+ mbnd,maxder,itol,rtol,atol,
+ rpar,ipar,pdervide,residide,ierr)
elseif (type.eq.'ODE') then
call mebdfi(n,tin,h,y,dy,tout,t(i+1),mf,idid,lout,
+ lwork,work,liwork,iwork,
+ mbnd,maxder,itol,rtol,atol,
+ rpar,ipar,pdervode,residode,ierr)
elseif (type.eq.'DAE') then
call mebdfi(n,tin,h,y,dy,tout,t(i+1),mf,idid,lout,
+ lwork,work,liwork,iwork,
+ mbnd,maxder,itol,rtol,atol,
+ rpar,ipar,pdervdae,residdae,ierr)
endif
if (ierr.eq.-1) then
h = h / 2d0
idid = -1
ierr = 0
goto 30
elseif (idid.eq.1) then
if (printsolout) then
idid = 3
c -------------------------------------------------
c The approximation at t0+h0 is printed in the output file
write(90,formatout)
+ tin, (y(indsol(it)),it=1,nindsol)
c -------------------------------------------------
else
idid = 0
end if
goto 30
elseif (idid.eq.3) then
c -------------------------------------------------
c We print only the point in the considered interval
c [t(i) t(i+1)]
if ((printsolout).and.(tin.le.tout)) then
c -------------------------------------------------
write(90,formatout)
+ tin, (y(indsol(it)),it=1,nindsol)
end if
goto 30
elseif (idid.ne.0) then
print *, 'MEBDFID: ERROR: ',
+ 'MEBDFI returned IDID = ', idid
stop
endif
c ----------------------------------------------
c The approximation in t(i+1) is printed in the
c output file
if (printsolout) then
write(90,formatout)
+ tin, (y(indsol(it)),it=1,nindsol)
idid = 3
end if
c ----------------------------------------------
40 continue
Mon principal problème est le "30 continue" situé au début, vers lequel plusieurs 'goto 30' renvoient. J'ai tenté des boucles 'do while' pour supprimer les 'goto 30' et le '30 continue', mais en vain.
Merci d'avance pour votre aide.
Partager