1 |
|
2 |
|
3 |
subroutine simul( |
4 |
I indic, |
5 |
I nn, |
6 |
I xx, |
7 |
O objf, |
8 |
O adxx |
9 |
& ) |
10 |
|
11 |
c ================================================================== |
12 |
c SUBROUTINE simul |
13 |
c ================================================================== |
14 |
c |
15 |
c o This routine is called by the large-scale optimization lsopt. |
16 |
c |
17 |
c Input : indic - Parameter (not used here). |
18 |
c nn - Number of control variables. |
19 |
c xx - Array of control variables. |
20 |
c |
21 |
c Output : objf - Value of objective function. |
22 |
c adxx - Gradients of objective function with respect |
23 |
c to the control variables. |
24 |
c |
25 |
c |
26 |
c started: Christian Eckert eckert@mit.edu 15-Feb-2000 |
27 |
c |
28 |
c changed: Christian Eckert eckert@mit.edu 10-Mar-2000 |
29 |
c |
30 |
c - Added ECCO layout. |
31 |
c |
32 |
c changed: Patrick Heimbach heimbach@mit.edu 19-Jun-2000 |
33 |
c - finished, revised and debugged |
34 |
c |
35 |
c ================================================================== |
36 |
c SUBROUTINE simul |
37 |
c ================================================================== |
38 |
|
39 |
implicit none |
40 |
|
41 |
c == global variables == |
42 |
|
43 |
#include "EEPARAMS.h" |
44 |
#include "SIZE.h" |
45 |
#include "ctrl.h" |
46 |
|
47 |
c == routine arguments == |
48 |
|
49 |
integer indic |
50 |
integer nn |
51 |
_RL xx(nn) |
52 |
_RL objf |
53 |
_RL adxx(nn) |
54 |
|
55 |
c == local variables == |
56 |
|
57 |
integer i |
58 |
_RL adobjf |
59 |
|
60 |
logical lheaderonly |
61 |
|
62 |
c == end of interface == |
63 |
|
64 |
print *, 'pathei-lsopt in simul' |
65 |
|
66 |
c-- Call the combined modified forward model and the adjoint model. |
67 |
do i = 1,nn |
68 |
adxx(i) = 0. |
69 |
enddo |
70 |
|
71 |
adobjf = 1. |
72 |
c |
73 |
lheaderonly = .false. |
74 |
|
75 |
print *, 'pathei-lsopt vor optim_readdata' |
76 |
|
77 |
call optim_readdata( nn, ctrlname, lheaderonly, objf, xx ) |
78 |
call optim_readdata( nn, costname, lheaderonly, objf, adxx ) |
79 |
|
80 |
indic = indic |
81 |
|
82 |
cph( |
83 |
print *, ' leaving simul with nn, objf = ', nn, objf |
84 |
print *, ' leaving simul with xx, adxx = ', xx(1), adxx(1) |
85 |
do i=1,nn |
86 |
c if (xx(i).EQ.'NaN') then |
87 |
c print *, 'pathei - out: i = ', i |
88 |
c end if |
89 |
end do |
90 |
cph) |
91 |
|
92 |
return |
93 |
end |