1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
c Include ECCO_CPPOPTIONS because the ecco_ctrl,cost files |
C ECCO_CPPOPTIONS used to affect maxcvars and defined ALLOW_OBCS?_CONTROL |
5 |
c have headers with options for OBCS masks. |
C#include "ECCO_CPPOPTIONS.h" |
6 |
#include "ECCO_CPPOPTIONS.h" |
C now: |
7 |
|
C CTRL_OPTIONS affects maxcvars and may define ALLOW_OBCS?_CONTROL |
8 |
|
#include "CTRL_OPTIONS.h" |
9 |
|
|
10 |
subroutine optim_readparms( |
subroutine optim_readparms( |
11 |
O nn, ff |
O nn, ff |
28 |
|
|
29 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
30 |
#include "SIZE.h" |
#include "SIZE.h" |
31 |
|
#if (defined (ALLOW_GENARR2D_CONTROL) || defined (ALLOW_GENARR3D_CONTROL) || defined (ALLOW_GENTIM2D_CONTROL)) |
32 |
|
# include "CTRL_SIZE.h" |
33 |
|
#endif |
34 |
#include "ctrl.h" |
#include "ctrl.h" |
35 |
#include "optim.h" |
#include "optim.h" |
36 |
|
|
90 |
ff = 0. |
ff = 0. |
91 |
cdfer expId = 'MIT_CE_000' |
cdfer expId = 'MIT_CE_000' |
92 |
yctrlid = 'MIT_CE_000' |
yctrlid = 'MIT_CE_000' |
93 |
|
yctrlposunpack = '.opt' |
94 |
|
yctrlpospack = '.opt' |
95 |
|
ctrlname = 'ecco_ctrl' |
96 |
|
costname = 'ecco_cost' |
97 |
|
scalname = ' ' |
98 |
|
maskname = ' ' |
99 |
|
metaname = ' ' |
100 |
coldStart = .false. |
coldStart = .false. |
101 |
|
|
102 |
modeldataunit = 14 |
modeldataunit = 14 |
154 |
epsx = eps |
epsx = eps |
155 |
epsg = eps |
epsg = eps |
156 |
endif |
endif |
157 |
|
c always force cold start for the 0th cycle |
158 |
|
if ( optimcycle .eq. 0 ) coldStart=.true. |
159 |
|
|
160 |
call optim_readdata ( nn, ctrlname, .true., ff, vv) |
c read header from costname rather than ctrlname, because the |
161 |
|
c cost function value in costname is what we need, ctrlname only |
162 |
|
c contains a valid cost function value for the 0th iteration |
163 |
|
call optim_readdata ( nn, costname, .true., ff, vv) |
164 |
|
|
165 |
if ( dfminFrac.lt.0.0 .or. dfminFrac.ge.1.0) then |
if ( dfminFrac.lt.0.0 .or. dfminFrac.ge.1.0) then |
166 |
print*, ' OPTIM_READPARMS: dfminFrac = ', dfminFrac, |
print*, ' OPTIM_READPARMS: dfminFrac = ', dfminFrac, |
169 |
endif |
endif |
170 |
if ( dfminFrac.ne.0.0 ) dfminFrac = 1.0 - dfminFrac |
if ( dfminFrac.ne.0.0 ) dfminFrac = 1.0 - dfminFrac |
171 |
if ( fmin.eq.UNSET_RL ) then |
if ( fmin.eq.UNSET_RL ) then |
172 |
if ( optimcycle .eq. 0 ) then |
if ( coldStart ) then |
173 |
c only in this case does ff contain the actual cost function value |
c only in this case does ff contain the actual cost function value |
174 |
fmin = dfminFrac*ff |
fmin = dfminFrac*ff |
175 |
else |
else |
177 |
fmin = ff |
fmin = ff |
178 |
endif |
endif |
179 |
endif |
endif |
180 |
if ( optimcycle.eq.0 ) then |
if ( coldStart ) then |
181 |
if ( fmin.le.0.0 ) then |
if ( fmin.le.0.0 ) then |
182 |
print '(A,E12.6,A)', ' OPTIM_READPARMS: fmin = ', fmin, |
print '(A,E12.6,A)', ' OPTIM_READPARMS: fmin = ', fmin, |
183 |
& ' should be > 0' |
& ' should be > 0' |
195 |
print*, ' OPTIM_READPARMS: Iteration number = ', optimcycle |
print*, ' OPTIM_READPARMS: Iteration number = ', optimcycle |
196 |
print*, ' number of control variables = ', nn |
print*, ' number of control variables = ', nn |
197 |
print*, ' cost function value in ', ctrlname, ' = ', ff |
print*, ' cost function value in ', ctrlname, ' = ', ff |
198 |
|
if ( coldStart ) then |
199 |
|
print*, ' expected cost function minimum = ', fmin |
200 |
|
print*, ' expected cost function decrease = ', ff-fmin |
201 |
|
endif |
202 |
print '(a,4a,i4.4)', |
print '(a,4a,i4.4)', |
203 |
& ' Data will be read from the following file: ', |
& ' Data will be read from the following file: ', |
204 |
& ctrlname,'_',yctrlid(1:10),'.opt', optimcycle |
& ctrlname,'_',yctrlid(1:10),'.opt', optimcycle |
205 |
print* |
print* |
206 |
|
|