/[MITgcm]/MITgcm/verification/bottom_ctrl_5x5/code_ad/cost_test.F
ViewVC logotype

Contents of /MITgcm/verification/bottom_ctrl_5x5/code_ad/cost_test.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Tue Oct 9 02:36:41 2007 UTC (16 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint59j, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.1: +2 -1 lines
add missing cvs $Header:$ or $Name:$

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

  ViewVC Help
Powered by ViewVC 1.1.22