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

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

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

revision 1.2 by heimbach, Fri Jul 13 13:37:45 2001 UTC revision 1.10 by heimbach, Sat Dec 4 23:22:28 2004 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2    
3    #include "PACKAGES_CONFIG.h"
4  #include "COST_CPPOPTIONS.h"  #include "COST_CPPOPTIONS.h"
5    
6          subroutine cost_final( mythid )
       subroutine cost_Final(  
      I                       mythid  
      &                     )  
7    
8  c     ==================================================================  c     ==================================================================
9  c     SUBROUTINE cost_Final  c     SUBROUTINE cost_final
10  c     ==================================================================  c     ==================================================================
11  c  c
12  c     o Sum of all cost function contributions.  c     o Sum of all cost function contributions.
13  c  c
14  c     started: Christian Eckert eckert@mit.edu 30-Jun-1999  c     started: Christian Eckert eckert@mit.edu 30-Jun-1999
 c  
15  c     changed: Christian Eckert eckert@mit.edu 25-Feb-2000  c     changed: Christian Eckert eckert@mit.edu 25-Feb-2000
16  c  c     heimbach@mit.edu 05-Nov-2003 Modularize cost package
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.  
17  c  c
18  c     ==================================================================  c     ==================================================================
19  c     SUBROUTINE cost_Final  c     SUBROUTINE cost_final
20  c     ==================================================================  c     ==================================================================
21    
22        implicit none        implicit none
# Line 30  c     == global variables == Line 25  c     == global variables ==
25    
26  #include "EEPARAMS.h"  #include "EEPARAMS.h"
27  #include "SIZE.h"  #include "SIZE.h"
28    #include "PARAMS.h"
29    
30  #include "cost.h"  #include "cost.h"
31  #include "ctrl.h"  #include "ctrl.h"
# Line 41  c     == routine arguments == Line 37  c     == routine arguments ==
37  #ifdef ALLOW_COST  #ifdef ALLOW_COST
38  c     == local variables ==  c     == local variables ==
39    
40          integer i,j,k
41        integer bi,bj        integer bi,bj
42        integer itlo,ithi        integer itlo,ithi
43        integer jtlo,jthi        integer jtlo,jthi
# Line 52  c     == end of interface == Line 49  c     == end of interface ==
49        itlo = mybxlo(mythid)        itlo = mybxlo(mythid)
50        ithi = mybxhi(mythid)        ithi = mybxhi(mythid)
51    
52  #ifdef ALLOW_COST_TEST  #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    #endif /* above stuff undef */
62    
63    #ifndef ALLOW_ECCO
64    
65    # ifdef ALLOW_COST_TEST
66        CALL COST_TEST (myThid)        CALL COST_TEST (myThid)
67  #endif  # endif
68    # ifdef ALLOW_COST_ATLANTIC_HEAT
69          CALL COST_ATLANTIC_HEAT (myThid)
70    # endif
71    
72  c--   Sum up all contributions.  c--   Sum up all contributions.
73        do bj = jtlo,jthi        do bj = jtlo,jthi
# Line 62  c--   Sum up all contributions. Line 75  c--   Sum up all contributions.
75    
76            print*,' --> objf_test(bi,bj)   =',objf_test(bi,bj)            print*,' --> objf_test(bi,bj)   =',objf_test(bi,bj)
77            print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj)            print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj)
78              print*,' --> objf_atl(bi,bj)    =',objf_atl(bi,bj)
79    
80            fc = fc            fc = fc
81       &            + mult_test   * objf_test(bi,bj)       &            + mult_test   * objf_test(bi,bj)
82       &            + mult_tracer * objf_tracer(bi,bj)       &            + mult_tracer * objf_tracer(bi,bj)
83         &            + mult_atl    * objf_atl(bi,bj)
84          enddo          enddo
85        enddo        enddo
86    
87        print*,' fc = ', fc        print*,' local fc = ', fc
88    
89  c--   Do global summation.  c--   Do global summation.
90        _GLOBAL_SUM_R8( fc , myThid )        _GLOBAL_SUM_R8( fc , myThid )
91    
92          print*,' global fc = ', fc
93    
94    #endif /* ALLOW_ECCO */
95    
96    c--   set averaging freq. to zero to avoid re-write of
97    c--   averaged fields in reverse checkpointing loops
98          taveFreq    = 0.
99          dumpFreq    = 0.
100          pChkptFreq  = 0.
101          monitorFreq = 0.
102    
103  #endif /* ALLOW_COST */  #endif /* ALLOW_COST */
104    
105        return        return

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22