migrating from IMSL to petsc

Kamaraju Kusumanchi kamaraju at bluebottle.com
Sun Oct 7 17:05:02 CDT 2007

Hi all

    I have a rather large Fortran 90 code (say 10,000 lines long) which 
extensively uses IMSL libraries for solving linear systems. Because of the 
limited capabilities of IMSL, the cost involved in purchasing the license 
etc., we are considering going with petsc instead. I have read the FAQs on 
the petsc website, finished reading the user manual. I have a few questions 
which the experts might find trivial to answer...

    Let's say I am solving Ax=B using IMSL's LU decomposition routine. In this 
case, A would be an nxn matrix, x and B would nx1 vectors. In the fortran 90 
code these are declared as (assuming statically allocated)

real :: A(1:n,1:n), B(1:n), x(1:n)

The IMSL routines just directly accept A, x, B as arguments. Whereas, the 
petsc's solvers seem to require the arguments to be of type Vec, Mat etc., 
Converting all the arrays into Vec, Mat types would involve quite a bit of 
changes in the code, which I would like to avoid if possible. So my questions 

1) What is the best way to migrate a fortran 90 code using IMSL libraries to 
Petsc libraries with minimal changes in the code?

2) Is there any way to use petsc linear solvers (to solve Ax=b) without 
dealing with new data types Vec, Mat etc., and just sticking with real 
arrays? At this point, I am only interested in solving the system of 
equations Ax=b and am not trying to exploit other cool features of petsc.

thanks for any suggestions

Kamaraju S Kusumanchi

Find out how you can get spam free email.

More information about the petsc-users mailing list