/[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.6 by heimbach, Thu Oct 2 21:34:45 2003 UTC revision 1.15 by heimbach, Wed Jun 7 01:55:13 2006 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( mythid )
7    
8  c     ==================================================================  c     ==================================================================
# Line 12  c Line 12  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
# Line 31  c     == global variables == Line 28  c     == global variables ==
28  #include "PARAMS.h"  #include "PARAMS.h"
29    
30  #include "cost.h"  #include "cost.h"
31  #include "ctrl.h"  #ifdef ALLOW_CTRL
32    # include "ctrl.h"
33    #endif
34    
35  c     == routine arguments ==  c     == routine arguments ==
36    
# Line 52  c     == end of interface == Line 51  c     == end of interface ==
51        itlo = mybxlo(mythid)        itlo = mybxlo(mythid)
52        ithi = mybxhi(mythid)        ithi = mybxhi(mythid)
53    
54  #if (defined (ALLOW_COST_VECTOR))  #ifdef ALLOW_SEAICE
55          CALL SEAICE_COST_FINAL (myThid)
56    #endif
57    
58    #if (defined (ALLOW_ECCO))
59          CALL ECCO_COST_FINAL (myThid)
60    
61    #elif (defined (ALLOW_COST_VECTOR))
62        CALL COST_VECTOR (myThid)        CALL COST_VECTOR (myThid)
63    
64  #elif (defined (ALLOW_COST_STATE_FINAL))  #elif (defined (ALLOW_COST_STATE_FINAL))
   
65        CALL COST_STATE_FINAL (myThid)        CALL COST_STATE_FINAL (myThid)
66    
67  #else /* ALLOW_COST_VECTOR undef */  #endif /* above stuff undef */
68    
69  #ifdef ALLOW_COST_TEST  #ifndef ALLOW_ECCO
       CALL COST_TEST (myThid)  
 #endif  
70    
71  #ifdef ALLOW_COST_ATLANTIC_HEAT  # ifdef ALLOW_COST_TEST
72          CALL COST_TEST (myThid)
73    # endif
74    # ifdef ALLOW_COST_ATLANTIC_HEAT
75        CALL COST_ATLANTIC_HEAT (myThid)        CALL COST_ATLANTIC_HEAT (myThid)
76  #endif  # endif
77    
78  c--   Sum up all contributions.  c--   Sum up all contributions.
79        do bj = jtlo,jthi        do bj = jtlo,jthi
80          do bi = itlo,ithi          do bi = itlo,ithi
81    
82            print*,' --> objf_test(bi,bj)   =',objf_test(bi,bj)            write(standardmessageunit,'(A,D22.15)')
83            print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj)       &          ' --> objf_test(bi,bj)   = ', objf_test(bi,bj)
84            print*,' --> objf_atl(bi,bj) =',objf_atl(bi,bj)            write(standardmessageunit,'(A,D22.15)')
85         &         ' --> objf_tracer(bi,bj) = ', objf_tracer(bi,bj)
86              write(standardmessageunit,'(A,D22.15)')
87         &         ' --> objf_atl(bi,bj)    = ', objf_atl(bi,bj)
88    #ifdef ALLOW_COST_TRANSPORT
89              write(standardmessageunit,'(A,D22.15)')
90         &         ' --> objf_transport(bi,bj) = ', objf_transport(bi,bj)
91    #endif
92    
93            fc = fc            fc = fc
94       &            + mult_test   * objf_test(bi,bj)       &            + mult_test   * objf_test(bi,bj)
95       &            + mult_tracer * objf_tracer(bi,bj)       &            + mult_tracer * objf_tracer(bi,bj)
96       &            + mult_atl    * objf_atl(bi,bj)       &            + mult_atl    * objf_atl(bi,bj)
97    #ifdef ALLOW_COST_TRANSPORT
98         &            + mult_transport * objf_transport(bi,bj)
99    #endif
100          enddo          enddo
101        enddo        enddo
102    
103        print*,' local fc = ', fc        write(standardmessageunit,'(A,D22.15)') '  local fc = ', fc
104    
105  c--   Do global summation.  c--   Do global summation.
106        _GLOBAL_SUM_R8( fc , myThid )        _GLOBAL_SUM_R8( fc , myThid )
107    
108  #endif /* ALLOW_COST_VECTOR */        write(standardmessageunit,'(A,D22.15)') ' global fc = ', fc
109    
110        print*,' global fc = ', fc  #endif /* ALLOW_ECCO */
111    
112  c--   set averaging freq. to zero to avoid re-write of  c--   set averaging freq. to zero to avoid re-write of
113  c--   averaged fields in reverse checkpointing loops  c--   averaged fields in reverse checkpointing loops
114        taveFreq = 0.        taveFreq    = 0.
115          dumpFreq    = 0.
116          pChkptFreq  = 0.
117          monitorFreq = 0.
118    
119  #endif /* ALLOW_COST */  #endif /* ALLOW_COST */
120    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22