/[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.7 - (show annotations) (download)
Thu Nov 6 22:03:49 2003 UTC (20 years, 6 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint52, checkpoint52a_pre, ecco_c52_e35, checkpoint51u_post
Changes since 1.6: +14 -17 lines
o merging from ecco-branch
o modularized cost package
  - ECCO-specific terms are now in pkg/ecco
  - cost package is driver

1 C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_final.F,v 1.6 2003/10/02 21:34:45 heimbach Exp $
2
3 #include "PACKAGES_CONFIG.h"
4 #include "COST_CPPOPTIONS.h"
5
6 subroutine cost_final( mythid )
7
8 c ==================================================================
9 c SUBROUTINE cost_final
10 c ==================================================================
11 c
12 c o Sum of all cost function contributions.
13 c
14 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
15 c changed: Christian Eckert eckert@mit.edu 25-Feb-2000
16 c heimbach@mit.edu 05-Nov-2003 Modularize cost package
17 c
18 c ==================================================================
19 c SUBROUTINE cost_final
20 c ==================================================================
21
22 implicit none
23
24 c == global variables ==
25
26 #include "EEPARAMS.h"
27 #include "SIZE.h"
28 #include "PARAMS.h"
29
30 #include "cost.h"
31 #include "ctrl.h"
32
33 c == routine arguments ==
34
35 integer mythid
36
37 #ifdef ALLOW_COST
38 c == local variables ==
39
40 integer i,j,k
41 integer bi,bj
42 integer itlo,ithi
43 integer jtlo,jthi
44
45 c == end of interface ==
46
47 jtlo = mybylo(mythid)
48 jthi = mybyhi(mythid)
49 itlo = mybxlo(mythid)
50 ithi = mybxhi(mythid)
51
52 #if (defined (ALLOW_ECCO))
53 CALL ECCO_COST_FINAL (myThid)
54
55 #elif (defined (ALLOW_COST_VECTOR))
56 CALL COST_VECTOR (myThid)
57
58 #elif (defined (ALLOW_COST_STATE_FINAL))
59 CALL COST_STATE_FINAL (myThid)
60
61 #else /* above stuff undef */
62
63 # ifdef ALLOW_COST_TEST
64 CALL COST_TEST (myThid)
65 # endif
66 # ifdef ALLOW_COST_ATLANTIC_HEAT
67 CALL COST_ATLANTIC_HEAT (myThid)
68 # endif
69
70 c-- Sum up all contributions.
71 do bj = jtlo,jthi
72 do bi = itlo,ithi
73
74 print*,' --> objf_test(bi,bj) =',objf_test(bi,bj)
75 print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj)
76 print*,' --> objf_atl(bi,bj) =',objf_atl(bi,bj)
77
78 fc = fc
79 & + mult_test * objf_test(bi,bj)
80 & + mult_tracer * objf_tracer(bi,bj)
81 & + mult_atl * objf_atl(bi,bj)
82 enddo
83 enddo
84
85 print*,' local fc = ', fc
86
87 c-- Do global summation.
88 _GLOBAL_SUM_R8( fc , myThid )
89
90 print*,' global fc = ', fc
91
92 #endif /* ALLOW_ECCO */
93
94 c-- set averaging freq. to zero to avoid re-write of
95 c-- averaged fields in reverse checkpointing loops
96 taveFreq = 0.
97
98 #endif /* ALLOW_COST */
99
100 return
101 end
102

  ViewVC Help
Powered by ViewVC 1.1.22