# Has anyone used DVODE and is it good?

**URL:** <https://fortran-lang.discourse.group/t/has-anyone-used-dvode-and-is-it-good/2281>\
**Category:** Uncategorized\
**Created:** [November 16, 2021, 9:08am UTC](https://fortran-lang.discourse.group/t/has-anyone-used-dvode-and-is-it-good/2281 "2021-11-16T09:08:06Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![CRquantum](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/crquantum/32/730_2.png) [@CRquantum](https://fortran-lang.discourse.group/u/CRquantum)\
**Post date:** [January 17, 2022, 6:04am UTC](https://fortran-lang.discourse.group/t/has-anyone-used-dvode-and-is-it-good/2281/27 "2022-01-17T06:04:57Z")

</div>

> [@ivanpribec](#):
>
> Easiest way to get rid of the error is to change `rtol` from a scalar to a one-element array in the calling code:
> 
> ```auto
> real(dp) :: rtol(1) ! Array rtol
> 
> ```

Thank you @ivanpribec !  
I just learned from Dr. Fortran @sblionel the […] trick,

> [@How to fix the errors in compiling ODEPACK in debug mode?](https://fortran-lang.discourse.group/t/how-to-fix-the-errors-in-compiling-odepack-in-debug-mode/2597/7):
>
> As I wrote earlier, Fortran does not allow you to pass a scalar to an array. And, again, the reason it works in release mode is that a release configuration doesn’t enable the cross-source-file generated interface check. If the value is an input, and not written to, you can pass [int(RWORK(LWM))] , making it an array constructor. Any changes made in the called routine will be discarded on return.

The below code also work, just add [] around atol and rtol to make array interface when call dvode (I see this trick in FLINT ode solver by @prince_mahajan too),

```auto
    call dvode(young_laplace, neq, y, s, send, &
        itol, [rtol], [atol], itask, istate, iopt, &
        rwork, lrw, iwork, liw, &
        young_laplace_jacobian, &
        mf, rpar, idum)

```

By the way, have you by any chance used DVODPK? You know like LSODPK, etc, those end with PK or K, means using some thing called Preconditioned Krylov methods?  
LLNL’s ODEPACK webpage mentioned DVODPK as a variant for DVODE,  
[https://computing.llnl.gov/projects/odepack](https://computing.llnl.gov/projects/odepack)  
It looks like CVODE in SUNDIALS is basically VODE + VODPK written in C and added some parallelization stuff.  
Do you know if those Preconditioned Krylov methods efficient?

Thanks a lot!

---

_[View the full topic](https://fortran-lang.discourse.group/t/has-anyone-used-dvode-and-is-it-good/2281)._
