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

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

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


Revision 1.18 - (hide annotations) (download)
Thu Jan 17 20:53:08 2008 UTC (16 years, 4 months ago) by dfer
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59o, checkpoint59n, checkpoint61f, checkpoint61e, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61l, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i
Changes since 1.17: +5 -5 lines
Unbreaking the adjoint (I had defined variables that already existed in ecco_cost.h).

1 dfer 1.18 C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_final.F,v 1.17 2008/01/15 20:28:39 dfer Exp $
2 jmc 1.16 C $Name: $
3 heimbach 1.1
4 heimbach 1.7 #include "PACKAGES_CONFIG.h"
5 heimbach 1.1 #include "COST_CPPOPTIONS.h"
6    
7 heimbach 1.3 subroutine cost_final( mythid )
8 heimbach 1.1
9     c ==================================================================
10 heimbach 1.3 c SUBROUTINE cost_final
11 heimbach 1.1 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 heimbach 1.7 c heimbach@mit.edu 05-Nov-2003 Modularize cost package
18 heimbach 1.1 c
19     c ==================================================================
20 heimbach 1.3 c SUBROUTINE cost_final
21 heimbach 1.1 c ==================================================================
22    
23     implicit none
24    
25     c == global variables ==
26    
27     #include "EEPARAMS.h"
28     #include "SIZE.h"
29 heimbach 1.5 #include "PARAMS.h"
30 heimbach 1.1
31     #include "cost.h"
32 heimbach 1.14 #ifdef ALLOW_CTRL
33     # include "ctrl.h"
34     #endif
35 heimbach 1.1
36     c == routine arguments ==
37    
38     integer mythid
39    
40 heimbach 1.2 #ifdef ALLOW_COST
41 heimbach 1.1 c == local variables ==
42    
43 heimbach 1.3 integer i,j,k
44 heimbach 1.1 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 heimbach 1.13 #ifdef ALLOW_SEAICE
56     CALL SEAICE_COST_FINAL (myThid)
57     #endif
58    
59 heimbach 1.7 #if (defined (ALLOW_ECCO))
60     CALL ECCO_COST_FINAL (myThid)
61 heimbach 1.3
62 heimbach 1.7 #elif (defined (ALLOW_COST_VECTOR))
63 heimbach 1.3 CALL COST_VECTOR (myThid)
64    
65 heimbach 1.6 #elif (defined (ALLOW_COST_STATE_FINAL))
66     CALL COST_STATE_FINAL (myThid)
67 heimbach 1.3
68 heimbach 1.8 #endif /* above stuff undef */
69    
70     #ifndef ALLOW_ECCO
71 heimbach 1.3
72 heimbach 1.7 # ifdef ALLOW_COST_TEST
73 heimbach 1.2 CALL COST_TEST (myThid)
74 heimbach 1.7 # endif
75     # ifdef ALLOW_COST_ATLANTIC_HEAT
76 heimbach 1.3 CALL COST_ATLANTIC_HEAT (myThid)
77 heimbach 1.7 # endif
78 dfer 1.17 #ifdef ALLOW_COST_HFLUXM
79     CALL COST_HFLUX (myThid)
80     #endif
81     #ifdef ALLOW_COST_TEMP
82     CALL COST_TEMP (myThid)
83     #endif
84 heimbach 1.3
85 heimbach 1.1 c-- Sum up all contributions.
86     do bj = jtlo,jthi
87     do bi = itlo,ithi
88    
89 jmc 1.16 write(standardmessageunit,'(A,D22.15)')
90 heimbach 1.11 & ' --> objf_test(bi,bj) = ', objf_test(bi,bj)
91 jmc 1.16 write(standardmessageunit,'(A,D22.15)')
92 heimbach 1.11 & ' --> objf_tracer(bi,bj) = ', objf_tracer(bi,bj)
93 jmc 1.16 write(standardmessageunit,'(A,D22.15)')
94 heimbach 1.11 & ' --> objf_atl(bi,bj) = ', objf_atl(bi,bj)
95 dfer 1.17 #ifdef ALLOW_COST_TEMP
96     write(standardmessageunit,'(A,D22.15)')
97 dfer 1.18 & ' --> objf_temp_tut(bi,bj) = ', objf_temp_tut(bi,bj)
98 dfer 1.17 #endif
99     #ifdef ALLOW_COST_HFLUXM
100     write(standardmessageunit,'(A,D22.15)')
101 dfer 1.18 & ' --> objf_hflux_tut(bi,bj) = ', objf_hflux_tut(bi,bj)
102 dfer 1.17 #endif
103 heimbach 1.15 #ifdef ALLOW_COST_TRANSPORT
104 jmc 1.16 write(standardmessageunit,'(A,D22.15)')
105 heimbach 1.15 & ' --> objf_transport(bi,bj) = ', objf_transport(bi,bj)
106     #endif
107 heimbach 1.1
108     fc = fc
109 heimbach 1.2 & + mult_test * objf_test(bi,bj)
110     & + mult_tracer * objf_tracer(bi,bj)
111 heimbach 1.3 & + mult_atl * objf_atl(bi,bj)
112 heimbach 1.15 #ifdef ALLOW_COST_TRANSPORT
113     & + mult_transport * objf_transport(bi,bj)
114     #endif
115 dfer 1.17 #ifdef ALLOW_COST_TEMP
116 dfer 1.18 & + mult_temp_tut * objf_temp_tut(bi,bj)
117 dfer 1.17 #endif
118     #ifdef ALLOW_COST_HFLUXM
119 dfer 1.18 & + mult_hflux_tut * objf_hflux_tut(bi,bj)
120 dfer 1.17 #endif
121 heimbach 1.1 enddo
122     enddo
123    
124 heimbach 1.12 write(standardmessageunit,'(A,D22.15)') ' local fc = ', fc
125 heimbach 1.1
126     c-- Do global summation.
127     _GLOBAL_SUM_R8( fc , myThid )
128 heimbach 1.3
129 heimbach 1.12 write(standardmessageunit,'(A,D22.15)') ' global fc = ', fc
130 heimbach 1.6
131 heimbach 1.7 #endif /* ALLOW_ECCO */
132 heimbach 1.5
133     c-- set averaging freq. to zero to avoid re-write of
134     c-- averaged fields in reverse checkpointing loops
135 heimbach 1.10 taveFreq = 0.
136     dumpFreq = 0.
137     pChkptFreq = 0.
138     monitorFreq = 0.
139 heimbach 1.1
140 heimbach 1.2 #endif /* ALLOW_COST */
141 heimbach 1.1
142     return
143     end
144    

  ViewVC Help
Powered by ViewVC 1.1.22