/[MITgcm]/MITgcm/pkg/diagnostics/diagnostics_fill_state.F
ViewVC logotype

Contents of /MITgcm/pkg/diagnostics/diagnostics_fill_state.F

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


Revision 1.8 - (show annotations) (download)
Wed Jun 23 20:41:28 2004 UTC (19 years, 10 months ago) by molod
Branch: MAIN
CVS Tags: checkpoint53f_post
Changes since 1.7: +4 -3 lines
Fix bug in filling of etan **2

1 C $Header: /u/gcmpack/MITgcm/pkg/diagnostics/diagnostics_fill_state.F,v 1.7 2004/06/14 21:54:47 jmc Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 subroutine diagnostics_fill_state(myThid)
8 implicit none
9 #include "SIZE.h"
10 #include "EEPARAMS.h"
11 #include "GRID.h"
12 #include "DYNVARS.h"
13
14 integer myThid
15
16 #ifdef ALLOW_DIAGNOSTICS
17 _RL dummy(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
18 _RL dummys(1-OLx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy)
19 integer i,j,K,bi,bj
20 integer km1
21
22 call fill_diagnostics(myThid,'ETAN ',0,1,0,1,1,etaN)
23
24 do bj = myByLo(myThid), myByHi(myThid)
25 do bi = myBxLo(myThid), myBxHi(myThid)
26 do j = 1,sNy
27 do i = 1,sNx
28 dummys(i,j,bi,bj) = etaN(i,j,bi,bj)*etaN(i,j,bi,bj)
29 enddo
30 enddo
31 enddo
32 enddo
33 call fill_diagnostics(myThid,'ETANSQ ',0,1,0,1,1,dummys)
34
35 call fill_diagnostics(myThid,'UVEL ',0,Nr,0,1,1,uVel)
36 call fill_diagnostics(myThid,'VVEL ',0,Nr,0,1,1,vVel)
37 call fill_diagnostics(myThid,'WVEL ',0,Nr,0,1,1,wVel)
38 call fill_diagnostics(myThid,'THETA ',0,Nr,0,1,1,theta)
39 call fill_diagnostics(myThid,'SALT ',0,Nr,0,1,1,salt)
40
41 do bj = myByLo(myThid), myByHi(myThid)
42 do bi = myBxLo(myThid), myBxHi(myThid)
43 do K=1,Nr
44 do j = 1,sNy
45 do i = 1,sNx
46 dummy(i,j,K,bi,bj) = uVel(i,j,K,bi,bj)*uVel(i,j,K,bi,bj)
47 enddo
48 enddo
49 enddo
50 enddo
51 enddo
52 call fill_diagnostics(myThid,'UVELSQ ',0,Nr,0,1,1,dummy)
53
54 do bj = myByLo(myThid), myByHi(myThid)
55 do bi = myBxLo(myThid), myBxHi(myThid)
56 do K=1,Nr
57 do j = 1,sNy
58 do i = 1,sNx
59 dummy(i,j,K,bi,bj) = vVel(i,j,K,bi,bj)*vVel(i,j,K,bi,bj)
60 enddo
61 enddo
62 enddo
63 enddo
64 enddo
65 call fill_diagnostics(myThid,'VVELSQ ',0,Nr,0,1,1,dummy)
66
67 do bj = myByLo(myThid), myByHi(myThid)
68 do bi = myBxLo(myThid), myBxHi(myThid)
69 do K=1,Nr
70 do j = 1,sNy
71 do i = 1,sNx
72 dummy(i,j,K,bi,bj) = wVel(i,j,K,bi,bj)*wVel(i,j,K,bi,bj)
73 enddo
74 enddo
75 enddo
76 enddo
77 enddo
78 call fill_diagnostics(myThid,'WVELSQ ',0,Nr,0,1,1,dummy)
79
80 do bj = myByLo(myThid), myByHi(myThid)
81 do bi = myBxLo(myThid), myBxHi(myThid)
82 do K=1,Nr
83 do j = 1,sNy
84 do i = 1,sNx
85 dummy(i,j,K,bi,bj) = theta(i,j,K,bi,bj)*theta(i,j,K,bi,bj)
86 enddo
87 enddo
88 enddo
89 enddo
90 enddo
91 call fill_diagnostics(myThid,'THETASQ ',0,Nr,0,1,1,dummy)
92
93 do bj = myByLo(myThid), myByHi(myThid)
94 do bi = myBxLo(myThid), myBxHi(myThid)
95 do K=1,Nr
96 do j = 1,sNy
97 do i = 1,sNx
98 dummy(i,j,K,bi,bj) = salt(i,j,K,bi,bj)*salt(i,j,K,bi,bj)
99 enddo
100 enddo
101 enddo
102 enddo
103 enddo
104 call fill_diagnostics(myThid,'SALTSQ ',0,Nr,0,1,1,dummy)
105
106 do bj = myByLo(myThid), myByHi(myThid)
107 do bi = myBxLo(myThid), myBxHi(myThid)
108 do K=1,Nr
109 do j = 1,sNy
110 do i = 1,sNx
111 dummy(i,j,K,bi,bj) = uVel(i,j,K,bi,bj)*vVel(i,j,K,bi,bj)
112 enddo
113 enddo
114 enddo
115 enddo
116 enddo
117 call fill_diagnostics(myThid,'UVELVVEL',0,Nr,0,1,1,dummy)
118
119 do bj = myByLo(myThid), myByHi(myThid)
120 do bi = myBxLo(myThid), myBxHi(myThid)
121 do K=1,Nr
122 do j = 1,sNy
123 do i = 1,sNx
124 dummy(i,j,K,bi,bj) = uVel(i,j,K,bi,bj)*
125 & 0.5*(theta(i,j,K,bi,bj)+theta(i-1,j,K,bi,bj))
126 enddo
127 enddo
128 enddo
129 enddo
130 enddo
131 call fill_diagnostics(myThid,'UVELTH ',0,Nr,0,1,1,dummy)
132
133 do bj = myByLo(myThid), myByHi(myThid)
134 do bi = myBxLo(myThid), myBxHi(myThid)
135 do K=1,Nr
136 do j = 1,sNy
137 do i = 1,sNx
138 dummy(i,j,K,bi,bj) = vVel(i,j,K,bi,bj)*
139 & 0.5*(theta(i,j,K,bi,bj)+theta(i,j-1,K,bi,bj))
140 enddo
141 enddo
142 enddo
143 enddo
144 enddo
145 call fill_diagnostics(myThid,'VVELTH ',0,Nr,0,1,1,dummy)
146
147 do bj = myByLo(myThid), myByHi(myThid)
148 do bi = myBxLo(myThid), myBxHi(myThid)
149 do K=1,Nr
150 km1 = MAX(k-1,1)
151 do j = 1,sNy
152 do i = 1,sNx
153 dummy(i,j,K,bi,bj) = wVel(i,j,K,bi,bj)*0.5*
154 & (theta(i,j,K,bi,bj)+theta(i,j,km1,bi,bj))
155 enddo
156 enddo
157 enddo
158 enddo
159 enddo
160 call fill_diagnostics(myThid,'WVELTH ',0,Nr,0,1,1,dummy)
161
162 do bj = myByLo(myThid), myByHi(myThid)
163 do bi = myBxLo(myThid), myBxHi(myThid)
164 do K=1,Nr
165 do j = 1,sNy
166 do i = 1,sNx
167 dummy(i,j,K,bi,bj) = uVel(i,j,K,bi,bj)*
168 & 0.5*(salt(i,j,K,bi,bj)+salt(i-1,j,K,bi,bj))
169 enddo
170 enddo
171 enddo
172 enddo
173 enddo
174 call fill_diagnostics(myThid,'UVELSLT ',0,Nr,0,1,1,dummy)
175
176 do bj = myByLo(myThid), myByHi(myThid)
177 do bi = myBxLo(myThid), myBxHi(myThid)
178 do K=1,Nr
179 do j = 1,sNy
180 do i = 1,sNx
181 dummy(i,j,K,bi,bj) = vVel(i,j,K,bi,bj)*
182 & 0.5*(salt(i,j,K,bi,bj)+salt(i,j-1,K,bi,bj))
183 enddo
184 enddo
185 enddo
186 enddo
187 enddo
188 call fill_diagnostics(myThid,'VVELSLT ',0,Nr,0,1,1,dummy)
189
190 do bj = myByLo(myThid), myByHi(myThid)
191 do bi = myBxLo(myThid), myBxHi(myThid)
192 do K=1,Nr
193 km1 = MAX(k-1,1)
194 do j = 1,sNy
195 do i = 1,sNx
196 dummy(i,j,K,bi,bj) = wVel(i,j,K,bi,bj)*0.5*
197 & (salt(i,j,K,bi,bj)+salt(i,j,km1,bi,bj))
198 enddo
199 enddo
200 enddo
201 enddo
202 enddo
203 call fill_diagnostics(myThid,'WVELSLT ',0,Nr,0,1,1,dummy)
204
205 do bj = myByLo(myThid), myByHi(myThid)
206 do bi = myBxLo(myThid), myBxHi(myThid)
207 do K=1,Nr
208 do j = 1,sNy
209 do i = 1,sNx
210 dummy(i,j,K,bi,bj) = uVel(i,j,K,bi,bj)*hFacW(i,j,K,bi,bj)
211 enddo
212 enddo
213 enddo
214 enddo
215 enddo
216 call fill_diagnostics(myThid,'UVELMASS',0,Nr,0,1,1,salt)
217
218 do bj = myByLo(myThid), myByHi(myThid)
219 do bi = myBxLo(myThid), myBxHi(myThid)
220 do K=1,Nr
221 do j = 1,sNy
222 do i = 1,sNx
223 dummy(i,j,K,bi,bj) = vVel(i,j,K,bi,bj)*hFacS(i,j,K,bi,bj)
224 enddo
225 enddo
226 enddo
227 enddo
228 enddo
229 call fill_diagnostics(myThid,'VVELMASS',0,Nr,0,1,1,dummy)
230
231 do bj = myByLo(myThid), myByHi(myThid)
232 do bi = myBxLo(myThid), myBxHi(myThid)
233 do K=1,Nr
234 do j = 1,sNy
235 do i = 1,sNx
236 dummy(i,j,K,bi,bj) = uVel(i,j,K,bi,bj)*
237 . 0.5*(theta(i,j,K,bi,bj)+theta(i-1,j,K,bi,bj))
238 . * hFacW(i,j,K,bi,bj)
239 enddo
240 enddo
241 enddo
242 enddo
243 enddo
244 call fill_diagnostics(myThid,'UTHMASS ',0,Nr,0,1,1,dummy)
245
246 do bj = myByLo(myThid), myByHi(myThid)
247 do bi = myBxLo(myThid), myBxHi(myThid)
248 do K=1,Nr
249 do j = 1,sNy
250 do i = 1,sNx
251 dummy(i,j,K,bi,bj) = vVel(i,j,K,bi,bj)*
252 . 0.5*(theta(i,j,K,bi,bj)+theta(i,j-1,K,bi,bj))
253 . * hFacS(i,j,K,bi,bj)
254 enddo
255 enddo
256 enddo
257 enddo
258 enddo
259 call fill_diagnostics(myThid,'VTHMASS ',0,Nr,0,1,1,dummy)
260
261 do bj = myByLo(myThid), myByHi(myThid)
262 do bi = myBxLo(myThid), myBxHi(myThid)
263 do K=1,Nr
264 do j = 1,sNy
265 do i = 1,sNx
266 dummy(i,j,K,bi,bj) = uVel(i,j,K,bi,bj)*
267 . 0.5*(salt(i,j,K,bi,bj)+salt(i-1,j,K,bi,bj))
268 . * hFacW(i,j,K,bi,bj)
269 enddo
270 enddo
271 enddo
272 enddo
273 enddo
274 call fill_diagnostics(myThid,'USLTMASS',0,Nr,0,1,1,dummy)
275
276 do bj = myByLo(myThid), myByHi(myThid)
277 do bi = myBxLo(myThid), myBxHi(myThid)
278 do K=1,Nr
279 do j = 1,sNy
280 do i = 1,sNx
281 dummy(i,j,K,bi,bj) = vVel(i,j,K,bi,bj)*
282 . 0.5*(salt(i,j,K,bi,bj)+salt(i,j-1,K,bi,bj))
283 . * hFacS(i,j,K,bi,bj)
284 enddo
285 enddo
286 enddo
287 enddo
288 enddo
289 call fill_diagnostics(myThid,'VSLTMASS',0,Nr,0,1,1,dummy)
290
291
292 #endif /* ALLOW_DIAGNOSTICS */
293
294 return
295 end

  ViewVC Help
Powered by ViewVC 1.1.22