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

Contents of /MITgcm/optim/optim_sub.F

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


Revision 1.1.2.1 - (show annotations) (download)
Tue Feb 5 20:34:35 2002 UTC (22 years, 2 months ago) by heimbach
Branch: ecco-branch
CVS Tags: ecco_c50_e32, ecco_c50_e33, ecco_c50_e30, ecco_c50_e31, ecco_c51_e34d, ecco_c51_e34e, ecco_c51_e34f, ecco_c51_e34g, ecco_c51_e34a, ecco_c51_e34b, ecco_c51_e34c, icebear5, icebear4, icebear3, icebear2, ecco_c50_e29, ecco_c50_e28, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, ecco_c50_e33a, ecco_c51_e34, ecco_ice2, ecco_ice1, ecco_c44_e25, ecco_c44_e22, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5
Branch point for: c24_e25_ice, icebear
Changes since 1.1: +128 -0 lines
o Updating adjoint/makefile to ECCO code
o Adding optim and lsopt for line search optimization.
o Adding verif. experiments for ECCO
Code will be tagged ecco-branch-mod1.

1
2
3 subroutine optim_sub(
4 I nn
5 & )
6
7 c ==================================================================
8 c SUBROUTINE optim_sub
9 c ==================================================================
10 c
11 c o Initialization of optimization run.
12 c
13 c started: Christian Eckert eckert@mit.edu 15-Feb-2000
14 c
15 c changed: Christian Eckert eckert@mit.edu 10-Mar-2000
16 c
17 c - Added ECCO layout.
18 c
19 c changed: Patrick Heimbach heimbach@mit.edu 19-Jun-2000
20 c - finished, revised and debugged
21 c
22 c ==================================================================
23 c SUBROUTINE optim_sub
24 c ==================================================================
25
26 implicit none
27
28 c == global variables ==
29
30 #include "EEPARAMS.h"
31 #include "SIZE.h"
32
33 #include "ecco.h"
34 #include "ctrl.h"
35 #include "optim.h"
36
37 c == routine arguments ==
38
39 integer nn
40
41 c == local variables ==
42
43 _RL objf
44
45 #if defined (DYNAMIC)
46 _RL xx(nn)
47 _RL adxx(nn)
48 _RL dd(nn)
49 _RL gold(nn)
50 _RL xdiff(nn)
51 #elif defined (USE_POINTER) || (MAX_INDEPEND == 0)
52 _RL xx
53 _RL adxx
54 _RL dd(1)
55 _RL gold(1)
56 _RL xdiff(1)
57 pointer (pxx,xx(1))
58 pointer (padxx,adxx(1))
59 pointer (pdd,dd)
60 pointer (pgold,gold)
61 pointer (pxdiff,xdiff)
62 #else
63 integer nmax
64 parameter( nmax = MAX_INDEPEND )
65 _RL xx(nmax)
66 _RL adxx(nmax)
67 _RL dd(nmax)
68 _RL gold(nmax)
69 _RL xdiff(nmax)
70 #endif
71
72 c-- Allocate memory for the control variables and the gradient vector.
73 #if defined(DYNAMIC)
74 #elif defined(USE_POINTER) || (MAX_INDEPEND == 0)
75 call myalloc( pxx , nn*REAL_BYTE )
76 call myalloc( padxx, nn*REAL_BYTE )
77 call myalloc( pdd, nn*REAL_BYTE )
78 call myalloc( pgold, nn*REAL_BYTE )
79 call myalloc( pxdiff, nn*REAL_BYTE )
80 #endif
81
82 integer ifail
83 integer itmax
84 logical loffline
85
86 c == external ==
87
88 external simul
89 external lsline
90
91 c == end of interface ==
92
93 c-- Initialisize the model and set a first guess of the control
94 c-- variables.
95 call optim_initmod( nn, xx )
96
97 #if defined (DYNAMIC)
98 #elif defined(USE_POINTER) || (MAX_INDEPEND == 0)
99 #else
100 if (nn .gt. nmax) then
101 print*,' OPTIMUM: Not enough space.'
102 print*,' nmax = ',nmax
103 print*,' nn = ',nn
104 print*
105 print*,' Set MAX_INDEPEND in Makefile .ge. ',nn
106 print*
107 stop ' ... stopped in OPTIMUM.'
108 endif
109 #endif
110
111 print*, ' OPTIMUM: Calling lsopt for iteration: ',optimcycle
112 print*, ' OPTIMUM: with nn, REAL_BYTE = ', nn, REAL_BYTE
113
114 loffline = .true.
115 itmax = numiter
116
117 c-- Large scale optimization --> Gilbert & Lemarechal.
118 call lsopt_top( nn, xx, objf, adxx
119 & , simul, lsline
120 & , epsx, fmin, epsg
121 & , iprint
122 & , itmax, nfunc, nupdate
123 & , dd, gold, xdiff
124 & , loffline
125 & , ifail )
126
127 return
128 end

  ViewVC Help
Powered by ViewVC 1.1.22