|
|
|
Next: 5.2.5 The control variables
Up: 5.2 TLM and ADM
Previous: 5.2.3 The AD build
Contents
Subsections
5.2.4 The cost function (dependent variable)
The cost function
is referred to as the dependent variable.
It is a function of the input variables
via the composition
.
The input are referred to as the
independent variables or control variables.
All aspects relevant to the treatment of the cost function
(parameter setting, initialization, accumulation,
final evaluation), are controlled by the package pkg/cost.
The aspects relevant to the treatment of the independent variables
are controlled by the package pkg/ctrl and will be treated
in the next section.
Figure 5.3:
|
- The package is enabled by adding cost to your file packages.conf
(see Section ???)
N.B.: In general the following packages ought to be enabled
simultaneously: autodiff, cost, ctrl.
The basic CPP option to enable the cost function is ALLOW_COST.
Each specific cost function contribution has its own option.
For the present example the option is ALLOW_COST_TRACER.
All cost-specific options are set in ECCO_CPPOPTIONS.h
Since the cost function is usually used in conjunction with
automatic differentiation, the CPP option
ALLOW_ADJOINT_RUN (file CPP_OPTIONS.h) and
ALLOW_AUTODIFF_TAMC (file ECCO_CPPOPTIONS.h)
should be defined.
The initialization of the cost package is readily enabled
as soon as the CPP option ALLOW_COST is defined.
-
This S/R
reads runtime flags and parameters from file data.cost.
For the present example the only relevant parameter read
is mult_tracer. This multiplier enables different
cost function contributions to be switched on
( = 1.) or off ( = 0.) at runtime.
For more complex cost functions which involve model vs. data
misfits, the corresponding data filenames and data
specifications (start date and time, period, ...) are read
in this S/R.
-
This S/R
initializes the different cost function contributions.
The contribution for the present example is objf_tracer
which is defined on each tile (bi,bj).
The 'driver' routine
cost_tile is called at the end of each time step.
Within this 'driver' routine, S/R are called for each of
the chosen cost function contributions.
In the present example (ALLOW_COST_TRACER),
S/R cost_tracer is called.
It accumulates objf_tracer according to eqn. (ref:ask-the-author).
At the end of the forward integration S/R cost_final
is called. It accumulates the total cost function fc
from each contribution and sums over all tiles:
|
(5.13) |
The total cost function fc will be the
'dependent' variable in the argument list for TAF, i.e.
taf -output 'fc' ...
Figure 5.4:
|
Next: 5.2.5 The control variables
Up: 5.2 TLM and ADM
Previous: 5.2.3 The AD build
Contents
mitgcm-support@mitgcm.org
Copyright © 2006
Massachusetts Institute of Technology |
Last update 2018-01-23 |
|
|