/[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.2.6.1 - (hide annotations) (download)
Tue Feb 5 20:23:57 2002 UTC (22 years, 3 months ago) by heimbach
Branch: ecco-branch
CVS Tags: ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, ecco_c44_e20, ecco_c44_e21, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5
Changes since 1.2: +81 -12 lines
Starting from ecco-branch, replacing packages
cost, ctrl, ecco, obcs by ECCO packages.
Will create tag ecco-branch-mod1 after this modif.

1 heimbach 1.2.6.1 C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/cost/cost_final.F,v 1.12 2001/08/31 22:45:46 heimbach Exp $
2 heimbach 1.1
3     #include "COST_CPPOPTIONS.h"
4    
5    
6     subroutine cost_Final(
7     I mythid
8     & )
9    
10     c ==================================================================
11     c SUBROUTINE cost_Final
12     c ==================================================================
13     c
14     c o Sum of all cost function contributions.
15     c
16     c started: Christian Eckert eckert@mit.edu 30-Jun-1999
17     c
18     c changed: Christian Eckert eckert@mit.edu 25-Feb-2000
19     c
20     c - Restructured the code in order to create a package
21     c for the MITgcmUV.
22     c
23     c ==================================================================
24     c SUBROUTINE cost_Final
25     c ==================================================================
26    
27     implicit none
28    
29     c == global variables ==
30    
31     #include "EEPARAMS.h"
32     #include "SIZE.h"
33    
34     #include "cost.h"
35     #include "ctrl.h"
36    
37     c == routine arguments ==
38    
39     integer mythid
40    
41     c == local variables ==
42    
43     integer bi,bj
44     integer itlo,ithi
45     integer jtlo,jthi
46    
47 heimbach 1.2.6.1 character*(MAX_LEN_MBUF) msgbuf
48    
49 heimbach 1.1 c == end of interface ==
50    
51     jtlo = mybylo(mythid)
52     jthi = mybyhi(mythid)
53     itlo = mybxlo(mythid)
54     ithi = mybxhi(mythid)
55    
56 heimbach 1.2.6.1 #ifdef ECCO_VERBOSE
57     write(msgbuf,'(a)') ' '
58     call print_message( msgbuf, standardmessageunit,
59     & SQUEEZE_RIGHT , mythid)
60     write(msgbuf,'(a)') ' '
61     call print_message( msgbuf, standardmessageunit,
62     & SQUEEZE_RIGHT , mythid)
63     write(msgbuf,'(a)')
64     & ' cost_Final: Evaluating the final cost function.'
65     call print_message( msgbuf, standardmessageunit,
66     & SQUEEZE_RIGHT , mythid)
67     write(msgbuf,'(a)') ' '
68     call print_message( msgbuf, standardmessageunit,
69     & SQUEEZE_RIGHT , mythid)
70 heimbach 1.1 #endif
71    
72     c-- Sum up all contributions.
73     do bj = jtlo,jthi
74     do bi = itlo,ithi
75    
76 heimbach 1.2.6.1 print*,' --> objf_temp(bi,bj) =',objf_temp(bi,bj)
77     print*,' --> objf_salt(bi,bj) =',objf_salt(bi,bj)
78     print*,' --> objf_sst(bi,bj) =',objf_sst(bi,bj)
79     print*,' --> objf_sss(bi,bj) =',objf_sss(bi,bj)
80     print*,' --> objf_h(bi,bj) =',objf_h(bi,bj)
81     print*,' --> objf_hmean =',objf_hmean
82     print*,' --> objf_tauu(bi,bj) =',objf_tauu(bi,bj)
83     print*,' --> objf_tauv(bi,bj) =',objf_tauv(bi,bj)
84     print*,' --> objf_hflux(bi,bj) =',objf_hflux(bi,bj)
85     print*,' --> objf_sflux(bi,bj) =',objf_sflux(bi,bj)
86     print*,' --> objf_atl(bi,bj) =',objf_atl(bi,bj)
87     print*,' --> objf_ctdt(bi,bj) =',objf_ctdt(bi,bj)
88     print*,' --> objf_ctds(bi,bj) =',objf_ctds(bi,bj)
89     print*,' --> objf_uwind(bi,bj) =',objf_uwind(bi,bj)
90     print*,' --> objf_vwind(bi,bj) =',objf_vwind(bi,bj)
91     print*,' --> objf_atemp(bi,bj) =',objf_atemp(bi,bj)
92     print*,' --> objf_aqh(bi,bj) =',objf_aqh(bi,bj)
93     print*,' --> objf_obcsn(bi,bj) =',objf_obcsn(bi,bj)
94     print*,' --> objf_obcss(bi,bj) =',objf_obcss(bi,bj)
95     print*,' --> objf_obcsw(bi,bj) =',objf_obcsw(bi,bj)
96     print*,' --> objf_obcse(bi,bj) =',objf_obcse(bi,bj)
97 heimbach 1.1
98     fc = fc
99 heimbach 1.2.6.1 & + mult_temp * objf_temp(bi,bj)
100     & + mult_salt * objf_salt(bi,bj)
101     & + mult_sst * objf_sst(bi,bj)
102     & + mult_sss * objf_sss(bi,bj)
103     & + mult_tauu * objf_tauu(bi,bj)
104     & + mult_tauv * objf_tauv(bi,bj)
105     & + mult_hflux * objf_hflux(bi,bj)
106     & + mult_sflux * objf_sflux(bi,bj)
107     & + mult_h * objf_h(bi,bj)
108     & + mult_atl * objf_atl(bi,bj)
109     & + mult_ctdt * objf_ctdt(bi,bj)
110     & + mult_ctds * objf_ctds(bi,bj)
111     & + mult_uwind * objf_uwind(bi,bj)
112     & + mult_vwind * objf_vwind(bi,bj)
113     & + mult_atemp * objf_atemp(bi,bj)
114     & + mult_aqh * objf_aqh(bi,bj)
115     & + mult_obcsn * objf_obcsn(bi,bj)
116     & + mult_obcss * objf_obcss(bi,bj)
117     & + mult_obcsw * objf_obcsw(bi,bj)
118     & + mult_obcse * objf_obcse(bi,bj)
119 heimbach 1.1 enddo
120     enddo
121    
122    
123     c-- Do global summation.
124     _GLOBAL_SUM_R8( fc , myThid )
125    
126 heimbach 1.2.6.1 c-- Each process has calculated the global part for itself.
127     _BEGIN_MASTER( mythid )
128     fc = fc + mult_hmean*objf_hmean
129     _END_MASTER( mythid )
130    
131     print *, ' --> fc =', fc
132    
133     #ifdef ECCO_VERBOSE
134     write(msgbuf,'(a,D22.15)')
135     & ' cost_Final: final cost function = ',fc
136     call print_message( msgbuf, standardmessageunit,
137     & SQUEEZE_RIGHT , mythid)
138     write(msgbuf,'(a)') ' '
139     call print_message( msgbuf, standardmessageunit,
140     & SQUEEZE_RIGHT , mythid)
141     write(msgbuf,'(a)')
142     & ' cost function evaluation finished.'
143     call print_message( msgbuf, standardmessageunit,
144     & SQUEEZE_RIGHT , mythid)
145     write(msgbuf,'(a)') ' '
146     call print_message( msgbuf, standardmessageunit,
147     & SQUEEZE_RIGHT , mythid)
148     #endif
149 heimbach 1.1
150     end

  ViewVC Help
Powered by ViewVC 1.1.22