1 |
C $Header: /u/gcmpack/MITgcm/pkg/ecco/cost_hyd.F,v 1.21 2011/03/13 22:24:42 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "COST_CPPOPTIONS.h" |
5 |
|
6 |
|
7 |
subroutine cost_hyd( myiter, mytime, mythid ) |
8 |
|
9 |
c ================================================================== |
10 |
c SUBROUTINE cost_hyd |
11 |
c ================================================================== |
12 |
c |
13 |
c o Evaluate cost function contributions of temperature, salt, and |
14 |
c sea surface temperature contributions. |
15 |
c |
16 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
17 |
c |
18 |
c changed: Christian Eckert eckert@mit.edu 25-Feb-2000 |
19 |
c |
20 |
c - Restructured the code in order to create a package |
21 |
c for the MITgcmUV. |
22 |
c |
23 |
c ================================================================== |
24 |
c SUBROUTINE cost_hyd |
25 |
c ================================================================== |
26 |
|
27 |
implicit none |
28 |
|
29 |
c == global variables == |
30 |
#include "EEPARAMS.h" |
31 |
#include "SIZE.h" |
32 |
#include "PARAMS.h" |
33 |
#include "GRID.h" |
34 |
|
35 |
#include "cal.h" |
36 |
#include "ctrl.h" |
37 |
#include "ctrl_dummy.h" |
38 |
#include "ecco_cost.h" |
39 |
#ifdef ALLOW_SEAICE |
40 |
# include "SEAICE_COST.h" |
41 |
#endif |
42 |
|
43 |
c == routine arguments == |
44 |
|
45 |
integer myiter |
46 |
_RL mytime |
47 |
integer mythid |
48 |
|
49 |
c == local variables == |
50 |
character*(max_len_mbuf) msgbuf |
51 |
|
52 |
integer nnzbar |
53 |
integer nnzobs |
54 |
integer nrecloc |
55 |
_RL spminloc |
56 |
_RL spmaxloc |
57 |
_RL spzeroloc |
58 |
_RL localperiod |
59 |
|
60 |
c == end of interface == |
61 |
|
62 |
|
63 |
#if (defined (ALLOW_SST_COST_CONTRIBUTION)) |
64 |
write(msgbuf,'(a)') 'ph-cost call cost_sst' |
65 |
call print_message( msgbuf, standardmessageunit, |
66 |
& SQUEEZE_RIGHT , mythid) |
67 |
nnzbar = nnztbar |
68 |
nnzobs = 1 |
69 |
spminloc = -1.8 |
70 |
spmaxloc = 40. |
71 |
spzeroloc = 0. |
72 |
localperiod = 0. |
73 |
call cost_generic( |
74 |
& nnzbar, tbarfile, tbar, xx_tbar_mean_dummy, |
75 |
& nnzobs, sstdatfile, mult_sst, |
76 |
& nmonsrec, sststartdate, localperiod, |
77 |
& 'C', wsst, |
78 |
& spminloc, spmaxloc, spzeroloc, |
79 |
& objf_sst, num_sst, |
80 |
& myiter, mytime, mythid ) |
81 |
c |
82 |
#elif (defined (ALLOW_DAILYSST_COST_CONTRIBUTION)) |
83 |
c |
84 |
write(msgbuf,'(a)') 'ph-cost call cost_sst' |
85 |
call print_message( msgbuf, standardmessageunit, |
86 |
& SQUEEZE_RIGHT , mythid) |
87 |
nnzbar = 1 |
88 |
nnzobs = 1 |
89 |
nrecloc = ndaysrec |
90 |
spminloc = -2. |
91 |
spmaxloc = 40. |
92 |
spzeroloc = 0. |
93 |
localperiod = 86400. |
94 |
call cost_generic( |
95 |
& nnzbar, sstbarfile, sstbar, xx_sstbar_mean_dummy, |
96 |
& nnzobs, sstdatfile, mult_sst, |
97 |
& nrecloc, sststartdate, localperiod, |
98 |
& 'C', wsst, |
99 |
& spminloc, spmaxloc, spzeroloc, |
100 |
& objf_sst, num_sst, |
101 |
& myiter, mytime, mythid ) |
102 |
cph call cost_sst ( myiter, mytime, mythid ) |
103 |
#endif |
104 |
|
105 |
#ifdef ALLOW_ARGO_THETA_COST_CONTRIBUTION |
106 |
write(msgbuf,'(a)') 'ph-cost call cost_argo_theta' |
107 |
call print_message( msgbuf, standardmessageunit, |
108 |
& SQUEEZE_RIGHT , mythid) |
109 |
call cost_argo_theta ( myiter, mytime, mythid ) |
110 |
#endif |
111 |
|
112 |
#ifdef ALLOW_CTDT_COST_CONTRIBUTION |
113 |
write(msgbuf,'(a)') 'ph-cost call cost_ctdt' |
114 |
call print_message( msgbuf, standardmessageunit, |
115 |
& SQUEEZE_RIGHT , mythid) |
116 |
call cost_ctdt ( myiter, mytime, mythid ) |
117 |
#endif |
118 |
|
119 |
#ifdef ALLOW_XBT_COST_CONTRIBUTION |
120 |
write(msgbuf,'(a)') 'ph-cost call cost_xbt' |
121 |
call print_message( msgbuf, standardmessageunit, |
122 |
& SQUEEZE_RIGHT , mythid) |
123 |
call cost_xbt ( myiter, mytime, mythid ) |
124 |
#endif |
125 |
|
126 |
#ifdef ALLOW_TMI_SST_COST_CONTRIBUTION |
127 |
write(msgbuf,'(a)') 'ph-cost call cost_tmi' |
128 |
call print_message( msgbuf, standardmessageunit, |
129 |
& SQUEEZE_RIGHT , mythid) |
130 |
nnzbar = nnztbar |
131 |
nnzobs = 1 |
132 |
spminloc = -1.8 |
133 |
spmaxloc = 40. |
134 |
spzeroloc = 0. |
135 |
localperiod = 0. |
136 |
call cost_generic( |
137 |
& nnzbar, tbarfile, tbar, xx_tbar_mean_dummy, |
138 |
& nnzobs, tmidatfile, mult_tmi, |
139 |
& nmonsrec, tmistartdate, localperiod, |
140 |
& 'C', wsst, |
141 |
& spminloc, spmaxloc, spzeroloc, |
142 |
& objf_tmi, num_tmi, |
143 |
& myiter, mytime, mythid ) |
144 |
cph call cost_tmi( myiter, mytime, mythid ) |
145 |
#endif |
146 |
|
147 |
#ifdef ALLOW_SSS_COST_CONTRIBUTION |
148 |
write(msgbuf,'(a)') 'ph-cost call cost_sss' |
149 |
call print_message( msgbuf, standardmessageunit, |
150 |
& SQUEEZE_RIGHT , mythid) |
151 |
nnzbar = nnzsbar |
152 |
nnzobs = 1 |
153 |
spminloc = 20. |
154 |
spmaxloc = 40. |
155 |
spzeroloc = 0. |
156 |
localperiod = 0. |
157 |
call cost_generic( |
158 |
& nnzbar, sbarfile, sbar, xx_sbar_mean_dummy, |
159 |
& nnzobs, sssdatfile, mult_sss, |
160 |
& nmonsrec, sssstartdate, localperiod, |
161 |
& 'C', wsss, |
162 |
& spminloc, spmaxloc, spzeroloc, |
163 |
& objf_sss, num_sss, |
164 |
& myiter, mytime, mythid ) |
165 |
cph call cost_sss ( myiter, mytime, mythid ) |
166 |
#endif |
167 |
|
168 |
#ifdef ALLOW_CTDS_COST_CONTRIBUTION |
169 |
write(msgbuf,'(a)') 'ph-cost call cost_ctds' |
170 |
call print_message( msgbuf, standardmessageunit, |
171 |
& SQUEEZE_RIGHT , mythid) |
172 |
call cost_ctds ( myiter, mytime, mythid ) |
173 |
#endif |
174 |
|
175 |
#ifdef ALLOW_ARGO_SALT_COST_CONTRIBUTION |
176 |
write(msgbuf,'(a)') 'ph-cost call cost_argo_salt' |
177 |
call print_message( msgbuf, standardmessageunit, |
178 |
& SQUEEZE_RIGHT , mythid) |
179 |
call cost_argo_salt ( myiter, mytime, mythid ) |
180 |
#endif |
181 |
|
182 |
#ifdef ALLOW_THETA0_COST_CONTRIBUTION |
183 |
write(msgbuf,'(a)') 'ph-cost call cost_theta0' |
184 |
call print_message( msgbuf, standardmessageunit, |
185 |
& SQUEEZE_RIGHT , mythid) |
186 |
call cost_theta0 ( myiter, mytime, mythid ) |
187 |
#endif |
188 |
|
189 |
#ifdef ALLOW_SALT0_COST_CONTRIBUTION |
190 |
write(msgbuf,'(a)') 'ph-cost call cost_salt0' |
191 |
call print_message( msgbuf, standardmessageunit, |
192 |
& SQUEEZE_RIGHT , mythid) |
193 |
call cost_salt0 ( myiter, mytime, mythid ) |
194 |
#endif |
195 |
|
196 |
#ifdef ALLOW_THETA_COST_CONTRIBUTION |
197 |
write(msgbuf,'(a)') 'ph-cost call cost_theta' |
198 |
call print_message( msgbuf, standardmessageunit, |
199 |
& SQUEEZE_RIGHT , mythid) |
200 |
call cost_theta ( myiter, mytime, mythid ) |
201 |
#endif |
202 |
|
203 |
#ifdef ALLOW_SALT_COST_CONTRIBUTION |
204 |
write(msgbuf,'(a)') 'ph-cost call cost_salt' |
205 |
call print_message( msgbuf, standardmessageunit, |
206 |
& SQUEEZE_RIGHT , mythid) |
207 |
call cost_salt ( myiter, mytime, mythid ) |
208 |
#endif |
209 |
|
210 |
#ifdef ALLOW_TRANSPORT_COST_CONTRIBUTION |
211 |
write(msgbuf,'(a)') 'ph-cost call cost_gen_transport' |
212 |
call print_message( msgbuf, standardmessageunit, |
213 |
& SQUEEZE_RIGHT , mythid) |
214 |
call cost_gen_transport ( myiter, mytime, mythid ) |
215 |
#endif |
216 |
|
217 |
#if (defined (ALLOW_PROFILES) && defined (ALLOW_PROFILES_CONTRIBUTION)) |
218 |
CALL cost_profiles( myiter, mytime, mythid) |
219 |
#endif |
220 |
|
221 |
#ifdef ALLOW_ETAN0_COST_CONTRIBUTION |
222 |
write(msgbuf,'(a)') 'ph-cost call cost_etan0' |
223 |
call print_message( msgbuf, standardmessageunit, |
224 |
& SQUEEZE_RIGHT , mythid) |
225 |
call cost_etan0 ( myiter, mytime, mythid ) |
226 |
#endif |
227 |
|
228 |
#ifdef ALLOW_UVEL0_COST_CONTRIBUTION |
229 |
write(msgbuf,'(a)') 'ph-cost call cost_uvel0' |
230 |
call print_message( msgbuf, standardmessageunit, |
231 |
& SQUEEZE_RIGHT , mythid) |
232 |
call cost_uvel0 ( myiter, mytime, mythid ) |
233 |
#endif |
234 |
#ifdef ALLOW_VVEL0_COST_CONTRIBUTION |
235 |
write(msgbuf,'(a)') 'ph-cost call cost_vvel0' |
236 |
call print_message( msgbuf, standardmessageunit, |
237 |
& SQUEEZE_RIGHT , mythid) |
238 |
call cost_vvel0 ( myiter, mytime, mythid ) |
239 |
#endif |
240 |
|
241 |
#ifdef ALLOW_SEAICE_COST_SMR_AREA |
242 |
# ifdef ALLOW_SEAICE_COST_AREASST |
243 |
cph this block out of date; |
244 |
cph similar call moved to seaice_cost_driver and |
245 |
cph and extended using I. Fenty SST, SSS extensions |
246 |
|
247 |
write(msgbuf,'(a)') 'ph-cost call seaice_cost_areasst' |
248 |
call print_message( msgbuf, standardmessageunit, |
249 |
& SQUEEZE_RIGHT , mythid) |
250 |
nnzbar = 1 |
251 |
nnzobs = 1 |
252 |
nrecloc = ndaysrec |
253 |
spminloc = 0. |
254 |
spmaxloc = 1. |
255 |
spzeroloc = -9999. |
256 |
localperiod = 86400. |
257 |
call seaice_cost_areasst( |
258 |
& nnzbar, smrareabarfile, smrareabar, xx_smrareabar_mean_dummy, |
259 |
& nnzobs, smrareadatfile, smrareadat, mult_smrarea, |
260 |
& nrecloc, modelstartdate, localperiod, |
261 |
& maskC, wsmrarea, |
262 |
& spminloc, spmaxloc, spzeroloc, |
263 |
& objf_smrarea, num_smrarea, |
264 |
& myiter, mytime, mythid ) |
265 |
|
266 |
write(msgbuf,'(a,1P2E18.10)') |
267 |
& 'ph-cost seaice_cost_areasst ', |
268 |
& objf_smrarea(1,1), num_smrarea(1,1) |
269 |
call print_message( msgbuf, standardmessageunit, |
270 |
& SQUEEZE_RIGHT , mythid) |
271 |
|
272 |
# endif /* ALLOW_SEAICE_COST_AREASST */ |
273 |
#endif |
274 |
|
275 |
end |