/[MITgcm]/MITgcm/optim/simul.F
ViewVC logotype

Annotation of /MITgcm/optim/simul.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (hide annotations) (download)
Tue May 26 22:54:09 2015 UTC (8 years, 11 months ago) by gforget
Branch: MAIN
Changes since 1.3: +1 -0 lines
- add CTRL_OPTIONS.h that is needed to set maxcvars correctly
  when using generic controls (contributed by D. Amrhein).

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

  ViewVC Help
Powered by ViewVC 1.1.22