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

Annotation of /MITgcm/optim/optim_sub.F

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


Revision 1.2 - (hide annotations) (download)
Fri Nov 15 04:03:25 2002 UTC (21 years, 5 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint47e_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint47c_post, checkpoint50c_post, checkpoint52d_pre, checkpoint48e_post, checkpoint56b_post, checkpoint50c_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint48i_post, checkpoint50d_pre, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint52f_post, checkpoint50b_pre, checkpoint54f_post, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint51t_post, checkpoint51n_post, checkpoint55i_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint47a_post, checkpoint55c_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint47d_post, checkpoint53d_post, checkpoint48d_post, checkpoint48f_post, checkpoint52b_pre, checkpoint54b_post, checkpoint51l_pre, checkpoint52m_post, checkpoint55g_post, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint48a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52f_pre, checkpoint55d_post, checkpoint47j_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint55j_post, branch-exfmods-tag, branchpoint-genmake2, checkpoint54a_post, checkpoint55h_post, checkpoint51r_post, checkpoint48c_post, checkpoint51i_post, checkpoint55b_post, checkpoint51b_post, checkpoint51c_post, checkpoint53a_post, checkpoint47b_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, checkpoint50g_post, checkpoint52a_pre, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint56a_post, checkpoint53f_post, checkpoint52j_post, checkpoint47f_post, checkpoint50e_post, branch-netcdf, checkpoint52l_post, checkpoint52n_post, checkpoint53b_pre, checkpoint51e_post, checkpoint55a_post, checkpoint47, checkpoint48, checkpoint49, checkpoint51o_post, checkpoint51f_pre, checkpoint48g_post, checkpoint53b_post, checkpoint47h_post, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint50b_post, checkpoint51m_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint51a_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-exfmods-curt, branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.1: +128 -0 lines
o Incorporating QNVS line search routines into MITgcm
  (this is separate code, not compiled with MITgcm,
  and therefore not under pkg)
  - lsopt/
  - optim/

1 heimbach 1.2
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