/[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.6 - (hide annotations) (download)
Thu Oct 2 21:34:45 2003 UTC (20 years, 7 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint51o_pre, checkpoint51l_post, checkpoint51t_post, checkpoint51n_post, checkpoint51s_post, checkpoint51j_post, checkpoint51n_pre, checkpoint51l_pre, checkpoint51q_post, checkpoint51h_pre, checkpoint51r_post, checkpoint51i_post, checkpoint51i_pre, checkpoint51o_post, checkpoint51g_post, checkpoint51m_post, checkpoint51p_post
Branch point for: branch-nonh, tg2-branch, checkpoint51n_branch
Changes since 1.5: +8 -11 lines
Bringing cost/ ctrl/ up to date.

1 heimbach 1.6 C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_final.F,v 1.5 2003/01/21 19:20:52 heimbach Exp $
2 heimbach 1.1
3     #include "COST_CPPOPTIONS.h"
4    
5    
6 heimbach 1.3 subroutine cost_final( mythid )
7 heimbach 1.1
8     c ==================================================================
9 heimbach 1.3 c SUBROUTINE cost_final
10 heimbach 1.1 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
16     c changed: Christian Eckert eckert@mit.edu 25-Feb-2000
17     c
18     c - Restructured the code in order to create a package
19     c for the MITgcmUV.
20     c
21     c ==================================================================
22 heimbach 1.3 c SUBROUTINE cost_final
23 heimbach 1.1 c ==================================================================
24    
25     implicit none
26    
27     c == global variables ==
28    
29     #include "EEPARAMS.h"
30     #include "SIZE.h"
31 heimbach 1.5 #include "PARAMS.h"
32 heimbach 1.1
33     #include "cost.h"
34     #include "ctrl.h"
35    
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.6 #if (defined (ALLOW_COST_VECTOR))
56 heimbach 1.3
57     CALL COST_VECTOR (myThid)
58    
59 heimbach 1.6 #elif (defined (ALLOW_COST_STATE_FINAL))
60    
61     CALL COST_STATE_FINAL (myThid)
62 heimbach 1.3
63     #else /* ALLOW_COST_VECTOR undef */
64    
65 heimbach 1.2 #ifdef ALLOW_COST_TEST
66     CALL COST_TEST (myThid)
67 heimbach 1.1 #endif
68    
69 heimbach 1.3 #ifdef ALLOW_COST_ATLANTIC_HEAT
70     CALL COST_ATLANTIC_HEAT (myThid)
71     #endif
72    
73 heimbach 1.1 c-- Sum up all contributions.
74     do bj = jtlo,jthi
75     do bi = itlo,ithi
76    
77 heimbach 1.2 print*,' --> objf_test(bi,bj) =',objf_test(bi,bj)
78     print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj)
79 heimbach 1.3 print*,' --> objf_atl(bi,bj) =',objf_atl(bi,bj)
80 heimbach 1.1
81     fc = fc
82 heimbach 1.2 & + mult_test * objf_test(bi,bj)
83     & + mult_tracer * objf_tracer(bi,bj)
84 heimbach 1.3 & + mult_atl * objf_atl(bi,bj)
85 heimbach 1.1 enddo
86     enddo
87    
88 heimbach 1.6 print*,' local fc = ', fc
89 heimbach 1.1
90     c-- Do global summation.
91     _GLOBAL_SUM_R8( fc , myThid )
92 heimbach 1.3
93     #endif /* ALLOW_COST_VECTOR */
94 heimbach 1.6
95     print*,' global fc = ', fc
96 heimbach 1.5
97     c-- set averaging freq. to zero to avoid re-write of
98     c-- averaged fields in reverse checkpointing loops
99     taveFreq = 0.
100 heimbach 1.1
101 heimbach 1.2 #endif /* ALLOW_COST */
102 heimbach 1.1
103     return
104     end
105    

  ViewVC Help
Powered by ViewVC 1.1.22