/[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.8 - (hide annotations) (download)
Fri Nov 14 23:07:30 2003 UTC (20 years, 6 months ago) by heimbach
Branch: MAIN
CVS Tags: hrcube4, checkpoint52d_pre, checkpoint52j_pre, checkpoint52f_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint52e_pre, checkpoint52e_post, checkpoint52b_pre, checkpoint52b_post, checkpoint52c_post, checkpoint52f_pre, checkpoint52d_post, checkpoint52i_post, checkpoint52h_pre, checkpoint52j_post, branch-netcdf, checkpoint52a_post
Branch point for: netcdf-sm0
Changes since 1.7: +4 -2 lines
Fix ifdef/elif interplay between cost_final and ecco_cost_final

1 heimbach 1.8 C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/cost/cost_final.F,v 1.8 2003/11/14 23:07:30 heimbach Exp $
2 heimbach 1.1
3 heimbach 1.7 #include "PACKAGES_CONFIG.h"
4 heimbach 1.1 #include "COST_CPPOPTIONS.h"
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 changed: Christian Eckert eckert@mit.edu 25-Feb-2000
16 heimbach 1.7 c heimbach@mit.edu 05-Nov-2003 Modularize cost package
17 heimbach 1.1 c
18     c ==================================================================
19 heimbach 1.3 c SUBROUTINE cost_final
20 heimbach 1.1 c ==================================================================
21    
22     implicit none
23    
24     c == global variables ==
25    
26     #include "EEPARAMS.h"
27     #include "SIZE.h"
28 heimbach 1.5 #include "PARAMS.h"
29 heimbach 1.1
30     #include "cost.h"
31     #include "ctrl.h"
32    
33     c == routine arguments ==
34    
35     integer mythid
36    
37 heimbach 1.2 #ifdef ALLOW_COST
38 heimbach 1.1 c == local variables ==
39    
40 heimbach 1.3 integer i,j,k
41 heimbach 1.1 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 heimbach 1.7 #if (defined (ALLOW_ECCO))
53     CALL ECCO_COST_FINAL (myThid)
54 heimbach 1.3
55 heimbach 1.7 #elif (defined (ALLOW_COST_VECTOR))
56 heimbach 1.3 CALL COST_VECTOR (myThid)
57    
58 heimbach 1.6 #elif (defined (ALLOW_COST_STATE_FINAL))
59     CALL COST_STATE_FINAL (myThid)
60 heimbach 1.3
61 heimbach 1.8 #endif /* above stuff undef */
62    
63     #ifndef ALLOW_ECCO
64 heimbach 1.3
65 heimbach 1.7 # ifdef ALLOW_COST_TEST
66 heimbach 1.2 CALL COST_TEST (myThid)
67 heimbach 1.7 # endif
68     # ifdef ALLOW_COST_ATLANTIC_HEAT
69 heimbach 1.3 CALL COST_ATLANTIC_HEAT (myThid)
70 heimbach 1.7 # endif
71 heimbach 1.3
72 heimbach 1.1 c-- Sum up all contributions.
73     do bj = jtlo,jthi
74     do bi = itlo,ithi
75    
76 heimbach 1.2 print*,' --> objf_test(bi,bj) =',objf_test(bi,bj)
77     print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj)
78 heimbach 1.7 print*,' --> objf_atl(bi,bj) =',objf_atl(bi,bj)
79 heimbach 1.1
80     fc = fc
81 heimbach 1.2 & + mult_test * objf_test(bi,bj)
82     & + mult_tracer * objf_tracer(bi,bj)
83 heimbach 1.3 & + mult_atl * objf_atl(bi,bj)
84 heimbach 1.1 enddo
85     enddo
86    
87 heimbach 1.6 print*,' local fc = ', fc
88 heimbach 1.1
89     c-- Do global summation.
90     _GLOBAL_SUM_R8( fc , myThid )
91 heimbach 1.3
92 heimbach 1.7 print*,' global fc = ', fc
93 heimbach 1.6
94 heimbach 1.7 #endif /* ALLOW_ECCO */
95 heimbach 1.5
96     c-- set averaging freq. to zero to avoid re-write of
97     c-- averaged fields in reverse checkpointing loops
98     taveFreq = 0.
99 heimbach 1.1
100 heimbach 1.2 #endif /* ALLOW_COST */
101 heimbach 1.1
102     return
103     end
104    

  ViewVC Help
Powered by ViewVC 1.1.22