1 |
heimbach |
1.4 |
C $Header: /u/gcmpack/MITgcm/pkg/ecco/cost_averagesinit.F,v 1.3 2005/09/01 05:32:56 heimbach Exp $ |
2 |
heimbach |
1.1 |
|
3 |
|
|
#include "COST_CPPOPTIONS.h" |
4 |
|
|
|
5 |
heimbach |
1.3 |
subroutine cost_averagesinit( mythid ) |
6 |
heimbach |
1.1 |
|
7 |
|
|
c ================================================================== |
8 |
heimbach |
1.3 |
c SUBROUTINE cost_averagesinit |
9 |
heimbach |
1.1 |
c ================================================================== |
10 |
|
|
c |
11 |
|
|
c o Set average fields for temperature, salinity, surface pressure, |
12 |
|
|
c and averaging counters to zero. The average fields are declared |
13 |
|
|
c in the header file ecco_cost.h. |
14 |
|
|
c |
15 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
16 |
|
|
c |
17 |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
18 |
|
|
c |
19 |
|
|
c - Restructured the code in order to create a package |
20 |
|
|
c for the MITgcmUV. |
21 |
|
|
c |
22 |
|
|
c ================================================================== |
23 |
heimbach |
1.3 |
c SUBROUTINE cost_averagesinit |
24 |
heimbach |
1.1 |
c ================================================================== |
25 |
|
|
|
26 |
|
|
implicit none |
27 |
|
|
|
28 |
|
|
c == global variables == |
29 |
|
|
|
30 |
|
|
#include "EEPARAMS.h" |
31 |
|
|
#include "SIZE.h" |
32 |
|
|
|
33 |
|
|
#include "ecco_cost.h" |
34 |
|
|
#include "ctrl_dummy.h" |
35 |
heimbach |
1.3 |
#ifdef ALLOW_SEAICE |
36 |
|
|
# include "SEAICE_COST.h" |
37 |
|
|
#endif |
38 |
heimbach |
1.1 |
|
39 |
|
|
c == routine arguments == |
40 |
|
|
|
41 |
|
|
integer mythid |
42 |
|
|
|
43 |
|
|
c == local variables == |
44 |
|
|
|
45 |
|
|
integer bi,bj |
46 |
|
|
integer i,j,k |
47 |
|
|
integer itlo,ithi |
48 |
|
|
integer jtlo,jthi |
49 |
|
|
integer jmin,jmax |
50 |
|
|
integer imin,imax |
51 |
|
|
|
52 |
|
|
c == end of interface == |
53 |
|
|
|
54 |
|
|
c-- Set the loop ranges. |
55 |
|
|
jtlo = mybylo(mythid) |
56 |
|
|
jthi = mybyhi(mythid) |
57 |
|
|
itlo = mybxlo(mythid) |
58 |
|
|
ithi = mybxhi(mythid) |
59 |
|
|
jmin = 1 |
60 |
|
|
jmax = sny |
61 |
|
|
imin = 1 |
62 |
|
|
imax = snx |
63 |
|
|
|
64 |
|
|
do bj = jtlo,jthi |
65 |
|
|
do bi = itlo,ithi |
66 |
|
|
|
67 |
|
|
#ifdef ALLOW_SSH_COST_CONTRIBUTION |
68 |
|
|
c-- Initialise surface pressure average. |
69 |
|
|
do j = jmin,jmax |
70 |
|
|
do i = imin,imax |
71 |
|
|
psbar(i,j,bi,bj) = 0. _d 0 |
72 |
|
|
enddo |
73 |
|
|
enddo |
74 |
|
|
|
75 |
|
|
xx_psbar_mean_dummy = 0. _d 0 |
76 |
|
|
#endif |
77 |
|
|
|
78 |
|
|
#if (defined (ALLOW_THETA_COST_CONTRIBUTION) || \ |
79 |
|
|
defined (ALLOW_CTDT_COST_CONTRIBUTION) || \ |
80 |
|
|
defined (ALLOW_XBT_COST_CONTRIBUTION) || \ |
81 |
|
|
defined (ALLOW_DRIFT_COST_CONTRIBUTION) || \ |
82 |
|
|
defined (ALLOW_OBCS_COST_CONTRIBUTION)) |
83 |
|
|
c-- Initialise temperature average (3d). |
84 |
|
|
do k = 1,nr |
85 |
|
|
do j = jmin,jmax |
86 |
|
|
do i = imin,imax |
87 |
|
|
tbar(i,j,k,bi,bj) = 0. _d 0 |
88 |
|
|
enddo |
89 |
|
|
enddo |
90 |
|
|
enddo |
91 |
|
|
xx_tbar_mean_dummy = 0. _d 0 |
92 |
heimbach |
1.4 |
nnztbar = nr |
93 |
heimbach |
1.2 |
#else |
94 |
|
|
#ifdef ALLOW_SST_COST_CONTRIBUTION |
95 |
|
|
c-- Initialise temperature average (2d). |
96 |
|
|
k = 1 |
97 |
|
|
do j = jmin,jmax |
98 |
|
|
do i = imin,imax |
99 |
|
|
tbar(i,j,bi,bj) = 0. _d 0 |
100 |
|
|
enddo |
101 |
|
|
enddo |
102 |
|
|
xx_tbar_mean_dummy = 0. _d 0 |
103 |
heimbach |
1.4 |
nnztbar = 1 |
104 |
heimbach |
1.2 |
#endif |
105 |
heimbach |
1.1 |
#endif |
106 |
|
|
|
107 |
|
|
#if (defined (ALLOW_SALT_COST_CONTRIBUTION) || \ |
108 |
|
|
defined (ALLOW_CTDS_COST_CONTRIBUTION) || \ |
109 |
|
|
defined (ALLOW_DRIFT_COST_CONTRIBUTION) || \ |
110 |
|
|
defined (ALLOW_OBCS_COST_CONTRIBUTION)) |
111 |
|
|
c-- Initialise salt average. |
112 |
|
|
do k = 1,nr |
113 |
|
|
do j = jmin,jmax |
114 |
|
|
do i = imin,imax |
115 |
|
|
sbar(i,j,k,bi,bj) = 0. _d 0 |
116 |
|
|
enddo |
117 |
|
|
enddo |
118 |
|
|
enddo |
119 |
|
|
xx_sbar_mean_dummy = 0. _d 0 |
120 |
heimbach |
1.4 |
nnzsbar = nr |
121 |
heimbach |
1.2 |
#else |
122 |
|
|
#ifdef ALLOW_SSS_COST_CONTRIBUTION |
123 |
|
|
c-- Initialise salinity average (2d). |
124 |
|
|
k = 1 |
125 |
|
|
do j = jmin,jmax |
126 |
|
|
do i = imin,imax |
127 |
|
|
sbar(i,j,bi,bj) = 0. _d 0 |
128 |
|
|
enddo |
129 |
|
|
enddo |
130 |
|
|
xx_sbar_mean_dummy = 0. _d 0 |
131 |
heimbach |
1.4 |
nnzsbar = 1 |
132 |
heimbach |
1.2 |
#endif |
133 |
heimbach |
1.1 |
#endif |
134 |
|
|
|
135 |
|
|
#if (defined (ALLOW_DRIFTER_COST_CONTRIBUTION) || \ |
136 |
heimbach |
1.2 |
defined (ALLOW_OBCS_COST_CONTRIBUTION)) |
137 |
heimbach |
1.1 |
c-- Initialise uvel, vvel average. |
138 |
|
|
do k = 1,nr |
139 |
|
|
do j = jmin,jmax |
140 |
|
|
do i = imin,imax |
141 |
|
|
ubar(i,j,k,bi,bj) = 0. _d 0 |
142 |
|
|
vbar(i,j,k,bi,bj) = 0. _d 0 |
143 |
|
|
enddo |
144 |
|
|
enddo |
145 |
|
|
enddo |
146 |
|
|
xx_ubar_mean_dummy = 0. _d 0 |
147 |
|
|
xx_vbar_mean_dummy = 0. _d 0 |
148 |
|
|
#endif |
149 |
|
|
|
150 |
|
|
#ifdef ALLOW_DRIFTW_COST_CONTRIBUTION |
151 |
|
|
c-- Initialise uvel, vvel average. |
152 |
|
|
do k = 1,nr |
153 |
|
|
do j = jmin,jmax |
154 |
|
|
do i = imin,imax |
155 |
|
|
wbar(i,j,k,bi,bj) = 0. _d 0 |
156 |
|
|
enddo |
157 |
|
|
enddo |
158 |
|
|
enddo |
159 |
|
|
xx_wbar_mean_dummy = 0. _d 0 |
160 |
|
|
#endif |
161 |
|
|
|
162 |
|
|
#ifdef ALLOW_SCAT_COST_CONTRIBUTION |
163 |
|
|
c-- Initialise salinity average (2d). |
164 |
|
|
do j = jmin,jmax |
165 |
|
|
do i = imin,imax |
166 |
|
|
tauxbar(i,j,bi,bj) = 0. _d 0 |
167 |
|
|
tauybar(i,j,bi,bj) = 0. _d 0 |
168 |
|
|
enddo |
169 |
|
|
enddo |
170 |
|
|
xx_taux_mean_dummy = 0. _d 0 |
171 |
|
|
xx_tauy_mean_dummy = 0. _d 0 |
172 |
|
|
#endif |
173 |
|
|
|
174 |
|
|
#ifdef ALLOW_MEAN_HFLUX_COST_CONTRIBUTION |
175 |
|
|
c-- Initialise salinity average (2d). |
176 |
|
|
do j = jmin,jmax |
177 |
|
|
do i = imin,imax |
178 |
|
|
hfluxbar(i,j,bi,bj) = 0. _d 0 |
179 |
|
|
enddo |
180 |
|
|
enddo |
181 |
|
|
xx_hflux_mean_dummy = 0. _d 0 |
182 |
|
|
#endif |
183 |
|
|
|
184 |
|
|
#ifdef ALLOW_MEAN_SFLUX_COST_CONTRIBUTION |
185 |
|
|
c-- Initialise salinity average (2d). |
186 |
|
|
do j = jmin,jmax |
187 |
|
|
do i = imin,imax |
188 |
|
|
sfluxbar(i,j,bi,bj) = 0. _d 0 |
189 |
|
|
enddo |
190 |
|
|
enddo |
191 |
|
|
xx_sflux_mean_dummy = 0. _d 0 |
192 |
heimbach |
1.2 |
#endif |
193 |
heimbach |
1.1 |
|
194 |
heimbach |
1.3 |
#ifdef ALLOW_SEAICE |
195 |
|
|
|
196 |
|
|
# ifdef ALLOW_SEAICE_COST_SMR_AREA |
197 |
|
|
c-- Initialise salinity average (2d). |
198 |
|
|
do j = jmin,jmax |
199 |
|
|
do i = imin,imax |
200 |
|
|
smrareabar(i,j,bi,bj) = 0. _d 0 |
201 |
|
|
enddo |
202 |
|
|
enddo |
203 |
|
|
xx_smrareabar_mean_dummy = 0. _d 0 |
204 |
|
|
# endif |
205 |
|
|
|
206 |
|
|
#endif |
207 |
|
|
|
208 |
heimbach |
1.1 |
enddo |
209 |
|
|
enddo |
210 |
|
|
|
211 |
|
|
return |
212 |
|
|
end |
213 |
|
|
|