/[MITgcm]/MITgcm/pkg/cost/cost_test.F
ViewVC logotype

Contents of /MITgcm/pkg/cost/cost_test.F

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


Revision 1.8 - (show annotations) (download)
Mon Nov 19 14:00:39 2007 UTC (16 years, 7 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62c, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62x, checkpoint60, checkpoint61, checkpoint62, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59k, checkpoint62b, checkpoint61f, checkpoint61n, checkpoint61q, checkpoint61e, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.7: +6 -1 lines
Quick hack to switch to "global" cost function.

1 C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_test.F,v 1.7 2007/10/08 23:59:21 jmc Exp $
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 _RL thetaRef
35
36 integer i, j, k
37 integer ig, jg
38 integer itlo,ithi
39 integer jtlo,jthi
40
41 jtlo = mybylo(mythid)
42 jthi = mybyhi(mythid)
43 itlo = mybxlo(mythid)
44 ithi = mybxhi(mythid)
45
46 if ( useCubedSphereExchange) then
47 iLocOut = 7
48 jLocOut = 28
49 kLocOut = 1
50 else
51 iLocOut = 80
52 jLocOut = 30
53 kLocOut = 1
54 endif
55
56 ce some reference temperature
57 thetaRef = 24.0D0
58
59 C-- Calculate mask for tracer cells (0 => land, 1 => water)
60 k=1
61
62 C-- Calculate cost function on tile of this instance
63 do bj = jtlo,jthi
64 do bi = itlo,ithi
65 do j=1,sNy
66 jg = myYGlobalLo-1+(bj-1)*sNy+j
67 do i=1,sNx
68 ig = myXGlobalLo-1+(bi-1)*sNx+i
69
70 #ifndef ALLOW_COST_TSQUARED
71 if ((ig .eq. iLocOut) .and. (jg .eq. jLocOut)) then
72 write(*,'(a,3(x,i4),a,4(x,i4))')
73 & 'COST ',ig,jg,kLocOut,' TILE ',i,j,bi,bj
74 objf_test(bi,bj) = theta(i,j,kLocOut,bi,bj)
75 cph(
76 print *, 'ph-cost ', ig, jg, kLocOut,
77 & theta(i,j,kLocOut,bi,bj)
78 cph)
79 endif
80 #else
81 objf_test(bi,bj) = objf_test(bi,bj) +
82 & theta(i,j,kLocOut,bi,bj)**2
83 #endif
84
85 end do
86 end do
87 end do
88 end do
89
90 #endif
91
92 END

  ViewVC Help
Powered by ViewVC 1.1.22