| 1 | !---------------------------------------------------------------------- |
| 2 | !---------------------------------------------------------------------- |
| 3 | ! pvl : Setting functional parameter values (for Bratu's equation) |
| 4 | !---------------------------------------------------------------------- |
| 5 | !---------------------------------------------------------------------- |
| 6 | |
| 7 | SUBROUTINE FUNC(NDIM,U,ICP,PAR,IJAC,F,DFDU,DFDP) |
| 8 | ! ---------- ---- |
| 9 | |
| 10 | IMPLICIT NONE |
| 11 | INTEGER, INTENT(IN) :: NDIM, IJAC, ICP(*) |
| 12 | DOUBLE PRECISION, INTENT(IN) :: U(NDIM), PAR(*) |
| 13 | DOUBLE PRECISION, INTENT(OUT) :: F(NDIM) |
| 14 | DOUBLE PRECISION, INTENT(INOUT) :: DFDU(NDIM,*), DFDP(NDIM,*) |
| 15 | |
| 16 | DOUBLE PRECISION E |
| 17 | |
| 18 | E=EXP(U(1)) |
| 19 | F(1)=U(2) |
| 20 | F(2)=-PAR(1)*E |
| 21 | |
| 22 | END SUBROUTINE FUNC |
| 23 | |
| 24 | SUBROUTINE STPNT(NDIM,U,PAR,T) |
| 25 | ! ---------- ----- |
| 26 | |
| 27 | IMPLICIT NONE |
| 28 | INTEGER, INTENT(IN) :: NDIM |
| 29 | DOUBLE PRECISION, INTENT(INOUT) :: U(NDIM), PAR(*) |
| 30 | DOUBLE PRECISION, INTENT(IN) :: T |
| 31 | |
| 32 | PAR(1)=0 |
| 33 | U(1)=0.0 |
| 34 | U(2)=0.0 |
| 35 | |
| 36 | END SUBROUTINE STPNT |
| 37 | |
| 38 | SUBROUTINE BCND(NDIM,PAR,ICP,NBC,U0,U1,FB,IJAC,DBC) |
| 39 | ! ---------- ---- |
| 40 | |
| 41 | IMPLICIT NONE |
| 42 | INTEGER, INTENT(IN) :: NDIM, ICP(*), NBC, IJAC |
| 43 | DOUBLE PRECISION, INTENT(IN) :: PAR(*), U0(NDIM), U1(NDIM) |
| 44 | DOUBLE PRECISION, INTENT(OUT) :: FB(NBC) |
| 45 | DOUBLE PRECISION, INTENT(INOUT) :: DBC(NBC,*) |
| 46 | |
| 47 | FB(1)=U0(1) |
| 48 | FB(2)=U1(1) |
| 49 | |
| 50 | END SUBROUTINE BCND |
| 51 | |
| 52 | DOUBLE PRECISION FUNCTION GETU2(U,NDX,NTST,NCOL) |
| 53 | ! ------ --------- -------- ----- |
| 54 | INTEGER, INTENT(IN) :: NDX,NCOL,NTST |
| 55 | DOUBLE PRECISION, INTENT(IN) :: U(NDX,0:NCOL*NTST) |
| 56 | |
| 57 | GETU2 = U(2,0) |
| 58 | |
| 59 | END FUNCTION GETU2 |
| 60 | |
| 61 | SUBROUTINE PVLS(NDIM,U,PAR) |
| 62 | ! ---------- ---- |
| 63 | |
| 64 | IMPLICIT NONE |
| 65 | INTEGER, INTENT(IN) :: NDIM |
| 66 | DOUBLE PRECISION, INTENT(IN) :: U(NDIM) |
| 67 | DOUBLE PRECISION, INTENT(INOUT) :: PAR(*) |
| 68 | |
| 69 | DOUBLE PRECISION, EXTERNAL :: GETP,GETU2 |
| 70 | INTEGER NDX,NCOL,NTST |
| 71 | !---------------------------------------------------------------------- |
| 72 | ! NOTE : |
| 73 | ! Parameters set in this subroutine should be considered as ``solution |
| 74 | ! measures'' and be used for output purposes only. |
| 75 | ! |
| 76 | ! They should never be used as `true'' continuation parameters. |
| 77 | ! |
| 78 | ! They may, however, be added as ``over-specified parameters'' in the |
| 79 | ! parameter list associated with the AUTO-Constant NICP, in order to |
| 80 | ! print their values on the screen and in the ``p.xxx file. |
| 81 | ! |
| 82 | ! They may also appear in the list associated with AUTO-constant NUZR. |
| 83 | ! |
| 84 | !---------------------------------------------------------------------- |
| 85 | ! For algebraic problems the argument U is, as usual, the state vector. |
| 86 | ! For differential equations the argument U represents the approximate |
| 87 | ! solution on the entire interval [0,1]. In this case its values can |
| 88 | ! be accessed indirectly by calls to GETP, as illustrated below, or |
| 89 | ! by obtaining NDIM, NCOL, NTST via GETP and then dimensioning U as |
| 90 | ! U(NDIM,0:NCOL*NTST) in a seperate subroutine that is called by PVLS. |
| 91 | !---------------------------------------------------------------------- |
| 92 | |
| 93 | ! Set PAR(2) equal to the L2-norm of U(1) |
| 94 | PAR(2)=GETP('NRM',1,U) |
| 95 | |
| 96 | ! Set PAR(3) equal to the minimum of U(2) |
| 97 | PAR(3)=GETP('MIN',2,U) |
| 98 | |
| 99 | ! Set PAR(4) equal to the value of U(2) at the left boundary. |
| 100 | PAR(4)=GETP('BV0',2,U) |
| 101 | |
| 102 | ! Set PAR(5) equal to the value of U(2) at the left boundary using |
| 103 | ! another method |
| 104 | NDX=NINT(GETP('NDX',0,U)) |
| 105 | NTST=NINT(GETP('NTST',0,U)) |
| 106 | NCOL=NINT(GETP('NCOL',0,U)) |
| 107 | PAR(5)=GETU2(U,NDX,NTST,NCOL) |
| 108 | !---------------------------------------------------------------------- |
| 109 | ! The first argument of GETP may be one of the following: |
| 110 | ! 'NRM' (L2-norm), 'MAX' (maximum), |
| 111 | ! 'INT' (integral), 'BV0 (left boundary value), |
| 112 | ! 'MIN' (minimum), 'BV1' (right boundary value). |
| 113 | ! 'MNT' (t value for minimum) |
| 114 | ! 'MXT' (t value for maximum) |
| 115 | ! 'NDIM', 'NDX' (effective (active) number of dimensions) |
| 116 | ! 'NTST' (NTST from constant file) |
| 117 | ! 'NCOL' (NCOL from constant file) |
| 118 | ! 'NBC' (active NBC) |
| 119 | ! 'NINT' (active NINT) |
| 120 | ! 'DTM' (delta t for all t values, I=1...NTST) |
| 121 | ! 'WINT' (integration weights used for interpolation, I=0...NCOL) |
| 122 | ! |
| 123 | ! Also available are |
| 124 | ! 'STP' (Pseudo-arclength step size used). |
| 125 | ! 'FLD' (`Fold function', which vanishes at folds). |
| 126 | ! 'BIF' (`Bifurcation function', which vanishes at singular points). |
| 127 | ! 'HBF' (`Hopf function'; which vanishes at Hopf points). |
| 128 | ! 'SPB' ( Function which vanishes at secondary periodic bifurcations). |
| 129 | ! 'EIG' ( Eigenvalues/multipliers, I=1...2*NDIM, alternates real/imag parts). |
| 130 | ! 'STA' ( Number of stable eigenvalues/multipliers). |
| 131 | !---------------------------------------------------------------------- |
| 132 | |
| 133 | END SUBROUTINE PVLS |
| 134 | |
| 135 | SUBROUTINE ICND |
| 136 | END SUBROUTINE ICND |
| 137 | |
| 138 | SUBROUTINE FOPT |
| 139 | END SUBROUTINE FOPT |