1 |
|
2 |
#include "PACKAGES_CONFIG.h" |
3 |
|
4 |
c ================================================================== |
5 |
c HEADER COST |
6 |
c ================================================================== |
7 |
c |
8 |
c o Header for model-data comparison. |
9 |
c |
10 |
c The individual cost function contributions are multiplied by |
11 |
c factors mult_"var" which allow to switch off these contributions |
12 |
c without removing them in the adjoint code. This is useful for |
13 |
c doing tests with the adjoint and perhaps useful in assimilation |
14 |
c experiments where individual contributions are successively |
15 |
c switched on. For future applications it would be better to place |
16 |
c the initialisation of the multipliers somewhere else, for example |
17 |
c in a namelist, which is read in at the start of the model. |
18 |
c |
19 |
c started: Christian Eckert eckert@mit.edu 24-Feb-1999 |
20 |
c changed: Christian Eckert eckert@mit.edu |
21 |
c heimbach@mit.edu 05-Nov-2003 Modularize cost package |
22 |
c |
23 |
c ================================================================== |
24 |
c HEADER COST |
25 |
c ================================================================== |
26 |
|
27 |
|
28 |
c The cost function, its contributions, and multipliers: |
29 |
c ====================================================== |
30 |
c |
31 |
c fc - Final cost function. |
32 |
c mult_"var" - multipliers for the individual cost |
33 |
c function contributions. |
34 |
|
35 |
common /cost_r/ |
36 |
& fc |
37 |
_RL fc |
38 |
|
39 |
common /cost_objf/ |
40 |
& objf_atl, |
41 |
& objf_test, |
42 |
& objf_tracer, |
43 |
& objf_entropy, |
44 |
& objf_t_misfit, |
45 |
& objf_eflux |
46 |
|
47 |
_RL objf_atl (nsx,nsy) |
48 |
_RL objf_test (nsx,nsy) |
49 |
_RL objf_tracer (nsx,nsy) |
50 |
_RL objf_entropy (nsx,nsy) |
51 |
_RL objf_t_misfit (nsx,nsy) |
52 |
_RL objf_eflux (nsx,nsy) |
53 |
|
54 |
common /cost_param_r/ |
55 |
& lastinterval |
56 |
_RL lastinterval |
57 |
|
58 |
#ifdef ALLOW_COST_STATE_FINAL |
59 |
common /cost_state_final_r/ |
60 |
& objf_state_final |
61 |
cph _RL objf_state_final (snx,sny,nsx,nsy) |
62 |
_RL objf_state_final (snx,sny,nsx,nsy,4*Nr+1) |
63 |
#endif |
64 |
|
65 |
#ifdef ALLOW_COST_VECTOR |
66 |
common /cost_vector_r/ |
67 |
& objf_vector |
68 |
_RL objf_vector (snx,nsx,nsy) |
69 |
#endif |
70 |
|
71 |
common /cost_aux_r/ |
72 |
& mult_atl, |
73 |
& mult_test, |
74 |
& mult_tracer, |
75 |
& mult_entropy, |
76 |
& mult_t_misfit, |
77 |
& mult_eflux, |
78 |
& multTheta, |
79 |
& multSalt, |
80 |
& multUvel, |
81 |
& multVvel, |
82 |
& multEtan |
83 |
|
84 |
_RL mult_atl |
85 |
_RL mult_test |
86 |
_RL mult_tracer |
87 |
_RL mult_entropy |
88 |
_RL mult_t_misfit |
89 |
_RL mult_eflux |
90 |
_RL multTheta |
91 |
_RL multSalt |
92 |
_RL multUvel |
93 |
_RL multVvel |
94 |
_RL multEtan |
95 |
|
96 |
#ifdef ALLOW_COST_TEST |
97 |
common /cost_test_i/ |
98 |
& iLocOut |
99 |
& , jLocOut |
100 |
& , kLocOut |
101 |
integer iLocOut |
102 |
integer jLocOut |
103 |
integer kLocOut |
104 |
#endif |
105 |
|
106 |
#ifdef ALLOW_COST_ATLANTIC_HEAT |
107 |
COMMON /COST_MEAN_R/ |
108 |
& cMeanTheta, cMeanUVel, cMeanVVel |
109 |
_RL cMeanTheta(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
110 |
_RL cMeanUVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
111 |
_RL cMeanVVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
112 |
#endif |
113 |
|
114 |
c ================================================================== |
115 |
c END OF HEADER COST |
116 |
c ================================================================== |
117 |
|
118 |
|