Description
If someone wishes to build and run a single precision version of ODEPACK, they need to note that it is not enough to change the kind parameter of real variables and constants from dp = kind(0.0d0) to sp = kind(0.0e0).
In the files on Netlib/odepack, there are two sets of files, with the 4th letter or the file name signifying whether the code in the file is for single precision ('s') or double precision ('d').
The saved integer variable LRATIO in cdrv.inc and the two separate saved integer variables LENRAT in dlsodes.inc and dlsodis.inc are all equal to the ratio of the memory size of real variables to the memory size of integer variables.
In the original Fortran 77 sources, a number of arrays that are in common blocks are interpreted as real variables in some places and as integer variables in other places, so setting LRATIO or LENRAT to an incorrect value will cause havoc (access violations, seg-faults).
In your modern Fortran version, it would be nice to code LRATIO and LENRAT in terms of the precision parameter specified at the beginning of M_odepack.f90 (i.e., wp = dp or wp = sp). If that is done, and all the real constants in the source files are coded with the _wp suffix, there would be only one line of code to change to move from double precision to single precision -- set wp = dp or wp = sp at the top of M_odepack.f90 .
If the kind designation _wp is selected for use in the code, please note that many of the subroutines have an array argument with the same name, so all instances of that variable will have to be renamed to something else, for example wpa.