*DECK DDAINI SUBROUTINE DDAINI (X, Y, YPRIME, NEQ, RES, JAC, H, WT, IDID, RPAR, * IPAR, PHI, DELTA, E, WM, IWM, HMIN, UROUND, NONNEG, NTEMP) C***BEGIN PROLOGUE DDAINI C***SUBSIDIARY C***PURPOSE Initialization routine for DDASSL. C***LIBRARY SLATEC (DASSL) C***TYPE DOUBLE PRECISION (SDAINI-S, DDAINI-D) C***AUTHOR Petzold, Linda R., (LLNL) C***DESCRIPTION C----------------------------------------------------------------- C DDAINI TAKES ONE STEP OF SIZE H OR SMALLER C WITH THE BACKWARD EULER METHOD, TO C FIND YPRIME. X AND Y ARE UPDATED TO BE CONSISTENT WITH THE C NEW STEP. A MODIFIED DAMPED NEWTON ITERATION IS USED TO C SOLVE THE CORRECTOR ITERATION. C C THE INITIAL GUESS FOR YPRIME IS USED IN THE C PREDICTION, AND IN FORMING THE ITERATION C MATRIX, BUT IS NOT INVOLVED IN THE C ERROR TEST. THIS MAY HAVE TROUBLE C CONVERGING IF THE INITIAL GUESS IS NO C GOOD, OR IF G(X,Y,YPRIME) DEPENDS C NONLINEARLY ON YPRIME. C C THE PARAMETERS REPRESENT: C X -- INDEPENDENT VARIABLE C Y -- SOLUTION VECTOR AT X C YPRIME -- DERIVATIVE OF SOLUTION VECTOR C NEQ -- NUMBER OF EQUATIONS C H -- STEPSIZE. IMDER MAY USE A STEPSIZE C SMALLER THAN H. C WT -- VECTOR OF WEIGHTS FOR ERROR C CRITERION C IDID -- COMPLETION CODE WITH THE FOLLOWING MEANINGS C IDID= 1 -- YPRIME WAS FOUND SUCCESSFULLY C IDID=-12 -- DDAINI FAILED TO FIND YPRIME C RPAR,IPAR -- REAL AND INTEGER PARAMETER ARRAYS C THAT ARE NOT ALTERED BY DDAINI C PHI -- WORK SPACE FOR DDAINI C DELTA,E -- WORK SPACE FOR DDAINI C WM,IWM -- REAL AND INTEGER ARRAYS STORING C MATRIX INFORMATION C C----------------------------------------------------------------- C***ROUTINES CALLED DDAJAC, DDANRM, DDASLV C***REVISION HISTORY (YYMMDD) C 830315 DATE WRITTEN C 901009 Finished conversion to SLATEC 4.0 format (F.N.Fritsch) C 901019 Merged changes made by C. Ulrich with SLATEC 4.0 format. C 901026 Added explicit declarations for all variables and minor C cosmetic changes to prologue. (FNF) C 901030 Minor corrections to declarations. (FNF) C***END PROLOGUE DDAINI