PDA

View Full Version : Errors in IMSL-6 manual : examples for DASPG



mecej4
12-11-2009, 07:39 PM
Example-2: Replace


REAL FEETL, GRAV, LENSQ, MASSKG, MASSLB, METERL, M

by


REAL, SAVE :: FEETL, GRAV, LENSQ, MASSKG, MASSLB, METERL, M

Example-4:

a) Replace
USE IMSL_LIBRARIES by
USE NUMERICAL_LIBRARIES
USE UMAG_INT
(b) Remove
EXTERNAL DGSPG, DJSPG
(c) Change "numopts=1" to "numopt=1" in the two calls to UMAG.

(d) In the second call to SCOPY, change WK(IVAL(1:)) to WK(IVAL(1):)

(e) In the call to SAXPY, change GVAL((J+1):, 1) to GVAL((J+1):), 1

pate
12-15-2009, 12:12 PM
These changes will have to reviewed for the next release of IMSL Fortran. Thank you for your input.

pate
12-22-2009, 08:32 AM
Here are the corrected examples. They will be in the next version of IMSL Fortran, but until then you can use these.

mmrw
02-03-2011, 04:04 AM
Those examples were very helpful. However I wonder if you can give me an example of how to change the default value of the maximum number of steps to more than 500. [IN(6) option I believe]. Also how to increase the tolerance to say 1e-6

Thanks

Mike

mecej4
02-15-2011, 02:03 AM
The DASPG routines are marked "deprecated" in FNL 7.

The third example, daspgex3.f90, shows how to read and write algorithm control variables, and the usage of these variables is explained in the manual.

For example, to specify the iteration limit in daspgex1.f90, add the following lines of code


! Set iteration limit to 10
IOPT(1) = INUM
CALL IUMAG ('math', ICHAP, IGET, 1, IOPT, IN)
IOPT(1) = IN(6)
IVAL(1) = 10
CALL IUMAG ('math', ICHAP, IPUT, 1, IOPT, IVAL)


and add PARAMETER and TYPE declarations for the new variables introduced as in daspgex3.f90. After making these changes, if we try to run the program, it aborts with the following printout:


T Y(1) Y(2) Y'(1) Y'(2)

*** WARNING ERROR 3 from DASPG. At the current T=1.720000E-02, 10 steps
*** were taken on this call before reaching TOUT.

*** TERMINAL ERROR 4 from D2SPG. IDO is 4. An error condition has occurred.
Here is a traceback of subprogram calls in reverse order:
Routine name Error type Error code
------------ ---------- ----------
D2SPG 5 4 (Called internally)
DASPG 0 0
USER 3 3