38 |
|
|
39 |
integer mythid |
integer mythid |
40 |
|
|
41 |
|
#ifdef ALLOW_COST |
42 |
c == local variables == |
c == local variables == |
43 |
|
|
44 |
integer bi,bj |
integer bi,bj |
45 |
integer itlo,ithi |
integer itlo,ithi |
46 |
integer jtlo,jthi |
integer jtlo,jthi |
47 |
|
|
|
#ifdef ECCO_VERBOSE |
|
|
character*(MAX_LEN_MBUF) msgbuf |
|
|
#endif |
|
|
|
|
48 |
c == end of interface == |
c == end of interface == |
49 |
|
|
50 |
jtlo = mybylo(mythid) |
jtlo = mybylo(mythid) |
52 |
itlo = mybxlo(mythid) |
itlo = mybxlo(mythid) |
53 |
ithi = mybxhi(mythid) |
ithi = mybxhi(mythid) |
54 |
|
|
55 |
#ifdef ECCO_VERBOSE |
#ifdef ALLOW_COST_TEST |
56 |
write(msgbuf,'(a)') ' ' |
CALL COST_TEST (myThid) |
|
call print_message( msgbuf, standardmessageunit, |
|
|
& SQUEEZE_RIGHT , mythid) |
|
|
write(msgbuf,'(a)') ' ' |
|
|
call print_message( msgbuf, standardmessageunit, |
|
|
& SQUEEZE_RIGHT , mythid) |
|
|
write(msgbuf,'(a)') |
|
|
& ' cost_Final: Evaluating the final cost function.' |
|
|
call print_message( msgbuf, standardmessageunit, |
|
|
& SQUEEZE_RIGHT , mythid) |
|
|
write(msgbuf,'(a)') ' ' |
|
|
call print_message( msgbuf, standardmessageunit, |
|
|
& SQUEEZE_RIGHT , mythid) |
|
57 |
#endif |
#endif |
58 |
|
|
59 |
c-- Sum up all contributions. |
c-- Sum up all contributions. |
60 |
do bj = jtlo,jthi |
do bj = jtlo,jthi |
61 |
do bi = itlo,ithi |
do bi = itlo,ithi |
62 |
|
|
63 |
print*,' --> objf_temp(bi,bj) =',objf_temp(bi,bj) |
print*,' --> objf_test(bi,bj) =',objf_test(bi,bj) |
64 |
print*,' --> objf_salt(bi,bj) =',objf_salt(bi,bj) |
print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj) |
|
print*,' --> objf_tauu(bi,bj) =',objf_tauu(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) |
|
65 |
|
|
66 |
fc = fc |
fc = fc |
67 |
& + mult_temp * objf_temp(bi,bj) |
& + mult_test * objf_test(bi,bj) |
68 |
& + mult_salt * objf_salt(bi,bj) |
& + mult_tracer * objf_tracer(bi,bj) |
|
& + mult_tauu * objf_tauu(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) |
|
69 |
enddo |
enddo |
70 |
enddo |
enddo |
71 |
|
|
72 |
|
print*,' fc = ', fc |
73 |
|
|
74 |
c-- Do global summation. |
c-- Do global summation. |
75 |
_GLOBAL_SUM_R8( fc , myThid ) |
_GLOBAL_SUM_R8( fc , myThid ) |
76 |
|
|
77 |
c-- Each process has calculated the global part for itself. |
#endif /* ALLOW_COST */ |
|
_BEGIN_MASTER( mythid ) |
|
|
fc = fc + mult_hmean*objf_hmean |
|
|
_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 |
|
78 |
|
|
79 |
return |
return |
80 |
end |
end |