1 |
heimbach |
1.14 |
C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_init_varia.F,v 1.13 2012/08/10 22:57:20 gforget Exp $ |
2 |
jmc |
1.9 |
C $Name: $ |
3 |
heimbach |
1.1 |
|
4 |
jmc |
1.12 |
#include "COST_OPTIONS.h" |
5 |
heimbach |
1.1 |
|
6 |
|
|
subroutine cost_init_varia( mythid ) |
7 |
|
|
|
8 |
|
|
c ================================================================== |
9 |
|
|
c SUBROUTINE cost_init_varia |
10 |
|
|
c ================================================================== |
11 |
|
|
c |
12 |
|
|
c o Initialise the variable cost function part. |
13 |
|
|
c |
14 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
15 |
|
|
c |
16 |
|
|
c changed: Christian Eckert eckert@mit.edu 18-Apr-2000 |
17 |
|
|
c |
18 |
|
|
c - Restructured the code in order to create a package |
19 |
|
|
c for the MITgcmUV. |
20 |
|
|
c |
21 |
|
|
c ================================================================== |
22 |
|
|
c SUBROUTINE cost_init_varia |
23 |
|
|
c ================================================================== |
24 |
|
|
|
25 |
|
|
implicit none |
26 |
|
|
|
27 |
|
|
c == global variables == |
28 |
|
|
|
29 |
|
|
#include "EEPARAMS.h" |
30 |
|
|
#include "SIZE.h" |
31 |
|
|
|
32 |
|
|
#include "cost.h" |
33 |
|
|
|
34 |
|
|
c == routine arguments == |
35 |
|
|
|
36 |
|
|
integer mythid |
37 |
|
|
|
38 |
|
|
c == local variables == |
39 |
|
|
|
40 |
|
|
integer i,j,k |
41 |
|
|
integer bi,bj |
42 |
|
|
integer itlo,ithi |
43 |
|
|
integer jtlo,jthi |
44 |
|
|
|
45 |
|
|
c == external functions == |
46 |
|
|
|
47 |
|
|
c == end of interface == |
48 |
|
|
jtlo = mybylo(mythid) |
49 |
|
|
jthi = mybyhi(mythid) |
50 |
|
|
itlo = mybxlo(mythid) |
51 |
|
|
ithi = mybxhi(mythid) |
52 |
|
|
|
53 |
|
|
c-- Initialize the tiled cost function contributions. |
54 |
|
|
do bj = jtlo,jthi |
55 |
|
|
do bi = itlo,ithi |
56 |
gforget |
1.11 |
#if ( !defined (ALLOW_ECCO) || !defined (ALLOW_COST_ATLANTIC) ) |
57 |
heimbach |
1.1 |
objf_atl(bi,bj) = 0. _d 0 |
58 |
gforget |
1.11 |
#endif |
59 |
heimbach |
1.1 |
objf_test(bi,bj) = 0. _d 0 |
60 |
|
|
objf_tracer(bi,bj) = 0. _d 0 |
61 |
heimbach |
1.6 |
#ifdef ALLOW_COST_TRANSPORT |
62 |
|
|
objf_transport(bi,bj) = 0. _d 0 |
63 |
|
|
#endif |
64 |
|
|
#ifdef ALLOW_COST_DEPTH |
65 |
|
|
objf_depth(bi,bj) = 0. _d 0 |
66 |
|
|
#endif |
67 |
heimbach |
1.1 |
#ifdef ALLOW_COST_VECTOR |
68 |
|
|
do i=1,sNx |
69 |
|
|
objf_vector(i,bi,bj) = 0. _d 0 |
70 |
|
|
end do |
71 |
|
|
#endif |
72 |
|
|
c |
73 |
dfer |
1.7 |
#ifdef ALLOW_COST |
74 |
heimbach |
1.1 |
do k=1,nr |
75 |
|
|
do j=1,sNy |
76 |
|
|
do i=1,sNx |
77 |
|
|
cMeanTheta(i,j,k,bi,bj) = 0. _d 0 |
78 |
|
|
cMeanUVel(i,j,k,bi,bj) = 0. _d 0 |
79 |
|
|
cMeanVVel(i,j,k,bi,bj) = 0. _d 0 |
80 |
heimbach |
1.8 |
cMeanThetaUVel(i,j,k,bi,bj) = 0. _d 0 |
81 |
|
|
cMeanThetaVVel(i,j,k,bi,bj) = 0. _d 0 |
82 |
heimbach |
1.1 |
end do |
83 |
|
|
end do |
84 |
|
|
end do |
85 |
|
|
#endif |
86 |
|
|
c |
87 |
|
|
#ifdef ALLOW_COST_STATE_FINAL |
88 |
|
|
do j=1,sNy |
89 |
heimbach |
1.3 |
do i=1,sNx |
90 |
|
|
do k=1,4*Nr |
91 |
|
|
objf_state_final(i,j,bi,bj,k) = 0. _d 0 |
92 |
|
|
enddo |
93 |
|
|
objf_state_final(i,j,bi,bj,4*Nr+1) = 0. _d 0 |
94 |
heimbach |
1.1 |
cph No init. of cost_state_final here, |
95 |
|
|
cph because we need it in ADM*TLM |
96 |
|
|
end do |
97 |
|
|
end do |
98 |
|
|
#endif |
99 |
|
|
enddo |
100 |
|
|
enddo |
101 |
|
|
|
102 |
|
|
#ifdef ALLOW_SEAICE |
103 |
|
|
call seaice_cost_init_varia( mythid ) |
104 |
|
|
#endif |
105 |
|
|
|
106 |
heimbach |
1.14 |
#ifdef ALLOW_THSICE |
107 |
|
|
call thsice_cost_init_varia( mythid ) |
108 |
|
|
#endif |
109 |
|
|
|
110 |
heimbach |
1.1 |
#ifdef ALLOW_ECCO |
111 |
|
|
call ecco_cost_init_varia( mythid ) |
112 |
|
|
#endif |
113 |
|
|
|
114 |
|
|
c-- Initialise the "global" parts of the cost function. |
115 |
|
|
_BEGIN_MASTER( mythid ) |
116 |
|
|
fc = 0. _d 0 |
117 |
gforget |
1.13 |
glofc = 0. _d 0 |
118 |
heimbach |
1.1 |
_END_MASTER( mythid ) |
119 |
|
|
|
120 |
|
|
_BARRIER |
121 |
|
|
|
122 |
|
|
return |
123 |
|
|
end |