/[MITgcm]/MITgcm/pkg/cost/cost_final.F
ViewVC logotype

Contents of /MITgcm/pkg/cost/cost_final.F

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


Revision 1.21 - (show annotations) (download)
Mon Apr 19 15:21:49 2010 UTC (14 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62f
Changes since 1.20: +10 -2 lines
switch off diagnostics and MNC output flags (like in ctrl_init_ctrlvar.F)

1 C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_final.F,v 1.20 2009/10/15 05:21:50 heimbach Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "COST_CPPOPTIONS.h"
6
7 subroutine cost_final( mythid )
8
9 c ==================================================================
10 c SUBROUTINE cost_final
11 c ==================================================================
12 c
13 c o Sum of all cost function contributions.
14 c
15 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
16 c changed: Christian Eckert eckert@mit.edu 25-Feb-2000
17 c heimbach@mit.edu 05-Nov-2003 Modularize cost package
18 c
19 c ==================================================================
20 c SUBROUTINE cost_final
21 c ==================================================================
22
23 implicit none
24
25 c == global variables ==
26
27 #include "EEPARAMS.h"
28 #include "SIZE.h"
29 #include "PARAMS.h"
30
31 #include "cost.h"
32 #ifdef ALLOW_CTRL
33 # include "ctrl.h"
34 #endif
35 #ifdef ALLOW_DIC
36 cph-- quickly for testing
37 # include "DIC_COST.h"
38 #endif
39 #ifdef ALLOW_MNC
40 # include "MNC_PARAMS.h"
41 #endif
42
43 c == routine arguments ==
44
45 integer mythid
46
47 #ifdef ALLOW_COST
48 c == local variables ==
49
50 integer i,j,k
51 integer bi,bj
52 integer itlo,ithi
53 integer jtlo,jthi
54
55 c == end of interface ==
56
57 jtlo = mybylo(mythid)
58 jthi = mybyhi(mythid)
59 itlo = mybxlo(mythid)
60 ithi = mybxhi(mythid)
61
62 #ifdef ALLOW_SEAICE
63 CALL SEAICE_COST_FINAL (myThid)
64 #endif
65
66 #if (defined (ALLOW_ECCO))
67 CALL ECCO_COST_FINAL (myThid)
68
69 #elif (defined (ALLOW_COST_VECTOR))
70 CALL COST_VECTOR (myThid)
71
72 #elif (defined (ALLOW_COST_STATE_FINAL))
73 CALL COST_STATE_FINAL (myThid)
74
75 #endif /* above stuff undef */
76
77 #ifndef ALLOW_ECCO
78
79 # ifdef ALLOW_COST_TEST
80 CALL COST_TEST (myThid)
81 # endif
82 # ifdef ALLOW_COST_ATLANTIC_HEAT
83 CALL COST_ATLANTIC_HEAT (myThid)
84 # endif
85 #ifdef ALLOW_COST_HFLUXM
86 CALL COST_HFLUX (myThid)
87 #endif
88 #ifdef ALLOW_COST_TEMP
89 CALL COST_TEMP (myThid)
90 #endif
91
92 c-- Sum up all contributions.
93 do bj = jtlo,jthi
94 do bi = itlo,ithi
95
96 write(standardmessageunit,'(A,D22.15)')
97 & ' --> objf_test(bi,bj) = ', objf_test(bi,bj)
98 write(standardmessageunit,'(A,D22.15)')
99 & ' --> objf_tracer(bi,bj) = ', objf_tracer(bi,bj)
100 write(standardmessageunit,'(A,D22.15)')
101 & ' --> objf_atl(bi,bj) = ', objf_atl(bi,bj)
102 #ifdef ALLOW_COST_TEMP
103 write(standardmessageunit,'(A,D22.15)')
104 & ' --> objf_temp_tut(bi,bj) = ', objf_temp_tut(bi,bj)
105 #endif
106 #ifdef ALLOW_COST_HFLUXM
107 write(standardmessageunit,'(A,D22.15)')
108 & ' --> objf_hflux_tut(bi,bj) = ', objf_hflux_tut(bi,bj)
109 #endif
110 #ifdef ALLOW_COST_TRANSPORT
111 write(standardmessageunit,'(A,D22.15)')
112 & ' --> objf_transport(bi,bj) = ', objf_transport(bi,bj)
113 #endif
114
115 fc = fc
116 & + mult_test * objf_test(bi,bj)
117 & + mult_tracer * objf_tracer(bi,bj)
118 & + mult_atl * objf_atl(bi,bj)
119 #ifdef ALLOW_COST_TRANSPORT
120 & + mult_transport * objf_transport(bi,bj)
121 #endif
122 #ifdef ALLOW_COST_TEMP
123 & + mult_temp_tut * objf_temp_tut(bi,bj)
124 #endif
125 #ifdef ALLOW_COST_HFLUXM
126 & + mult_hflux_tut * objf_hflux_tut(bi,bj)
127 #endif
128 enddo
129 enddo
130
131 write(standardmessageunit,'(A,D22.15)') ' local fc = ', fc
132
133 c-- Do global summation.
134 _GLOBAL_SUM_RL( fc , myThid )
135
136 #ifdef ALLOW_DIC
137 cph-- quickly for testing
138 fc = totcost
139 #endif
140
141 write(standardmessageunit,'(A,D22.15)') ' global fc = ', fc
142
143 #endif /* ALLOW_ECCO */
144
145 c-- set averaging freq. to zero to avoid re-write of
146 c-- averaged fields in reverse checkpointing loops
147 taveFreq = 0.
148 dumpFreq = 0.
149 pChkptFreq = 0.
150 monitorFreq = 0.
151 useDiagnostics = .FALSE.
152 #ifdef ALLOW_MNC
153 monitor_mnc=.FALSE.
154 snapshot_mnc=.FALSE.
155 timeave_mnc=.FALSE.
156 #endif
157
158 #endif /* ALLOW_COST */
159
160 return
161 end

  ViewVC Help
Powered by ViewVC 1.1.22