1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "COST_CPPOPTIONS.h" |
5 |
|
6 |
|
7 |
subroutine cost_gen_transport( |
8 |
I myiter, |
9 |
I mytime, |
10 |
I mythid |
11 |
& ) |
12 |
|
13 |
c ================================================================== |
14 |
c SUBROUTINE cost_gen_transport |
15 |
c ================================================================== |
16 |
c |
17 |
c o Evaluate cost function contribution for transports |
18 |
c |
19 |
c ================================================================== |
20 |
c SUBROUTINE cost_ssh |
21 |
c ================================================================== |
22 |
|
23 |
implicit none |
24 |
|
25 |
c == global variables == |
26 |
|
27 |
#include "EEPARAMS.h" |
28 |
#include "SIZE.h" |
29 |
#include "PARAMS.h" |
30 |
|
31 |
#include "ecco_cost.h" |
32 |
#include "ctrl.h" |
33 |
#include "ctrl_dummy.h" |
34 |
#include "optim.h" |
35 |
#include "DYNVARS.h" |
36 |
#ifdef ALLOW_PROFILES |
37 |
#include "profiles.h" |
38 |
#endif |
39 |
|
40 |
c == routine arguments == |
41 |
|
42 |
integer myiter |
43 |
_RL mytime |
44 |
integer mythid |
45 |
|
46 |
#ifdef ALLOW_TRANSPORT_COST_CONTRIBUTION |
47 |
c == local variables == |
48 |
|
49 |
integer bi,bj |
50 |
integer itlo,ithi |
51 |
integer jtlo,jthi |
52 |
integer irec |
53 |
integer ilps |
54 |
logical doglobalread |
55 |
logical ladinit |
56 |
_RL ftmp |
57 |
character*(max_len_mbuf) msgbuf |
58 |
|
59 |
c == external functions == |
60 |
|
61 |
integer ilnblnk |
62 |
external ilnblnk |
63 |
|
64 |
c == end of interface == |
65 |
|
66 |
jtlo = mybylo(mythid) |
67 |
jthi = mybyhi(mythid) |
68 |
itlo = mybxlo(mythid) |
69 |
ithi = mybxhi(mythid) |
70 |
|
71 |
c-- Loop over records for the second time. |
72 |
do irec = 1, ndaysrec |
73 |
|
74 |
ftmp = 0. _d 0 |
75 |
do bj = jtlo,jthi |
76 |
do bi = itlo,ithi |
77 |
ftmp = ftmp + transpbar(irec,bi,bj) |
78 |
enddo |
79 |
enddo |
80 |
_GLOBAL_SUM_R8( ftmp , myThid ) |
81 |
|
82 |
write(msgbuf,'(A,I,2(X,P2E22.14))') |
83 |
& 'ph-cost-transport FS: day, 1-model, 2-obs ', |
84 |
& irec, ftmp, transpobs(irec) |
85 |
call print_message( msgbuf, standardmessageunit, |
86 |
& SQUEEZE_RIGHT , mythid) |
87 |
|
88 |
if ( ftmp.NE.0. .AND. wtransp(irec).NE.0. ) then |
89 |
objf_transp = objf_transp + |
90 |
& wtransp(irec)*( ftmp - transpobs(irec) )**2 |
91 |
num_transp = num_transp + 1. _d 0 |
92 |
endif |
93 |
|
94 |
enddo |
95 |
|
96 |
#endif /* ifdef ALLOW_TRANSPORT_COST_CONTRIBUTION */ |
97 |
|
98 |
end |