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. |
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 |
39 |
#ifdef ALLOW_COST |
#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 |
51 |
itlo = mybxlo(mythid) |
itlo = mybxlo(mythid) |
52 |
ithi = mybxhi(mythid) |
ithi = mybxhi(mythid) |
53 |
|
|
54 |
|
#ifdef ALLOW_COST_VECTOR |
55 |
|
|
56 |
|
CALL COST_VECTOR (myThid) |
57 |
|
|
58 |
|
do bj = jtlo,jthi |
59 |
|
do bi = itlo,ithi |
60 |
|
do i = 1,sNx |
61 |
|
print*,' --> objf_vector(i,bi,bj) = ', |
62 |
|
& objf_vector(i,bi,bj) |
63 |
|
end do |
64 |
|
end do |
65 |
|
end do |
66 |
|
|
67 |
|
#else /* ALLOW_COST_VECTOR undef */ |
68 |
|
|
69 |
#ifdef ALLOW_COST_TEST |
#ifdef ALLOW_COST_TEST |
70 |
CALL COST_TEST (myThid) |
CALL COST_TEST (myThid) |
71 |
#endif |
#endif |
72 |
|
|
73 |
|
#ifdef ALLOW_COST_ATLANTIC_HEAT |
74 |
|
CALL COST_ATLANTIC_HEAT (myThid) |
75 |
|
#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_test(bi,bj) =',objf_test(bi,bj) |
print*,' --> objf_test(bi,bj) =',objf_test(bi,bj) |
82 |
print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj) |
print*,' --> objf_tracer(bi,bj) =',objf_tracer(bi,bj) |
83 |
|
print*,' --> objf_atl(bi,bj) =',objf_atl(bi,bj) |
84 |
|
|
85 |
fc = fc |
fc = fc |
86 |
& + mult_test * objf_test(bi,bj) |
& + mult_test * objf_test(bi,bj) |
87 |
& + mult_tracer * objf_tracer(bi,bj) |
& + mult_tracer * objf_tracer(bi,bj) |
88 |
|
& + mult_atl * objf_atl(bi,bj) |
89 |
enddo |
enddo |
90 |
enddo |
enddo |
91 |
|
|
94 |
c-- Do global summation. |
c-- Do global summation. |
95 |
_GLOBAL_SUM_R8( fc , myThid ) |
_GLOBAL_SUM_R8( fc , myThid ) |
96 |
|
|
97 |
|
#endif /* ALLOW_COST_VECTOR */ |
98 |
|
|
99 |
#endif /* ALLOW_COST */ |
#endif /* ALLOW_COST */ |
100 |
|
|
101 |
return |
return |