/[MITgcm]/MITgcm/pkg/ecco/cost_hyd.F
ViewVC logotype

Contents of /MITgcm/pkg/ecco/cost_hyd.F

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


Revision 1.39 - (show annotations) (download)
Mon Oct 26 03:22:17 2015 UTC (8 years, 7 months ago) by gforget
Branch: MAIN
Changes since 1.38: +21 -6 lines
- cost_hyd.F: replace calls to cost_theta0, cost_salt0, cost_etan0,
  cost_uvel0, cost_vvel0 with calls to ctrl_cost_gen3d/2d.
- cost_internal_params.F: replace calls to cost_tau_eddy, cost_kapgm,
  cost_kapredi, cost_diffkr, cost_bottomdrag, with ctrl_cost_gen2d/3d calls.

1 C $Header: /u/gcmpack/MITgcm/pkg/ecco/cost_hyd.F,v 1.38 2015/10/24 18:49:43 gforget Exp $
2 C $Name: $
3
4 #include "ECCO_OPTIONS.h"
5 #ifdef ALLOW_SEAICE
6 # include "SEAICE_OPTIONS.h"
7 #endif
8
9 subroutine cost_hyd( myiter, mytime, mythid )
10
11 c ==================================================================
12 c SUBROUTINE cost_hyd
13 c ==================================================================
14 c
15 c o Evaluate cost function contributions of temperature, salt, and
16 c sea surface temperature contributions.
17 c
18 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
19 c
20 c changed: Christian Eckert eckert@mit.edu 25-Feb-2000
21 c
22 c - Restructured the code in order to create a package
23 c for the MITgcmUV.
24 c
25 c ==================================================================
26 c SUBROUTINE cost_hyd
27 c ==================================================================
28
29 implicit none
30
31 c == global variables ==
32 #ifdef ECCO_CTRL_DEPRECATED
33 #include "EEPARAMS.h"
34 #include "SIZE.h"
35 #include "PARAMS.h"
36 #include "GRID.h"
37
38 #include "cal.h"
39 #include "CTRL_SIZE.h"
40 #include "ctrl.h"
41 #include "ctrl_dummy.h"
42 #include "ecco_cost.h"
43 #ifdef ALLOW_SEAICE
44 # include "SEAICE_COST.h"
45 #endif
46 #endif
47
48 c == routine arguments ==
49
50 integer myiter
51 _RL mytime
52 integer mythid
53
54 #ifdef ECCO_CTRL_DEPRECATED
55 c == local variables ==
56 character*(max_len_mbuf) msgbuf
57
58 integer nnzbar
59 integer nnzobs
60 integer nrecloc
61 integer nmonsloc
62 _RL spminloc
63 _RL spmaxloc
64 _RL spzeroloc
65 _RL localperiod
66
67 c == end of interface ==
68
69
70 IF (using_cost_sst) THEN
71 #if (defined (ALLOW_SST_COST_CONTRIBUTION))
72 write(msgbuf,'(a)') 'ph-cost call cost_sst'
73 call print_message( msgbuf, standardmessageunit,
74 & SQUEEZE_RIGHT , mythid)
75 nnzbar = nnztbar
76 nnzobs = 1
77 spminloc = -1.8
78 spmaxloc = 40.
79 spzeroloc = 0.
80 localperiod = 0.
81 nmonsloc=nmonsrec
82 call cost_generic(
83 & nnzbar, tbarfile, xx_tbar_mean_dummy,
84 & nnzobs, sstdatfile, ssterrfile, mult_sst,
85 & nmonsloc, nmonsloc, sststartdate, localperiod,
86 & 'C', spminloc, spmaxloc, spzeroloc,
87 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
88 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
89 & 0, sstdatfile, objf_sst, num_sst,
90 & myiter, mytime, mythid )
91 c
92 #elif (defined (ALLOW_DAILYSST_COST_CONTRIBUTION))
93 c
94 write(msgbuf,'(a)') 'ph-cost call cost_sst'
95 call print_message( msgbuf, standardmessageunit,
96 & SQUEEZE_RIGHT , mythid)
97 nnzbar = 1
98 nnzobs = 1
99 nrecloc = ndaysrec
100 spminloc = -2.
101 spmaxloc = 40.
102 spzeroloc = 0.
103 localperiod = 86400.
104 nmonsloc=nmonsrec
105 call cost_generic(
106 & nnzbar, sstbarfile, xx_sstbar_mean_dummy,
107 & nnzobs, sstdatfile, ssterrfile, mult_sst,
108 & nrecloc, nmonsloc, sststartdate, localperiod,
109 & 'C', spminloc, spmaxloc, spzeroloc,
110 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
111 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
112 & 0, sstdatfile, objf_sst, num_sst,
113 & myiter, mytime, mythid )
114 cph call cost_sst ( myiter, mytime, mythid )
115 #endif
116 ENDIF
117
118 #ifdef ALLOW_ARGO_THETA_COST_CONTRIBUTION
119 write(msgbuf,'(a)') 'ph-cost call cost_argo_theta'
120 call print_message( msgbuf, standardmessageunit,
121 & SQUEEZE_RIGHT , mythid)
122 nnzbar = Nr
123 nnzobs = Nr
124 spminloc = -1.8
125 spmaxloc = 40.
126 spzeroloc = 0.
127 localperiod = 0.
128 nmonsloc=nmonsrec
129 call cost_generic(
130 & nnzbar, tbarfile, xx_tbar_mean_dummy,
131 & nnzobs, argotfile, temperrfile, mult_argot,
132 & nmonsloc, nmonsloc, argotstartdate, localperiod,
133 & 'C', spminloc, spmaxloc, spzeroloc,
134 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
135 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
136 & 0, argotfile, objf_argot, num_argot,
137 & myiter, mytime, mythid )
138 #endif
139
140 #ifdef ALLOW_CTDT_COST_CONTRIBUTION
141 write(msgbuf,'(a)') 'ph-cost call cost_ctdt'
142 call print_message( msgbuf, standardmessageunit,
143 & SQUEEZE_RIGHT , mythid)
144 nnzbar = Nr
145 nnzobs = Nr
146 spminloc = -1.8
147 spmaxloc = 40.
148 spzeroloc = 0.
149 localperiod = 0.
150 nmonsloc=nmonsrec
151 call cost_generic(
152 & nnzbar, tbarfile, xx_tbar_mean_dummy,
153 & nnzobs, ctdtfile, temperrfile, mult_ctdt,
154 & nmonsloc, nmonsloc, ctdtstartdate, localperiod,
155 & 'C', spminloc, spmaxloc, spzeroloc,
156 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
157 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
158 & 0, ctdtfile, objf_ctdt, num_ctdt,
159 & myiter, mytime, mythid )
160 #endif
161
162 #ifdef ALLOW_XBT_COST_CONTRIBUTION
163 write(msgbuf,'(a)') 'ph-cost call cost_xbt'
164 call print_message( msgbuf, standardmessageunit,
165 & SQUEEZE_RIGHT , mythid)
166 nnzbar = Nr
167 nnzobs = Nr
168 spminloc = -1.8
169 spmaxloc = 40.
170 spzeroloc = 0.
171 localperiod = 0.
172 nmonsloc=nmonsrec
173 call cost_generic(
174 & nnzbar, tbarfile, xx_tbar_mean_dummy,
175 & nnzobs, xbtfile, temperrfile, mult_xbt,
176 & nmonsloc, nmonsloc, xbtstartdate, localperiod,
177 & 'C', spminloc, spmaxloc, spzeroloc,
178 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
179 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
180 & 0, xbtfile, objf_xbt, num_xbt,
181 & myiter, mytime, mythid )
182 #endif
183
184 IF (using_cost_sst) THEN
185 #ifdef ALLOW_TMI_SST_COST_CONTRIBUTION
186 write(msgbuf,'(a)') 'ph-cost call cost_tmi'
187 call print_message( msgbuf, standardmessageunit,
188 & SQUEEZE_RIGHT , mythid)
189 nnzbar = nnztbar
190 nnzobs = 1
191 spminloc = -1.8
192 spmaxloc = 40.
193 spzeroloc = 0.
194 localperiod = 0.
195 nmonsloc=nmonsrec
196 call cost_generic(
197 & nnzbar, tbarfile, xx_tbar_mean_dummy,
198 & nnzobs, tmidatfile, ssterrfile, mult_tmi,
199 & nmonsloc, nmonsloc, tmistartdate, localperiod,
200 & 'C', spminloc, spmaxloc, spzeroloc,
201 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
202 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
203 & 0, tmidatfile, objf_tmi, num_tmi,
204 & myiter, mytime, mythid )
205 cph call cost_tmi( myiter, mytime, mythid )
206 #endif
207 ENDIF
208
209 #ifdef ALLOW_SSS_COST_CONTRIBUTION
210 write(msgbuf,'(a)') 'ph-cost call cost_sss'
211 call print_message( msgbuf, standardmessageunit,
212 & SQUEEZE_RIGHT , mythid)
213 nnzbar = nnzsbar
214 nnzobs = 1
215 spminloc = 20.
216 spmaxloc = 40.
217 spzeroloc = 0.
218 localperiod = 0.
219 nmonsloc=nmonsrec
220 call cost_generic(
221 & nnzbar, sbarfile, xx_sbar_mean_dummy,
222 & nnzobs, sssdatfile, ssterrfile, mult_sss,
223 & nmonsloc, nmonsloc, sssstartdate, localperiod,
224 & 'C', spminloc, spmaxloc, spzeroloc,
225 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
226 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
227 & 0, sssdatfile, objf_sss, num_sss,
228 & myiter, mytime, mythid )
229 cph call cost_sss ( myiter, mytime, mythid )
230 #endif
231
232 #ifdef ALLOW_CTDS_COST_CONTRIBUTION
233 write(msgbuf,'(a)') 'ph-cost call cost_ctds'
234 call print_message( msgbuf, standardmessageunit,
235 & SQUEEZE_RIGHT , mythid)
236 nnzbar = Nr
237 nnzobs = Nr
238 spminloc = 20.
239 spmaxloc = 40.
240 spzeroloc = 0.
241 localperiod = 0.
242 nmonsloc=nmonsrec
243 call cost_generic(
244 & nnzbar, sbarfile, xx_sbar_mean_dummy,
245 & nnzobs, ctdsfile, salterrfile, mult_ctds,
246 & nmonsloc, nmonsloc, ctdsstartdate, localperiod,
247 & 'C', spminloc, spmaxloc, spzeroloc,
248 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
249 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
250 & 0, ctdsfile, objf_ctds, num_ctds,
251 & myiter, mytime, mythid )
252 #endif
253
254 #ifdef ALLOW_ARGO_SALT_COST_CONTRIBUTION
255 write(msgbuf,'(a)') 'ph-cost call cost_argo_salt'
256 call print_message( msgbuf, standardmessageunit,
257 & SQUEEZE_RIGHT , mythid)
258 nnzbar = Nr
259 nnzobs = Nr
260 spminloc = 20.
261 spmaxloc = 40.
262 spzeroloc = 0.
263 localperiod = 0.
264 nmonsloc=nmonsrec
265 call cost_generic(
266 & nnzbar, sbarfile, xx_sbar_mean_dummy,
267 & nnzobs, argosfile, salterrfile, mult_argos,
268 & nmonsloc, nmonsloc, argosstartdate, localperiod,
269 & 'C', spminloc, spmaxloc, spzeroloc,
270 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
271 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
272 & 0, argosfile, objf_argos, num_argos,
273 & myiter, mytime, mythid )
274 #endif
275
276 #ifdef ALLOW_THETA0_COST_CONTRIBUTION
277 if (.NOT.ctrlUseGen) then
278 write(msgbuf,'(a)') 'ph-cost call cost_theta0'
279 call print_message( msgbuf, standardmessageunit,
280 & SQUEEZE_RIGHT , mythid)
281 call ctrl_cost_gen3d (
282 & xx_theta_file,xx_theta_dummy, wthetaLev,
283 & num_temp0, objf_temp0, maskC, myThid )
284 endif
285 #endif
286
287 #ifdef ALLOW_SALT0_COST_CONTRIBUTION
288 if (.NOT.ctrlUseGen) then
289 write(msgbuf,'(a)') 'ph-cost call cost_salt0'
290 call print_message( msgbuf, standardmessageunit,
291 & SQUEEZE_RIGHT , mythid)
292 call ctrl_cost_gen3d (
293 & xx_salt_file,xx_salt_dummy, wsaltLev,
294 & num_salt0, objf_salt0, maskC, myThid )
295 endif
296 #endif
297
298 #ifdef ALLOW_THETA_COST_CONTRIBUTION
299 write(msgbuf,'(a)') 'ph-cost call cost_theta'
300 call print_message( msgbuf, standardmessageunit,
301 & SQUEEZE_RIGHT , mythid)
302 nnzbar = Nr
303 nnzobs = Nr
304 spminloc = -1.8
305 spmaxloc = 40.
306 spzeroloc = 0.
307 localperiod = 0.
308 nmonsloc=nmonsrec
309 no_preproc(1)='clim'
310 no_preproc_i(1)=12
311 call cost_generic(
312 & nnzbar, tbarfile, xx_tbar_mean_dummy,
313 & nnzobs, tdatfile, temperrfile, mult_temp,
314 & nmonsloc, nmonsloc, modelstartdate, localperiod,
315 & 'C', spminloc, spmaxloc, spzeroloc,
316 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
317 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
318 & 0, tdatfile, objf_temp, num_temp,
319 & myiter, mytime, mythid )
320 no_preproc(1)=' '
321 no_preproc_i(1)=0
322 #endif
323
324 #ifdef ALLOW_SALT_COST_CONTRIBUTION
325 write(msgbuf,'(a)') 'ph-cost call cost_salt'
326 call print_message( msgbuf, standardmessageunit,
327 & SQUEEZE_RIGHT , mythid)
328 nnzbar = Nr
329 nnzobs = Nr
330 spminloc = 25.
331 spmaxloc = 40.
332 spzeroloc = 0.
333 localperiod = 0.
334 nmonsloc=nmonsrec
335 no_preproc(1)='clim'
336 no_preproc_i(1)=12
337 call cost_generic(
338 & nnzbar, sbarfile, xx_sbar_mean_dummy,
339 & nnzobs, sdatfile, salterrfile, mult_salt,
340 & nmonsloc, nmonsloc, modelstartdate, localperiod,
341 & 'C', spminloc, spmaxloc, spzeroloc,
342 & no_preproc, no_preproc_c, no_preproc_i, no_preproc_r,
343 & no_posproc, no_posproc_c, no_posproc_i, no_posproc_r,
344 & 0, sdatfile, objf_salt, num_salt,
345 & myiter, mytime, mythid )
346 no_preproc(1)=' '
347 no_preproc_i(1)=0
348 #endif
349
350 #ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
351 write(msgbuf,'(a)') 'ph-cost call cost_sigmar'
352 call print_message( msgbuf, standardmessageunit,
353 & SQUEEZE_RIGHT , mythid)
354 call cost_sigmar ( myiter, mytime, mythid )
355 #endif
356
357 #ifdef ALLOW_TRANSPORT_COST_CONTRIBUTION
358 write(msgbuf,'(a)') 'ph-cost call cost_gen_transport'
359 call print_message( msgbuf, standardmessageunit,
360 & SQUEEZE_RIGHT , mythid)
361 call cost_gen_transport ( myiter, mytime, mythid )
362 #endif
363
364 #ifdef ALLOW_ETAN0_COST_CONTRIBUTION
365 write(msgbuf,'(a)') 'ph-cost call cost_etan0'
366 call print_message( msgbuf, standardmessageunit,
367 & SQUEEZE_RIGHT , mythid)
368 call ctrl_cost_gen2d (
369 & 1,1,xx_etan_file,xx_etan_dummy,zeroRL,
370 & wetan, num_etan0, objf_etan0,
371 #ifdef ECCO_CTRL_DEPRECATED
372 & zeroRL, num_zero_mean, objf_zero_mean,
373 & objf_zero_smoo, zeroRL, zeroRL,
374 #endif /* ECCO_CTRL_DEPRECATED */
375 & maskC, myThid )
376 #endif
377
378 #ifdef ALLOW_UVEL0_COST_CONTRIBUTION
379 write(msgbuf,'(a)') 'ph-cost call cost_uvel0'
380 call print_message( msgbuf, standardmessageunit,
381 & SQUEEZE_RIGHT , mythid)
382 call ctrl_cost_gen3d (
383 & xx_uvel_file,xx_uvel_dummy, wuvel3d,
384 & num_uvel0, objf_uvel0, maskW, myThid )
385 #endif
386 #ifdef ALLOW_VVEL0_COST_CONTRIBUTION
387 write(msgbuf,'(a)') 'ph-cost call cost_vvel0'
388 call print_message( msgbuf, standardmessageunit,
389 & SQUEEZE_RIGHT , mythid)
390 call ctrl_cost_gen3d (
391 & xx_vvel_file,xx_vvel_dummy, wvvel3d,
392 & num_vvel0, objf_vvel0, maskS, myThid )
393 #endif
394
395 #ifdef ALLOW_SEAICE_COST_SMR_AREA
396 # ifdef ALLOW_SEAICE_COST_AREASST
397 cph this block out of date;
398 cph similar call moved to seaice_cost_driver and
399 cph and extended using I. Fenty SST, SSS extensions
400
401 write(msgbuf,'(a)') 'ph-cost call seaice_cost_areasst'
402 call print_message( msgbuf, standardmessageunit,
403 & SQUEEZE_RIGHT , mythid)
404 nnzbar = 1
405 nnzobs = 1
406 nrecloc = ndaysrec
407 spminloc = 0.
408 spmaxloc = 1.
409 spzeroloc = -9999.
410 localperiod = 86400.
411 call seaice_cost_areasst(
412 & nnzbar, smrareabarfile, smrareabar, xx_smrareabar_mean_dummy,
413 & nnzobs, smrareadatfile, smrareadat, mult_smrarea,
414 & nrecloc, smrareastartdate, localperiod,
415 & maskC, wsmrarea,
416 & spminloc, spmaxloc, spzeroloc,
417 & objf_smrarea, num_smrarea,
418 & myiter, mytime, mythid )
419
420 write(msgbuf,'(a,1P2E18.10)')
421 & 'ph-cost seaice_cost_areasst ',
422 & objf_smrarea(1,1), num_smrarea(1,1)
423 call print_message( msgbuf, standardmessageunit,
424 & SQUEEZE_RIGHT , mythid)
425
426 # endif /* ALLOW_SEAICE_COST_AREASST */
427 #endif
428
429 #endif /* ECCO_CTRL_DEPRECATED */
430
431 end

  ViewVC Help
Powered by ViewVC 1.1.22