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 |
|
25 |
#include "cost.h" |
26 |
|
27 |
C == Routine arguments == |
28 |
C myThid - Thread number for this instance of the routine. |
29 |
integer bi, bj |
30 |
integer myThid |
31 |
|
32 |
#ifdef ALLOW_COST_TEST |
33 |
C == Local variables |
34 |
integer i, j, k |
35 |
integer ig, jg |
36 |
integer itlo,ithi |
37 |
integer jtlo,jthi |
38 |
|
39 |
_RL vol_trans |
40 |
C-- index values at which the transport is to be calculated |
41 |
INTEGER iysecmin, iysecmax, ixsec |
42 |
PARAMETER (ixsec = 4, iysecmin = 3, iysecmax = 3) |
43 |
|
44 |
C |
45 |
jtlo = mybylo(mythid) |
46 |
jthi = mybyhi(mythid) |
47 |
itlo = mybxlo(mythid) |
48 |
ithi = mybxhi(mythid) |
49 |
|
50 |
DO bj=jtlo,jthi |
51 |
DO bi=itlo,ithi |
52 |
vol_trans = 0. |
53 |
DO J=1,sNy |
54 |
jg = myYGlobalLo-1+(bj-1)*sNy+J |
55 |
IF ( jg .ge. iysecmin .and. jg .le. iysecmax ) THEN |
56 |
DO I=1,sNx |
57 |
ig = myXGlobalLo-1+(bi-1)*sNx+I |
58 |
IF ( ig .eq. ixsec ) THEN |
59 |
DO K=1,Nr |
60 |
IF ( maskW(I,J,K,BI,BJ) .NE. 0. ) THEN |
61 |
vol_trans = vol_trans |
62 |
& + uVel(I,J,K,BI,BJ) |
63 |
& *_hFacW(I,J,K,BI,BJ) |
64 |
& *dyG(I,J,BI,BJ)*drF(K) |
65 |
ENDIF |
66 |
ENDDO |
67 |
ENDIF |
68 |
ENDDO |
69 |
ENDIF |
70 |
ENDDO |
71 |
objf_test(bi,bj) = vol_trans*1.0e-06 |
72 |
END DO |
73 |
END DO |
74 |
CML objf_test(1,1) = vVel(3,3,1,1,1)* _hFacS(3,3,1,1,1) |
75 |
Cml iLocOut = 6 |
76 |
Cml jLocOut = 35 |
77 |
Cml kLocOut = 1 |
78 |
Cml |
79 |
Cmlce some reference temperature |
80 |
Cml thetaRef = 24.0D0 |
81 |
Cml |
82 |
CmlC-- Calculate cost function on tile of this instance |
83 |
Cml do bj = jtlo,jthi |
84 |
Cml do bi = itlo,ithi |
85 |
Cml do j=1,sNy |
86 |
Cml jg = myYGlobalLo-1+(bj-1)*sNy+j |
87 |
Cml do i=1,sNx |
88 |
Cml ig = myXGlobalLo-1+(bi-1)*sNx+i |
89 |
Cml |
90 |
Cml if ((ig .eq. iLocOut) .and. (jg .eq. jLocOut)) then |
91 |
Cml write(*,'(a,3(x,i4),a,4(x,i4))') |
92 |
Cml & 'COST ',ig,jg,kLocOut,' TILE ',i,j,bi,bj |
93 |
Cml objf_test(bi,bj) = theta(i,j,kLocOut,bi,bj) |
94 |
Cml endif |
95 |
Cml |
96 |
Cml end do |
97 |
Cml end do |
98 |
Cml end do |
99 |
Cml end do |
100 |
|
101 |
#endif |
102 |
|
103 |
END |