| 1 |
heimbach |
1.1 |
{\scriptsize |
| 2 |
|
|
\begin{verbatim} |
| 3 |
|
|
... ... |
| 4 |
|
|
| ) |
| 5 |
|
|
| (---- CALL OPTLINE / LSLINE |
| 6 |
|
|
| ) | |
| 7 |
|
|
| ( |---- /// loop over simulations |
| 8 |
|
|
| ) ( |
| 9 |
|
|
| ( )---- CALL SIMUL |
| 10 |
|
|
| ) ( | |
| 11 |
|
|
| ( ) |---- input: xdiff(i) |
| 12 |
|
|
| ) ( |---- output: ff(i), gg(i) |
| 13 |
|
|
| ( ) |---- >>> if ONLINE <<< |
| 14 |
|
|
| ) ( runs model and adjoint |
| 15 |
|
|
| ( ) >>> if OFFLINE <<< |
| 16 |
|
|
| ) ( reads those values from file |
| 17 |
|
|
| ( ) |
| 18 |
|
|
| ) (---- 1st Wolfe test: |
| 19 |
|
|
| ( ) ff(i) <= tact*xpara1*<gg(i-1),dd(i-1)> |
| 20 |
|
|
| ) ( |
| 21 |
|
|
| ( )---- 2nd Wolfe test: |
| 22 |
|
|
| ) ( <gg(i),dd(i-1)> >= xpara2*<gg(i-1),dd(i-1)> |
| 23 |
|
|
| ( ) |
| 24 |
|
|
| ) (---- >>> if 1st and 2nd Wolfe tests ok <<< |
| 25 |
|
|
| ( ) | 320: update xx: xx(i) = xdiff(i) |
| 26 |
|
|
| ) ( | |
| 27 |
|
|
| ( ) >>> else if 1st Wolfe test not ok <<< |
| 28 |
|
|
| ) ( | 500: INTERpolate new tact: |
| 29 |
|
|
| ( ) | barr*tact < tact < (1-barr)*tact |
| 30 |
|
|
| ) ( | CALL CUBIC |
| 31 |
|
|
| ( ) | |
| 32 |
|
|
| ) ( >>> else if 2nd Wolfe test not ok <<< |
| 33 |
|
|
| ( ) 350: EXTRApolate new tact: |
| 34 |
|
|
| ) ( (1+barmin)*tact < tact < 10*tact |
| 35 |
|
|
| ( ) CALL CUBIC |
| 36 |
|
|
| ) ( |
| 37 |
|
|
| ( )---- >>> if new tact > tmax <<< |
| 38 |
|
|
| ) ( | ifail = 7 |
| 39 |
|
|
| ( ) | |
| 40 |
|
|
| ) (---- >>> if new tact < tmin OR tact*dd < machine precision <<< |
| 41 |
|
|
| ( ) | ifail = 8 |
| 42 |
|
|
| ) ( | |
| 43 |
|
|
| ( )---- >>> else <<< |
| 44 |
|
|
| ) ( update xdiff for new simulation |
| 45 |
|
|
| ( ) |
| 46 |
|
|
| ) \\\ if nfunc > 1: use inter-/extrapolated tact and xdiff |
| 47 |
|
|
| ( for new simulation |
| 48 |
|
|
| ) N.B.: new xx is thus not based on new gg, but |
| 49 |
|
|
| ( rather on new step size tact |
| 50 |
|
|
| ) |
| 51 |
|
|
| (---- store new values xx(i), gg(i) to OPWARMD (first 2 entries) |
| 52 |
|
|
| )---- >>> if ifail = 7,8,9 <<< |
| 53 |
|
|
| ( goto 1000 |
| 54 |
|
|
| ) |
| 55 |
|
|
... ... |
| 56 |
|
|
\end{verbatim} |
| 57 |
|
|
} |