1 |
heimbach |
1.2 |
C $Header: /u/gcmpack/MITgcm_contrib/dgoldberg/streamice/cost_test.F,v 1.1 2012/07/19 18:53:11 dgoldberg Exp $ |
2 |
dgoldberg |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "COST_CPPOPTIONS.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_STREAMICE |
25 |
|
|
# include "STREAMICE.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 |
|
|
|
50 |
|
|
C-- Calculate mask for tracer cells (0 => land, 1 => water) |
51 |
|
|
k=1 |
52 |
|
|
|
53 |
|
|
C-- Calculate cost function on tile of this instance |
54 |
|
|
do bj = jtlo,jthi |
55 |
|
|
do bi = itlo,ithi |
56 |
|
|
do j=1,sNy |
57 |
|
|
jg = myYGlobalLo-1+(bj-1)*sNy+j |
58 |
|
|
do i=1,sNx |
59 |
|
|
ig = myXGlobalLo-1+(bi-1)*sNx+i |
60 |
|
|
|
61 |
|
|
print *, 'ph-str-test i,j ', |
62 |
|
|
& h_streamice(i,j,bi,bj) |
63 |
|
|
|
64 |
|
|
if (j.eq.1 .or. j.eq.sNy) then |
65 |
|
|
objf_test(bi,bj) = objf_test(bi,bj) |
66 |
|
|
& + u_streamice(i,j,bi,bj)**2 |
67 |
|
|
else |
68 |
|
|
objf_test(bi,bj) = objf_test(bi,bj) |
69 |
|
|
& + u_streamice(i,j,bi,bj)**2 |
70 |
|
|
endif |
71 |
|
|
|
72 |
|
|
end do |
73 |
|
|
end do |
74 |
|
|
end do |
75 |
|
|
end do |
76 |
|
|
|
77 |
|
|
#endif |
78 |
|
|
|
79 |
|
|
RETURN |
80 |
|
|
END |