/[MITgcm]/MITgcm/pkg/ecco/cost_averagesinit.F
ViewVC logotype

Contents of /MITgcm/pkg/ecco/cost_averagesinit.F

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


Revision 1.23 - (show annotations) (download)
Tue Nov 10 13:58:14 2015 UTC (8 years, 6 months ago) by atn
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, HEAD
Changes since 1.22: +1 -13 lines
Consolidate separate u/v components into total transports.  Fully works in ad mode.

1 C $Header: /u/gcmpack/MITgcm/pkg/ecco/cost_averagesinit.F,v 1.22 2015/11/10 08:05:06 atn Exp $
2 C $Name: $
3
4 #include "ECCO_OPTIONS.h"
5 #ifdef ALLOW_SEAICE
6 # include "SEAICE_OPTIONS.h"
7 #endif
8 #ifdef ALLOW_CTRL
9 # include "CTRL_OPTIONS.h"
10 #endif
11
12 subroutine cost_averagesinit( mythid )
13
14 c ==================================================================
15 c SUBROUTINE cost_averagesinit
16 c ==================================================================
17 c
18 c o Set average fields for temperature, salinity, surface pressure,
19 c and averaging counters to zero. The average fields are declared
20 c in the header file ecco_cost.h.
21 c
22 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
23 c
24 c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
25 c
26 c - Restructured the code in order to create a package
27 c for the MITgcmUV.
28 c
29 c ==================================================================
30 c SUBROUTINE cost_averagesinit
31 c ==================================================================
32
33 implicit none
34
35 c == global variables ==
36
37 #include "EEPARAMS.h"
38 #include "SIZE.h"
39
40 #include "ecco_cost.h"
41 #ifdef ALLOW_CTRL
42 # include "CTRL_SIZE.h"
43 # include "ctrl.h"
44 # include "ctrl_dummy.h"
45 #endif
46 #ifdef ALLOW_SEAICE
47 # include "SEAICE_COST.h"
48 #endif
49
50 c == routine arguments ==
51
52 integer mythid
53
54 c == local variables ==
55
56 integer bi,bj
57 integer i,j,k,kk
58 integer itlo,ithi
59 integer jtlo,jthi
60 integer jmin,jmax
61 integer imin,imax
62 integer irec
63
64 c == end of interface ==
65
66 c-- Set the loop ranges.
67 jtlo = mybylo(mythid)
68 jthi = mybyhi(mythid)
69 itlo = mybxlo(mythid)
70 ithi = mybxhi(mythid)
71 jmin = 1
72 jmax = sny
73 imin = 1
74 imax = snx
75
76 do bj = jtlo,jthi
77 do bi = itlo,ithi
78
79 #ifdef ALLOW_GENCOST_CONTRIBUTION
80 do k=1,NGENCOST
81 do j = jmin,jmax
82 do i = imin,imax
83 gencost_barfld(i,j,bi,bj,k) = 0. _d 0
84 gencost_modfld(i,j,bi,bj,k) = 0. _d 0
85 enddo
86 enddo
87 gencost_dummy(k) = 0. _d 0
88 enddo
89 #ifdef ALLOW_GENCOST3D
90 do kk=1,NGENCOST3D
91 do j = jmin,jmax
92 do i = imin,imax
93 do k = 1,nr
94 gencost_bar3d(i,j,k,bi,bj,kk) = 0. _d 0
95 gencost_mod3d(i,j,k,bi,bj,kk) = 0. _d 0
96 enddo
97 enddo
98 enddo
99 enddo
100 #endif
101 #endif
102
103 #ifdef ALLOW_SSH_COST_CONTRIBUTION
104 c-- Initialise surface pressure average.
105 do j = jmin,jmax
106 do i = imin,imax
107 psbar(i,j,bi,bj) = 0. _d 0
108 enddo
109 enddo
110
111 xx_psbar_mean_dummy = 0. _d 0
112 #endif
113
114 #ifdef ALLOW_BP_COST_CONTRIBUTION
115 c-- Initialise surface pressure average.
116 do j = jmin,jmax
117 do i = imin,imax
118 bpbar(i,j,bi,bj) = 0. _d 0
119 enddo
120 enddo
121
122 xx_bpbar_mean_dummy = 0. _d 0
123 #endif
124
125 #ifdef ALLOW_IESTAU_COST_CONTRIBUTION
126 c-- Initialize roundtrip travel time average
127 do j = jmin,jmax
128 do i = imin,imax
129 iestaubar(i,j,bi,bj) = 0. _d 0
130 enddo
131 enddo
132 xx_iestaubar_mean_dummy = 0. _d 0
133 #endif
134
135 #ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
136 c-- Initialise sigmaR average (3d).
137 do k = 1,nr
138 do j = jmin,jmax
139 do i = imin,imax
140 sigmaRbar(i,j,k,bi,bj) = 0. _d 0
141 enddo
142 enddo
143 enddo
144 xx_sigmaRbar_mean_dummy = 0. _d 0
145 nnzsigmaRbar = nr
146 #endif
147
148 #if (defined (ALLOW_THETA_COST_CONTRIBUTION) || \
149 defined (ALLOW_CTDT_COST_CONTRIBUTION) || \
150 defined (ALLOW_XBT_COST_CONTRIBUTION) || \
151 defined (ALLOW_DRIFT_COST_CONTRIBUTION) || \
152 defined (ALLOW_OBCS_COST_CONTRIBUTION))
153 c-- Initialise temperature average (3d).
154 do k = 1,nr
155 do j = jmin,jmax
156 do i = imin,imax
157 tbar(i,j,k,bi,bj) = 0. _d 0
158 enddo
159 enddo
160 enddo
161 xx_tbar_mean_dummy = 0. _d 0
162 nnztbar = nr
163 #else
164 #ifdef ALLOW_SST_COST_CONTRIBUTION
165 c-- Initialise temperature average (2d).
166 k = 1
167 do j = jmin,jmax
168 do i = imin,imax
169 tbar(i,j,bi,bj) = 0. _d 0
170 enddo
171 enddo
172 xx_tbar_mean_dummy = 0. _d 0
173 nnztbar = 1
174 #endif
175 #endif
176
177 #ifdef ALLOW_DAILYSST_COST_CONTRIBUTION
178 cph#ifdef ALLOW_SEAICE_COST_AREASST
179 c-- Initialise temperature average (2d).
180 do j = jmin,jmax
181 do i = imin,imax
182 sstbar(i,j,bi,bj) = 0. _d 0
183 enddo
184 enddo
185 xx_sstbar_mean_dummy = 0. _d 0
186 #endif
187
188 #if (defined (ALLOW_SALT_COST_CONTRIBUTION) || \
189 defined (ALLOW_CTDS_COST_CONTRIBUTION) || \
190 defined (ALLOW_DRIFT_COST_CONTRIBUTION) || \
191 defined (ALLOW_OBCS_COST_CONTRIBUTION))
192 c-- Initialise salt average.
193 do k = 1,nr
194 do j = jmin,jmax
195 do i = imin,imax
196 sbar(i,j,k,bi,bj) = 0. _d 0
197 enddo
198 enddo
199 enddo
200 xx_sbar_mean_dummy = 0. _d 0
201 nnzsbar = nr
202 #else
203 #ifdef ALLOW_SSS_COST_CONTRIBUTION
204 c-- Initialise salinity average (2d).
205 k = 1
206 do j = jmin,jmax
207 do i = imin,imax
208 sbar(i,j,bi,bj) = 0. _d 0
209 enddo
210 enddo
211 xx_sbar_mean_dummy = 0. _d 0
212 nnzsbar = 1
213 #endif
214 #endif
215
216 #if (defined (ALLOW_DRIFTER_COST_CONTRIBUTION) || \
217 defined (ALLOW_OBCS_COST_CONTRIBUTION))
218 c-- Initialise uvel, vvel average.
219 do k = 1,nr
220 do j = jmin,jmax
221 do i = imin,imax
222 ubar(i,j,k,bi,bj) = 0. _d 0
223 vbar(i,j,k,bi,bj) = 0. _d 0
224 enddo
225 enddo
226 enddo
227 xx_ubar_mean_dummy = 0. _d 0
228 xx_vbar_mean_dummy = 0. _d 0
229 #endif
230
231 #ifdef ALLOW_DRIFTW_COST_CONTRIBUTION
232 c-- Initialise uvel, vvel average.
233 do k = 1,nr
234 do j = jmin,jmax
235 do i = imin,imax
236 wbar(i,j,k,bi,bj) = 0. _d 0
237 enddo
238 enddo
239 enddo
240 xx_wbar_mean_dummy = 0. _d 0
241 #endif
242
243 #if (defined (ALLOW_SCAT_COST_CONTRIBUTION) || \
244 defined (ALLOW_DAILYSCAT_COST_CONTRIBUTION) )
245 c-- Initialise salinity average (2d).
246 do j = jmin,jmax
247 do i = imin,imax
248 tauxbar(i,j,bi,bj) = 0. _d 0
249 tauybar(i,j,bi,bj) = 0. _d 0
250 enddo
251 enddo
252 xx_taux_mean_dummy = 0. _d 0
253 xx_tauy_mean_dummy = 0. _d 0
254 #endif
255
256 #ifdef ALLOW_MEAN_HFLUX_COST_CONTRIBUTION
257 c-- Initialise salinity average (2d).
258 do j = jmin,jmax
259 do i = imin,imax
260 hfluxmeanbar(i,j,bi,bj) = 0. _d 0
261 enddo
262 enddo
263 xx_hflux_mean_dummy = 0. _d 0
264 #endif
265
266 #ifdef ALLOW_MEAN_SFLUX_COST_CONTRIBUTION
267 c-- Initialise salinity average (2d).
268 do j = jmin,jmax
269 do i = imin,imax
270 sfluxmeanbar(i,j,bi,bj) = 0. _d 0
271 enddo
272 enddo
273 xx_sflux_mean_dummy = 0. _d 0
274 #endif
275
276 #ifdef ALLOW_SEAICE
277
278 # ifdef ALLOW_SEAICE_COST_SMR_AREA
279 c-- Initialise salinity average (2d).
280 do j = jmin,jmax
281 do i = imin,imax
282 smrareabar(i,j,bi,bj) = 0. _d 0
283 smrsstbar(i,j,bi,bj) = 0. _d 0
284 smrsssbar(i,j,bi,bj) = 0. _d 0
285 enddo
286 enddo
287 xx_smrareabar_mean_dummy = 0. _d 0
288 xx_smrsstbar_mean_dummy = 0. _d 0
289 xx_smrsssbar_mean_dummy = 0. _d 0
290 # endif
291
292 #endif
293
294 #ifdef ALLOW_TRANSPORT_COST_CONTRIBUTION
295 do irec = 1, ndaysrec
296 transpbar(irec,bi,bj) = 0. _d 0
297 enddo
298 #endif
299
300 enddo
301 enddo
302
303 return
304 end
305

  ViewVC Help
Powered by ViewVC 1.1.22