1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
subroutine cost_test( myThid ) |
7 |
C /==========================================================\ |
8 |
C | subroutine cost_test | |
9 |
C | o this routine computes the cost function for the tiles | |
10 |
C | of this processor | |
11 |
C |==========================================================| |
12 |
C | | |
13 |
C | Notes | |
14 |
C | ===== | |
15 |
C \==========================================================/ |
16 |
IMPLICIT NONE |
17 |
|
18 |
C == Global variables === |
19 |
#include "SIZE.h" |
20 |
#include "EEPARAMS.h" |
21 |
#include "PARAMS.h" |
22 |
#include "DYNVARS.h" |
23 |
#include "GRID.h" |
24 |
#ifdef ALLOW_PASSIVE_TRACER |
25 |
# include "TR1.h" |
26 |
#endif |
27 |
|
28 |
#include "cost.h" |
29 |
|
30 |
C == Routine arguments == |
31 |
C myThid - Thread number for this instance of the routine. |
32 |
integer bi, bj |
33 |
integer myThid |
34 |
|
35 |
#ifdef ALLOW_COST_TEST |
36 |
C == Local variables |
37 |
_RL thetaRef |
38 |
|
39 |
integer i, j, k |
40 |
integer ig, jg |
41 |
integer itlo,ithi |
42 |
integer jtlo,jthi |
43 |
|
44 |
jtlo = mybylo(mythid) |
45 |
jthi = mybyhi(mythid) |
46 |
itlo = mybxlo(mythid) |
47 |
ithi = mybxhi(mythid) |
48 |
|
49 |
iLocOut = 1 |
50 |
jLocOut = 32 |
51 |
kLocOut = 1 |
52 |
|
53 |
do bj = jtlo,jthi |
54 |
do bi = itlo,ithi |
55 |
objf_test(bi,bj)= 0. _d 0 |
56 |
enddo |
57 |
enddo |
58 |
|
59 |
ce some reference temperature |
60 |
thetaRef = 24.0D0 |
61 |
C-- Calculate mask for tracer cells (0 => land, 1 => water) |
62 |
k=1 |
63 |
|
64 |
C-- Calculate cost function on tile of this instance |
65 |
do bj = jtlo,jthi |
66 |
do bi = itlo,ithi |
67 |
c |
68 |
do j=1,sNy |
69 |
jg = myYGlobalLo-1+(bj-1)*sNy+j |
70 |
do i=1,sNx |
71 |
ig = myXGlobalLo-1+(bi-1)*sNx+i |
72 |
|
73 |
if ((jg .gt.30) .and. (jg .lt.40)) then |
74 |
objf_test(bi,bj) = objf_test(bi,bj) + |
75 |
& theta(i,j,kLocOut,bi,bj) |
76 |
write(*,'(a,F10.1,3(x,i4),a,4(x,i4))') |
77 |
& 'objf_test ', objf_test(bi,bj), |
78 |
& ig,jg,kLocOut,' TILE ',i,j,bi,bj |
79 |
endif |
80 |
|
81 |
end do |
82 |
end do |
83 |
c |
84 |
objf_test(bi,bj) = objf_test(bi,bj) / 9. _d 0 |
85 |
c |
86 |
end do |
87 |
end do |
88 |
|
89 |
#endif |
90 |
|
91 |
END |