I am currently working on a project where I need to solve Differential Algebraic Equations (DAEs) in Fortran. I have already tried using DDaskr (developed by Brown, Hindmarsh, and Petzold), but unfortunately, I encountered several compilation errors (around 10 errors in total). This might be related to version incompatibilities or other technical issues, as I have followed the available instructions closely.
Given this, I’m seeking recommendations for other robust and actively maintained DAE solvers that are compatible with Fortran. I would appreciate any suggestions, especially if they come with clear documentation and examples to help with integration into existing code.
Has anyone faced similar issues with DDaskr, and if so, how did you resolve them? Alternatively, are there any other solvers you’ve had success with?
Hi Diiiiii and welcome,
The whole family dassl, daspk, daskr are among the best DAE solvers I could find. They should be pretty straightforward to build and if I recall they even extracted the dependencies from LINPACK to avoid any external dependencies.
Back in the days, I compiled daspk without any problem, but just pay attention that it is fixed-form legacy fortran 77.
Which errors did you get and which compiler do you use?
From the root of your folder run fpm build --flag "-std=legacy"
And voilà
DASKR uses implicit typing, and external procedures to pass the residual, the jacobian and the krylov solver. You also need to instruct gfortran that it’s legacy code.
Maybe the codes will compile with gfortran -std=legacy. Some modernized ODE packages in Fortran are listed here. Daskr was discussed in the thread Package for Bayesian inference?.
Thanks, @davidpfister and @Beliavsky ! Turns out the problem was on my end — I forgot to add -std=legacy when compiling and was just using the default. Once I fixed that, everything worked.