/[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.1 by heimbach, Sun Mar 25 22:33:54 2001 UTC revision 1.4 by heimbach, Sat Jul 13 03:01:39 2002 UTC
# Line 3  C $Header$ Line 3  C $Header$
3  #include "COST_CPPOPTIONS.h"  #include "COST_CPPOPTIONS.h"
4    
5    
6        subroutine cost_Final(        subroutine cost_final( mythid )
      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.
# Line 21  c              - Restructured the code i Line 19  c              - Restructured the code i
19  c                for the MITgcmUV.  c                for the MITgcmUV.
20  c  c
21  c     ==================================================================  c     ==================================================================
22  c     SUBROUTINE cost_Final  c     SUBROUTINE cost_final
23  c     ==================================================================  c     ==================================================================
24    
25        implicit none        implicit none
# Line 38  c     == routine arguments == Line 36  c     == routine arguments ==
36    
37        integer mythid        integer mythid
38    
39    #ifdef ALLOW_COST
40  c     == local variables ==  c     == local variables ==
41    
42          integer i,j,k
43        integer bi,bj        integer bi,bj
44        integer itlo,ithi        integer itlo,ithi
45        integer jtlo,jthi        integer jtlo,jthi
46    
 #ifdef ECCO_VERBOSE  
       character*(MAX_LEN_MBUF) msgbuf  
 #endif  
   
47  c     == end of interface ==  c     == end of interface ==
48    
49        jtlo = mybylo(mythid)        jtlo = mybylo(mythid)
# Line 55  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  #ifdef ECCO_VERBOSE  #ifdef ALLOW_COST_VECTOR
55        write(msgbuf,'(a)') ' '  
56        call print_message( msgbuf, standardmessageunit,        CALL COST_VECTOR (myThid)
57       &                    SQUEEZE_RIGHT , mythid)  
58        write(msgbuf,'(a)') ' '        do bj = jtlo,jthi
59        call print_message( msgbuf, standardmessageunit,          do bi = itlo,ithi
60       &                    SQUEEZE_RIGHT , mythid)            do i = 1,sNx
61        write(msgbuf,'(a)')              print*,' --> objf_vector(i,bi,bj)  = ',
62       &  ' cost_Final: Evaluating the final cost function.'       &            objf_vector(i,bi,bj)
63        call print_message( msgbuf, standardmessageunit,            end do
64       &                    SQUEEZE_RIGHT , mythid)          end do
65        write(msgbuf,'(a)') ' '        end do
66        call print_message( msgbuf, standardmessageunit,  
67       &                    SQUEEZE_RIGHT , mythid)  #else /* ALLOW_COST_VECTOR undef */
68    
69    #ifdef ALLOW_COST_TEST
70          CALL COST_TEST (myThid)
71    #endif
72    
73    #ifdef ALLOW_COST_ATLANTIC_HEAT
74          CALL COST_ATLANTIC_HEAT (myThid)
75  #endif  #endif
76    
77  c--   Sum up all contributions.  c--   Sum up all contributions.
78        do bj = jtlo,jthi        do bj = jtlo,jthi
79          do bi = itlo,ithi          do bi = itlo,ithi
80    
81            print*,' --> objf_temp(bi,bj) =',objf_temp(bi,bj)            print*,' --> objf_test(bi,bj)   =',objf_test(bi,bj)
82            print*,' --> objf_salt(bi,bj) =',objf_salt(bi,bj)            print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj)
83            print*,' --> objf_tauu(bi,bj) =',objf_tauu(bi,bj)            print*,' --> objf_atl(bi,bj) =',objf_atl(bi,bj)
           print*,' --> objf_tauv(bi,bj) =',objf_tauv(bi,bj)  
           print*,' --> objf_hflux(bi,bj)   =',objf_hflux(bi,bj)  
           print*,' --> objf_sflux(bi,bj)   =',objf_sflux(bi,bj)  
           print*,' --> objf_sst(bi,bj)  =',objf_sst(bi,bj)  
           print*,' --> objf_h(bi,bj)    =',objf_h(bi,bj)  
           print*,' --> objf_atl(bi,bj)  =',objf_atl(bi,bj)  
           print*,' --> objf_ctdt(bi,bj) =',objf_ctdt(bi,bj)  
           print*,' --> objf_ctds(bi,bj) =',objf_ctds(bi,bj)  
           print*,' --> objf_test(bi,bj) =',objf_test(bi,bj)  
84    
85            fc = fc            fc = fc
86       &            + mult_temp * objf_temp(bi,bj)       &            + mult_test   * objf_test(bi,bj)
87       &            + mult_salt * objf_salt(bi,bj)       &            + mult_tracer * objf_tracer(bi,bj)
88       &            + mult_tauu * objf_tauu(bi,bj)       &            + mult_atl    * objf_atl(bi,bj)
      &            + mult_tauv * objf_tauv(bi,bj)  
      &            + mult_hq   * objf_hflux(bi,bj)    
      &            + mult_hs   * objf_sflux(bi,bj)    
      &            + mult_sst  * objf_sst(bi,bj)  
      &            + mult_h    * objf_h(bi,bj)  
      &            + mult_atl  * objf_atl(bi,bj)  
      &            + mult_ctdt * objf_ctdt(bi,bj)  
      &            + mult_ctds * objf_ctds(bi,bj)  
      &            + mult_test * objf_test(bi,bj)  
89          enddo          enddo
90        enddo        enddo
91    
92          print*,' fc = ', fc
93    
94  c--   Do global summation.  c--   Do global summation.
95        _GLOBAL_SUM_R8( fc , myThid )        _GLOBAL_SUM_R8( fc , myThid )
96    
97  c--   Each process has calculated the global part for itself.  #endif /* ALLOW_COST_VECTOR */
98        _BEGIN_MASTER( mythid )  
99          fc = fc + mult_hmean*objf_hmean  #endif /* ALLOW_COST */
       _END_MASTER( mythid )  
       print*,' --> fc               =',fc  
   
 #ifdef ECCO_VERBOSE  
       write(msgbuf,'(a,D22.15)')  
      &  ' cost_Final: final cost function = ',fc  
       call print_message( msgbuf, standardmessageunit,  
      &                    SQUEEZE_RIGHT , mythid)  
       write(msgbuf,'(a)') ' '  
       call print_message( msgbuf, standardmessageunit,  
      &                    SQUEEZE_RIGHT , mythid)  
       write(msgbuf,'(a)')  
      &  '             cost function evaluation finished.'  
       call print_message( msgbuf, standardmessageunit,  
      &                    SQUEEZE_RIGHT , mythid)  
       write(msgbuf,'(a)') ' '  
       call print_message( msgbuf, standardmessageunit,  
      &                    SQUEEZE_RIGHT , mythid)  
 #endif  
100    
101        return        return
102        end        end

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22