PDA

View Full Version : Use of IVPAG/DIVPAG routine (Diff. Equations) - F90



G.M.
02-19-2007, 12:26 AM
Dear all,
I hope to have a suggestion from you about use of IVPAG/DIVPAG with F90.
Let suppose we want to use IVPAG nested in a DO loop in order to solve different systems where a parameter is modified. Here a piece of code:
...
DO !external
parameter= parameter+1.0
...
ido= 1
DO !IVPAG
call IVPAG(ido,...,fcn,...,y)
...
ido =3 !after last integration
...
ENDDO
...
ENDDO
...

With the above structure we get a correct deallocation of IVPAG, but we get one only external DO loop . On the contrary, if we drop "ido= 3", the program tryes to make a 2nd external DO loop, but at the 2nd "call IVPAG" we have a deallocation error. Maybe, somebody of you knows the proper sequence of "ido" statements, or simply see an error.

Thank you in advance!
G.M.

pate
02-21-2007, 02:16 PM
The routine is setting IDO=2 while in the loop. But you should not set IDO=3 until you are ready to make one last call and release the workspace. After that, you should have some means of exiting the loop that contains the call to IVPAG. If you look at Example 1 in the Help file or manual, when IEND=10, it sets IDO=3, loops back up for one more call to IVPAG. But the very next statement after that final call sees that IEND=11 and skips the call to loop back up again and continues to the end. It looks like you are looping back up and making subsequent calls to IVPAG after the final call is made (with IDO=3). At least that is the way it looks with this limited code. See the examples in the Help manual to see the way they managed the loop.