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