/[MITgcm]/MITgcm/pkg/ecco/ecco_cost.h
ViewVC logotype

Annotation of /MITgcm/pkg/ecco/ecco_cost.h

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


Revision 1.38 - (hide annotations) (download)
Wed May 13 13:39:38 2009 UTC (15 years, 1 month ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint61o, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61x
Changes since 1.37: +3 -2 lines
File MIME type: text/plain
Enable easy way for daily SST cost.

1 heimbach 1.38 C $Header: /u/gcmpack/MITgcm/pkg/ecco/ecco_cost.h,v 1.37 2009/03/14 11:53:41 heimbach Exp $
2 jmc 1.30 C $Name: $
3 heimbach 1.1
4     c ==================================================================
5     c HEADER AVERAGES
6     c ==================================================================
7     c
8     c o Header for averaged temperature, salinity, and surface pressure
9     c fields and counters associated with the averaging.
10     c
11     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
12 heimbach 1.2 c
13 heimbach 1.1 c ==================================================================
14     c HEADER AVERAGES
15     c ==================================================================
16    
17     c Averaging counters:
18     c ===================
19     c
20     c sum1day - counter for the daily averaging
21     c sum1mon - counter for the monthly averaging
22     c dayrec - number of averaged surface pressure records.
23     c monrec - number of averaged theta and salinity records.
24    
25 jmc 1.30 common /average_i/
26 heimbach 1.21 & sum1day,sum1mon,sum1year,
27     & dayrec,monrec,yearrec
28 heimbach 1.1 integer sum1day
29     integer sum1mon
30 heimbach 1.21 integer sum1year
31 heimbach 1.1 integer dayrec
32     integer monrec
33 heimbach 1.21 integer yearrec
34 heimbach 1.1
35 gforget 1.26 c Number of Generic Cost terms:
36     c =============================
37     INTEGER NGENCOST
38     PARAMETER ( NGENCOST=10 )
39 heimbach 1.1
40 heimbach 1.36 c Number of days: (hard-coded to set up some vector dimensions
41 heimbach 1.35 c =============================
42 heimbach 1.37 c 17 years: 6210
43 heimbach 1.35 INTEGER maxNumDays
44 heimbach 1.37 PARAMETER ( maxNumDays = 6210 )
45 heimbach 1.35
46 heimbach 1.1 c Averaged Fields:
47     c ================
48     c
49     c tbar - contains the averaged temperature field after the call
50     c to subroutine POST_MONTHLY. Before, it accumulates the
51     c intantaneous temperatures.
52     c sbar - contains the averaged salinity field after the call
53     c to subroutine POST_MONTHLY. Before, it accumulates the
54     c intantaneous salinities.
55     c psbar - contains the averaged surface pressure field after the call
56     c to subroutine POST_DAILY. Before, it accumulates the
57     c intantaneous surface pressure field.
58 jmc 1.30 c ubar - contains the averaged zonal velocity component for the
59 heimbach 1.1 c whole integration period. Before, it accumulates the
60     c intantaneous field.
61     c vbar - contains the averaged zonal velocity component for the
62     c whole integration period. Before, it accumulates the
63     c intantaneous field.
64     c tauxbar - contains the averaged zonal velocity component for the
65     c whole integration period. Before, it accumulates the
66     c intantaneous field.
67     c tauybar - contains the averaged zonal velocity component for the
68     c whole integration period. Before, it accumulates the
69     c intantaneous field.
70     c hfluxbar - contains the averaged zonal velocity component for the
71     c whole integration period. Before, it accumulates the
72     c intantaneous field.
73     c sfluxbar - contains the averaged zonal velocity component for the
74     c whole integration period. Before, it accumulates the
75     c intantaneous field.
76    
77 jmc 1.30 common /averages_r/
78 heimbach 1.1 & tbar,
79     & sbar,
80 heimbach 1.33 & sstbar,
81 heimbach 1.1 & psbar,
82 heimbach 1.28 & bpbar,
83 heimbach 1.1 & ubar,
84     & vbar,
85     & wbar,
86     & tauxbar,
87     & tauybar,
88     & hfluxbar,
89     & sfluxbar,
90 jmc 1.30 & Slmean,
91 heimbach 1.1 & Tlmean,
92     & wlmean,
93     & Sfmean,
94 jmc 1.30 & Tfmean,
95 heimbach 1.2 & sbar_gen,
96     & tbar_gen,
97     & wfmean
98 heimbach 1.1
99     #if (defined (ALLOW_THETA_COST_CONTRIBUTION) || \
100     defined (ALLOW_CTDT_COST_CONTRIBUTION) || \
101     defined (ALLOW_XBT_COST_CONTRIBUTION) || \
102     defined (ALLOW_DRIFT_COST_CONTRIBUTION) || \
103     defined (ALLOW_OBCS_COST_CONTRIBUTION))
104     _RL tbar (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
105     #else
106 heimbach 1.2 #ifdef ALLOW_SST_COST_CONTRIBUTION
107     _RL tbar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
108     #else
109 heimbach 1.1 _RL tbar
110     #endif
111 heimbach 1.2 #endif
112     #ifdef GENERIC_BAR_MONTH
113     _RL tbar_gen (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
114     _RL sbar_gen (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
115     #else
116     _RL tbar_gen
117     _RL sbar_gen
118     #endif
119 heimbach 1.1
120 heimbach 1.38 #ifdef ALLOW_DAILYSST_COST_CONTRIBUTION
121     cph#ifdef ALLOW_SEAICE_COST_AREASST
122 heimbach 1.33 _RL sstbar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
123     #else
124     _RL sstbar
125     #endif
126    
127 heimbach 1.1 #if (defined (ALLOW_SALT_COST_CONTRIBUTION) || \
128     defined (ALLOW_CTDS_COST_CONTRIBUTION) || \
129     defined (ALLOW_DRIFT_COST_CONTRIBUTION) || \
130     defined (ALLOW_OBCS_COST_CONTRIBUTION))
131     _RL sbar (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
132     #else
133 heimbach 1.2 #ifdef ALLOW_SSS_COST_CONTRIBUTION
134     _RL sbar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
135     #else
136 heimbach 1.1 _RL sbar
137     #endif
138     #endif
139    
140     #ifdef ALLOW_SSH_COST_CONTRIBUTION
141     _RL psbar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
142     #else
143     _RL psbar
144     #endif
145    
146 heimbach 1.28 #ifdef ALLOW_BP_COST_CONTRIBUTION
147     _RL bpbar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
148     #else
149     _RL bpbar
150     #endif
151    
152 heimbach 1.1 #if (defined (ALLOW_DRIFTER_COST_CONTRIBUTION) || \
153 heimbach 1.2 defined (ALLOW_OBCS_COST_CONTRIBUTION))
154 heimbach 1.1 _RL ubar (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
155     _RL vbar (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
156     #else
157     _RL ubar
158     _RL vbar
159     #endif
160    
161     #ifdef ALLOW_DRIFTW_COST_CONTRIBUTION
162     _RL wbar (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
163     #else
164     _RL wbar
165     #endif
166    
167     #ifdef ALLOW_DRIFT_COST_CONTRIBUTION
168     _RL Tlmean(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
169     _RL Slmean(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
170     _RL Tfmean(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
171     _RL Sfmean(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
172     #else
173     _RL Tlmean
174     _RL Slmean
175     _RL Tfmean
176 jmc 1.30 _RL Sfmean
177 heimbach 1.1 #endif
178    
179     #ifdef ALLOW_DRIFTW_COST_CONTRIBUTION
180     _RL wlmean(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
181     _RL wfmean(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
182     #else
183     _RL wlmean
184     _RL wfmean
185     #endif
186    
187     #ifdef ALLOW_SCAT_COST_CONTRIBUTION
188     _RL tauxbar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
189     _RL tauybar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
190     #else
191 jmc 1.30 _RL tauxbar
192     _RL tauybar
193 heimbach 1.1 #endif
194    
195     #ifdef ALLOW_MEAN_HFLUX_COST_CONTRIBUTION
196     _RL hfluxbar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
197 jmc 1.30 #else
198 heimbach 1.1 _RL hfluxbar
199     #endif
200    
201     #ifdef ALLOW_MEAN_SFLUX_COST_CONTRIBUTION
202 jmc 1.30 _RL sfluxbar (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
203     #else
204 heimbach 1.1 _RL sfluxbar
205     #endif
206    
207    
208 jmc 1.30 common /averages_c/
209 heimbach 1.1 & tbarfile,
210     & sbarfile,
211 heimbach 1.33 & sstbarfile,
212 heimbach 1.1 & psbarfile,
213 heimbach 1.28 & bpbarfile,
214 heimbach 1.1 & ubarfile,
215     & vbarfile,
216     & wbarfile,
217     & tauxbarfile,
218     & tauybarfile,
219     & hfluxbarfile,
220 heimbach 1.27 & sfluxbarfile,
221     & costTranspDataFile
222 heimbach 1.1 character*(MAX_LEN_FNAM) tbarfile
223     character*(MAX_LEN_FNAM) sbarfile
224 heimbach 1.33 character*(MAX_LEN_FNAM) sstbarfile
225 heimbach 1.1 character*(MAX_LEN_FNAM) psbarfile
226 heimbach 1.28 character*(MAX_LEN_FNAM) bpbarfile
227 heimbach 1.1 character*(MAX_LEN_FNAM) ubarfile
228     character*(MAX_LEN_FNAM) vbarfile
229     character*(MAX_LEN_FNAM) wbarfile
230     character*(MAX_LEN_FNAM) tauxbarfile
231     character*(MAX_LEN_FNAM) tauybarfile
232     character*(MAX_LEN_FNAM) hfluxbarfile
233     character*(MAX_LEN_FNAM) sfluxbarfile
234 heimbach 1.27 character*(MAX_LEN_FNAM) costTranspDataFile
235    
236     #ifdef ALLOW_TRANSPORT_COST_CONTRIBUTION
237     common /averages_transp_r/
238     & transpbar
239     & , transpobs
240     & , wtransp
241 jmc 1.30 _RL transpbar(maxNumDays,nsx,nsy)
242 heimbach 1.27 _RL transpobs(maxNumDays)
243     _RL wtransp(maxNumDays)
244     #endif
245 heimbach 1.1
246     c file precision and field type
247    
248 jmc 1.30 common /prec_type_cost/
249 heimbach 1.1 & cost_iprec,
250     & cost_yftype
251    
252     integer cost_iprec
253     character*(2) cost_yftype
254    
255     c ==================================================================
256     c END OF HEADER AVERAGES
257     c ==================================================================
258    
259    
260    
261     c ==================================================================
262     c HEADER COST
263     c ==================================================================
264     c
265     c o Header for model-data comparison.
266     c
267     c The individual cost function contributions are multiplied by
268     c factors mult_"var" which allow to switch off these contributions
269     c without removing them in the adjoint code. This is useful for
270     c doing tests with the adjoint and perhaps useful in assimilation
271     c experiments where individual contributions are successively
272     c switched on. For future applications it would be better to place
273     c the initialisation of the multipliers somewhere else, for example
274     c in a namelist, which is read in at the start of the model.
275     c
276     c started: Christian Eckert eckert@mit.edu 24-Feb-1999
277     c
278     c changed: Christian Eckert eckert@mit.edu
279     c
280     c
281     c ==================================================================
282     c HEADER COST
283     c ==================================================================
284    
285    
286     c The cost function, its contributions, and multipliers:
287     c ======================================================
288     c
289     c fc - Final cost function.
290     c objf_hflux - Heat flux contribution.
291     c objf_sflux - Salt flux contribution.
292     c objf_tauu - Zonal wind stress contribution.
293     c objf_tauv - Meridional wind stress contribution.
294     c objf_hfluxm - time-mean Heat flux contribution.
295     c objf_sfluxm - time-mean Salt flux contribution.
296     c objf_tauum - time-mean Zonal wind stress contribution.
297     c objf_tauvm - time-mean Meridional wind stress contribution.
298     c objf_hfluxmm - Global time-mean Heat flux contribution.
299     c objf_sfluxmm - Global time-mean Salt flux contribution.
300     c objf_hmean - Mean sea surface height contribution.
301     c objf_h - Residual sea surface height contribution.
302 heimbach 1.21 c objf_tp - Residual sea surface height contribution from T/P
303     c objf_ers - Residual sea surface height contribution from T/P
304     c objf_gfo - Residual sea surface height contribution from T/P
305 heimbach 1.1 c objf_temp - Temperature contribution.
306     c objf_salt - Salinity contribution.
307     c objf_temp0 - Initial conditions Temperature contribution.
308     c objf_salt0 - Initial conditions Salinity contribution.
309 heimbach 1.2 c objf_sst - Sea surface temperature contribution.
310 heimbach 1.1 c objf_tmi - Sea surface temperature contribution.
311     c objf_sss - Sea surface salinity contribution.
312 jmc 1.30 c objf_ctdt - Temperature measurements from Woce CTD
313     c objf_ctds - Salinity measurements from Woce CTD
314 heimbach 1.2 c objf_ctdtclim - Temperature measurements from Woce CTD without timetag
315     c objf_ctdsclim - Salinity measurements from Woce CTD without timetag
316 heimbach 1.1 c objf_xbt - XBT temperature data
317     c objf_argot - ARGO temperature profiles
318     c objf_argos - ARGO salt profiles
319 gforget 1.26 c objf_gencost - gencost user defined contribution
320 heimbach 1.1 c objf_scatxm - time-mean zonal SCAT contribution
321     c objf_scatym - time-mean meridional SCAT contribution
322     c objf_scatx - zonal SCAT contribution
323     c objf_scaty - meridional SCAT contribution
324     c objf_kapgm - kappa GM contribution
325 gforget 1.31 c objf_kapredi - kappa REDI contribution
326 heimbach 1.1 c objf_diffkr - diffusion contribution
327     c objf_theta_ini_fin - final vs. initial theta misfit
328     c objf_salt_ini_fin - final vs. initial salt misfit
329 gforget 1.32 c objf_eddytau - eddy streamfunction contribution
330 gforget 1.25 c objf_bottomdrag - bottom drag contribution
331 heimbach 1.1 c
332     c mult_"var" - multipliers for the individual cost
333     c function contributions.
334    
335     common /ecco_cost_objf/
336     & objf_hflux,
337     & objf_hfluxm,
338     & objf_hfluxmm,
339 heimbach 1.13 & objf_hfluxsmoo,
340 heimbach 1.1 & objf_sflux,
341     & objf_sfluxm,
342     & objf_sfluxmm,
343 heimbach 1.13 & objf_sfluxsmoo,
344 heimbach 1.1 & objf_tauu,
345     & objf_tauum,
346 heimbach 1.13 & objf_tauusmoo,
347 heimbach 1.1 & objf_tauv,
348     & objf_tauvm,
349 heimbach 1.13 & objf_tauvsmoo,
350 heimbach 1.1 & objf_hmean,
351     & objf_h,
352 heimbach 1.21 & objf_tp,
353     & objf_ers,
354     & objf_gfo,
355 heimbach 1.1 & objf_temp,
356     & objf_salt,
357     & objf_temp0,
358     & objf_salt0,
359 heimbach 1.14 & objf_temp0smoo,
360     & objf_salt0smoo,
361 heimbach 1.2 & objf_sst,
362 heimbach 1.1 & objf_tmi,
363     & objf_sss,
364 heimbach 1.28 & objf_bp,
365 heimbach 1.1 & objf_ctdt,
366     & objf_ctds,
367     & objf_ctdtclim,
368     & objf_ctdsclim,
369     & objf_xbt,
370     & objf_argot,
371     & objf_argos,
372 gforget 1.26 & objf_gencost,
373 heimbach 1.1 & objf_drift,
374     & objf_tdrift,
375     & objf_sdrift,
376     & objf_wdrift,
377     & objf_scatx,
378     & objf_scaty,
379     & objf_scatxm,
380     & objf_scatym,
381     & objf_atemp,
382     & objf_aqh,
383 heimbach 1.6 & objf_precip,
384 heimbach 1.7 & objf_swflux,
385 heimbach 1.9 & objf_swdown,
386 heimbach 1.23 & objf_snowprecip,
387     & objf_lwflux,
388     & objf_lwdown,
389     & objf_evap,
390     & objf_apressure,
391     & objf_runoff,
392 heimbach 1.1 & objf_uwind,
393     & objf_vwind,
394 heimbach 1.8 & objf_atempm,
395     & objf_aqhm,
396     & objf_precipm,
397     & objf_swfluxm,
398 heimbach 1.9 & objf_swdownm,
399 heimbach 1.23 & objf_snowprecipm,
400     & objf_lwfluxm,
401     & objf_lwdownm,
402     & objf_evapm,
403     & objf_apressurem,
404     & objf_runoffm,
405 heimbach 1.8 & objf_uwindm,
406     & objf_vwindm,
407 heimbach 1.13 & objf_atempsmoo,
408     & objf_aqhsmoo,
409     & objf_precipsmoo,
410     & objf_swfluxsmoo,
411     & objf_swdownsmoo,
412 heimbach 1.23 & objf_snowprecipsmoo,
413     & objf_lwfluxsmoo,
414     & objf_lwdownsmoo,
415     & objf_evapsmoo,
416     & objf_apressuresmoo,
417     & objf_runoffsmoo,
418 heimbach 1.13 & objf_uwindsmoo,
419     & objf_vwindsmoo,
420 heimbach 1.1 & objf_obcsn,
421     & objf_obcss,
422     & objf_obcsw,
423     & objf_obcse,
424     & objf_obcsvol,
425     & objf_curmtr,
426     & objf_ageos,
427 heimbach 1.9 & objf_kapgm,
428 gforget 1.31 & objf_kapredi,
429 heimbach 1.1 & objf_diffkr,
430     & objf_theta_ini_fin,
431 heimbach 1.3 & objf_salt_ini_fin,
432 gforget 1.25 & objf_eddytau,
433 heimbach 1.27 & objf_bottomdrag,
434     & objf_transp
435 heimbach 1.1 _RL objf_hflux (nsx,nsy)
436     _RL objf_hfluxm (nsx,nsy)
437 heimbach 1.29 _RL objf_hfluxmm
438 heimbach 1.13 _RL objf_hfluxsmoo (nsx,nsy)
439 heimbach 1.1 _RL objf_sflux (nsx,nsy)
440     _RL objf_sfluxm (nsx,nsy)
441 heimbach 1.24 _RL objf_sfluxmm
442 heimbach 1.13 _RL objf_sfluxsmoo (nsx,nsy)
443 heimbach 1.1 _RL objf_tauu (nsx,nsy)
444     _RL objf_tauum (nsx,nsy)
445 heimbach 1.13 _RL objf_tauusmoo (nsx,nsy)
446 heimbach 1.1 _RL objf_tauv (nsx,nsy)
447     _RL objf_tauvm (nsx,nsy)
448 heimbach 1.13 _RL objf_tauvsmoo (nsx,nsy)
449 heimbach 1.2 _RL objf_hmean
450 heimbach 1.1 _RL objf_h (nsx,nsy)
451 heimbach 1.21 _RL objf_tp (nsx,nsy)
452     _RL objf_ers (nsx,nsy)
453     _RL objf_gfo (nsx,nsy)
454 heimbach 1.1 _RL objf_temp (nsx,nsy)
455     _RL objf_salt (nsx,nsy)
456     _RL objf_temp0(nsx,nsy)
457     _RL objf_salt0(nsx,nsy)
458 heimbach 1.14 _RL objf_temp0smoo(nsx,nsy)
459     _RL objf_salt0smoo(nsx,nsy)
460 heimbach 1.2 _RL objf_sst (nsx,nsy)
461 heimbach 1.1 _RL objf_tmi (nsx,nsy)
462 jmc 1.30 _RL objf_sss (nsx,nsy)
463     _RL objf_bp (nsx,nsy)
464 heimbach 1.1 _RL objf_ctdt (nsx,nsy)
465     _RL objf_ctds (nsx,nsy)
466     _RL objf_ctdtclim (nsx,nsy)
467     _RL objf_ctdsclim (nsx,nsy)
468     _RL objf_xbt (nsx,nsy)
469     _RL objf_argot(nsx,nsy)
470     _RL objf_argos(nsx,nsy)
471 gforget 1.26 _RL objf_gencost(NGENCOST,nsx,nsy)
472 heimbach 1.1 _RL objf_drift(nsx,nsy)
473     _RL objf_tdrift(nsx,nsy)
474     _RL objf_sdrift(nsx,nsy)
475     _RL objf_wdrift(nsx,nsy)
476     _RL objf_scatx(nsx,nsy)
477     _RL objf_scaty(nsx,nsy)
478     _RL objf_scatxm(nsx,nsy)
479     _RL objf_scatym(nsx,nsy)
480     _RL objf_atemp(nsx,nsy)
481     _RL objf_aqh (nsx,nsy)
482 heimbach 1.6 _RL objf_precip(nsx,nsy)
483 heimbach 1.7 _RL objf_swflux(nsx,nsy)
484 heimbach 1.9 _RL objf_swdown(nsx,nsy)
485 heimbach 1.23 _RL objf_snowprecip(nsx,nsy)
486     _RL objf_lwflux(nsx,nsy)
487     _RL objf_lwdown(nsx,nsy)
488     _RL objf_evap(nsx,nsy)
489     _RL objf_apressure(nsx,nsy)
490     _RL objf_runoff(nsx,nsy)
491 heimbach 1.1 _RL objf_uwind(nsx,nsy)
492     _RL objf_vwind(nsx,nsy)
493 heimbach 1.8 _RL objf_atempm(nsx,nsy)
494     _RL objf_aqhm (nsx,nsy)
495     _RL objf_precipm(nsx,nsy)
496     _RL objf_swfluxm(nsx,nsy)
497 heimbach 1.9 _RL objf_swdownm(nsx,nsy)
498 heimbach 1.23 _RL objf_snowprecipm(nsx,nsy)
499     _RL objf_lwfluxm(nsx,nsy)
500     _RL objf_lwdownm(nsx,nsy)
501     _RL objf_evapm(nsx,nsy)
502     _RL objf_apressurem(nsx,nsy)
503     _RL objf_runoffm(nsx,nsy)
504 heimbach 1.8 _RL objf_uwindm(nsx,nsy)
505     _RL objf_vwindm(nsx,nsy)
506 heimbach 1.13 _RL objf_atempsmoo(nsx,nsy)
507     _RL objf_aqhsmoo (nsx,nsy)
508     _RL objf_precipsmoo(nsx,nsy)
509     _RL objf_swfluxsmoo(nsx,nsy)
510     _RL objf_swdownsmoo(nsx,nsy)
511 heimbach 1.23 _RL objf_snowprecipsmoo(nsx,nsy)
512     _RL objf_lwfluxsmoo(nsx,nsy)
513     _RL objf_lwdownsmoo(nsx,nsy)
514     _RL objf_evapsmoo(nsx,nsy)
515     _RL objf_apressuresmoo(nsx,nsy)
516     _RL objf_runoffsmoo(nsx,nsy)
517 heimbach 1.13 _RL objf_uwindsmoo(nsx,nsy)
518     _RL objf_vwindsmoo(nsx,nsy)
519 heimbach 1.1 _RL objf_obcsn(nsx,nsy)
520     _RL objf_obcss(nsx,nsy)
521     _RL objf_obcsw(nsx,nsy)
522     _RL objf_obcse(nsx,nsy)
523 heimbach 1.2 _RL objf_obcsvol
524 heimbach 1.1 _RL objf_curmtr(nsx,nsy)
525     _RL objf_ageos(nsx,nsy)
526     _RL objf_kapgm(nsx,nsy)
527 gforget 1.31 _RL objf_kapredi(nsx,nsy)
528 heimbach 1.1 _RL objf_diffkr(nsx,nsy)
529     _RL objf_theta_ini_fin(nsx,nsy)
530     _RL objf_salt_ini_fin(nsx,nsy)
531 heimbach 1.3 _RL objf_eddytau(nsx,nsy)
532 gforget 1.25 _RL objf_bottomdrag(nsx,nsy)
533 heimbach 1.27 _RL objf_transp
534 heimbach 1.1
535 heimbach 1.4 common /ecco_cost_num/
536     & num_hflux,
537     & num_hfluxm,
538     & num_hfluxmm,
539     & num_sflux,
540     & num_sfluxm,
541     & num_sfluxmm,
542     & num_tauu,
543     & num_tauum,
544     & num_tauv,
545     & num_tauvm,
546     & num_hmean,
547     & num_h,
548 heimbach 1.21 & num_tp,
549     & num_ers,
550     & num_gfo,
551 heimbach 1.4 & num_temp,
552     & num_salt,
553     & num_temp0,
554     & num_salt0,
555     & num_sst,
556     & num_tmi,
557     & num_sss,
558 heimbach 1.28 & num_bp,
559 heimbach 1.4 & num_ctdt,
560     & num_ctds,
561     & num_ctdtclim,
562     & num_ctdsclim,
563     & num_xbt,
564     & num_argot,
565     & num_argos,
566 gforget 1.26 & num_gencost,
567 heimbach 1.4 & num_drift,
568     & num_tdrift,
569     & num_sdrift,
570     & num_wdrift,
571     & num_scatx,
572     & num_scaty,
573     & num_scatxm,
574     & num_scatym,
575     & num_atemp,
576     & num_aqh,
577 heimbach 1.6 & num_precip,
578 heimbach 1.7 & num_swflux,
579 heimbach 1.9 & num_swdown,
580 heimbach 1.23 & num_snowprecip,
581     & num_lwflux,
582     & num_lwdown,
583     & num_evap,
584     & num_apressure,
585     & num_runoff,
586 heimbach 1.4 & num_uwind,
587     & num_vwind,
588 heimbach 1.8 & num_atempm,
589     & num_aqhm,
590     & num_precipm,
591     & num_swfluxm,
592 heimbach 1.9 & num_swdownm,
593 heimbach 1.23 & num_snowprecipm,
594     & num_lwfluxm,
595     & num_lwdownm,
596     & num_evapm,
597     & num_apressurem,
598     & num_runoffm,
599 heimbach 1.8 & num_uwindm,
600     & num_vwindm,
601 heimbach 1.4 & num_obcsn,
602     & num_obcss,
603     & num_obcsw,
604     & num_obcse,
605     & num_obcsvol,
606     & num_curmtr,
607     & num_ageos,
608 heimbach 1.9 & num_kapgm,
609 gforget 1.31 & num_kapredi,
610 heimbach 1.4 & num_diffkr,
611     & num_theta_ini_fin,
612     & num_salt_ini_fin,
613 gforget 1.25 & num_eddytau,
614 heimbach 1.27 & num_bottomdrag,
615     & num_transp
616 heimbach 1.4
617     _RL num_hflux (nsx,nsy)
618     _RL num_hfluxm (nsx,nsy)
619     _RL num_hfluxmm(nsx,nsy)
620     _RL num_sflux (nsx,nsy)
621     _RL num_sfluxm (nsx,nsy)
622     _RL num_sfluxmm(nsx,nsy)
623     _RL num_tauu (nsx,nsy)
624     _RL num_tauum (nsx,nsy)
625     _RL num_tauv (nsx,nsy)
626     _RL num_tauvm (nsx,nsy)
627     _RL num_hmean
628     _RL num_h (nsx,nsy)
629 heimbach 1.21 _RL num_tp (nsx,nsy)
630     _RL num_ers (nsx,nsy)
631     _RL num_gfo (nsx,nsy)
632 heimbach 1.4 _RL num_temp (nsx,nsy)
633     _RL num_salt (nsx,nsy)
634     _RL num_temp0(nsx,nsy)
635     _RL num_salt0(nsx,nsy)
636     _RL num_sst (nsx,nsy)
637     _RL num_tmi (nsx,nsy)
638 jmc 1.30 _RL num_sss (nsx,nsy)
639     _RL num_bp (nsx,nsy)
640 heimbach 1.4 _RL num_ctdt (nsx,nsy)
641     _RL num_ctds (nsx,nsy)
642     _RL num_ctdtclim (nsx,nsy)
643     _RL num_ctdsclim (nsx,nsy)
644     _RL num_xbt (nsx,nsy)
645     _RL num_argot(nsx,nsy)
646     _RL num_argos(nsx,nsy)
647 gforget 1.26 _RL num_gencost(NGENCOST,nsx,nsy)
648 heimbach 1.4 _RL num_drift(nsx,nsy)
649     _RL num_tdrift(nsx,nsy)
650     _RL num_sdrift(nsx,nsy)
651     _RL num_wdrift(nsx,nsy)
652     _RL num_scatx(nsx,nsy)
653     _RL num_scaty(nsx,nsy)
654     _RL num_scatxm(nsx,nsy)
655     _RL num_scatym(nsx,nsy)
656     _RL num_atemp(nsx,nsy)
657     _RL num_aqh (nsx,nsy)
658 heimbach 1.6 _RL num_precip(nsx,nsy)
659 heimbach 1.7 _RL num_swflux(nsx,nsy)
660 heimbach 1.9 _RL num_swdown(nsx,nsy)
661 heimbach 1.23 _RL num_snowprecip(nsx,nsy)
662     _RL num_lwflux(nsx,nsy)
663     _RL num_lwdown(nsx,nsy)
664     _RL num_evap(nsx,nsy)
665     _RL num_apressure(nsx,nsy)
666     _RL num_runoff(nsx,nsy)
667 heimbach 1.4 _RL num_uwind(nsx,nsy)
668     _RL num_vwind(nsx,nsy)
669 heimbach 1.8 _RL num_atempm(nsx,nsy)
670     _RL num_aqhm (nsx,nsy)
671     _RL num_precipm(nsx,nsy)
672     _RL num_swfluxm(nsx,nsy)
673 heimbach 1.9 _RL num_swdownm(nsx,nsy)
674 heimbach 1.23 _RL num_snowprecipm(nsx,nsy)
675     _RL num_lwfluxm(nsx,nsy)
676     _RL num_lwdownm(nsx,nsy)
677     _RL num_evapm(nsx,nsy)
678     _RL num_apressurem(nsx,nsy)
679     _RL num_runoffm(nsx,nsy)
680 heimbach 1.8 _RL num_uwindm(nsx,nsy)
681     _RL num_vwindm(nsx,nsy)
682 heimbach 1.4 _RL num_obcsn(nsx,nsy)
683     _RL num_obcss(nsx,nsy)
684     _RL num_obcsw(nsx,nsy)
685     _RL num_obcse(nsx,nsy)
686     _RL num_obcsvol
687     _RL num_curmtr(nsx,nsy)
688     _RL num_ageos(nsx,nsy)
689     _RL num_kapgm(nsx,nsy)
690 gforget 1.31 _RL num_kapredi(nsx,nsy)
691 heimbach 1.4 _RL num_diffkr(nsx,nsy)
692     _RL num_theta_ini_fin(nsx,nsy)
693     _RL num_salt_ini_fin(nsx,nsy)
694     _RL num_eddytau(nsx,nsy)
695 gforget 1.25 _RL num_bottomdrag(nsx,nsy)
696 heimbach 1.27 _RL num_transp
697 heimbach 1.4
698 heimbach 1.1 common /ecco_cost_aux_r/
699     & mult_hflux,
700     & mult_sflux,
701 heimbach 1.16 & mult_hfluxmm,
702     & mult_sfluxmm,
703 heimbach 1.1 & mult_tauu,
704     & mult_tauv,
705     & mult_hmean,
706     & mult_h,
707 heimbach 1.21 & mult_tp,
708     & mult_ers,
709     & mult_gfo,
710 heimbach 1.1 & mult_temp,
711     & mult_salt,
712     & mult_temp0,
713     & mult_salt0,
714 heimbach 1.2 & mult_sst,
715 heimbach 1.1 & mult_tmi,
716     & mult_sss,
717 heimbach 1.28 & mult_bp,
718 heimbach 1.1 & mult_ctdt,
719     & mult_ctds,
720     & mult_ctdtclim,
721     & mult_ctdsclim,
722     & mult_xbt,
723     & mult_argot,
724     & mult_argos,
725 gforget 1.26 & mult_gencost,
726 heimbach 1.1 & mult_drift,
727     & mult_tdrift,
728     & mult_sdrift,
729     & mult_wdrift,
730     & mult_scatx,
731     & mult_scaty,
732     & mult_atemp,
733     & mult_aqh,
734 heimbach 1.6 & mult_precip,
735 heimbach 1.7 & mult_swflux,
736 heimbach 1.9 & mult_swdown,
737 heimbach 1.23 & mult_snowprecip,
738     & mult_lwflux,
739     & mult_lwdown,
740     & mult_evap,
741     & mult_apressure,
742     & mult_runoff,
743 heimbach 1.1 & mult_uwind,
744     & mult_vwind,
745     & mult_obcsn,
746     & mult_obcss,
747     & mult_obcsw,
748     & mult_obcse,
749     & mult_obcsvol,
750     & mult_curmtr,
751     & mult_ageos,
752     & mult_kapgm,
753 gforget 1.31 & mult_kapredi,
754 heimbach 1.1 & mult_diffkr,
755 heimbach 1.3 & mult_ini_fin,
756 gforget 1.25 & mult_edtau,
757     & mult_bottomdrag,
758 heimbach 1.14 & mult_smooth_ic,
759 heimbach 1.27 & mult_smooth_bc,
760     & mult_transp
761 heimbach 1.1 _RL mult_hflux
762     _RL mult_sflux
763 heimbach 1.16 _RL mult_hfluxmm
764     _RL mult_sfluxmm
765 heimbach 1.1 _RL mult_tauu
766     _RL mult_tauv
767     _RL mult_hmean
768     _RL mult_h
769 heimbach 1.21 _RL mult_tp
770     _RL mult_ers
771     _RL mult_gfo
772 heimbach 1.1 _RL mult_temp
773     _RL mult_salt
774     _RL mult_temp0
775     _RL mult_salt0
776 heimbach 1.2 _RL mult_sst
777 heimbach 1.1 _RL mult_tmi
778     _RL mult_sss
779 heimbach 1.28 _RL mult_bp
780 heimbach 1.1 _RL mult_ctdt
781     _RL mult_ctds
782     _RL mult_ctdtclim
783     _RL mult_ctdsclim
784     _RL mult_xbt
785     _RL mult_argot
786     _RL mult_argos
787 gforget 1.26 _RL mult_gencost(NGENCOST)
788 heimbach 1.1 _RL mult_drift
789     _RL mult_tdrift
790     _RL mult_sdrift
791     _RL mult_wdrift
792     _RL mult_scatx
793     _RL mult_scaty
794     _RL mult_atemp
795     _RL mult_aqh
796 heimbach 1.6 _RL mult_precip
797 heimbach 1.7 _RL mult_swflux
798 heimbach 1.9 _RL mult_swdown
799 heimbach 1.23 _RL mult_snowprecip
800     _RL mult_lwflux
801     _RL mult_lwdown
802     _RL mult_evap
803     _RL mult_apressure
804     _RL mult_runoff
805 heimbach 1.1 _RL mult_uwind
806     _RL mult_vwind
807     _RL mult_obcsn
808     _RL mult_obcss
809     _RL mult_obcsw
810     _RL mult_obcse
811     _RL mult_obcsvol
812     _RL mult_curmtr
813     _RL mult_ageos
814     _RL mult_kapgm
815 gforget 1.31 _RL mult_kapredi
816 heimbach 1.1 _RL mult_diffkr
817     _RL mult_ini_fin
818 gforget 1.25 _RL mult_edtau
819     _RL mult_bottomdrag
820 heimbach 1.14 _RL mult_smooth_ic
821     _RL mult_smooth_bc
822 heimbach 1.27 _RL mult_transp
823 heimbach 1.1
824     c Record counters relevant for the cost function evaluation.
825     c ==========================================================
826     c
827 heimbach 1.21 c nyearsrec - number of yearly records that will be generated by
828     c the current model integration.
829     c nmonsrec - number of monthly records that will be generated by
830     c the current model integration.
831     c ndaysrec - number of daily records that will be generated by
832     c the current model integration.
833 heimbach 1.1
834     common /ecco_cost_i/
835 heimbach 1.21 & nyearsrec,
836 heimbach 1.1 & nmonsrec,
837 heimbach 1.11 & ndaysrec,
838     & nnztbar,
839     & nnzsbar
840 heimbach 1.21 integer nyearsrec
841 heimbach 1.1 integer nmonsrec
842     integer ndaysrec
843 heimbach 1.11 integer nnztbar
844     integer nnzsbar
845 heimbach 1.1
846    
847     c Data files for the weights used in the cost function:
848     c =====================================================
849     c
850     c hflux_errfile - heat flux error.
851     c sflux_errfile - salt flux error.
852     c tauu_errfile - zonal wind stress error.
853     c tauum_errfile - zonal wind stress error.
854     c tauv_errfile - meridional wind stress error.
855     c tauvm_errfile - meridional wind stress error.
856     c tscatx_errfile - zonal wind stress error.
857     c tscaty_errfile - meridional wind stress error.
858     c data_errfile - weights for theta, salt, and SST
859     c geoid_errfile - geoid error.
860     c geoid_covariancefile - geoid error covariance.
861     c ssh_errfile - sea surface height error.
862     c ctdt_errfile - CTD temperature error.
863     c ctds_errfile - CTD salinity error.
864     c drift_errfile - drifter error.
865     c salterrfile - representation error due unresolved eddies
866     c temperrfile - representation error due unresolved eddies
867     c velerrfile - representation error
868    
869 jmc 1.30 common /ecco_cost_c/
870 heimbach 1.1 & hflux_errfile,
871     & hfluxm_errfile,
872     & sflux_errfile,
873     & sfluxm_errfile,
874     & tauu_errfile,
875     & tauum_errfile,
876     & tauv_errfile,
877     & tauvm_errfile,
878     & scatx_errfile,
879     & scaty_errfile,
880     & data_errfile,
881     & geoid_errfile,
882     & geoid_covariancefile,
883     & ssh_errfile,
884 heimbach 1.22 & tp_errfile,
885     & ers_errfile,
886     & gfo_errfile,
887 heimbach 1.1 & ctdt_errfile,
888 jmc 1.30 & ctds_errfile,
889 heimbach 1.1 & drift_errfile,
890 jmc 1.30 & udrifterrfile,
891     & vdrifterrfile,
892 heimbach 1.1 & salterrfile,
893     & temperrfile,
894     & velerrfile,
895 heimbach 1.12 & salt0errfile,
896     & temp0errfile,
897     & vel0errfile,
898 heimbach 1.1 & atemp_errfile,
899     & aqh_errfile,
900 heimbach 1.6 & precip_errfile,
901 heimbach 1.7 & swflux_errfile,
902 heimbach 1.9 & swdown_errfile,
903 heimbach 1.23 & snowprecip_errfile,
904     & lwflux_errfile,
905     & lwdown_errfile,
906     & evap_errfile,
907     & apressure_errfile,
908     & runoff_errfile,
909 gforget 1.25 & edtau_errfile,
910     & kapgm_errfile,
911 gforget 1.31 & kapredi_errfile,
912 gforget 1.25 & diffkr_errfile,
913     & bottomdrag_errfile,
914 gforget 1.26 & gencost_errfile,
915 heimbach 1.1 & uwind_errfile,
916     & vwind_errfile
917     character*(MAX_LEN_FNAM) hflux_errfile
918     character*(MAX_LEN_FNAM) sflux_errfile
919     character*(MAX_LEN_FNAM) tauu_errfile
920     character*(MAX_LEN_FNAM) tauv_errfile
921     character*(MAX_LEN_FNAM) hfluxm_errfile
922     character*(MAX_LEN_FNAM) sfluxm_errfile
923     character*(MAX_LEN_FNAM) tauum_errfile
924     character*(MAX_LEN_FNAM) tauvm_errfile
925     character*(MAX_LEN_FNAM) scatx_errfile
926     character*(MAX_LEN_FNAM) scaty_errfile
927     character*(MAX_LEN_FNAM) data_errfile
928     character*(MAX_LEN_FNAM) geoid_errfile
929     character*(MAX_LEN_FNAM) geoid_covariancefile
930     character*(MAX_LEN_FNAM) ssh_errfile
931 heimbach 1.22 character*(MAX_LEN_FNAM) tp_errfile
932     character*(MAX_LEN_FNAM) ers_errfile
933     character*(MAX_LEN_FNAM) gfo_errfile
934 jmc 1.30 character*(MAX_LEN_FNAM) ctdt_errfile
935     character*(MAX_LEN_FNAM) ctds_errfile
936 heimbach 1.1 character*(MAX_LEN_FNAM) drift_errfile
937     character*(MAX_LEN_FNAM) udrifterrfile
938 jmc 1.30 character*(MAX_LEN_FNAM) vdrifterrfile
939 heimbach 1.1 character*(MAX_LEN_FNAM) salterrfile
940     character*(MAX_LEN_FNAM) temperrfile
941     character*(MAX_LEN_FNAM) velerrfile
942 heimbach 1.12 character*(MAX_LEN_FNAM) salt0errfile
943     character*(MAX_LEN_FNAM) temp0errfile
944     character*(MAX_LEN_FNAM) vel0errfile
945 heimbach 1.1 character*(MAX_LEN_FNAM) atemp_errfile
946     character*(MAX_LEN_FNAM) aqh_errfile
947 heimbach 1.6 character*(MAX_LEN_FNAM) precip_errfile
948 heimbach 1.7 character*(MAX_LEN_FNAM) swflux_errfile
949 heimbach 1.9 character*(MAX_LEN_FNAM) swdown_errfile
950 heimbach 1.23 character*(MAX_LEN_FNAM) snowprecip_errfile
951     character*(MAX_LEN_FNAM) lwflux_errfile
952     character*(MAX_LEN_FNAM) lwdown_errfile
953     character*(MAX_LEN_FNAM) evap_errfile
954     character*(MAX_LEN_FNAM) apressure_errfile
955     character*(MAX_LEN_FNAM) runoff_errfile
956 gforget 1.25 character*(MAX_LEN_FNAM) edtau_errfile
957     character*(MAX_LEN_FNAM) kapgm_errfile
958 gforget 1.31 character*(MAX_LEN_FNAM) kapredi_errfile
959 gforget 1.25 character*(MAX_LEN_FNAM) diffkr_errfile
960     character*(MAX_LEN_FNAM) bottomdrag_errfile
961 gforget 1.26 character*(MAX_LEN_FNAM) gencost_errfile(NGENCOST)
962 heimbach 1.1 character*(MAX_LEN_FNAM) uwind_errfile
963     character*(MAX_LEN_FNAM) vwind_errfile
964    
965    
966     c Arrays where the weights are stored:
967     c ====================================
968     c
969     c cosphi - cosine of latitude.
970     c whflux - weight for heat flux.
971     c wsflux - weight for salt flux.
972     c wtauu - weight for zonal wind stress.
973     c wtauu - weight for meridional wind stress.
974     c wscatx - weight for zonal scat stress.
975     c wscaty - weight for meridional scat stress.
976     c wtheta - weight for temperature.
977     c wtheta2 - representation error due to unresolved eddies
978     c wsst - weight for sea surface temperature.
979     c wsss - weight for sea surface salinity.
980     c wsalt - weight for salinity.
981     c wsalt2 - representation error due to unresolved eddies
982     c wtp - weight for TOPEX/POSEIDON data.
983     c wers - weight for ERS data.
984     c wp - weight for geoid.
985     c wctdt - weight for CTD temperature.
986     c wctds - weight for CTD salinity.
987     c wudrift - weight for mean zonal velocity from drifters.
988     c wvdrift - weight for mean meridional velocity from drifters.
989    
990 jmc 1.30 common /ecco_cost_weights_r/
991 heimbach 1.1 & frame,
992     & cosphi,
993     & whflux,wsflux,wtauu,wtauv,
994 heimbach 1.23 & watemp,waqh,wprecip,wsnowprecip,
995     & wswflux,wswdown,wlwflux,wlwdown,
996     & wevap,wapressure,wrunoff,
997 gforget 1.25 & wbottomdrag,
998 heimbach 1.9 & wuwind,wvwind,
999 heimbach 1.1 & wscatx,wscaty,
1000     & wtheta,wtheta2,wthetaLev,
1001     & wsalt,wsalt2,wsaltLev,
1002 heimbach 1.20 & wdiffkr,wdiffkr2,wdiffkrFld,
1003     & wkapgm,wkapgm2,wkapgmFld,
1004 gforget 1.31 & wkapredi,wkapredi2,wkaprediFld,
1005 heimbach 1.20 & wedtaux,wedtaux2,wedtauxFld,
1006     & wedtauy,wedtauy2,wedtauyFld,
1007 heimbach 1.28 & wsst,wsss,wbp,
1008 heimbach 1.15 & wtp,wers,wgfo,
1009 heimbach 1.1 & wp,
1010     & wctdt,wctds,
1011     & wudrift,wvdrift,
1012     & whfluxmm,wsfluxmm,
1013     & wcurrent,wcurrent2,
1014     & wcurrentLev,wbaro
1015    
1016     _RL frame (1-olx:snx+olx,1-oly:sny+oly )
1017     _RL cosphi (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1018     _RL whflux (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1019     _RL whfluxm (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1020     _RL whfluxmm(1-olx:snx+olx,1-oly:sny+oly)
1021     _RL wsflux (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1022     _RL wsfluxm (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1023     _RL wsfluxmm(1-olx:snx+olx,1-oly:sny+oly)
1024     _RL wtauu (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1025     _RL wtauv (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1026     _RL wtauum (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1027     _RL wtauvm (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1028     _RL wscatx (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1029     _RL wscaty (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1030     _RL watemp (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1031     _RL waqh (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1032 heimbach 1.6 _RL wprecip (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1033 heimbach 1.7 _RL wswflux (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1034 heimbach 1.9 _RL wswdown (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1035 heimbach 1.23 _RL wsnowprecip (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1036     _RL wlwflux (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1037     _RL wlwdown (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1038     _RL wevap (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1039     _RL wapressure(1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1040     _RL wrunoff (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1041 gforget 1.25 _RL wbottomdrag (1-olx:snx+olx,1-oly:sny+oly,nsx,nsy)
1042 heimbach 1.1 _RL wuwind (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1043     _RL wvwind (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1044     _RL wtheta ( nr,nsx,nsy)
1045     _RL wsalt ( nr,nsx,nsy)
1046     _RL wtheta2 (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1047     _RL wsalt2 (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1048     _RL wthetaLev (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1049     _RL wsaltLev (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1050     _RL wsst (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1051     _RL wsss (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1052 heimbach 1.28 _RL wbp (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1053 heimbach 1.1 _RL wtp (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1054     _RL wers (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1055 heimbach 1.15 _RL wgfo (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1056 heimbach 1.1 _RL wp (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1057     _RL wctdt ( nr,nsx,nsy)
1058     _RL wctds ( nr,nsx,nsy)
1059     _RL wudrift (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1060     _RL wvdrift (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1061     _RL wcurrent( nr,nsx,nsy)
1062     _RL wcurrent2 (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1063     _RL wcurrentLev (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1064     _RL wbaro
1065 heimbach 1.20 _RL wdiffkr ( nr,nsx,nsy)
1066     _RL wdiffkr2 (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1067     _RL wdiffkrFld (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1068     _RL wkapgm ( nr,nsx,nsy)
1069     _RL wkapgm2 (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1070     _RL wkapgmFld (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1071 gforget 1.31 _RL wkapredi ( nr,nsx,nsy)
1072     _RL wkapredi2 (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1073     _RL wkaprediFld (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1074 heimbach 1.20 _RL wedtaux ( nr,nsx,nsy)
1075     _RL wedtaux2 (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1076     _RL wedtauxFld (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1077     _RL wedtauy ( nr,nsx,nsy)
1078     _RL wedtauy2 (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1079     _RL wedtauyFld (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1080 heimbach 1.1
1081 heimbach 1.6 common /ecco_cost_weights_0_r/
1082 heimbach 1.7 & whflux0, wsflux0, wtau0,
1083 heimbach 1.23 & watemp0, waqh0, wprecip0, wsnowprecip0, wwind0,
1084 jmc 1.30 & wswflux0, wswdown0, wlwflux0, wlwdown0,
1085 gforget 1.31 & wevap0, wapressure0, wrunoff0, wkapredi0,
1086 gforget 1.25 & wbottomdrag0,wdiffkr0, wkapgm0, wedtau0
1087 heimbach 1.6 _RL whflux0
1088     _RL wsflux0
1089     _RL wtau0
1090     _RL watemp0
1091     _RL waqh0
1092     _RL wprecip0
1093 heimbach 1.7 _RL wswflux0
1094 heimbach 1.9 _RL wswdown0
1095 heimbach 1.23 _RL wsnowprecip0
1096     _RL wlwflux0
1097     _RL wlwdown0
1098     _RL wevap0
1099     _RL wapressure0
1100     _RL wrunoff0
1101 gforget 1.25 _RL wbottomdrag0
1102 heimbach 1.6 _RL wwind0
1103 heimbach 1.20 _RL wdiffkr0
1104     _RL wkapgm0
1105 gforget 1.31 _RL wkapredi0
1106 heimbach 1.20 _RL wedtau0
1107 heimbach 1.8
1108     common /ecco_cost_weights_mean_r/
1109     & wmean_hflux, wmean_sflux, wmean_tau,
1110 jmc 1.30 & wmean_atemp, wmean_aqh,
1111 heimbach 1.23 & wmean_precip, wmean_snowprecip, wmean_wind,
1112     & wmean_swflux, wmean_swdown, wmean_lwflux, wmean_lwdown,
1113     & wmean_evap, wmean_apressure, wmean_runoff
1114 heimbach 1.8 _RL wmean_hflux
1115     _RL wmean_sflux
1116     _RL wmean_tau
1117     _RL wmean_atemp
1118     _RL wmean_aqh
1119     _RL wmean_precip
1120     _RL wmean_swflux
1121 heimbach 1.9 _RL wmean_swdown
1122 heimbach 1.23 _RL wmean_snowprecip
1123     _RL wmean_lwflux
1124     _RL wmean_lwdown
1125     _RL wmean_evap
1126     _RL wmean_apressure
1127     _RL wmean_runoff
1128 heimbach 1.8 _RL wmean_wind
1129 jmc 1.30
1130 heimbach 1.5 common /ecco_cost_weights_2_r/
1131     & whflux2,wsflux2,wtauu2,wtauv2
1132     _RL whflux2 (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1133     _RL wsflux2 (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1134     _RL wtauu2 (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1135     _RL wtauv2 (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1136 jmc 1.30
1137    
1138 heimbach 1.5
1139 heimbach 1.1 #if (defined (ALLOW_OBCSN_COST_CONTRIBUTION) || \
1140     defined (ALLOW_OBCSN_CONTROL))
1141     common /ecco_cost_weights_obcsn/
1142     & wobcsn, wobcsnLev
1143     _RL wobcsn ( nr,nobcs)
1144     _RL wobcsnLev (1-olx:snx+olx,nr,nsx,nsy,nobcs)
1145     #endif
1146     #if (defined (ALLOW_OBCSS_COST_CONTRIBUTION) || \
1147     defined (ALLOW_OBCSS_CONTROL))
1148     common /ecco_cost_weights_obcss/
1149     & wobcss, wobcssLev
1150     _RL wobcss ( nr,nobcs)
1151     _RL wobcssLev (1-olx:snx+olx,nr,nsx,nsy,nobcs)
1152     #endif
1153     #if (defined (ALLOW_OBCSW_COST_CONTRIBUTION) || \
1154     defined (ALLOW_OBCSW_CONTROL))
1155     common /ecco_cost_weights_obcsw/
1156     & wobcsw, wobcswLev
1157     _RL wobcsw ( nr,nobcs)
1158     _RL wobcswLev (1-oly:sny+oly,nr,nsx,nsy,nobcs)
1159     #endif
1160     #if (defined (ALLOW_OBCSE_COST_CONTRIBUTION) || \
1161     defined (ALLOW_OBCSE_CONTROL))
1162     common /ecco_cost_weights_obcse/
1163     & wobcse, wobcseLev
1164     _RL wobcse ( nr,nobcs)
1165     _RL wobcseLev (1-oly:sny+oly,nr,nsx,nsy,nobcs)
1166     #endif
1167    
1168 heimbach 1.2
1169 heimbach 1.1 c Arrays that contain observations for the model-data comparison:
1170     c ===============================================================
1171     c
1172     c tdat - reference temperature data.
1173     c scatxdat - reference zonal wind stress.
1174     c scatydat - reference meridional wind stress.
1175 heimbach 1.2 c sstdat - reference sea surface temperature data.
1176 heimbach 1.1 c tmidat - reference TMI sea surface temperature data.
1177     c sssdat - reference sea surface temperature data.
1178 heimbach 1.28 c bpdat - bottom pressure from time-varying GRACE.
1179 heimbach 1.1 c tauxmask - mask for reference wind stress data.
1180 jmc 1.30 c tauymask - mask for reference wind stress data.
1181 heimbach 1.1 c scatxmask - mask for scat wind stress data.
1182 jmc 1.30 c scatymask - mask for scat wind stress data.
1183 heimbach 1.2 c sstmask - mask for reference sea surface temperature data.
1184 heimbach 1.1 c tmimask - mask for reference sea surface temperature data.
1185     c sssmask - mask for reference sea surface temperature data.
1186     c sdat - reference salinity data.
1187     c tpmean - reference mean sea surface height data.
1188     c tpmeanmask - mask for reference mean sea surface height data.
1189     c tpobs - TOPEX/POSEIDON data.
1190     c tpmask - mask for TOPEX/POSEIDON data.
1191     c ersobs - ERS data.
1192     c ersmask - mask for ERS data.
1193     c ctdtobs - CTD temperature data
1194     c ctdsobs - CTD salinity data
1195 jmc 1.30 c xbtobs - XBT data
1196     c argot - ARGO temperature data
1197     c argos - ARGO salt data
1198 heimbach 1.1 c udriftdat - drifters zonal velocities
1199     c vdriftdat - drifters meridional velocities
1200    
1201     common /ecco_cost_data_r/
1202     & tdat,
1203     & scatxdat,
1204     & scatydat,
1205 heimbach 1.2 & sstdat,
1206 heimbach 1.1 & tmidat,
1207     & sssdat,
1208 heimbach 1.28 & bpdat,
1209 heimbach 1.2 & sstmask,
1210 heimbach 1.1 & tmimask,
1211     & sssmask,
1212 heimbach 1.28 & bpmask,
1213 heimbach 1.1 & tauxmask,
1214     & tauymask,
1215     & scatxmask,
1216     & scatymask,
1217     & sdat,
1218     & tpmean,
1219     & tpmeanmask,
1220     & tpobs,
1221     & tpmask,
1222     & ersobs,
1223     & ersmask,
1224 heimbach 1.15 & gfoobs,
1225     & gfomask,
1226 heimbach 1.1 & ctdtobs,
1227     & ctdsobs,
1228     & xbtobs,
1229     & argotobs,
1230     & argosobs,
1231     & udriftdat,
1232     & vdriftdat,
1233     & curmtruobs,
1234     & curmtrvobs
1235 jmc 1.30
1236 heimbach 1.1 _RL tdat (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1237     _RL scatxdat (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1238     _RL scatydat (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1239 heimbach 1.2 _RL sstdat (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1240 heimbach 1.1 _RL tmidat (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1241     _RL sssdat (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1242 heimbach 1.28 _RL bpdat (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1243 heimbach 1.1 _RL tauxmask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1244     _RL tauymask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1245     _RL scatxmask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1246     _RL scatymask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1247 heimbach 1.2 _RL sstmask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1248 heimbach 1.1 _RL tmimask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1249     _RL sssmask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1250 heimbach 1.28 _RL bpmask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1251 heimbach 1.1 _RL sdat (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1252     _RL tpmean (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1253     _RL tpmeanmask(1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1254     _RL tpobs (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1255     _RL tpmask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1256     _RL ersobs (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1257     _RL ersmask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1258 heimbach 1.15 _RL gfoobs (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1259     _RL gfomask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1260 heimbach 1.1 _RL ctdtobs (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1261     _RL ctdsobs (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1262     _RL xbtobs (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1263     _RL argotobs (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1264     _RL argosobs (1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1265     _RL udriftdat (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1266     _RL vdriftdat (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
1267     _RL curmtruobs(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1268     _RL curmtrvobs(1-olx:snx+olx,1-oly:sny+oly,nr,nsx,nsy)
1269    
1270 heimbach 1.2
1271 heimbach 1.1 c Files that contain obervations:
1272     c ===============================
1273     c
1274     c tdatfile - reference data file for temperature.
1275     c sdatfile - reference data file for salinity.
1276     c scatxdatfile - reference data file for zonal wind stress.
1277     c scatydatfile - reference data file for meridional wind stress.
1278     c sstdatfile - reference data file for sea surface temperature.
1279 heimbach 1.2 c tmidatfile - reference data file for TMI sea surface temperature.
1280 heimbach 1.1 c topexmeanfile - reference data file for mean sea surface height.
1281     c topexfile - reference data file for sea surface height data
1282     c (TOPEX/POSEIDON).
1283     c ersfile - reference data file for sea surface height data
1284     c (ERS).
1285 jmc 1.30 c ctdtfile, ctdsfile- reference data file for temperature and salinity
1286 heimbach 1.1 c from CTD
1287     c ctdtclimfile, ctdsclimfile- reference data file for temperature
1288 heimbach 1.2 c and salinity from CTD with out timetag
1289 heimbach 1.1 c xbtfile - reference data file for xbt
1290     c ARGOtfile - reference data file for ARGO
1291     c ARGOsfile - reference data file for ARGO
1292     c driftfile - reference data file for drifter's mean velocities
1293    
1294     common /ecco_cost_data_c/
1295     & tdatfile,
1296     & sdatfile,
1297     & scatxdatfile,
1298     & scatydatfile,
1299 heimbach 1.2 & sstdatfile,
1300 heimbach 1.1 & tmidatfile,
1301     & sssdatfile,
1302 heimbach 1.28 & bpdatfile,
1303 heimbach 1.1 & topexmeanfile,
1304     & topexfile,
1305     & ersfile,
1306 heimbach 1.15 & gfofile,
1307 heimbach 1.1 & ctdtfile,
1308     & ctdsfile,
1309     & ctdtclimfile,
1310     & ctdsclimfile,
1311     & xbtfile,
1312     & argotfile,
1313     & argosfile,
1314 jmc 1.30 & udriftfile,
1315 heimbach 1.1 & vdriftfile,
1316 gforget 1.26 & gencost_datafile,
1317 heimbach 1.1 & curmtrufile,
1318 heimbach 1.19 & curmtrvfile
1319 heimbach 1.1
1320     character*(MAX_LEN_FNAM) tdatfile
1321     character*(MAX_LEN_FNAM) sdatfile
1322     character*(MAX_LEN_FNAM) scatxdatfile
1323     character*(MAX_LEN_FNAM) scatydatfile
1324 heimbach 1.2 character*(MAX_LEN_FNAM) sstdatfile
1325 heimbach 1.1 character*(MAX_LEN_FNAM) tmidatfile
1326     character*(MAX_LEN_FNAM) sssdatfile
1327 heimbach 1.28 character*(MAX_LEN_FNAM) bpdatfile
1328 heimbach 1.1 character*(MAX_LEN_FNAM) topexmeanfile
1329     character*(MAX_LEN_FNAM) topexfile
1330     character*(MAX_LEN_FNAM) ersfile
1331 heimbach 1.15 character*(MAX_LEN_FNAM) gfofile
1332 heimbach 1.1 character*(MAX_LEN_FNAM) ctdtfile
1333     character*(MAX_LEN_FNAM) ctdsfile
1334     character*(MAX_LEN_FNAM) ctdtclimfile
1335     character*(MAX_LEN_FNAM) ctdsclimfile
1336     character*(MAX_LEN_FNAM) xbtfile
1337     character*(MAX_LEN_FNAM) argotfile
1338     character*(MAX_LEN_FNAM) argosfile
1339     character*(MAX_LEN_FNAM) argofile
1340 gforget 1.26 character*(MAX_LEN_FNAM) gencost_datafile(NGENCOST)
1341 heimbach 1.1 character*(MAX_LEN_FNAM) udriftfile
1342 jmc 1.30 character*(MAX_LEN_FNAM) vdriftfile
1343 heimbach 1.1 character*(MAX_LEN_FNAM) curmtrufile
1344     character*(MAX_LEN_FNAM) curmtrvfile
1345    
1346 heimbach 1.2
1347 heimbach 1.1 c Flags used in the model-data comparison:
1348     c ========================================
1349     c
1350     c using_ers - flag that indicates the use of ERS data
1351    
1352     common /ecco_cost_data_flags/
1353     & using_topex,
1354 heimbach 1.15 & using_ers,
1355     & using_gfo
1356 heimbach 1.1 logical using_topex
1357     logical using_ers
1358 heimbach 1.15 logical using_gfo
1359 heimbach 1.1
1360     c Calendar information for the observations:
1361     c ==========================================
1362     c
1363 heimbach 1.2 c sststartdate - start date of the sea surface temperature data.
1364 heimbach 1.1 c tmistartdate - start date of the sea surface temperature data.
1365     c topexstartdate - start date of the sea surface height data.
1366     c ersstartdate - start date of the sea surface height data.
1367 heimbach 1.2 c sshperiod - sampling interval for the sea surface height data.
1368 heimbach 1.1
1369     common /ecco_cost_data_times_i/
1370     & scatxstartdate,
1371     & scatystartdate,
1372     & sststartdate,
1373     & argotstartdate,
1374     & argosstartdate,
1375 heimbach 1.2 & tmistartdate,
1376     & sssstartdate,
1377 heimbach 1.28 & bpstartdate,
1378 heimbach 1.1 & topexstartdate,
1379 heimbach 1.15 & ersstartdate,
1380     & gfostartdate
1381 heimbach 1.1 integer scatxstartdate(4)
1382     integer scatystartdate(4)
1383     integer sststartdate(4)
1384     integer argotstartdate(4)
1385     integer argosstartdate(4)
1386 heimbach 1.2 integer tmistartdate(4)
1387     integer sssstartdate(4)
1388 heimbach 1.28 integer bpstartdate(4)
1389 heimbach 1.1 integer topexstartdate(4)
1390     integer ersstartdate(4)
1391 heimbach 1.15 integer gfostartdate(4)
1392 heimbach 1.1
1393     common /ecco_cost_data_aux_i/
1394     & tmistartdate1,
1395     & tmistartdate2,
1396     & sststartdate1,
1397     & sststartdate2,
1398     & sssstartdate1,
1399     & sssstartdate2,
1400 heimbach 1.28 & bpstartdate1,
1401     & bpstartdate2,
1402 heimbach 1.1 & argotstartdate1,
1403     & argotstartdate2,
1404     & argosstartdate1,
1405     & argosstartdate2,
1406     & topexstartdate1,
1407     & topexstartdate2,
1408     & ersstartdate1,
1409     & ersstartdate2,
1410 heimbach 1.15 & gfostartdate1,
1411     & gfostartdate2,
1412 heimbach 1.1 & scatstartdate1,
1413 heimbach 1.10 & scatstartdate2
1414 heimbach 1.1
1415     integer tmistartdate1
1416     integer tmistartdate2
1417     integer sststartdate1
1418     integer sststartdate2
1419     integer sssstartdate1
1420     integer sssstartdate2
1421 heimbach 1.28 integer bpstartdate1
1422     integer bpstartdate2
1423 heimbach 1.1 integer argotstartdate1
1424     integer argotstartdate2
1425     integer argosstartdate1
1426     integer argosstartdate2
1427     integer topexstartdate1
1428     integer topexstartdate2
1429     integer ersstartdate1
1430     integer ersstartdate2
1431 heimbach 1.15 integer gfostartdate1
1432     integer gfostartdate2
1433 heimbach 1.1 integer scatstartdate1
1434     integer scatstartdate2
1435    
1436     common /ecco_cost_data_times_r/
1437     & topexperiod,
1438     & ersperiod,
1439 heimbach 1.15 & gfoperiod,
1440 heimbach 1.10 & scatperiod
1441 heimbach 1.1 _RL topexperiod
1442     _RL ersperiod
1443 heimbach 1.15 _RL gfoperiod
1444 heimbach 1.1 _RL scatperiod
1445    
1446 heimbach 1.17 common /ecco_cost_data_detrend/
1447     & topexintercept,
1448     & ersintercept,
1449     & gfointercept,
1450     & topexslope,
1451     & ersslope,
1452     & gfoslope
1453     _RL topexintercept
1454     _RL ersintercept
1455     _RL gfointercept
1456     _RL topexslope
1457     _RL ersslope
1458     _RL gfoslope
1459    
1460 heimbach 1.35 #ifdef ALLOW_SSH_COST_CONTRIBUTION
1461     common /ecco_ssh_daymask_r/
1462     & tpTimeMask, ersTimeMask, gfoTimeMask
1463     _RL tpTimeMask(maxNumDays)
1464     _RL ersTimeMask(maxNumDays)
1465     _RL gfoTimeMask(maxNumDays)
1466     #endif
1467    
1468     common /ecco_ssh_daymask_c/
1469     & tpTimeMaskFile, ersTimeMaskFile, gfoTimeMaskFile
1470     character*(MAX_LEN_FNAM) tpTimeMaskFile
1471     character*(MAX_LEN_FNAM) ersTimeMaskFile
1472     character*(MAX_LEN_FNAM) gfoTimeMaskFile
1473    
1474 heimbach 1.1 c ==================================================================
1475     c END OF HEADER COST
1476     c ==================================================================
1477 heimbach 1.2
1478    

  ViewVC Help
Powered by ViewVC 1.1.22