/[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.16 - (show annotations) (download)
Mon Oct 8 23:59:21 2007 UTC (16 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint59m, checkpoint59l, checkpoint59i, checkpoint59k, checkpoint59j
Changes since 1.15: +6 -5 lines
add missing cvs $Header:$ or $Name:$

1 C $Header: $
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
36 c == routine arguments ==
37
38 integer mythid
39
40 #ifdef ALLOW_COST
41 c == local variables ==
42
43 integer i,j,k
44 integer bi,bj
45 integer itlo,ithi
46 integer jtlo,jthi
47
48 c == end of interface ==
49
50 jtlo = mybylo(mythid)
51 jthi = mybyhi(mythid)
52 itlo = mybxlo(mythid)
53 ithi = mybxhi(mythid)
54
55 #ifdef ALLOW_SEAICE
56 CALL SEAICE_COST_FINAL (myThid)
57 #endif
58
59 #if (defined (ALLOW_ECCO))
60 CALL ECCO_COST_FINAL (myThid)
61
62 #elif (defined (ALLOW_COST_VECTOR))
63 CALL COST_VECTOR (myThid)
64
65 #elif (defined (ALLOW_COST_STATE_FINAL))
66 CALL COST_STATE_FINAL (myThid)
67
68 #endif /* above stuff undef */
69
70 #ifndef ALLOW_ECCO
71
72 # ifdef ALLOW_COST_TEST
73 CALL COST_TEST (myThid)
74 # endif
75 # ifdef ALLOW_COST_ATLANTIC_HEAT
76 CALL COST_ATLANTIC_HEAT (myThid)
77 # endif
78
79 c-- Sum up all contributions.
80 do bj = jtlo,jthi
81 do bi = itlo,ithi
82
83 write(standardmessageunit,'(A,D22.15)')
84 & ' --> objf_test(bi,bj) = ', objf_test(bi,bj)
85 write(standardmessageunit,'(A,D22.15)')
86 & ' --> objf_tracer(bi,bj) = ', objf_tracer(bi,bj)
87 write(standardmessageunit,'(A,D22.15)')
88 & ' --> objf_atl(bi,bj) = ', objf_atl(bi,bj)
89 #ifdef ALLOW_COST_TRANSPORT
90 write(standardmessageunit,'(A,D22.15)')
91 & ' --> objf_transport(bi,bj) = ', objf_transport(bi,bj)
92 #endif
93
94 fc = fc
95 & + mult_test * objf_test(bi,bj)
96 & + mult_tracer * objf_tracer(bi,bj)
97 & + mult_atl * objf_atl(bi,bj)
98 #ifdef ALLOW_COST_TRANSPORT
99 & + mult_transport * objf_transport(bi,bj)
100 #endif
101 enddo
102 enddo
103
104 write(standardmessageunit,'(A,D22.15)') ' local fc = ', fc
105
106 c-- Do global summation.
107 _GLOBAL_SUM_R8( fc , myThid )
108
109 write(standardmessageunit,'(A,D22.15)') ' global fc = ', fc
110
111 #endif /* ALLOW_ECCO */
112
113 c-- set averaging freq. to zero to avoid re-write of
114 c-- averaged fields in reverse checkpointing loops
115 taveFreq = 0.
116 dumpFreq = 0.
117 pChkptFreq = 0.
118 monitorFreq = 0.
119
120 #endif /* ALLOW_COST */
121
122 return
123 end
124

  ViewVC Help
Powered by ViewVC 1.1.22