/[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.3 - (show annotations) (download)
Fri Dec 3 01:06:33 2004 UTC (15 years, 6 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint57m_post, checkpoint62u, checkpoint57g_pre, checkpoint62t, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint57g_post, checkpoint57y_post, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint59, checkpoint58, checkpoint57, checkpoint58f_post, checkpoint57n_post, checkpoint58d_post, checkpoint62s, checkpoint58a_post, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint57z_post, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint58t_post, checkpoint58m_post, checkpoint57l_post, checkpoint57t_post, checkpoint63g, checkpoint57v_post, checkpoint57f_post, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint57a_post, checkpoint57h_pre, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint58w_post, checkpoint57h_post, checkpoint57y_pre, checkpoint58o_post, checkpoint57c_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint57c_pre, checkpoint58r_post, checkpoint58n_post, checkpoint57e_post, checkpoint65o, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, eckpoint57e_pre, checkpoint58k_post, checkpoint62b, checkpoint58v_post, checkpoint64y, checkpoint64x, checkpoint58l_post, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint57h_done, checkpoint57j_post, checkpoint57f_pre, checkpoint61f, checkpoint58g_post, checkpoint58x_post, checkpoint61n, checkpoint59j, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint57a_pre, checkpoint57o_post, checkpoint61q, checkpoint57k_post, checkpoint57w_post, checkpoint61e, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post, checkpoint58u_post, checkpoint58s_post, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
Changes since 1.2: +0 -1 lines
o optim:
  - remove unnecessary header files
  - adjusted namelists
  - add xerbla.F to Makefile

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 "ctrl.h"
34 #include "optim.h"
35
36 c == routine arguments ==
37
38 integer nn
39
40 c == local variables ==
41
42 _RL objf
43
44 #if defined (DYNAMIC)
45 _RL xx(nn)
46 _RL adxx(nn)
47 _RL dd(nn)
48 _RL gold(nn)
49 _RL xdiff(nn)
50 #elif defined (USE_POINTER) || (MAX_INDEPEND == 0)
51 _RL xx
52 _RL adxx
53 _RL dd(1)
54 _RL gold(1)
55 _RL xdiff(1)
56 pointer (pxx,xx(1))
57 pointer (padxx,adxx(1))
58 pointer (pdd,dd)
59 pointer (pgold,gold)
60 pointer (pxdiff,xdiff)
61 #else
62 integer nmax
63 parameter( nmax = MAX_INDEPEND )
64 _RL xx(nmax)
65 _RL adxx(nmax)
66 _RL dd(nmax)
67 _RL gold(nmax)
68 _RL xdiff(nmax)
69 #endif
70
71 c-- Allocate memory for the control variables and the gradient vector.
72 #if defined(DYNAMIC)
73 #elif defined(USE_POINTER) || (MAX_INDEPEND == 0)
74 call myalloc( pxx , nn*REAL_BYTE )
75 call myalloc( padxx, nn*REAL_BYTE )
76 call myalloc( pdd, nn*REAL_BYTE )
77 call myalloc( pgold, nn*REAL_BYTE )
78 call myalloc( pxdiff, nn*REAL_BYTE )
79 #endif
80
81 integer ifail
82 integer itmax
83 logical loffline
84
85 c == external ==
86
87 external simul
88 external lsline
89
90 c == end of interface ==
91
92 c-- Initialisize the model and set a first guess of the control
93 c-- variables.
94 call optim_initmod( nn, xx )
95
96 #if defined (DYNAMIC)
97 #elif defined(USE_POINTER) || (MAX_INDEPEND == 0)
98 #else
99 if (nn .gt. nmax) then
100 print*,' OPTIMUM: Not enough space.'
101 print*,' nmax = ',nmax
102 print*,' nn = ',nn
103 print*
104 print*,' Set MAX_INDEPEND in Makefile .ge. ',nn
105 print*
106 stop ' ... stopped in OPTIMUM.'
107 endif
108 #endif
109
110 print*, ' OPTIMUM: Calling lsopt for iteration: ',optimcycle
111 print*, ' OPTIMUM: with nn, REAL_BYTE = ', nn, REAL_BYTE
112
113 loffline = .true.
114 itmax = numiter
115
116 c-- Large scale optimization --> Gilbert & Lemarechal.
117 call lsopt_top( nn, xx, objf, adxx
118 & , simul, lsline
119 & , epsx, fmin, epsg
120 & , iprint
121 & , itmax, nfunc, nupdate
122 & , dd, gold, xdiff
123 & , loffline
124 & , ifail )
125
126 return
127 end

  ViewVC Help
Powered by ViewVC 1.1.22