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