em_allocs.inc

References to this file elsewhere.
1 !STARTOFREGISTRYGENERATEDINCLUDE 'inc/em_allocs.inc'
2 !
3 ! WARNING This file is generated automatically by use_registry
4 ! using the data base in the file named Registry.
5 ! Do not edit.  Your changes to this file will be lost.
6 !
7 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
8 ALLOCATE(grid%lu_index(sm31:em31,sm32:em32),STAT=ierr)
9  if (ierr.ne.0) then
10  CALL wrf_error_fatal ( &
11 'frame/module_domain.f: Failed to allocate grid%lu_index(sm31:em31,sm32:em32). ')
12  endif
13 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%lu_index=initial_data_value
14 IF(.NOT.inter_domain)THEN
15 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
16 ALLOCATE(grid%lu_mask(sm31:em31,sm32:em32),STAT=ierr)
17  if (ierr.ne.0) then
18  CALL wrf_error_fatal ( &
19 'frame/module_domain.f: Failed to allocate grid%lu_mask(sm31:em31,sm32:em32). ')
20  endif
21 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%lu_mask=initial_data_value
22 ELSE
23 ALLOCATE(grid%lu_mask(1,1),STAT=ierr)
24  if (ierr.ne.0) then
25  CALL wrf_error_fatal ( &
26 'frame/module_domain.f: Failed to allocate grid%lu_mask(1,1).  ')
27  endif
28 ENDIF
29 IF(.NOT.inter_domain)THEN
30 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((model_config_rec%num_metgrid_levels)-(1)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
31 ALLOCATE(grid%em_qv_gc(sm31:em31,1:model_config_rec%num_metgrid_levels,sm32:em32),STAT=ierr)
32  if (ierr.ne.0) then
33  CALL wrf_error_fatal ( &
34 'frame/module_domain.f: Failed to allocate grid%em_qv_gc(sm31:em31,1:model_config_rec%num_metgrid_levels,sm32:em32). ')
35  endif
36 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_qv_gc=initial_data_value
37 ELSE
38 ALLOCATE(grid%em_qv_gc(1,1,1),STAT=ierr)
39  if (ierr.ne.0) then
40  CALL wrf_error_fatal ( &
41 'frame/module_domain.f: Failed to allocate grid%em_qv_gc(1,1,1).  ')
42  endif
43 ENDIF
44 IF(IAND(1,tl).NE.0)THEN
45 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
46 ALLOCATE(grid%em_u_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
47  if (ierr.ne.0) then
48  CALL wrf_error_fatal ( &
49 'frame/module_domain.f: Failed to allocate grid%em_u_1(sm31:em31,sm32:em32,sm33:em33). ')
50  endif
51 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_1=initial_data_value
52 ELSE
53 ALLOCATE(grid%em_u_1(1,1,1),STAT=ierr)
54  if (ierr.ne.0) then
55  CALL wrf_error_fatal ( &
56 'frame/module_domain.f: Failed to allocate grid%em_u_1(1,1,1).  ')
57  endif
58 ENDIF
59 IF(IAND(2,tl).NE.0)THEN
60 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
61 ALLOCATE(grid%em_u_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
62  if (ierr.ne.0) then
63  CALL wrf_error_fatal ( &
64 'frame/module_domain.f: Failed to allocate grid%em_u_2(sm31:em31,sm32:em32,sm33:em33). ')
65  endif
66 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_2=initial_data_value
67 ELSE
68 ALLOCATE(grid%em_u_2(1,1,1),STAT=ierr)
69  if (ierr.ne.0) then
70  CALL wrf_error_fatal ( &
71 'frame/module_domain.f: Failed to allocate grid%em_u_2(1,1,1).  ')
72  endif
73 ENDIF
74 IF(.NOT.inter_domain)THEN
75 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
76 ALLOCATE(grid%em_u_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
77  if (ierr.ne.0) then
78  CALL wrf_error_fatal ( &
79 'frame/module_domain.f: Failed to allocate grid%em_u_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
80  endif
81 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_bxs=initial_data_value
82 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
83 ALLOCATE(grid%em_u_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
84  if (ierr.ne.0) then
85  CALL wrf_error_fatal ( &
86 'frame/module_domain.f: Failed to allocate grid%em_u_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
87  endif
88 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_bxe=initial_data_value
89 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
90 ALLOCATE(grid%em_u_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
91  if (ierr.ne.0) then
92  CALL wrf_error_fatal ( &
93 'frame/module_domain.f: Failed to allocate grid%em_u_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
94  endif
95 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_bys=initial_data_value
96 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
97 ALLOCATE(grid%em_u_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
98  if (ierr.ne.0) then
99  CALL wrf_error_fatal ( &
100 'frame/module_domain.f: Failed to allocate grid%em_u_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
101  endif
102 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_bye=initial_data_value
103 ELSE
104 ALLOCATE(grid%em_u_bxs(1,1,1),STAT=ierr)
105  if (ierr.ne.0) then
106  CALL wrf_error_fatal ( &
107 'frame/module_domain.f: Failed to allocate grid%em_u_bxs(1,1,1).  ')
108  endif
109 ALLOCATE(grid%em_u_bxe(1,1,1),STAT=ierr)
110  if (ierr.ne.0) then
111  CALL wrf_error_fatal ( &
112 'frame/module_domain.f: Failed to allocate grid%em_u_bxe(1,1,1).  ')
113  endif
114 ALLOCATE(grid%em_u_bys(1,1,1),STAT=ierr)
115  if (ierr.ne.0) then
116  CALL wrf_error_fatal ( &
117 'frame/module_domain.f: Failed to allocate grid%em_u_bys(1,1,1).  ')
118  endif
119 ALLOCATE(grid%em_u_bye(1,1,1),STAT=ierr)
120  if (ierr.ne.0) then
121  CALL wrf_error_fatal ( &
122 'frame/module_domain.f: Failed to allocate grid%em_u_bye(1,1,1).  ')
123  endif
124 ENDIF
125 IF(.NOT.inter_domain)THEN
126 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
127 ALLOCATE(grid%em_u_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
128  if (ierr.ne.0) then
129  CALL wrf_error_fatal ( &
130 'frame/module_domain.f: Failed to allocate grid%em_u_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
131  endif
132 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_btxs=initial_data_value
133 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
134 ALLOCATE(grid%em_u_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
135  if (ierr.ne.0) then
136  CALL wrf_error_fatal ( &
137 'frame/module_domain.f: Failed to allocate grid%em_u_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
138  endif
139 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_btxe=initial_data_value
140 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
141 ALLOCATE(grid%em_u_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
142  if (ierr.ne.0) then
143  CALL wrf_error_fatal ( &
144 'frame/module_domain.f: Failed to allocate grid%em_u_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
145  endif
146 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_btys=initial_data_value
147 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
148 ALLOCATE(grid%em_u_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
149  if (ierr.ne.0) then
150  CALL wrf_error_fatal ( &
151 'frame/module_domain.f: Failed to allocate grid%em_u_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
152  endif
153 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_u_btye=initial_data_value
154 ELSE
155 ALLOCATE(grid%em_u_btxs(1,1,1),STAT=ierr)
156  if (ierr.ne.0) then
157  CALL wrf_error_fatal ( &
158 'frame/module_domain.f: Failed to allocate grid%em_u_btxs(1,1,1).  ')
159  endif
160 ALLOCATE(grid%em_u_btxe(1,1,1),STAT=ierr)
161  if (ierr.ne.0) then
162  CALL wrf_error_fatal ( &
163 'frame/module_domain.f: Failed to allocate grid%em_u_btxe(1,1,1).  ')
164  endif
165 ALLOCATE(grid%em_u_btys(1,1,1),STAT=ierr)
166  if (ierr.ne.0) then
167  CALL wrf_error_fatal ( &
168 'frame/module_domain.f: Failed to allocate grid%em_u_btys(1,1,1).  ')
169  endif
170 ALLOCATE(grid%em_u_btye(1,1,1),STAT=ierr)
171  if (ierr.ne.0) then
172  CALL wrf_error_fatal ( &
173 'frame/module_domain.f: Failed to allocate grid%em_u_btye(1,1,1).  ')
174  endif
175 ENDIF
176 IF(IAND(1,tl).NE.0)THEN
177 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
178 ALLOCATE(grid%a_u_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
179  if (ierr.ne.0) then
180  CALL wrf_error_fatal ( &
181 'frame/module_domain.f: Failed to allocate grid%a_u_1(sm31:em31,sm32:em32,sm33:em33). ')
182  endif
183 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_1=initial_data_value
184 ELSE
185 ALLOCATE(grid%a_u_1(1,1,1),STAT=ierr)
186  if (ierr.ne.0) then
187  CALL wrf_error_fatal ( &
188 'frame/module_domain.f: Failed to allocate grid%a_u_1(1,1,1).  ')
189  endif
190 ENDIF
191 IF(IAND(2,tl).NE.0)THEN
192 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
193 ALLOCATE(grid%a_u_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
194  if (ierr.ne.0) then
195  CALL wrf_error_fatal ( &
196 'frame/module_domain.f: Failed to allocate grid%a_u_2(sm31:em31,sm32:em32,sm33:em33). ')
197  endif
198 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_2=initial_data_value
199 ELSE
200 ALLOCATE(grid%a_u_2(1,1,1),STAT=ierr)
201  if (ierr.ne.0) then
202  CALL wrf_error_fatal ( &
203 'frame/module_domain.f: Failed to allocate grid%a_u_2(1,1,1).  ')
204  endif
205 ENDIF
206 IF(.NOT.inter_domain)THEN
207 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
208 ALLOCATE(grid%a_u_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
209  if (ierr.ne.0) then
210  CALL wrf_error_fatal ( &
211 'frame/module_domain.f: Failed to allocate grid%a_u_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
212  endif
213 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_bxs=initial_data_value
214 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
215 ALLOCATE(grid%a_u_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
216  if (ierr.ne.0) then
217  CALL wrf_error_fatal ( &
218 'frame/module_domain.f: Failed to allocate grid%a_u_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
219  endif
220 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_bxe=initial_data_value
221 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
222 ALLOCATE(grid%a_u_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
223  if (ierr.ne.0) then
224  CALL wrf_error_fatal ( &
225 'frame/module_domain.f: Failed to allocate grid%a_u_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
226  endif
227 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_bys=initial_data_value
228 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
229 ALLOCATE(grid%a_u_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
230  if (ierr.ne.0) then
231  CALL wrf_error_fatal ( &
232 'frame/module_domain.f: Failed to allocate grid%a_u_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
233  endif
234 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_bye=initial_data_value
235 ELSE
236 ALLOCATE(grid%a_u_bxs(1,1,1),STAT=ierr)
237  if (ierr.ne.0) then
238  CALL wrf_error_fatal ( &
239 'frame/module_domain.f: Failed to allocate grid%a_u_bxs(1,1,1).  ')
240  endif
241 ALLOCATE(grid%a_u_bxe(1,1,1),STAT=ierr)
242  if (ierr.ne.0) then
243  CALL wrf_error_fatal ( &
244 'frame/module_domain.f: Failed to allocate grid%a_u_bxe(1,1,1).  ')
245  endif
246 ALLOCATE(grid%a_u_bys(1,1,1),STAT=ierr)
247  if (ierr.ne.0) then
248  CALL wrf_error_fatal ( &
249 'frame/module_domain.f: Failed to allocate grid%a_u_bys(1,1,1).  ')
250  endif
251 ALLOCATE(grid%a_u_bye(1,1,1),STAT=ierr)
252  if (ierr.ne.0) then
253  CALL wrf_error_fatal ( &
254 'frame/module_domain.f: Failed to allocate grid%a_u_bye(1,1,1).  ')
255  endif
256 ENDIF
257 IF(.NOT.inter_domain)THEN
258 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
259 ALLOCATE(grid%a_u_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
260  if (ierr.ne.0) then
261  CALL wrf_error_fatal ( &
262 'frame/module_domain.f: Failed to allocate grid%a_u_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
263  endif
264 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_btxs=initial_data_value
265 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
266 ALLOCATE(grid%a_u_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
267  if (ierr.ne.0) then
268  CALL wrf_error_fatal ( &
269 'frame/module_domain.f: Failed to allocate grid%a_u_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
270  endif
271 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_btxe=initial_data_value
272 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
273 ALLOCATE(grid%a_u_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
274  if (ierr.ne.0) then
275  CALL wrf_error_fatal ( &
276 'frame/module_domain.f: Failed to allocate grid%a_u_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
277  endif
278 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_btys=initial_data_value
279 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
280 ALLOCATE(grid%a_u_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
281  if (ierr.ne.0) then
282  CALL wrf_error_fatal ( &
283 'frame/module_domain.f: Failed to allocate grid%a_u_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
284  endif
285 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_u_btye=initial_data_value
286 ELSE
287 ALLOCATE(grid%a_u_btxs(1,1,1),STAT=ierr)
288  if (ierr.ne.0) then
289  CALL wrf_error_fatal ( &
290 'frame/module_domain.f: Failed to allocate grid%a_u_btxs(1,1,1).  ')
291  endif
292 ALLOCATE(grid%a_u_btxe(1,1,1),STAT=ierr)
293  if (ierr.ne.0) then
294  CALL wrf_error_fatal ( &
295 'frame/module_domain.f: Failed to allocate grid%a_u_btxe(1,1,1).  ')
296  endif
297 ALLOCATE(grid%a_u_btys(1,1,1),STAT=ierr)
298  if (ierr.ne.0) then
299  CALL wrf_error_fatal ( &
300 'frame/module_domain.f: Failed to allocate grid%a_u_btys(1,1,1).  ')
301  endif
302 ALLOCATE(grid%a_u_btye(1,1,1),STAT=ierr)
303  if (ierr.ne.0) then
304  CALL wrf_error_fatal ( &
305 'frame/module_domain.f: Failed to allocate grid%a_u_btye(1,1,1).  ')
306  endif
307 ENDIF
308 IF(IAND(1,tl).NE.0)THEN
309 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
310 ALLOCATE(grid%g_u_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
311  if (ierr.ne.0) then
312  CALL wrf_error_fatal ( &
313 'frame/module_domain.f: Failed to allocate grid%g_u_1(sm31:em31,sm32:em32,sm33:em33). ')
314  endif
315 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_1=initial_data_value
316 ELSE
317 ALLOCATE(grid%g_u_1(1,1,1),STAT=ierr)
318  if (ierr.ne.0) then
319  CALL wrf_error_fatal ( &
320 'frame/module_domain.f: Failed to allocate grid%g_u_1(1,1,1).  ')
321  endif
322 ENDIF
323 IF(IAND(2,tl).NE.0)THEN
324 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
325 ALLOCATE(grid%g_u_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
326  if (ierr.ne.0) then
327  CALL wrf_error_fatal ( &
328 'frame/module_domain.f: Failed to allocate grid%g_u_2(sm31:em31,sm32:em32,sm33:em33). ')
329  endif
330 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_2=initial_data_value
331 ELSE
332 ALLOCATE(grid%g_u_2(1,1,1),STAT=ierr)
333  if (ierr.ne.0) then
334  CALL wrf_error_fatal ( &
335 'frame/module_domain.f: Failed to allocate grid%g_u_2(1,1,1).  ')
336  endif
337 ENDIF
338 IF(.NOT.inter_domain)THEN
339 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
340 ALLOCATE(grid%g_u_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
341  if (ierr.ne.0) then
342  CALL wrf_error_fatal ( &
343 'frame/module_domain.f: Failed to allocate grid%g_u_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
344  endif
345 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_bxs=initial_data_value
346 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
347 ALLOCATE(grid%g_u_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
348  if (ierr.ne.0) then
349  CALL wrf_error_fatal ( &
350 'frame/module_domain.f: Failed to allocate grid%g_u_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
351  endif
352 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_bxe=initial_data_value
353 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
354 ALLOCATE(grid%g_u_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
355  if (ierr.ne.0) then
356  CALL wrf_error_fatal ( &
357 'frame/module_domain.f: Failed to allocate grid%g_u_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
358  endif
359 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_bys=initial_data_value
360 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
361 ALLOCATE(grid%g_u_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
362  if (ierr.ne.0) then
363  CALL wrf_error_fatal ( &
364 'frame/module_domain.f: Failed to allocate grid%g_u_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
365  endif
366 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_bye=initial_data_value
367 ELSE
368 ALLOCATE(grid%g_u_bxs(1,1,1),STAT=ierr)
369  if (ierr.ne.0) then
370  CALL wrf_error_fatal ( &
371 'frame/module_domain.f: Failed to allocate grid%g_u_bxs(1,1,1).  ')
372  endif
373 ALLOCATE(grid%g_u_bxe(1,1,1),STAT=ierr)
374  if (ierr.ne.0) then
375  CALL wrf_error_fatal ( &
376 'frame/module_domain.f: Failed to allocate grid%g_u_bxe(1,1,1).  ')
377  endif
378 ALLOCATE(grid%g_u_bys(1,1,1),STAT=ierr)
379  if (ierr.ne.0) then
380  CALL wrf_error_fatal ( &
381 'frame/module_domain.f: Failed to allocate grid%g_u_bys(1,1,1).  ')
382  endif
383 ALLOCATE(grid%g_u_bye(1,1,1),STAT=ierr)
384  if (ierr.ne.0) then
385  CALL wrf_error_fatal ( &
386 'frame/module_domain.f: Failed to allocate grid%g_u_bye(1,1,1).  ')
387  endif
388 ENDIF
389 IF(.NOT.inter_domain)THEN
390 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
391 ALLOCATE(grid%g_u_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
392  if (ierr.ne.0) then
393  CALL wrf_error_fatal ( &
394 'frame/module_domain.f: Failed to allocate grid%g_u_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
395  endif
396 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_btxs=initial_data_value
397 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
398 ALLOCATE(grid%g_u_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
399  if (ierr.ne.0) then
400  CALL wrf_error_fatal ( &
401 'frame/module_domain.f: Failed to allocate grid%g_u_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
402  endif
403 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_btxe=initial_data_value
404 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
405 ALLOCATE(grid%g_u_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
406  if (ierr.ne.0) then
407  CALL wrf_error_fatal ( &
408 'frame/module_domain.f: Failed to allocate grid%g_u_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
409  endif
410 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_btys=initial_data_value
411 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
412 ALLOCATE(grid%g_u_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
413  if (ierr.ne.0) then
414  CALL wrf_error_fatal ( &
415 'frame/module_domain.f: Failed to allocate grid%g_u_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
416  endif
417 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_u_btye=initial_data_value
418 ELSE
419 ALLOCATE(grid%g_u_btxs(1,1,1),STAT=ierr)
420  if (ierr.ne.0) then
421  CALL wrf_error_fatal ( &
422 'frame/module_domain.f: Failed to allocate grid%g_u_btxs(1,1,1).  ')
423  endif
424 ALLOCATE(grid%g_u_btxe(1,1,1),STAT=ierr)
425  if (ierr.ne.0) then
426  CALL wrf_error_fatal ( &
427 'frame/module_domain.f: Failed to allocate grid%g_u_btxe(1,1,1).  ')
428  endif
429 ALLOCATE(grid%g_u_btys(1,1,1),STAT=ierr)
430  if (ierr.ne.0) then
431  CALL wrf_error_fatal ( &
432 'frame/module_domain.f: Failed to allocate grid%g_u_btys(1,1,1).  ')
433  endif
434 ALLOCATE(grid%g_u_btye(1,1,1),STAT=ierr)
435  if (ierr.ne.0) then
436  CALL wrf_error_fatal ( &
437 'frame/module_domain.f: Failed to allocate grid%g_u_btye(1,1,1).  ')
438  endif
439 ENDIF
440 IF(IAND(1,tl).NE.0)THEN
441 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
442 ALLOCATE(grid%em_v_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
443  if (ierr.ne.0) then
444  CALL wrf_error_fatal ( &
445 'frame/module_domain.f: Failed to allocate grid%em_v_1(sm31:em31,sm32:em32,sm33:em33). ')
446  endif
447 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_1=initial_data_value
448 ELSE
449 ALLOCATE(grid%em_v_1(1,1,1),STAT=ierr)
450  if (ierr.ne.0) then
451  CALL wrf_error_fatal ( &
452 'frame/module_domain.f: Failed to allocate grid%em_v_1(1,1,1).  ')
453  endif
454 ENDIF
455 IF(IAND(2,tl).NE.0)THEN
456 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
457 ALLOCATE(grid%em_v_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
458  if (ierr.ne.0) then
459  CALL wrf_error_fatal ( &
460 'frame/module_domain.f: Failed to allocate grid%em_v_2(sm31:em31,sm32:em32,sm33:em33). ')
461  endif
462 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_2=initial_data_value
463 ELSE
464 ALLOCATE(grid%em_v_2(1,1,1),STAT=ierr)
465  if (ierr.ne.0) then
466  CALL wrf_error_fatal ( &
467 'frame/module_domain.f: Failed to allocate grid%em_v_2(1,1,1).  ')
468  endif
469 ENDIF
470 IF(.NOT.inter_domain)THEN
471 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
472 ALLOCATE(grid%em_v_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
473  if (ierr.ne.0) then
474  CALL wrf_error_fatal ( &
475 'frame/module_domain.f: Failed to allocate grid%em_v_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
476  endif
477 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_bxs=initial_data_value
478 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
479 ALLOCATE(grid%em_v_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
480  if (ierr.ne.0) then
481  CALL wrf_error_fatal ( &
482 'frame/module_domain.f: Failed to allocate grid%em_v_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
483  endif
484 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_bxe=initial_data_value
485 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
486 ALLOCATE(grid%em_v_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
487  if (ierr.ne.0) then
488  CALL wrf_error_fatal ( &
489 'frame/module_domain.f: Failed to allocate grid%em_v_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
490  endif
491 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_bys=initial_data_value
492 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
493 ALLOCATE(grid%em_v_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
494  if (ierr.ne.0) then
495  CALL wrf_error_fatal ( &
496 'frame/module_domain.f: Failed to allocate grid%em_v_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
497  endif
498 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_bye=initial_data_value
499 ELSE
500 ALLOCATE(grid%em_v_bxs(1,1,1),STAT=ierr)
501  if (ierr.ne.0) then
502  CALL wrf_error_fatal ( &
503 'frame/module_domain.f: Failed to allocate grid%em_v_bxs(1,1,1).  ')
504  endif
505 ALLOCATE(grid%em_v_bxe(1,1,1),STAT=ierr)
506  if (ierr.ne.0) then
507  CALL wrf_error_fatal ( &
508 'frame/module_domain.f: Failed to allocate grid%em_v_bxe(1,1,1).  ')
509  endif
510 ALLOCATE(grid%em_v_bys(1,1,1),STAT=ierr)
511  if (ierr.ne.0) then
512  CALL wrf_error_fatal ( &
513 'frame/module_domain.f: Failed to allocate grid%em_v_bys(1,1,1).  ')
514  endif
515 ALLOCATE(grid%em_v_bye(1,1,1),STAT=ierr)
516  if (ierr.ne.0) then
517  CALL wrf_error_fatal ( &
518 'frame/module_domain.f: Failed to allocate grid%em_v_bye(1,1,1).  ')
519  endif
520 ENDIF
521 IF(.NOT.inter_domain)THEN
522 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
523 ALLOCATE(grid%em_v_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
524  if (ierr.ne.0) then
525  CALL wrf_error_fatal ( &
526 'frame/module_domain.f: Failed to allocate grid%em_v_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
527  endif
528 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_btxs=initial_data_value
529 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
530 ALLOCATE(grid%em_v_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
531  if (ierr.ne.0) then
532  CALL wrf_error_fatal ( &
533 'frame/module_domain.f: Failed to allocate grid%em_v_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
534  endif
535 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_btxe=initial_data_value
536 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
537 ALLOCATE(grid%em_v_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
538  if (ierr.ne.0) then
539  CALL wrf_error_fatal ( &
540 'frame/module_domain.f: Failed to allocate grid%em_v_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
541  endif
542 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_btys=initial_data_value
543 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
544 ALLOCATE(grid%em_v_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
545  if (ierr.ne.0) then
546  CALL wrf_error_fatal ( &
547 'frame/module_domain.f: Failed to allocate grid%em_v_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
548  endif
549 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_v_btye=initial_data_value
550 ELSE
551 ALLOCATE(grid%em_v_btxs(1,1,1),STAT=ierr)
552  if (ierr.ne.0) then
553  CALL wrf_error_fatal ( &
554 'frame/module_domain.f: Failed to allocate grid%em_v_btxs(1,1,1).  ')
555  endif
556 ALLOCATE(grid%em_v_btxe(1,1,1),STAT=ierr)
557  if (ierr.ne.0) then
558  CALL wrf_error_fatal ( &
559 'frame/module_domain.f: Failed to allocate grid%em_v_btxe(1,1,1).  ')
560  endif
561 ALLOCATE(grid%em_v_btys(1,1,1),STAT=ierr)
562  if (ierr.ne.0) then
563  CALL wrf_error_fatal ( &
564 'frame/module_domain.f: Failed to allocate grid%em_v_btys(1,1,1).  ')
565  endif
566 ALLOCATE(grid%em_v_btye(1,1,1),STAT=ierr)
567  if (ierr.ne.0) then
568  CALL wrf_error_fatal ( &
569 'frame/module_domain.f: Failed to allocate grid%em_v_btye(1,1,1).  ')
570  endif
571 ENDIF
572 IF(IAND(1,tl).NE.0)THEN
573 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
574 ALLOCATE(grid%a_v_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
575  if (ierr.ne.0) then
576  CALL wrf_error_fatal ( &
577 'frame/module_domain.f: Failed to allocate grid%a_v_1(sm31:em31,sm32:em32,sm33:em33). ')
578  endif
579 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_1=initial_data_value
580 ELSE
581 ALLOCATE(grid%a_v_1(1,1,1),STAT=ierr)
582  if (ierr.ne.0) then
583  CALL wrf_error_fatal ( &
584 'frame/module_domain.f: Failed to allocate grid%a_v_1(1,1,1).  ')
585  endif
586 ENDIF
587 IF(IAND(2,tl).NE.0)THEN
588 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
589 ALLOCATE(grid%a_v_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
590  if (ierr.ne.0) then
591  CALL wrf_error_fatal ( &
592 'frame/module_domain.f: Failed to allocate grid%a_v_2(sm31:em31,sm32:em32,sm33:em33). ')
593  endif
594 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_2=initial_data_value
595 ELSE
596 ALLOCATE(grid%a_v_2(1,1,1),STAT=ierr)
597  if (ierr.ne.0) then
598  CALL wrf_error_fatal ( &
599 'frame/module_domain.f: Failed to allocate grid%a_v_2(1,1,1).  ')
600  endif
601 ENDIF
602 IF(.NOT.inter_domain)THEN
603 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
604 ALLOCATE(grid%a_v_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
605  if (ierr.ne.0) then
606  CALL wrf_error_fatal ( &
607 'frame/module_domain.f: Failed to allocate grid%a_v_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
608  endif
609 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_bxs=initial_data_value
610 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
611 ALLOCATE(grid%a_v_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
612  if (ierr.ne.0) then
613  CALL wrf_error_fatal ( &
614 'frame/module_domain.f: Failed to allocate grid%a_v_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
615  endif
616 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_bxe=initial_data_value
617 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
618 ALLOCATE(grid%a_v_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
619  if (ierr.ne.0) then
620  CALL wrf_error_fatal ( &
621 'frame/module_domain.f: Failed to allocate grid%a_v_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
622  endif
623 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_bys=initial_data_value
624 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
625 ALLOCATE(grid%a_v_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
626  if (ierr.ne.0) then
627  CALL wrf_error_fatal ( &
628 'frame/module_domain.f: Failed to allocate grid%a_v_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
629  endif
630 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_bye=initial_data_value
631 ELSE
632 ALLOCATE(grid%a_v_bxs(1,1,1),STAT=ierr)
633  if (ierr.ne.0) then
634  CALL wrf_error_fatal ( &
635 'frame/module_domain.f: Failed to allocate grid%a_v_bxs(1,1,1).  ')
636  endif
637 ALLOCATE(grid%a_v_bxe(1,1,1),STAT=ierr)
638  if (ierr.ne.0) then
639  CALL wrf_error_fatal ( &
640 'frame/module_domain.f: Failed to allocate grid%a_v_bxe(1,1,1).  ')
641  endif
642 ALLOCATE(grid%a_v_bys(1,1,1),STAT=ierr)
643  if (ierr.ne.0) then
644  CALL wrf_error_fatal ( &
645 'frame/module_domain.f: Failed to allocate grid%a_v_bys(1,1,1).  ')
646  endif
647 ALLOCATE(grid%a_v_bye(1,1,1),STAT=ierr)
648  if (ierr.ne.0) then
649  CALL wrf_error_fatal ( &
650 'frame/module_domain.f: Failed to allocate grid%a_v_bye(1,1,1).  ')
651  endif
652 ENDIF
653 IF(.NOT.inter_domain)THEN
654 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
655 ALLOCATE(grid%a_v_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
656  if (ierr.ne.0) then
657  CALL wrf_error_fatal ( &
658 'frame/module_domain.f: Failed to allocate grid%a_v_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
659  endif
660 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_btxs=initial_data_value
661 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
662 ALLOCATE(grid%a_v_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
663  if (ierr.ne.0) then
664  CALL wrf_error_fatal ( &
665 'frame/module_domain.f: Failed to allocate grid%a_v_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
666  endif
667 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_btxe=initial_data_value
668 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
669 ALLOCATE(grid%a_v_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
670  if (ierr.ne.0) then
671  CALL wrf_error_fatal ( &
672 'frame/module_domain.f: Failed to allocate grid%a_v_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
673  endif
674 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_btys=initial_data_value
675 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
676 ALLOCATE(grid%a_v_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
677  if (ierr.ne.0) then
678  CALL wrf_error_fatal ( &
679 'frame/module_domain.f: Failed to allocate grid%a_v_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
680  endif
681 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_v_btye=initial_data_value
682 ELSE
683 ALLOCATE(grid%a_v_btxs(1,1,1),STAT=ierr)
684  if (ierr.ne.0) then
685  CALL wrf_error_fatal ( &
686 'frame/module_domain.f: Failed to allocate grid%a_v_btxs(1,1,1).  ')
687  endif
688 ALLOCATE(grid%a_v_btxe(1,1,1),STAT=ierr)
689  if (ierr.ne.0) then
690  CALL wrf_error_fatal ( &
691 'frame/module_domain.f: Failed to allocate grid%a_v_btxe(1,1,1).  ')
692  endif
693 ALLOCATE(grid%a_v_btys(1,1,1),STAT=ierr)
694  if (ierr.ne.0) then
695  CALL wrf_error_fatal ( &
696 'frame/module_domain.f: Failed to allocate grid%a_v_btys(1,1,1).  ')
697  endif
698 ALLOCATE(grid%a_v_btye(1,1,1),STAT=ierr)
699  if (ierr.ne.0) then
700  CALL wrf_error_fatal ( &
701 'frame/module_domain.f: Failed to allocate grid%a_v_btye(1,1,1).  ')
702  endif
703 ENDIF
704 IF(IAND(1,tl).NE.0)THEN
705 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
706 ALLOCATE(grid%g_v_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
707  if (ierr.ne.0) then
708  CALL wrf_error_fatal ( &
709 'frame/module_domain.f: Failed to allocate grid%g_v_1(sm31:em31,sm32:em32,sm33:em33). ')
710  endif
711 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_1=initial_data_value
712 ELSE
713 ALLOCATE(grid%g_v_1(1,1,1),STAT=ierr)
714  if (ierr.ne.0) then
715  CALL wrf_error_fatal ( &
716 'frame/module_domain.f: Failed to allocate grid%g_v_1(1,1,1).  ')
717  endif
718 ENDIF
719 IF(IAND(2,tl).NE.0)THEN
720 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
721 ALLOCATE(grid%g_v_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
722  if (ierr.ne.0) then
723  CALL wrf_error_fatal ( &
724 'frame/module_domain.f: Failed to allocate grid%g_v_2(sm31:em31,sm32:em32,sm33:em33). ')
725  endif
726 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_2=initial_data_value
727 ELSE
728 ALLOCATE(grid%g_v_2(1,1,1),STAT=ierr)
729  if (ierr.ne.0) then
730  CALL wrf_error_fatal ( &
731 'frame/module_domain.f: Failed to allocate grid%g_v_2(1,1,1).  ')
732  endif
733 ENDIF
734 IF(.NOT.inter_domain)THEN
735 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
736 ALLOCATE(grid%g_v_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
737  if (ierr.ne.0) then
738  CALL wrf_error_fatal ( &
739 'frame/module_domain.f: Failed to allocate grid%g_v_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
740  endif
741 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_bxs=initial_data_value
742 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
743 ALLOCATE(grid%g_v_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
744  if (ierr.ne.0) then
745  CALL wrf_error_fatal ( &
746 'frame/module_domain.f: Failed to allocate grid%g_v_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
747  endif
748 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_bxe=initial_data_value
749 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
750 ALLOCATE(grid%g_v_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
751  if (ierr.ne.0) then
752  CALL wrf_error_fatal ( &
753 'frame/module_domain.f: Failed to allocate grid%g_v_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
754  endif
755 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_bys=initial_data_value
756 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
757 ALLOCATE(grid%g_v_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
758  if (ierr.ne.0) then
759  CALL wrf_error_fatal ( &
760 'frame/module_domain.f: Failed to allocate grid%g_v_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
761  endif
762 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_bye=initial_data_value
763 ELSE
764 ALLOCATE(grid%g_v_bxs(1,1,1),STAT=ierr)
765  if (ierr.ne.0) then
766  CALL wrf_error_fatal ( &
767 'frame/module_domain.f: Failed to allocate grid%g_v_bxs(1,1,1).  ')
768  endif
769 ALLOCATE(grid%g_v_bxe(1,1,1),STAT=ierr)
770  if (ierr.ne.0) then
771  CALL wrf_error_fatal ( &
772 'frame/module_domain.f: Failed to allocate grid%g_v_bxe(1,1,1).  ')
773  endif
774 ALLOCATE(grid%g_v_bys(1,1,1),STAT=ierr)
775  if (ierr.ne.0) then
776  CALL wrf_error_fatal ( &
777 'frame/module_domain.f: Failed to allocate grid%g_v_bys(1,1,1).  ')
778  endif
779 ALLOCATE(grid%g_v_bye(1,1,1),STAT=ierr)
780  if (ierr.ne.0) then
781  CALL wrf_error_fatal ( &
782 'frame/module_domain.f: Failed to allocate grid%g_v_bye(1,1,1).  ')
783  endif
784 ENDIF
785 IF(.NOT.inter_domain)THEN
786 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
787 ALLOCATE(grid%g_v_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
788  if (ierr.ne.0) then
789  CALL wrf_error_fatal ( &
790 'frame/module_domain.f: Failed to allocate grid%g_v_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
791  endif
792 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_btxs=initial_data_value
793 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
794 ALLOCATE(grid%g_v_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
795  if (ierr.ne.0) then
796  CALL wrf_error_fatal ( &
797 'frame/module_domain.f: Failed to allocate grid%g_v_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
798  endif
799 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_btxe=initial_data_value
800 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
801 ALLOCATE(grid%g_v_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
802  if (ierr.ne.0) then
803  CALL wrf_error_fatal ( &
804 'frame/module_domain.f: Failed to allocate grid%g_v_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
805  endif
806 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_btys=initial_data_value
807 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
808 ALLOCATE(grid%g_v_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
809  if (ierr.ne.0) then
810  CALL wrf_error_fatal ( &
811 'frame/module_domain.f: Failed to allocate grid%g_v_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
812  endif
813 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_v_btye=initial_data_value
814 ELSE
815 ALLOCATE(grid%g_v_btxs(1,1,1),STAT=ierr)
816  if (ierr.ne.0) then
817  CALL wrf_error_fatal ( &
818 'frame/module_domain.f: Failed to allocate grid%g_v_btxs(1,1,1).  ')
819  endif
820 ALLOCATE(grid%g_v_btxe(1,1,1),STAT=ierr)
821  if (ierr.ne.0) then
822  CALL wrf_error_fatal ( &
823 'frame/module_domain.f: Failed to allocate grid%g_v_btxe(1,1,1).  ')
824  endif
825 ALLOCATE(grid%g_v_btys(1,1,1),STAT=ierr)
826  if (ierr.ne.0) then
827  CALL wrf_error_fatal ( &
828 'frame/module_domain.f: Failed to allocate grid%g_v_btys(1,1,1).  ')
829  endif
830 ALLOCATE(grid%g_v_btye(1,1,1),STAT=ierr)
831  if (ierr.ne.0) then
832  CALL wrf_error_fatal ( &
833 'frame/module_domain.f: Failed to allocate grid%g_v_btye(1,1,1).  ')
834  endif
835 ENDIF
836 IF(IAND(1,tl).NE.0)THEN
837 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
838 ALLOCATE(grid%em_w_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
839  if (ierr.ne.0) then
840  CALL wrf_error_fatal ( &
841 'frame/module_domain.f: Failed to allocate grid%em_w_1(sm31:em31,sm32:em32,sm33:em33). ')
842  endif
843 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_1=initial_data_value
844 ELSE
845 ALLOCATE(grid%em_w_1(1,1,1),STAT=ierr)
846  if (ierr.ne.0) then
847  CALL wrf_error_fatal ( &
848 'frame/module_domain.f: Failed to allocate grid%em_w_1(1,1,1).  ')
849  endif
850 ENDIF
851 IF(IAND(2,tl).NE.0)THEN
852 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
853 ALLOCATE(grid%em_w_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
854  if (ierr.ne.0) then
855  CALL wrf_error_fatal ( &
856 'frame/module_domain.f: Failed to allocate grid%em_w_2(sm31:em31,sm32:em32,sm33:em33). ')
857  endif
858 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_2=initial_data_value
859 ELSE
860 ALLOCATE(grid%em_w_2(1,1,1),STAT=ierr)
861  if (ierr.ne.0) then
862  CALL wrf_error_fatal ( &
863 'frame/module_domain.f: Failed to allocate grid%em_w_2(1,1,1).  ')
864  endif
865 ENDIF
866 IF(.NOT.inter_domain)THEN
867 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
868 ALLOCATE(grid%em_w_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
869  if (ierr.ne.0) then
870  CALL wrf_error_fatal ( &
871 'frame/module_domain.f: Failed to allocate grid%em_w_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
872  endif
873 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_bxs=initial_data_value
874 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
875 ALLOCATE(grid%em_w_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
876  if (ierr.ne.0) then
877  CALL wrf_error_fatal ( &
878 'frame/module_domain.f: Failed to allocate grid%em_w_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
879  endif
880 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_bxe=initial_data_value
881 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
882 ALLOCATE(grid%em_w_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
883  if (ierr.ne.0) then
884  CALL wrf_error_fatal ( &
885 'frame/module_domain.f: Failed to allocate grid%em_w_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
886  endif
887 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_bys=initial_data_value
888 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
889 ALLOCATE(grid%em_w_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
890  if (ierr.ne.0) then
891  CALL wrf_error_fatal ( &
892 'frame/module_domain.f: Failed to allocate grid%em_w_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
893  endif
894 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_bye=initial_data_value
895 ELSE
896 ALLOCATE(grid%em_w_bxs(1,1,1),STAT=ierr)
897  if (ierr.ne.0) then
898  CALL wrf_error_fatal ( &
899 'frame/module_domain.f: Failed to allocate grid%em_w_bxs(1,1,1).  ')
900  endif
901 ALLOCATE(grid%em_w_bxe(1,1,1),STAT=ierr)
902  if (ierr.ne.0) then
903  CALL wrf_error_fatal ( &
904 'frame/module_domain.f: Failed to allocate grid%em_w_bxe(1,1,1).  ')
905  endif
906 ALLOCATE(grid%em_w_bys(1,1,1),STAT=ierr)
907  if (ierr.ne.0) then
908  CALL wrf_error_fatal ( &
909 'frame/module_domain.f: Failed to allocate grid%em_w_bys(1,1,1).  ')
910  endif
911 ALLOCATE(grid%em_w_bye(1,1,1),STAT=ierr)
912  if (ierr.ne.0) then
913  CALL wrf_error_fatal ( &
914 'frame/module_domain.f: Failed to allocate grid%em_w_bye(1,1,1).  ')
915  endif
916 ENDIF
917 IF(.NOT.inter_domain)THEN
918 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
919 ALLOCATE(grid%em_w_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
920  if (ierr.ne.0) then
921  CALL wrf_error_fatal ( &
922 'frame/module_domain.f: Failed to allocate grid%em_w_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
923  endif
924 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_btxs=initial_data_value
925 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
926 ALLOCATE(grid%em_w_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
927  if (ierr.ne.0) then
928  CALL wrf_error_fatal ( &
929 'frame/module_domain.f: Failed to allocate grid%em_w_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
930  endif
931 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_btxe=initial_data_value
932 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
933 ALLOCATE(grid%em_w_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
934  if (ierr.ne.0) then
935  CALL wrf_error_fatal ( &
936 'frame/module_domain.f: Failed to allocate grid%em_w_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
937  endif
938 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_btys=initial_data_value
939 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
940 ALLOCATE(grid%em_w_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
941  if (ierr.ne.0) then
942  CALL wrf_error_fatal ( &
943 'frame/module_domain.f: Failed to allocate grid%em_w_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
944  endif
945 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_w_btye=initial_data_value
946 ELSE
947 ALLOCATE(grid%em_w_btxs(1,1,1),STAT=ierr)
948  if (ierr.ne.0) then
949  CALL wrf_error_fatal ( &
950 'frame/module_domain.f: Failed to allocate grid%em_w_btxs(1,1,1).  ')
951  endif
952 ALLOCATE(grid%em_w_btxe(1,1,1),STAT=ierr)
953  if (ierr.ne.0) then
954  CALL wrf_error_fatal ( &
955 'frame/module_domain.f: Failed to allocate grid%em_w_btxe(1,1,1).  ')
956  endif
957 ALLOCATE(grid%em_w_btys(1,1,1),STAT=ierr)
958  if (ierr.ne.0) then
959  CALL wrf_error_fatal ( &
960 'frame/module_domain.f: Failed to allocate grid%em_w_btys(1,1,1).  ')
961  endif
962 ALLOCATE(grid%em_w_btye(1,1,1),STAT=ierr)
963  if (ierr.ne.0) then
964  CALL wrf_error_fatal ( &
965 'frame/module_domain.f: Failed to allocate grid%em_w_btye(1,1,1).  ')
966  endif
967 ENDIF
968 IF(IAND(1,tl).NE.0)THEN
969 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
970 ALLOCATE(grid%a_w_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
971  if (ierr.ne.0) then
972  CALL wrf_error_fatal ( &
973 'frame/module_domain.f: Failed to allocate grid%a_w_1(sm31:em31,sm32:em32,sm33:em33). ')
974  endif
975 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_1=initial_data_value
976 ELSE
977 ALLOCATE(grid%a_w_1(1,1,1),STAT=ierr)
978  if (ierr.ne.0) then
979  CALL wrf_error_fatal ( &
980 'frame/module_domain.f: Failed to allocate grid%a_w_1(1,1,1).  ')
981  endif
982 ENDIF
983 IF(IAND(2,tl).NE.0)THEN
984 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
985 ALLOCATE(grid%a_w_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
986  if (ierr.ne.0) then
987  CALL wrf_error_fatal ( &
988 'frame/module_domain.f: Failed to allocate grid%a_w_2(sm31:em31,sm32:em32,sm33:em33). ')
989  endif
990 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_2=initial_data_value
991 ELSE
992 ALLOCATE(grid%a_w_2(1,1,1),STAT=ierr)
993  if (ierr.ne.0) then
994  CALL wrf_error_fatal ( &
995 'frame/module_domain.f: Failed to allocate grid%a_w_2(1,1,1).  ')
996  endif
997 ENDIF
998 IF(.NOT.inter_domain)THEN
999 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1000 ALLOCATE(grid%a_w_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1001  if (ierr.ne.0) then
1002  CALL wrf_error_fatal ( &
1003 'frame/module_domain.f: Failed to allocate grid%a_w_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1004  endif
1005 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_bxs=initial_data_value
1006 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1007 ALLOCATE(grid%a_w_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1008  if (ierr.ne.0) then
1009  CALL wrf_error_fatal ( &
1010 'frame/module_domain.f: Failed to allocate grid%a_w_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1011  endif
1012 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_bxe=initial_data_value
1013 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1014 ALLOCATE(grid%a_w_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1015  if (ierr.ne.0) then
1016  CALL wrf_error_fatal ( &
1017 'frame/module_domain.f: Failed to allocate grid%a_w_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
1018  endif
1019 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_bys=initial_data_value
1020 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1021 ALLOCATE(grid%a_w_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1022  if (ierr.ne.0) then
1023  CALL wrf_error_fatal ( &
1024 'frame/module_domain.f: Failed to allocate grid%a_w_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
1025  endif
1026 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_bye=initial_data_value
1027 ELSE
1028 ALLOCATE(grid%a_w_bxs(1,1,1),STAT=ierr)
1029  if (ierr.ne.0) then
1030  CALL wrf_error_fatal ( &
1031 'frame/module_domain.f: Failed to allocate grid%a_w_bxs(1,1,1).  ')
1032  endif
1033 ALLOCATE(grid%a_w_bxe(1,1,1),STAT=ierr)
1034  if (ierr.ne.0) then
1035  CALL wrf_error_fatal ( &
1036 'frame/module_domain.f: Failed to allocate grid%a_w_bxe(1,1,1).  ')
1037  endif
1038 ALLOCATE(grid%a_w_bys(1,1,1),STAT=ierr)
1039  if (ierr.ne.0) then
1040  CALL wrf_error_fatal ( &
1041 'frame/module_domain.f: Failed to allocate grid%a_w_bys(1,1,1).  ')
1042  endif
1043 ALLOCATE(grid%a_w_bye(1,1,1),STAT=ierr)
1044  if (ierr.ne.0) then
1045  CALL wrf_error_fatal ( &
1046 'frame/module_domain.f: Failed to allocate grid%a_w_bye(1,1,1).  ')
1047  endif
1048 ENDIF
1049 IF(.NOT.inter_domain)THEN
1050 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1051 ALLOCATE(grid%a_w_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1052  if (ierr.ne.0) then
1053  CALL wrf_error_fatal ( &
1054 'frame/module_domain.f: Failed to allocate grid%a_w_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1055  endif
1056 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_btxs=initial_data_value
1057 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1058 ALLOCATE(grid%a_w_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1059  if (ierr.ne.0) then
1060  CALL wrf_error_fatal ( &
1061 'frame/module_domain.f: Failed to allocate grid%a_w_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1062  endif
1063 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_btxe=initial_data_value
1064 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1065 ALLOCATE(grid%a_w_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1066  if (ierr.ne.0) then
1067  CALL wrf_error_fatal ( &
1068 'frame/module_domain.f: Failed to allocate grid%a_w_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
1069  endif
1070 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_btys=initial_data_value
1071 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1072 ALLOCATE(grid%a_w_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1073  if (ierr.ne.0) then
1074  CALL wrf_error_fatal ( &
1075 'frame/module_domain.f: Failed to allocate grid%a_w_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
1076  endif
1077 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_w_btye=initial_data_value
1078 ELSE
1079 ALLOCATE(grid%a_w_btxs(1,1,1),STAT=ierr)
1080  if (ierr.ne.0) then
1081  CALL wrf_error_fatal ( &
1082 'frame/module_domain.f: Failed to allocate grid%a_w_btxs(1,1,1).  ')
1083  endif
1084 ALLOCATE(grid%a_w_btxe(1,1,1),STAT=ierr)
1085  if (ierr.ne.0) then
1086  CALL wrf_error_fatal ( &
1087 'frame/module_domain.f: Failed to allocate grid%a_w_btxe(1,1,1).  ')
1088  endif
1089 ALLOCATE(grid%a_w_btys(1,1,1),STAT=ierr)
1090  if (ierr.ne.0) then
1091  CALL wrf_error_fatal ( &
1092 'frame/module_domain.f: Failed to allocate grid%a_w_btys(1,1,1).  ')
1093  endif
1094 ALLOCATE(grid%a_w_btye(1,1,1),STAT=ierr)
1095  if (ierr.ne.0) then
1096  CALL wrf_error_fatal ( &
1097 'frame/module_domain.f: Failed to allocate grid%a_w_btye(1,1,1).  ')
1098  endif
1099 ENDIF
1100 IF(IAND(1,tl).NE.0)THEN
1101 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1102 ALLOCATE(grid%g_w_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1103  if (ierr.ne.0) then
1104  CALL wrf_error_fatal ( &
1105 'frame/module_domain.f: Failed to allocate grid%g_w_1(sm31:em31,sm32:em32,sm33:em33). ')
1106  endif
1107 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_1=initial_data_value
1108 ELSE
1109 ALLOCATE(grid%g_w_1(1,1,1),STAT=ierr)
1110  if (ierr.ne.0) then
1111  CALL wrf_error_fatal ( &
1112 'frame/module_domain.f: Failed to allocate grid%g_w_1(1,1,1).  ')
1113  endif
1114 ENDIF
1115 IF(IAND(2,tl).NE.0)THEN
1116 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1117 ALLOCATE(grid%g_w_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1118  if (ierr.ne.0) then
1119  CALL wrf_error_fatal ( &
1120 'frame/module_domain.f: Failed to allocate grid%g_w_2(sm31:em31,sm32:em32,sm33:em33). ')
1121  endif
1122 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_2=initial_data_value
1123 ELSE
1124 ALLOCATE(grid%g_w_2(1,1,1),STAT=ierr)
1125  if (ierr.ne.0) then
1126  CALL wrf_error_fatal ( &
1127 'frame/module_domain.f: Failed to allocate grid%g_w_2(1,1,1).  ')
1128  endif
1129 ENDIF
1130 IF(.NOT.inter_domain)THEN
1131 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1132 ALLOCATE(grid%g_w_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1133  if (ierr.ne.0) then
1134  CALL wrf_error_fatal ( &
1135 'frame/module_domain.f: Failed to allocate grid%g_w_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1136  endif
1137 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_bxs=initial_data_value
1138 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1139 ALLOCATE(grid%g_w_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1140  if (ierr.ne.0) then
1141  CALL wrf_error_fatal ( &
1142 'frame/module_domain.f: Failed to allocate grid%g_w_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1143  endif
1144 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_bxe=initial_data_value
1145 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1146 ALLOCATE(grid%g_w_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1147  if (ierr.ne.0) then
1148  CALL wrf_error_fatal ( &
1149 'frame/module_domain.f: Failed to allocate grid%g_w_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
1150  endif
1151 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_bys=initial_data_value
1152 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1153 ALLOCATE(grid%g_w_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1154  if (ierr.ne.0) then
1155  CALL wrf_error_fatal ( &
1156 'frame/module_domain.f: Failed to allocate grid%g_w_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
1157  endif
1158 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_bye=initial_data_value
1159 ELSE
1160 ALLOCATE(grid%g_w_bxs(1,1,1),STAT=ierr)
1161  if (ierr.ne.0) then
1162  CALL wrf_error_fatal ( &
1163 'frame/module_domain.f: Failed to allocate grid%g_w_bxs(1,1,1).  ')
1164  endif
1165 ALLOCATE(grid%g_w_bxe(1,1,1),STAT=ierr)
1166  if (ierr.ne.0) then
1167  CALL wrf_error_fatal ( &
1168 'frame/module_domain.f: Failed to allocate grid%g_w_bxe(1,1,1).  ')
1169  endif
1170 ALLOCATE(grid%g_w_bys(1,1,1),STAT=ierr)
1171  if (ierr.ne.0) then
1172  CALL wrf_error_fatal ( &
1173 'frame/module_domain.f: Failed to allocate grid%g_w_bys(1,1,1).  ')
1174  endif
1175 ALLOCATE(grid%g_w_bye(1,1,1),STAT=ierr)
1176  if (ierr.ne.0) then
1177  CALL wrf_error_fatal ( &
1178 'frame/module_domain.f: Failed to allocate grid%g_w_bye(1,1,1).  ')
1179  endif
1180 ENDIF
1181 IF(.NOT.inter_domain)THEN
1182 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1183 ALLOCATE(grid%g_w_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1184  if (ierr.ne.0) then
1185  CALL wrf_error_fatal ( &
1186 'frame/module_domain.f: Failed to allocate grid%g_w_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1187  endif
1188 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_btxs=initial_data_value
1189 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1190 ALLOCATE(grid%g_w_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1191  if (ierr.ne.0) then
1192  CALL wrf_error_fatal ( &
1193 'frame/module_domain.f: Failed to allocate grid%g_w_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1194  endif
1195 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_btxe=initial_data_value
1196 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1197 ALLOCATE(grid%g_w_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1198  if (ierr.ne.0) then
1199  CALL wrf_error_fatal ( &
1200 'frame/module_domain.f: Failed to allocate grid%g_w_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
1201  endif
1202 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_btys=initial_data_value
1203 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1204 ALLOCATE(grid%g_w_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1205  if (ierr.ne.0) then
1206  CALL wrf_error_fatal ( &
1207 'frame/module_domain.f: Failed to allocate grid%g_w_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
1208  endif
1209 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_w_btye=initial_data_value
1210 ELSE
1211 ALLOCATE(grid%g_w_btxs(1,1,1),STAT=ierr)
1212  if (ierr.ne.0) then
1213  CALL wrf_error_fatal ( &
1214 'frame/module_domain.f: Failed to allocate grid%g_w_btxs(1,1,1).  ')
1215  endif
1216 ALLOCATE(grid%g_w_btxe(1,1,1),STAT=ierr)
1217  if (ierr.ne.0) then
1218  CALL wrf_error_fatal ( &
1219 'frame/module_domain.f: Failed to allocate grid%g_w_btxe(1,1,1).  ')
1220  endif
1221 ALLOCATE(grid%g_w_btys(1,1,1),STAT=ierr)
1222  if (ierr.ne.0) then
1223  CALL wrf_error_fatal ( &
1224 'frame/module_domain.f: Failed to allocate grid%g_w_btys(1,1,1).  ')
1225  endif
1226 ALLOCATE(grid%g_w_btye(1,1,1),STAT=ierr)
1227  if (ierr.ne.0) then
1228  CALL wrf_error_fatal ( &
1229 'frame/module_domain.f: Failed to allocate grid%g_w_btye(1,1,1).  ')
1230  endif
1231 ENDIF
1232 IF(IAND(1,tl).NE.0)THEN
1233 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1234 ALLOCATE(grid%em_ph_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1235  if (ierr.ne.0) then
1236  CALL wrf_error_fatal ( &
1237 'frame/module_domain.f: Failed to allocate grid%em_ph_1(sm31:em31,sm32:em32,sm33:em33). ')
1238  endif
1239 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_1=initial_data_value
1240 ELSE
1241 ALLOCATE(grid%em_ph_1(1,1,1),STAT=ierr)
1242  if (ierr.ne.0) then
1243  CALL wrf_error_fatal ( &
1244 'frame/module_domain.f: Failed to allocate grid%em_ph_1(1,1,1).  ')
1245  endif
1246 ENDIF
1247 IF(IAND(2,tl).NE.0)THEN
1248 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1249 ALLOCATE(grid%em_ph_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1250  if (ierr.ne.0) then
1251  CALL wrf_error_fatal ( &
1252 'frame/module_domain.f: Failed to allocate grid%em_ph_2(sm31:em31,sm32:em32,sm33:em33). ')
1253  endif
1254 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_2=initial_data_value
1255 ELSE
1256 ALLOCATE(grid%em_ph_2(1,1,1),STAT=ierr)
1257  if (ierr.ne.0) then
1258  CALL wrf_error_fatal ( &
1259 'frame/module_domain.f: Failed to allocate grid%em_ph_2(1,1,1).  ')
1260  endif
1261 ENDIF
1262 IF(.NOT.inter_domain)THEN
1263 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1264 ALLOCATE(grid%em_ph_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1265  if (ierr.ne.0) then
1266  CALL wrf_error_fatal ( &
1267 'frame/module_domain.f: Failed to allocate grid%em_ph_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1268  endif
1269 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_bxs=initial_data_value
1270 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1271 ALLOCATE(grid%em_ph_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1272  if (ierr.ne.0) then
1273  CALL wrf_error_fatal ( &
1274 'frame/module_domain.f: Failed to allocate grid%em_ph_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1275  endif
1276 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_bxe=initial_data_value
1277 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1278 ALLOCATE(grid%em_ph_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1279  if (ierr.ne.0) then
1280  CALL wrf_error_fatal ( &
1281 'frame/module_domain.f: Failed to allocate grid%em_ph_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
1282  endif
1283 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_bys=initial_data_value
1284 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1285 ALLOCATE(grid%em_ph_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1286  if (ierr.ne.0) then
1287  CALL wrf_error_fatal ( &
1288 'frame/module_domain.f: Failed to allocate grid%em_ph_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
1289  endif
1290 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_bye=initial_data_value
1291 ELSE
1292 ALLOCATE(grid%em_ph_bxs(1,1,1),STAT=ierr)
1293  if (ierr.ne.0) then
1294  CALL wrf_error_fatal ( &
1295 'frame/module_domain.f: Failed to allocate grid%em_ph_bxs(1,1,1).  ')
1296  endif
1297 ALLOCATE(grid%em_ph_bxe(1,1,1),STAT=ierr)
1298  if (ierr.ne.0) then
1299  CALL wrf_error_fatal ( &
1300 'frame/module_domain.f: Failed to allocate grid%em_ph_bxe(1,1,1).  ')
1301  endif
1302 ALLOCATE(grid%em_ph_bys(1,1,1),STAT=ierr)
1303  if (ierr.ne.0) then
1304  CALL wrf_error_fatal ( &
1305 'frame/module_domain.f: Failed to allocate grid%em_ph_bys(1,1,1).  ')
1306  endif
1307 ALLOCATE(grid%em_ph_bye(1,1,1),STAT=ierr)
1308  if (ierr.ne.0) then
1309  CALL wrf_error_fatal ( &
1310 'frame/module_domain.f: Failed to allocate grid%em_ph_bye(1,1,1).  ')
1311  endif
1312 ENDIF
1313 IF(.NOT.inter_domain)THEN
1314 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1315 ALLOCATE(grid%em_ph_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1316  if (ierr.ne.0) then
1317  CALL wrf_error_fatal ( &
1318 'frame/module_domain.f: Failed to allocate grid%em_ph_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1319  endif
1320 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_btxs=initial_data_value
1321 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1322 ALLOCATE(grid%em_ph_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1323  if (ierr.ne.0) then
1324  CALL wrf_error_fatal ( &
1325 'frame/module_domain.f: Failed to allocate grid%em_ph_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1326  endif
1327 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_btxe=initial_data_value
1328 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1329 ALLOCATE(grid%em_ph_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1330  if (ierr.ne.0) then
1331  CALL wrf_error_fatal ( &
1332 'frame/module_domain.f: Failed to allocate grid%em_ph_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
1333  endif
1334 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_btys=initial_data_value
1335 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1336 ALLOCATE(grid%em_ph_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1337  if (ierr.ne.0) then
1338  CALL wrf_error_fatal ( &
1339 'frame/module_domain.f: Failed to allocate grid%em_ph_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
1340  endif
1341 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_ph_btye=initial_data_value
1342 ELSE
1343 ALLOCATE(grid%em_ph_btxs(1,1,1),STAT=ierr)
1344  if (ierr.ne.0) then
1345  CALL wrf_error_fatal ( &
1346 'frame/module_domain.f: Failed to allocate grid%em_ph_btxs(1,1,1).  ')
1347  endif
1348 ALLOCATE(grid%em_ph_btxe(1,1,1),STAT=ierr)
1349  if (ierr.ne.0) then
1350  CALL wrf_error_fatal ( &
1351 'frame/module_domain.f: Failed to allocate grid%em_ph_btxe(1,1,1).  ')
1352  endif
1353 ALLOCATE(grid%em_ph_btys(1,1,1),STAT=ierr)
1354  if (ierr.ne.0) then
1355  CALL wrf_error_fatal ( &
1356 'frame/module_domain.f: Failed to allocate grid%em_ph_btys(1,1,1).  ')
1357  endif
1358 ALLOCATE(grid%em_ph_btye(1,1,1),STAT=ierr)
1359  if (ierr.ne.0) then
1360  CALL wrf_error_fatal ( &
1361 'frame/module_domain.f: Failed to allocate grid%em_ph_btye(1,1,1).  ')
1362  endif
1363 ENDIF
1364 IF(IAND(1,tl).NE.0)THEN
1365 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1366 ALLOCATE(grid%a_ph_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1367  if (ierr.ne.0) then
1368  CALL wrf_error_fatal ( &
1369 'frame/module_domain.f: Failed to allocate grid%a_ph_1(sm31:em31,sm32:em32,sm33:em33). ')
1370  endif
1371 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_1=initial_data_value
1372 ELSE
1373 ALLOCATE(grid%a_ph_1(1,1,1),STAT=ierr)
1374  if (ierr.ne.0) then
1375  CALL wrf_error_fatal ( &
1376 'frame/module_domain.f: Failed to allocate grid%a_ph_1(1,1,1).  ')
1377  endif
1378 ENDIF
1379 IF(IAND(2,tl).NE.0)THEN
1380 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1381 ALLOCATE(grid%a_ph_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1382  if (ierr.ne.0) then
1383  CALL wrf_error_fatal ( &
1384 'frame/module_domain.f: Failed to allocate grid%a_ph_2(sm31:em31,sm32:em32,sm33:em33). ')
1385  endif
1386 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_2=initial_data_value
1387 ELSE
1388 ALLOCATE(grid%a_ph_2(1,1,1),STAT=ierr)
1389  if (ierr.ne.0) then
1390  CALL wrf_error_fatal ( &
1391 'frame/module_domain.f: Failed to allocate grid%a_ph_2(1,1,1).  ')
1392  endif
1393 ENDIF
1394 IF(.NOT.inter_domain)THEN
1395 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1396 ALLOCATE(grid%a_ph_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1397  if (ierr.ne.0) then
1398  CALL wrf_error_fatal ( &
1399 'frame/module_domain.f: Failed to allocate grid%a_ph_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1400  endif
1401 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_bxs=initial_data_value
1402 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1403 ALLOCATE(grid%a_ph_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1404  if (ierr.ne.0) then
1405  CALL wrf_error_fatal ( &
1406 'frame/module_domain.f: Failed to allocate grid%a_ph_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1407  endif
1408 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_bxe=initial_data_value
1409 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1410 ALLOCATE(grid%a_ph_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1411  if (ierr.ne.0) then
1412  CALL wrf_error_fatal ( &
1413 'frame/module_domain.f: Failed to allocate grid%a_ph_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
1414  endif
1415 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_bys=initial_data_value
1416 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1417 ALLOCATE(grid%a_ph_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1418  if (ierr.ne.0) then
1419  CALL wrf_error_fatal ( &
1420 'frame/module_domain.f: Failed to allocate grid%a_ph_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
1421  endif
1422 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_bye=initial_data_value
1423 ELSE
1424 ALLOCATE(grid%a_ph_bxs(1,1,1),STAT=ierr)
1425  if (ierr.ne.0) then
1426  CALL wrf_error_fatal ( &
1427 'frame/module_domain.f: Failed to allocate grid%a_ph_bxs(1,1,1).  ')
1428  endif
1429 ALLOCATE(grid%a_ph_bxe(1,1,1),STAT=ierr)
1430  if (ierr.ne.0) then
1431  CALL wrf_error_fatal ( &
1432 'frame/module_domain.f: Failed to allocate grid%a_ph_bxe(1,1,1).  ')
1433  endif
1434 ALLOCATE(grid%a_ph_bys(1,1,1),STAT=ierr)
1435  if (ierr.ne.0) then
1436  CALL wrf_error_fatal ( &
1437 'frame/module_domain.f: Failed to allocate grid%a_ph_bys(1,1,1).  ')
1438  endif
1439 ALLOCATE(grid%a_ph_bye(1,1,1),STAT=ierr)
1440  if (ierr.ne.0) then
1441  CALL wrf_error_fatal ( &
1442 'frame/module_domain.f: Failed to allocate grid%a_ph_bye(1,1,1).  ')
1443  endif
1444 ENDIF
1445 IF(.NOT.inter_domain)THEN
1446 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1447 ALLOCATE(grid%a_ph_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1448  if (ierr.ne.0) then
1449  CALL wrf_error_fatal ( &
1450 'frame/module_domain.f: Failed to allocate grid%a_ph_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1451  endif
1452 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_btxs=initial_data_value
1453 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1454 ALLOCATE(grid%a_ph_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1455  if (ierr.ne.0) then
1456  CALL wrf_error_fatal ( &
1457 'frame/module_domain.f: Failed to allocate grid%a_ph_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1458  endif
1459 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_btxe=initial_data_value
1460 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1461 ALLOCATE(grid%a_ph_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1462  if (ierr.ne.0) then
1463  CALL wrf_error_fatal ( &
1464 'frame/module_domain.f: Failed to allocate grid%a_ph_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
1465  endif
1466 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_btys=initial_data_value
1467 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1468 ALLOCATE(grid%a_ph_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1469  if (ierr.ne.0) then
1470  CALL wrf_error_fatal ( &
1471 'frame/module_domain.f: Failed to allocate grid%a_ph_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
1472  endif
1473 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_ph_btye=initial_data_value
1474 ELSE
1475 ALLOCATE(grid%a_ph_btxs(1,1,1),STAT=ierr)
1476  if (ierr.ne.0) then
1477  CALL wrf_error_fatal ( &
1478 'frame/module_domain.f: Failed to allocate grid%a_ph_btxs(1,1,1).  ')
1479  endif
1480 ALLOCATE(grid%a_ph_btxe(1,1,1),STAT=ierr)
1481  if (ierr.ne.0) then
1482  CALL wrf_error_fatal ( &
1483 'frame/module_domain.f: Failed to allocate grid%a_ph_btxe(1,1,1).  ')
1484  endif
1485 ALLOCATE(grid%a_ph_btys(1,1,1),STAT=ierr)
1486  if (ierr.ne.0) then
1487  CALL wrf_error_fatal ( &
1488 'frame/module_domain.f: Failed to allocate grid%a_ph_btys(1,1,1).  ')
1489  endif
1490 ALLOCATE(grid%a_ph_btye(1,1,1),STAT=ierr)
1491  if (ierr.ne.0) then
1492  CALL wrf_error_fatal ( &
1493 'frame/module_domain.f: Failed to allocate grid%a_ph_btye(1,1,1).  ')
1494  endif
1495 ENDIF
1496 IF(IAND(1,tl).NE.0)THEN
1497 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1498 ALLOCATE(grid%g_ph_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1499  if (ierr.ne.0) then
1500  CALL wrf_error_fatal ( &
1501 'frame/module_domain.f: Failed to allocate grid%g_ph_1(sm31:em31,sm32:em32,sm33:em33). ')
1502  endif
1503 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_1=initial_data_value
1504 ELSE
1505 ALLOCATE(grid%g_ph_1(1,1,1),STAT=ierr)
1506  if (ierr.ne.0) then
1507  CALL wrf_error_fatal ( &
1508 'frame/module_domain.f: Failed to allocate grid%g_ph_1(1,1,1).  ')
1509  endif
1510 ENDIF
1511 IF(IAND(2,tl).NE.0)THEN
1512 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1513 ALLOCATE(grid%g_ph_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1514  if (ierr.ne.0) then
1515  CALL wrf_error_fatal ( &
1516 'frame/module_domain.f: Failed to allocate grid%g_ph_2(sm31:em31,sm32:em32,sm33:em33). ')
1517  endif
1518 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_2=initial_data_value
1519 ELSE
1520 ALLOCATE(grid%g_ph_2(1,1,1),STAT=ierr)
1521  if (ierr.ne.0) then
1522  CALL wrf_error_fatal ( &
1523 'frame/module_domain.f: Failed to allocate grid%g_ph_2(1,1,1).  ')
1524  endif
1525 ENDIF
1526 IF(.NOT.inter_domain)THEN
1527 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1528 ALLOCATE(grid%g_ph_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1529  if (ierr.ne.0) then
1530  CALL wrf_error_fatal ( &
1531 'frame/module_domain.f: Failed to allocate grid%g_ph_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1532  endif
1533 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_bxs=initial_data_value
1534 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1535 ALLOCATE(grid%g_ph_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1536  if (ierr.ne.0) then
1537  CALL wrf_error_fatal ( &
1538 'frame/module_domain.f: Failed to allocate grid%g_ph_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1539  endif
1540 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_bxe=initial_data_value
1541 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1542 ALLOCATE(grid%g_ph_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1543  if (ierr.ne.0) then
1544  CALL wrf_error_fatal ( &
1545 'frame/module_domain.f: Failed to allocate grid%g_ph_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
1546  endif
1547 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_bys=initial_data_value
1548 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1549 ALLOCATE(grid%g_ph_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1550  if (ierr.ne.0) then
1551  CALL wrf_error_fatal ( &
1552 'frame/module_domain.f: Failed to allocate grid%g_ph_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
1553  endif
1554 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_bye=initial_data_value
1555 ELSE
1556 ALLOCATE(grid%g_ph_bxs(1,1,1),STAT=ierr)
1557  if (ierr.ne.0) then
1558  CALL wrf_error_fatal ( &
1559 'frame/module_domain.f: Failed to allocate grid%g_ph_bxs(1,1,1).  ')
1560  endif
1561 ALLOCATE(grid%g_ph_bxe(1,1,1),STAT=ierr)
1562  if (ierr.ne.0) then
1563  CALL wrf_error_fatal ( &
1564 'frame/module_domain.f: Failed to allocate grid%g_ph_bxe(1,1,1).  ')
1565  endif
1566 ALLOCATE(grid%g_ph_bys(1,1,1),STAT=ierr)
1567  if (ierr.ne.0) then
1568  CALL wrf_error_fatal ( &
1569 'frame/module_domain.f: Failed to allocate grid%g_ph_bys(1,1,1).  ')
1570  endif
1571 ALLOCATE(grid%g_ph_bye(1,1,1),STAT=ierr)
1572  if (ierr.ne.0) then
1573  CALL wrf_error_fatal ( &
1574 'frame/module_domain.f: Failed to allocate grid%g_ph_bye(1,1,1).  ')
1575  endif
1576 ENDIF
1577 IF(.NOT.inter_domain)THEN
1578 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1579 ALLOCATE(grid%g_ph_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1580  if (ierr.ne.0) then
1581  CALL wrf_error_fatal ( &
1582 'frame/module_domain.f: Failed to allocate grid%g_ph_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1583  endif
1584 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_btxs=initial_data_value
1585 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1586 ALLOCATE(grid%g_ph_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1587  if (ierr.ne.0) then
1588  CALL wrf_error_fatal ( &
1589 'frame/module_domain.f: Failed to allocate grid%g_ph_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1590  endif
1591 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_btxe=initial_data_value
1592 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1593 ALLOCATE(grid%g_ph_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1594  if (ierr.ne.0) then
1595  CALL wrf_error_fatal ( &
1596 'frame/module_domain.f: Failed to allocate grid%g_ph_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
1597  endif
1598 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_btys=initial_data_value
1599 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1600 ALLOCATE(grid%g_ph_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1601  if (ierr.ne.0) then
1602  CALL wrf_error_fatal ( &
1603 'frame/module_domain.f: Failed to allocate grid%g_ph_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
1604  endif
1605 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_ph_btye=initial_data_value
1606 ELSE
1607 ALLOCATE(grid%g_ph_btxs(1,1,1),STAT=ierr)
1608  if (ierr.ne.0) then
1609  CALL wrf_error_fatal ( &
1610 'frame/module_domain.f: Failed to allocate grid%g_ph_btxs(1,1,1).  ')
1611  endif
1612 ALLOCATE(grid%g_ph_btxe(1,1,1),STAT=ierr)
1613  if (ierr.ne.0) then
1614  CALL wrf_error_fatal ( &
1615 'frame/module_domain.f: Failed to allocate grid%g_ph_btxe(1,1,1).  ')
1616  endif
1617 ALLOCATE(grid%g_ph_btys(1,1,1),STAT=ierr)
1618  if (ierr.ne.0) then
1619  CALL wrf_error_fatal ( &
1620 'frame/module_domain.f: Failed to allocate grid%g_ph_btys(1,1,1).  ')
1621  endif
1622 ALLOCATE(grid%g_ph_btye(1,1,1),STAT=ierr)
1623  if (ierr.ne.0) then
1624  CALL wrf_error_fatal ( &
1625 'frame/module_domain.f: Failed to allocate grid%g_ph_btye(1,1,1).  ')
1626  endif
1627 ENDIF
1628 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1629 ALLOCATE(grid%em_phb(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1630  if (ierr.ne.0) then
1631  CALL wrf_error_fatal ( &
1632 'frame/module_domain.f: Failed to allocate grid%em_phb(sm31:em31,sm32:em32,sm33:em33). ')
1633  endif
1634 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_phb=initial_data_value
1635 IF(IAND(1,tl).NE.0)THEN
1636 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1637 ALLOCATE(grid%em_t_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1638  if (ierr.ne.0) then
1639  CALL wrf_error_fatal ( &
1640 'frame/module_domain.f: Failed to allocate grid%em_t_1(sm31:em31,sm32:em32,sm33:em33). ')
1641  endif
1642 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_1=initial_data_value
1643 ELSE
1644 ALLOCATE(grid%em_t_1(1,1,1),STAT=ierr)
1645  if (ierr.ne.0) then
1646  CALL wrf_error_fatal ( &
1647 'frame/module_domain.f: Failed to allocate grid%em_t_1(1,1,1).  ')
1648  endif
1649 ENDIF
1650 IF(IAND(2,tl).NE.0)THEN
1651 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1652 ALLOCATE(grid%em_t_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1653  if (ierr.ne.0) then
1654  CALL wrf_error_fatal ( &
1655 'frame/module_domain.f: Failed to allocate grid%em_t_2(sm31:em31,sm32:em32,sm33:em33). ')
1656  endif
1657 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_2=initial_data_value
1658 ELSE
1659 ALLOCATE(grid%em_t_2(1,1,1),STAT=ierr)
1660  if (ierr.ne.0) then
1661  CALL wrf_error_fatal ( &
1662 'frame/module_domain.f: Failed to allocate grid%em_t_2(1,1,1).  ')
1663  endif
1664 ENDIF
1665 IF(.NOT.inter_domain)THEN
1666 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1667 ALLOCATE(grid%em_t_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1668  if (ierr.ne.0) then
1669  CALL wrf_error_fatal ( &
1670 'frame/module_domain.f: Failed to allocate grid%em_t_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1671  endif
1672 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_bxs=initial_data_value
1673 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1674 ALLOCATE(grid%em_t_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1675  if (ierr.ne.0) then
1676  CALL wrf_error_fatal ( &
1677 'frame/module_domain.f: Failed to allocate grid%em_t_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1678  endif
1679 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_bxe=initial_data_value
1680 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1681 ALLOCATE(grid%em_t_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1682  if (ierr.ne.0) then
1683  CALL wrf_error_fatal ( &
1684 'frame/module_domain.f: Failed to allocate grid%em_t_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
1685  endif
1686 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_bys=initial_data_value
1687 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1688 ALLOCATE(grid%em_t_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1689  if (ierr.ne.0) then
1690  CALL wrf_error_fatal ( &
1691 'frame/module_domain.f: Failed to allocate grid%em_t_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
1692  endif
1693 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_bye=initial_data_value
1694 ELSE
1695 ALLOCATE(grid%em_t_bxs(1,1,1),STAT=ierr)
1696  if (ierr.ne.0) then
1697  CALL wrf_error_fatal ( &
1698 'frame/module_domain.f: Failed to allocate grid%em_t_bxs(1,1,1).  ')
1699  endif
1700 ALLOCATE(grid%em_t_bxe(1,1,1),STAT=ierr)
1701  if (ierr.ne.0) then
1702  CALL wrf_error_fatal ( &
1703 'frame/module_domain.f: Failed to allocate grid%em_t_bxe(1,1,1).  ')
1704  endif
1705 ALLOCATE(grid%em_t_bys(1,1,1),STAT=ierr)
1706  if (ierr.ne.0) then
1707  CALL wrf_error_fatal ( &
1708 'frame/module_domain.f: Failed to allocate grid%em_t_bys(1,1,1).  ')
1709  endif
1710 ALLOCATE(grid%em_t_bye(1,1,1),STAT=ierr)
1711  if (ierr.ne.0) then
1712  CALL wrf_error_fatal ( &
1713 'frame/module_domain.f: Failed to allocate grid%em_t_bye(1,1,1).  ')
1714  endif
1715 ENDIF
1716 IF(.NOT.inter_domain)THEN
1717 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1718 ALLOCATE(grid%em_t_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1719  if (ierr.ne.0) then
1720  CALL wrf_error_fatal ( &
1721 'frame/module_domain.f: Failed to allocate grid%em_t_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1722  endif
1723 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_btxs=initial_data_value
1724 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1725 ALLOCATE(grid%em_t_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1726  if (ierr.ne.0) then
1727  CALL wrf_error_fatal ( &
1728 'frame/module_domain.f: Failed to allocate grid%em_t_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1729  endif
1730 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_btxe=initial_data_value
1731 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1732 ALLOCATE(grid%em_t_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1733  if (ierr.ne.0) then
1734  CALL wrf_error_fatal ( &
1735 'frame/module_domain.f: Failed to allocate grid%em_t_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
1736  endif
1737 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_btys=initial_data_value
1738 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1739 ALLOCATE(grid%em_t_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1740  if (ierr.ne.0) then
1741  CALL wrf_error_fatal ( &
1742 'frame/module_domain.f: Failed to allocate grid%em_t_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
1743  endif
1744 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_btye=initial_data_value
1745 ELSE
1746 ALLOCATE(grid%em_t_btxs(1,1,1),STAT=ierr)
1747  if (ierr.ne.0) then
1748  CALL wrf_error_fatal ( &
1749 'frame/module_domain.f: Failed to allocate grid%em_t_btxs(1,1,1).  ')
1750  endif
1751 ALLOCATE(grid%em_t_btxe(1,1,1),STAT=ierr)
1752  if (ierr.ne.0) then
1753  CALL wrf_error_fatal ( &
1754 'frame/module_domain.f: Failed to allocate grid%em_t_btxe(1,1,1).  ')
1755  endif
1756 ALLOCATE(grid%em_t_btys(1,1,1),STAT=ierr)
1757  if (ierr.ne.0) then
1758  CALL wrf_error_fatal ( &
1759 'frame/module_domain.f: Failed to allocate grid%em_t_btys(1,1,1).  ')
1760  endif
1761 ALLOCATE(grid%em_t_btye(1,1,1),STAT=ierr)
1762  if (ierr.ne.0) then
1763  CALL wrf_error_fatal ( &
1764 'frame/module_domain.f: Failed to allocate grid%em_t_btye(1,1,1).  ')
1765  endif
1766 ENDIF
1767 IF(IAND(1,tl).NE.0)THEN
1768 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1769 ALLOCATE(grid%a_t_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1770  if (ierr.ne.0) then
1771  CALL wrf_error_fatal ( &
1772 'frame/module_domain.f: Failed to allocate grid%a_t_1(sm31:em31,sm32:em32,sm33:em33). ')
1773  endif
1774 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_1=initial_data_value
1775 ELSE
1776 ALLOCATE(grid%a_t_1(1,1,1),STAT=ierr)
1777  if (ierr.ne.0) then
1778  CALL wrf_error_fatal ( &
1779 'frame/module_domain.f: Failed to allocate grid%a_t_1(1,1,1).  ')
1780  endif
1781 ENDIF
1782 IF(IAND(2,tl).NE.0)THEN
1783 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1784 ALLOCATE(grid%a_t_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1785  if (ierr.ne.0) then
1786  CALL wrf_error_fatal ( &
1787 'frame/module_domain.f: Failed to allocate grid%a_t_2(sm31:em31,sm32:em32,sm33:em33). ')
1788  endif
1789 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_2=initial_data_value
1790 ELSE
1791 ALLOCATE(grid%a_t_2(1,1,1),STAT=ierr)
1792  if (ierr.ne.0) then
1793  CALL wrf_error_fatal ( &
1794 'frame/module_domain.f: Failed to allocate grid%a_t_2(1,1,1).  ')
1795  endif
1796 ENDIF
1797 IF(.NOT.inter_domain)THEN
1798 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1799 ALLOCATE(grid%a_t_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1800  if (ierr.ne.0) then
1801  CALL wrf_error_fatal ( &
1802 'frame/module_domain.f: Failed to allocate grid%a_t_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1803  endif
1804 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_bxs=initial_data_value
1805 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1806 ALLOCATE(grid%a_t_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1807  if (ierr.ne.0) then
1808  CALL wrf_error_fatal ( &
1809 'frame/module_domain.f: Failed to allocate grid%a_t_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1810  endif
1811 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_bxe=initial_data_value
1812 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1813 ALLOCATE(grid%a_t_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1814  if (ierr.ne.0) then
1815  CALL wrf_error_fatal ( &
1816 'frame/module_domain.f: Failed to allocate grid%a_t_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
1817  endif
1818 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_bys=initial_data_value
1819 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1820 ALLOCATE(grid%a_t_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1821  if (ierr.ne.0) then
1822  CALL wrf_error_fatal ( &
1823 'frame/module_domain.f: Failed to allocate grid%a_t_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
1824  endif
1825 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_bye=initial_data_value
1826 ELSE
1827 ALLOCATE(grid%a_t_bxs(1,1,1),STAT=ierr)
1828  if (ierr.ne.0) then
1829  CALL wrf_error_fatal ( &
1830 'frame/module_domain.f: Failed to allocate grid%a_t_bxs(1,1,1).  ')
1831  endif
1832 ALLOCATE(grid%a_t_bxe(1,1,1),STAT=ierr)
1833  if (ierr.ne.0) then
1834  CALL wrf_error_fatal ( &
1835 'frame/module_domain.f: Failed to allocate grid%a_t_bxe(1,1,1).  ')
1836  endif
1837 ALLOCATE(grid%a_t_bys(1,1,1),STAT=ierr)
1838  if (ierr.ne.0) then
1839  CALL wrf_error_fatal ( &
1840 'frame/module_domain.f: Failed to allocate grid%a_t_bys(1,1,1).  ')
1841  endif
1842 ALLOCATE(grid%a_t_bye(1,1,1),STAT=ierr)
1843  if (ierr.ne.0) then
1844  CALL wrf_error_fatal ( &
1845 'frame/module_domain.f: Failed to allocate grid%a_t_bye(1,1,1).  ')
1846  endif
1847 ENDIF
1848 IF(.NOT.inter_domain)THEN
1849 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1850 ALLOCATE(grid%a_t_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1851  if (ierr.ne.0) then
1852  CALL wrf_error_fatal ( &
1853 'frame/module_domain.f: Failed to allocate grid%a_t_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1854  endif
1855 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_btxs=initial_data_value
1856 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1857 ALLOCATE(grid%a_t_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1858  if (ierr.ne.0) then
1859  CALL wrf_error_fatal ( &
1860 'frame/module_domain.f: Failed to allocate grid%a_t_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1861  endif
1862 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_btxe=initial_data_value
1863 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1864 ALLOCATE(grid%a_t_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1865  if (ierr.ne.0) then
1866  CALL wrf_error_fatal ( &
1867 'frame/module_domain.f: Failed to allocate grid%a_t_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
1868  endif
1869 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_btys=initial_data_value
1870 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1871 ALLOCATE(grid%a_t_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1872  if (ierr.ne.0) then
1873  CALL wrf_error_fatal ( &
1874 'frame/module_domain.f: Failed to allocate grid%a_t_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
1875  endif
1876 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_t_btye=initial_data_value
1877 ELSE
1878 ALLOCATE(grid%a_t_btxs(1,1,1),STAT=ierr)
1879  if (ierr.ne.0) then
1880  CALL wrf_error_fatal ( &
1881 'frame/module_domain.f: Failed to allocate grid%a_t_btxs(1,1,1).  ')
1882  endif
1883 ALLOCATE(grid%a_t_btxe(1,1,1),STAT=ierr)
1884  if (ierr.ne.0) then
1885  CALL wrf_error_fatal ( &
1886 'frame/module_domain.f: Failed to allocate grid%a_t_btxe(1,1,1).  ')
1887  endif
1888 ALLOCATE(grid%a_t_btys(1,1,1),STAT=ierr)
1889  if (ierr.ne.0) then
1890  CALL wrf_error_fatal ( &
1891 'frame/module_domain.f: Failed to allocate grid%a_t_btys(1,1,1).  ')
1892  endif
1893 ALLOCATE(grid%a_t_btye(1,1,1),STAT=ierr)
1894  if (ierr.ne.0) then
1895  CALL wrf_error_fatal ( &
1896 'frame/module_domain.f: Failed to allocate grid%a_t_btye(1,1,1).  ')
1897  endif
1898 ENDIF
1899 IF(IAND(1,tl).NE.0)THEN
1900 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1901 ALLOCATE(grid%g_t_1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1902  if (ierr.ne.0) then
1903  CALL wrf_error_fatal ( &
1904 'frame/module_domain.f: Failed to allocate grid%g_t_1(sm31:em31,sm32:em32,sm33:em33). ')
1905  endif
1906 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_1=initial_data_value
1907 ELSE
1908 ALLOCATE(grid%g_t_1(1,1,1),STAT=ierr)
1909  if (ierr.ne.0) then
1910  CALL wrf_error_fatal ( &
1911 'frame/module_domain.f: Failed to allocate grid%g_t_1(1,1,1).  ')
1912  endif
1913 ENDIF
1914 IF(IAND(2,tl).NE.0)THEN
1915 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
1916 ALLOCATE(grid%g_t_2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
1917  if (ierr.ne.0) then
1918  CALL wrf_error_fatal ( &
1919 'frame/module_domain.f: Failed to allocate grid%g_t_2(sm31:em31,sm32:em32,sm33:em33). ')
1920  endif
1921 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_2=initial_data_value
1922 ELSE
1923 ALLOCATE(grid%g_t_2(1,1,1),STAT=ierr)
1924  if (ierr.ne.0) then
1925  CALL wrf_error_fatal ( &
1926 'frame/module_domain.f: Failed to allocate grid%g_t_2(1,1,1).  ')
1927  endif
1928 ENDIF
1929 IF(.NOT.inter_domain)THEN
1930 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1931 ALLOCATE(grid%g_t_bxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1932  if (ierr.ne.0) then
1933  CALL wrf_error_fatal ( &
1934 'frame/module_domain.f: Failed to allocate grid%g_t_bxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1935  endif
1936 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_bxs=initial_data_value
1937 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1938 ALLOCATE(grid%g_t_bxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1939  if (ierr.ne.0) then
1940  CALL wrf_error_fatal ( &
1941 'frame/module_domain.f: Failed to allocate grid%g_t_bxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1942  endif
1943 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_bxe=initial_data_value
1944 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1945 ALLOCATE(grid%g_t_bys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1946  if (ierr.ne.0) then
1947  CALL wrf_error_fatal ( &
1948 'frame/module_domain.f: Failed to allocate grid%g_t_bys(sm31:em31,sm33:em33,spec_bdy_width). ')
1949  endif
1950 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_bys=initial_data_value
1951 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1952 ALLOCATE(grid%g_t_bye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1953  if (ierr.ne.0) then
1954  CALL wrf_error_fatal ( &
1955 'frame/module_domain.f: Failed to allocate grid%g_t_bye(sm31:em31,sm33:em33,spec_bdy_width). ')
1956  endif
1957 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_bye=initial_data_value
1958 ELSE
1959 ALLOCATE(grid%g_t_bxs(1,1,1),STAT=ierr)
1960  if (ierr.ne.0) then
1961  CALL wrf_error_fatal ( &
1962 'frame/module_domain.f: Failed to allocate grid%g_t_bxs(1,1,1).  ')
1963  endif
1964 ALLOCATE(grid%g_t_bxe(1,1,1),STAT=ierr)
1965  if (ierr.ne.0) then
1966  CALL wrf_error_fatal ( &
1967 'frame/module_domain.f: Failed to allocate grid%g_t_bxe(1,1,1).  ')
1968  endif
1969 ALLOCATE(grid%g_t_bys(1,1,1),STAT=ierr)
1970  if (ierr.ne.0) then
1971  CALL wrf_error_fatal ( &
1972 'frame/module_domain.f: Failed to allocate grid%g_t_bys(1,1,1).  ')
1973  endif
1974 ALLOCATE(grid%g_t_bye(1,1,1),STAT=ierr)
1975  if (ierr.ne.0) then
1976  CALL wrf_error_fatal ( &
1977 'frame/module_domain.f: Failed to allocate grid%g_t_bye(1,1,1).  ')
1978  endif
1979 ENDIF
1980 IF(.NOT.inter_domain)THEN
1981 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1982 ALLOCATE(grid%g_t_btxs(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1983  if (ierr.ne.0) then
1984  CALL wrf_error_fatal ( &
1985 'frame/module_domain.f: Failed to allocate grid%g_t_btxs(sm32:em32,sm33:em33,spec_bdy_width). ')
1986  endif
1987 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_btxs=initial_data_value
1988 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1989 ALLOCATE(grid%g_t_btxe(sm32:em32,sm33:em33,spec_bdy_width),STAT=ierr)
1990  if (ierr.ne.0) then
1991  CALL wrf_error_fatal ( &
1992 'frame/module_domain.f: Failed to allocate grid%g_t_btxe(sm32:em32,sm33:em33,spec_bdy_width). ')
1993  endif
1994 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_btxe=initial_data_value
1995 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
1996 ALLOCATE(grid%g_t_btys(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
1997  if (ierr.ne.0) then
1998  CALL wrf_error_fatal ( &
1999 'frame/module_domain.f: Failed to allocate grid%g_t_btys(sm31:em31,sm33:em33,spec_bdy_width). ')
2000  endif
2001 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_btys=initial_data_value
2002 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width))) * RWORDSIZE
2003 ALLOCATE(grid%g_t_btye(sm31:em31,sm33:em33,spec_bdy_width),STAT=ierr)
2004  if (ierr.ne.0) then
2005  CALL wrf_error_fatal ( &
2006 'frame/module_domain.f: Failed to allocate grid%g_t_btye(sm31:em31,sm33:em33,spec_bdy_width). ')
2007  endif
2008 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_t_btye=initial_data_value
2009 ELSE
2010 ALLOCATE(grid%g_t_btxs(1,1,1),STAT=ierr)
2011  if (ierr.ne.0) then
2012  CALL wrf_error_fatal ( &
2013 'frame/module_domain.f: Failed to allocate grid%g_t_btxs(1,1,1).  ')
2014  endif
2015 ALLOCATE(grid%g_t_btxe(1,1,1),STAT=ierr)
2016  if (ierr.ne.0) then
2017  CALL wrf_error_fatal ( &
2018 'frame/module_domain.f: Failed to allocate grid%g_t_btxe(1,1,1).  ')
2019  endif
2020 ALLOCATE(grid%g_t_btys(1,1,1),STAT=ierr)
2021  if (ierr.ne.0) then
2022  CALL wrf_error_fatal ( &
2023 'frame/module_domain.f: Failed to allocate grid%g_t_btys(1,1,1).  ')
2024  endif
2025 ALLOCATE(grid%g_t_btye(1,1,1),STAT=ierr)
2026  if (ierr.ne.0) then
2027  CALL wrf_error_fatal ( &
2028 'frame/module_domain.f: Failed to allocate grid%g_t_btye(1,1,1).  ')
2029  endif
2030 ENDIF
2031 IF(IAND(1,tl).NE.0)THEN
2032 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2033 ALLOCATE(grid%em_mu_1(sm31:em31,sm32:em32),STAT=ierr)
2034  if (ierr.ne.0) then
2035  CALL wrf_error_fatal ( &
2036 'frame/module_domain.f: Failed to allocate grid%em_mu_1(sm31:em31,sm32:em32). ')
2037  endif
2038 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_1=initial_data_value
2039 ELSE
2040 ALLOCATE(grid%em_mu_1(1,1),STAT=ierr)
2041  if (ierr.ne.0) then
2042  CALL wrf_error_fatal ( &
2043 'frame/module_domain.f: Failed to allocate grid%em_mu_1(1,1).  ')
2044  endif
2045 ENDIF
2046 IF(IAND(2,tl).NE.0)THEN
2047 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2048 ALLOCATE(grid%em_mu_2(sm31:em31,sm32:em32),STAT=ierr)
2049  if (ierr.ne.0) then
2050  CALL wrf_error_fatal ( &
2051 'frame/module_domain.f: Failed to allocate grid%em_mu_2(sm31:em31,sm32:em32). ')
2052  endif
2053 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_2=initial_data_value
2054 ELSE
2055 ALLOCATE(grid%em_mu_2(1,1),STAT=ierr)
2056  if (ierr.ne.0) then
2057  CALL wrf_error_fatal ( &
2058 'frame/module_domain.f: Failed to allocate grid%em_mu_2(1,1).  ')
2059  endif
2060 ENDIF
2061 IF(.NOT.inter_domain)THEN
2062 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2063 ALLOCATE(grid%em_mu_bxs(sm32:em32,1,spec_bdy_width),STAT=ierr)
2064  if (ierr.ne.0) then
2065  CALL wrf_error_fatal ( &
2066 'frame/module_domain.f: Failed to allocate grid%em_mu_bxs(sm32:em32,1,spec_bdy_width). ')
2067  endif
2068 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_bxs=initial_data_value
2069 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2070 ALLOCATE(grid%em_mu_bxe(sm32:em32,1,spec_bdy_width),STAT=ierr)
2071  if (ierr.ne.0) then
2072  CALL wrf_error_fatal ( &
2073 'frame/module_domain.f: Failed to allocate grid%em_mu_bxe(sm32:em32,1,spec_bdy_width). ')
2074  endif
2075 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_bxe=initial_data_value
2076 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2077 ALLOCATE(grid%em_mu_bys(sm31:em31,1,spec_bdy_width),STAT=ierr)
2078  if (ierr.ne.0) then
2079  CALL wrf_error_fatal ( &
2080 'frame/module_domain.f: Failed to allocate grid%em_mu_bys(sm31:em31,1,spec_bdy_width). ')
2081  endif
2082 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_bys=initial_data_value
2083 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2084 ALLOCATE(grid%em_mu_bye(sm31:em31,1,spec_bdy_width),STAT=ierr)
2085  if (ierr.ne.0) then
2086  CALL wrf_error_fatal ( &
2087 'frame/module_domain.f: Failed to allocate grid%em_mu_bye(sm31:em31,1,spec_bdy_width). ')
2088  endif
2089 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_bye=initial_data_value
2090 ELSE
2091 ALLOCATE(grid%em_mu_bxs(1,1,1),STAT=ierr)
2092  if (ierr.ne.0) then
2093  CALL wrf_error_fatal ( &
2094 'frame/module_domain.f: Failed to allocate grid%em_mu_bxs(1,1,1).  ')
2095  endif
2096 ALLOCATE(grid%em_mu_bxe(1,1,1),STAT=ierr)
2097  if (ierr.ne.0) then
2098  CALL wrf_error_fatal ( &
2099 'frame/module_domain.f: Failed to allocate grid%em_mu_bxe(1,1,1).  ')
2100  endif
2101 ALLOCATE(grid%em_mu_bys(1,1,1),STAT=ierr)
2102  if (ierr.ne.0) then
2103  CALL wrf_error_fatal ( &
2104 'frame/module_domain.f: Failed to allocate grid%em_mu_bys(1,1,1).  ')
2105  endif
2106 ALLOCATE(grid%em_mu_bye(1,1,1),STAT=ierr)
2107  if (ierr.ne.0) then
2108  CALL wrf_error_fatal ( &
2109 'frame/module_domain.f: Failed to allocate grid%em_mu_bye(1,1,1).  ')
2110  endif
2111 ENDIF
2112 IF(.NOT.inter_domain)THEN
2113 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2114 ALLOCATE(grid%em_mu_btxs(sm32:em32,1,spec_bdy_width),STAT=ierr)
2115  if (ierr.ne.0) then
2116  CALL wrf_error_fatal ( &
2117 'frame/module_domain.f: Failed to allocate grid%em_mu_btxs(sm32:em32,1,spec_bdy_width). ')
2118  endif
2119 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_btxs=initial_data_value
2120 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2121 ALLOCATE(grid%em_mu_btxe(sm32:em32,1,spec_bdy_width),STAT=ierr)
2122  if (ierr.ne.0) then
2123  CALL wrf_error_fatal ( &
2124 'frame/module_domain.f: Failed to allocate grid%em_mu_btxe(sm32:em32,1,spec_bdy_width). ')
2125  endif
2126 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_btxe=initial_data_value
2127 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2128 ALLOCATE(grid%em_mu_btys(sm31:em31,1,spec_bdy_width),STAT=ierr)
2129  if (ierr.ne.0) then
2130  CALL wrf_error_fatal ( &
2131 'frame/module_domain.f: Failed to allocate grid%em_mu_btys(sm31:em31,1,spec_bdy_width). ')
2132  endif
2133 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_btys=initial_data_value
2134 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2135 ALLOCATE(grid%em_mu_btye(sm31:em31,1,spec_bdy_width),STAT=ierr)
2136  if (ierr.ne.0) then
2137  CALL wrf_error_fatal ( &
2138 'frame/module_domain.f: Failed to allocate grid%em_mu_btye(sm31:em31,1,spec_bdy_width). ')
2139  endif
2140 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu_btye=initial_data_value
2141 ELSE
2142 ALLOCATE(grid%em_mu_btxs(1,1,1),STAT=ierr)
2143  if (ierr.ne.0) then
2144  CALL wrf_error_fatal ( &
2145 'frame/module_domain.f: Failed to allocate grid%em_mu_btxs(1,1,1).  ')
2146  endif
2147 ALLOCATE(grid%em_mu_btxe(1,1,1),STAT=ierr)
2148  if (ierr.ne.0) then
2149  CALL wrf_error_fatal ( &
2150 'frame/module_domain.f: Failed to allocate grid%em_mu_btxe(1,1,1).  ')
2151  endif
2152 ALLOCATE(grid%em_mu_btys(1,1,1),STAT=ierr)
2153  if (ierr.ne.0) then
2154  CALL wrf_error_fatal ( &
2155 'frame/module_domain.f: Failed to allocate grid%em_mu_btys(1,1,1).  ')
2156  endif
2157 ALLOCATE(grid%em_mu_btye(1,1,1),STAT=ierr)
2158  if (ierr.ne.0) then
2159  CALL wrf_error_fatal ( &
2160 'frame/module_domain.f: Failed to allocate grid%em_mu_btye(1,1,1).  ')
2161  endif
2162 ENDIF
2163 IF(IAND(1,tl).NE.0)THEN
2164 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2165 ALLOCATE(grid%a_mu_1(sm31:em31,sm32:em32),STAT=ierr)
2166  if (ierr.ne.0) then
2167  CALL wrf_error_fatal ( &
2168 'frame/module_domain.f: Failed to allocate grid%a_mu_1(sm31:em31,sm32:em32). ')
2169  endif
2170 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_1=initial_data_value
2171 ELSE
2172 ALLOCATE(grid%a_mu_1(1,1),STAT=ierr)
2173  if (ierr.ne.0) then
2174  CALL wrf_error_fatal ( &
2175 'frame/module_domain.f: Failed to allocate grid%a_mu_1(1,1).  ')
2176  endif
2177 ENDIF
2178 IF(IAND(2,tl).NE.0)THEN
2179 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2180 ALLOCATE(grid%a_mu_2(sm31:em31,sm32:em32),STAT=ierr)
2181  if (ierr.ne.0) then
2182  CALL wrf_error_fatal ( &
2183 'frame/module_domain.f: Failed to allocate grid%a_mu_2(sm31:em31,sm32:em32). ')
2184  endif
2185 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_2=initial_data_value
2186 ELSE
2187 ALLOCATE(grid%a_mu_2(1,1),STAT=ierr)
2188  if (ierr.ne.0) then
2189  CALL wrf_error_fatal ( &
2190 'frame/module_domain.f: Failed to allocate grid%a_mu_2(1,1).  ')
2191  endif
2192 ENDIF
2193 IF(.NOT.inter_domain)THEN
2194 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2195 ALLOCATE(grid%a_mu_bxs(sm32:em32,1,spec_bdy_width),STAT=ierr)
2196  if (ierr.ne.0) then
2197  CALL wrf_error_fatal ( &
2198 'frame/module_domain.f: Failed to allocate grid%a_mu_bxs(sm32:em32,1,spec_bdy_width). ')
2199  endif
2200 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_bxs=initial_data_value
2201 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2202 ALLOCATE(grid%a_mu_bxe(sm32:em32,1,spec_bdy_width),STAT=ierr)
2203  if (ierr.ne.0) then
2204  CALL wrf_error_fatal ( &
2205 'frame/module_domain.f: Failed to allocate grid%a_mu_bxe(sm32:em32,1,spec_bdy_width). ')
2206  endif
2207 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_bxe=initial_data_value
2208 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2209 ALLOCATE(grid%a_mu_bys(sm31:em31,1,spec_bdy_width),STAT=ierr)
2210  if (ierr.ne.0) then
2211  CALL wrf_error_fatal ( &
2212 'frame/module_domain.f: Failed to allocate grid%a_mu_bys(sm31:em31,1,spec_bdy_width). ')
2213  endif
2214 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_bys=initial_data_value
2215 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2216 ALLOCATE(grid%a_mu_bye(sm31:em31,1,spec_bdy_width),STAT=ierr)
2217  if (ierr.ne.0) then
2218  CALL wrf_error_fatal ( &
2219 'frame/module_domain.f: Failed to allocate grid%a_mu_bye(sm31:em31,1,spec_bdy_width). ')
2220  endif
2221 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_bye=initial_data_value
2222 ELSE
2223 ALLOCATE(grid%a_mu_bxs(1,1,1),STAT=ierr)
2224  if (ierr.ne.0) then
2225  CALL wrf_error_fatal ( &
2226 'frame/module_domain.f: Failed to allocate grid%a_mu_bxs(1,1,1).  ')
2227  endif
2228 ALLOCATE(grid%a_mu_bxe(1,1,1),STAT=ierr)
2229  if (ierr.ne.0) then
2230  CALL wrf_error_fatal ( &
2231 'frame/module_domain.f: Failed to allocate grid%a_mu_bxe(1,1,1).  ')
2232  endif
2233 ALLOCATE(grid%a_mu_bys(1,1,1),STAT=ierr)
2234  if (ierr.ne.0) then
2235  CALL wrf_error_fatal ( &
2236 'frame/module_domain.f: Failed to allocate grid%a_mu_bys(1,1,1).  ')
2237  endif
2238 ALLOCATE(grid%a_mu_bye(1,1,1),STAT=ierr)
2239  if (ierr.ne.0) then
2240  CALL wrf_error_fatal ( &
2241 'frame/module_domain.f: Failed to allocate grid%a_mu_bye(1,1,1).  ')
2242  endif
2243 ENDIF
2244 IF(.NOT.inter_domain)THEN
2245 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2246 ALLOCATE(grid%a_mu_btxs(sm32:em32,1,spec_bdy_width),STAT=ierr)
2247  if (ierr.ne.0) then
2248  CALL wrf_error_fatal ( &
2249 'frame/module_domain.f: Failed to allocate grid%a_mu_btxs(sm32:em32,1,spec_bdy_width). ')
2250  endif
2251 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_btxs=initial_data_value
2252 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2253 ALLOCATE(grid%a_mu_btxe(sm32:em32,1,spec_bdy_width),STAT=ierr)
2254  if (ierr.ne.0) then
2255  CALL wrf_error_fatal ( &
2256 'frame/module_domain.f: Failed to allocate grid%a_mu_btxe(sm32:em32,1,spec_bdy_width). ')
2257  endif
2258 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_btxe=initial_data_value
2259 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2260 ALLOCATE(grid%a_mu_btys(sm31:em31,1,spec_bdy_width),STAT=ierr)
2261  if (ierr.ne.0) then
2262  CALL wrf_error_fatal ( &
2263 'frame/module_domain.f: Failed to allocate grid%a_mu_btys(sm31:em31,1,spec_bdy_width). ')
2264  endif
2265 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_btys=initial_data_value
2266 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2267 ALLOCATE(grid%a_mu_btye(sm31:em31,1,spec_bdy_width),STAT=ierr)
2268  if (ierr.ne.0) then
2269  CALL wrf_error_fatal ( &
2270 'frame/module_domain.f: Failed to allocate grid%a_mu_btye(sm31:em31,1,spec_bdy_width). ')
2271  endif
2272 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_mu_btye=initial_data_value
2273 ELSE
2274 ALLOCATE(grid%a_mu_btxs(1,1,1),STAT=ierr)
2275  if (ierr.ne.0) then
2276  CALL wrf_error_fatal ( &
2277 'frame/module_domain.f: Failed to allocate grid%a_mu_btxs(1,1,1).  ')
2278  endif
2279 ALLOCATE(grid%a_mu_btxe(1,1,1),STAT=ierr)
2280  if (ierr.ne.0) then
2281  CALL wrf_error_fatal ( &
2282 'frame/module_domain.f: Failed to allocate grid%a_mu_btxe(1,1,1).  ')
2283  endif
2284 ALLOCATE(grid%a_mu_btys(1,1,1),STAT=ierr)
2285  if (ierr.ne.0) then
2286  CALL wrf_error_fatal ( &
2287 'frame/module_domain.f: Failed to allocate grid%a_mu_btys(1,1,1).  ')
2288  endif
2289 ALLOCATE(grid%a_mu_btye(1,1,1),STAT=ierr)
2290  if (ierr.ne.0) then
2291  CALL wrf_error_fatal ( &
2292 'frame/module_domain.f: Failed to allocate grid%a_mu_btye(1,1,1).  ')
2293  endif
2294 ENDIF
2295 IF(IAND(1,tl).NE.0)THEN
2296 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2297 ALLOCATE(grid%g_mu_1(sm31:em31,sm32:em32),STAT=ierr)
2298  if (ierr.ne.0) then
2299  CALL wrf_error_fatal ( &
2300 'frame/module_domain.f: Failed to allocate grid%g_mu_1(sm31:em31,sm32:em32). ')
2301  endif
2302 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_1=initial_data_value
2303 ELSE
2304 ALLOCATE(grid%g_mu_1(1,1),STAT=ierr)
2305  if (ierr.ne.0) then
2306  CALL wrf_error_fatal ( &
2307 'frame/module_domain.f: Failed to allocate grid%g_mu_1(1,1).  ')
2308  endif
2309 ENDIF
2310 IF(IAND(2,tl).NE.0)THEN
2311 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2312 ALLOCATE(grid%g_mu_2(sm31:em31,sm32:em32),STAT=ierr)
2313  if (ierr.ne.0) then
2314  CALL wrf_error_fatal ( &
2315 'frame/module_domain.f: Failed to allocate grid%g_mu_2(sm31:em31,sm32:em32). ')
2316  endif
2317 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_2=initial_data_value
2318 ELSE
2319 ALLOCATE(grid%g_mu_2(1,1),STAT=ierr)
2320  if (ierr.ne.0) then
2321  CALL wrf_error_fatal ( &
2322 'frame/module_domain.f: Failed to allocate grid%g_mu_2(1,1).  ')
2323  endif
2324 ENDIF
2325 IF(.NOT.inter_domain)THEN
2326 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2327 ALLOCATE(grid%g_mu_bxs(sm32:em32,1,spec_bdy_width),STAT=ierr)
2328  if (ierr.ne.0) then
2329  CALL wrf_error_fatal ( &
2330 'frame/module_domain.f: Failed to allocate grid%g_mu_bxs(sm32:em32,1,spec_bdy_width). ')
2331  endif
2332 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_bxs=initial_data_value
2333 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2334 ALLOCATE(grid%g_mu_bxe(sm32:em32,1,spec_bdy_width),STAT=ierr)
2335  if (ierr.ne.0) then
2336  CALL wrf_error_fatal ( &
2337 'frame/module_domain.f: Failed to allocate grid%g_mu_bxe(sm32:em32,1,spec_bdy_width). ')
2338  endif
2339 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_bxe=initial_data_value
2340 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2341 ALLOCATE(grid%g_mu_bys(sm31:em31,1,spec_bdy_width),STAT=ierr)
2342  if (ierr.ne.0) then
2343  CALL wrf_error_fatal ( &
2344 'frame/module_domain.f: Failed to allocate grid%g_mu_bys(sm31:em31,1,spec_bdy_width). ')
2345  endif
2346 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_bys=initial_data_value
2347 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2348 ALLOCATE(grid%g_mu_bye(sm31:em31,1,spec_bdy_width),STAT=ierr)
2349  if (ierr.ne.0) then
2350  CALL wrf_error_fatal ( &
2351 'frame/module_domain.f: Failed to allocate grid%g_mu_bye(sm31:em31,1,spec_bdy_width). ')
2352  endif
2353 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_bye=initial_data_value
2354 ELSE
2355 ALLOCATE(grid%g_mu_bxs(1,1,1),STAT=ierr)
2356  if (ierr.ne.0) then
2357  CALL wrf_error_fatal ( &
2358 'frame/module_domain.f: Failed to allocate grid%g_mu_bxs(1,1,1).  ')
2359  endif
2360 ALLOCATE(grid%g_mu_bxe(1,1,1),STAT=ierr)
2361  if (ierr.ne.0) then
2362  CALL wrf_error_fatal ( &
2363 'frame/module_domain.f: Failed to allocate grid%g_mu_bxe(1,1,1).  ')
2364  endif
2365 ALLOCATE(grid%g_mu_bys(1,1,1),STAT=ierr)
2366  if (ierr.ne.0) then
2367  CALL wrf_error_fatal ( &
2368 'frame/module_domain.f: Failed to allocate grid%g_mu_bys(1,1,1).  ')
2369  endif
2370 ALLOCATE(grid%g_mu_bye(1,1,1),STAT=ierr)
2371  if (ierr.ne.0) then
2372  CALL wrf_error_fatal ( &
2373 'frame/module_domain.f: Failed to allocate grid%g_mu_bye(1,1,1).  ')
2374  endif
2375 ENDIF
2376 IF(.NOT.inter_domain)THEN
2377 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2378 ALLOCATE(grid%g_mu_btxs(sm32:em32,1,spec_bdy_width),STAT=ierr)
2379  if (ierr.ne.0) then
2380  CALL wrf_error_fatal ( &
2381 'frame/module_domain.f: Failed to allocate grid%g_mu_btxs(sm32:em32,1,spec_bdy_width). ')
2382  endif
2383 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_btxs=initial_data_value
2384 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(spec_bdy_width))) * RWORDSIZE
2385 ALLOCATE(grid%g_mu_btxe(sm32:em32,1,spec_bdy_width),STAT=ierr)
2386  if (ierr.ne.0) then
2387  CALL wrf_error_fatal ( &
2388 'frame/module_domain.f: Failed to allocate grid%g_mu_btxe(sm32:em32,1,spec_bdy_width). ')
2389  endif
2390 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_btxe=initial_data_value
2391 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2392 ALLOCATE(grid%g_mu_btys(sm31:em31,1,spec_bdy_width),STAT=ierr)
2393  if (ierr.ne.0) then
2394  CALL wrf_error_fatal ( &
2395 'frame/module_domain.f: Failed to allocate grid%g_mu_btys(sm31:em31,1,spec_bdy_width). ')
2396  endif
2397 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_btys=initial_data_value
2398 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(spec_bdy_width))) * RWORDSIZE
2399 ALLOCATE(grid%g_mu_btye(sm31:em31,1,spec_bdy_width),STAT=ierr)
2400  if (ierr.ne.0) then
2401  CALL wrf_error_fatal ( &
2402 'frame/module_domain.f: Failed to allocate grid%g_mu_btye(sm31:em31,1,spec_bdy_width). ')
2403  endif
2404 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_mu_btye=initial_data_value
2405 ELSE
2406 ALLOCATE(grid%g_mu_btxs(1,1,1),STAT=ierr)
2407  if (ierr.ne.0) then
2408  CALL wrf_error_fatal ( &
2409 'frame/module_domain.f: Failed to allocate grid%g_mu_btxs(1,1,1).  ')
2410  endif
2411 ALLOCATE(grid%g_mu_btxe(1,1,1),STAT=ierr)
2412  if (ierr.ne.0) then
2413  CALL wrf_error_fatal ( &
2414 'frame/module_domain.f: Failed to allocate grid%g_mu_btxe(1,1,1).  ')
2415  endif
2416 ALLOCATE(grid%g_mu_btys(1,1,1),STAT=ierr)
2417  if (ierr.ne.0) then
2418  CALL wrf_error_fatal ( &
2419 'frame/module_domain.f: Failed to allocate grid%g_mu_btys(1,1,1).  ')
2420  endif
2421 ALLOCATE(grid%g_mu_btye(1,1,1),STAT=ierr)
2422  if (ierr.ne.0) then
2423  CALL wrf_error_fatal ( &
2424 'frame/module_domain.f: Failed to allocate grid%g_mu_btye(1,1,1).  ')
2425  endif
2426 ENDIF
2427 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2428 ALLOCATE(grid%em_mub(sm31:em31,sm32:em32),STAT=ierr)
2429  if (ierr.ne.0) then
2430  CALL wrf_error_fatal ( &
2431 'frame/module_domain.f: Failed to allocate grid%em_mub(sm31:em31,sm32:em32). ')
2432  endif
2433 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mub=initial_data_value
2434 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2435 ALLOCATE(grid%em_mu0(sm31:em31,sm32:em32),STAT=ierr)
2436  if (ierr.ne.0) then
2437  CALL wrf_error_fatal ( &
2438 'frame/module_domain.f: Failed to allocate grid%em_mu0(sm31:em31,sm32:em32). ')
2439  endif
2440 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_mu0=initial_data_value
2441 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2442 ALLOCATE(grid%nest_pos(sm31:em31,sm32:em32),STAT=ierr)
2443  if (ierr.ne.0) then
2444  CALL wrf_error_fatal ( &
2445 'frame/module_domain.f: Failed to allocate grid%nest_pos(sm31:em31,sm32:em32). ')
2446  endif
2447 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%nest_pos=initial_data_value
2448 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2449 ALLOCATE(grid%nest_mask(sm31:em31,sm32:em32),STAT=ierr)
2450  if (ierr.ne.0) then
2451  CALL wrf_error_fatal ( &
2452 'frame/module_domain.f: Failed to allocate grid%nest_mask(sm31:em31,sm32:em32). ')
2453  endif
2454 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%nest_mask=initial_data_value
2455 IF(.NOT.inter_domain)THEN
2456 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2457 ALLOCATE(grid%ht_coarse(sm31:em31,sm32:em32),STAT=ierr)
2458  if (ierr.ne.0) then
2459  CALL wrf_error_fatal ( &
2460 'frame/module_domain.f: Failed to allocate grid%ht_coarse(sm31:em31,sm32:em32). ')
2461  endif
2462 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ht_coarse=initial_data_value
2463 ELSE
2464 ALLOCATE(grid%ht_coarse(1,1),STAT=ierr)
2465  if (ierr.ne.0) then
2466  CALL wrf_error_fatal ( &
2467 'frame/module_domain.f: Failed to allocate grid%ht_coarse(1,1).  ')
2468  endif
2469 ENDIF
2470 IF(.NOT.inter_domain)THEN
2471 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
2472 ALLOCATE(grid%em_p(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
2473  if (ierr.ne.0) then
2474  CALL wrf_error_fatal ( &
2475 'frame/module_domain.f: Failed to allocate grid%em_p(sm31:em31,sm32:em32,sm33:em33). ')
2476  endif
2477 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_p=initial_data_value
2478 ELSE
2479 ALLOCATE(grid%em_p(1,1,1),STAT=ierr)
2480  if (ierr.ne.0) then
2481  CALL wrf_error_fatal ( &
2482 'frame/module_domain.f: Failed to allocate grid%em_p(1,1,1).  ')
2483  endif
2484 ENDIF
2485 IF(.NOT.inter_domain)THEN
2486 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2487 ALLOCATE(grid%em_sr(sm31:em31,sm32:em32),STAT=ierr)
2488  if (ierr.ne.0) then
2489  CALL wrf_error_fatal ( &
2490 'frame/module_domain.f: Failed to allocate grid%em_sr(sm31:em31,sm32:em32). ')
2491  endif
2492 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_sr=initial_data_value
2493 ELSE
2494 ALLOCATE(grid%em_sr(1,1),STAT=ierr)
2495  if (ierr.ne.0) then
2496  CALL wrf_error_fatal ( &
2497 'frame/module_domain.f: Failed to allocate grid%em_sr(1,1).  ')
2498  endif
2499 ENDIF
2500 IF(.NOT.inter_domain)THEN
2501 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2502 ALLOCATE(grid%em_fnm(sm33:em33),STAT=ierr)
2503  if (ierr.ne.0) then
2504  CALL wrf_error_fatal ( &
2505 'frame/module_domain.f: Failed to allocate grid%em_fnm(sm33:em33). ')
2506  endif
2507 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_fnm=initial_data_value
2508 ELSE
2509 ALLOCATE(grid%em_fnm(1),STAT=ierr)
2510  if (ierr.ne.0) then
2511  CALL wrf_error_fatal ( &
2512 'frame/module_domain.f: Failed to allocate grid%em_fnm(1).  ')
2513  endif
2514 ENDIF
2515 IF(.NOT.inter_domain)THEN
2516 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2517 ALLOCATE(grid%em_fnp(sm33:em33),STAT=ierr)
2518  if (ierr.ne.0) then
2519  CALL wrf_error_fatal ( &
2520 'frame/module_domain.f: Failed to allocate grid%em_fnp(sm33:em33). ')
2521  endif
2522 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_fnp=initial_data_value
2523 ELSE
2524 ALLOCATE(grid%em_fnp(1),STAT=ierr)
2525  if (ierr.ne.0) then
2526  CALL wrf_error_fatal ( &
2527 'frame/module_domain.f: Failed to allocate grid%em_fnp(1).  ')
2528  endif
2529 ENDIF
2530 IF(.NOT.inter_domain)THEN
2531 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2532 ALLOCATE(grid%em_rdnw(sm33:em33),STAT=ierr)
2533  if (ierr.ne.0) then
2534  CALL wrf_error_fatal ( &
2535 'frame/module_domain.f: Failed to allocate grid%em_rdnw(sm33:em33). ')
2536  endif
2537 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_rdnw=initial_data_value
2538 ELSE
2539 ALLOCATE(grid%em_rdnw(1),STAT=ierr)
2540  if (ierr.ne.0) then
2541  CALL wrf_error_fatal ( &
2542 'frame/module_domain.f: Failed to allocate grid%em_rdnw(1).  ')
2543  endif
2544 ENDIF
2545 IF(.NOT.inter_domain)THEN
2546 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2547 ALLOCATE(grid%em_rdn(sm33:em33),STAT=ierr)
2548  if (ierr.ne.0) then
2549  CALL wrf_error_fatal ( &
2550 'frame/module_domain.f: Failed to allocate grid%em_rdn(sm33:em33). ')
2551  endif
2552 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_rdn=initial_data_value
2553 ELSE
2554 ALLOCATE(grid%em_rdn(1),STAT=ierr)
2555  if (ierr.ne.0) then
2556  CALL wrf_error_fatal ( &
2557 'frame/module_domain.f: Failed to allocate grid%em_rdn(1).  ')
2558  endif
2559 ENDIF
2560 IF(.NOT.inter_domain)THEN
2561 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2562 ALLOCATE(grid%em_dnw(sm33:em33),STAT=ierr)
2563  if (ierr.ne.0) then
2564  CALL wrf_error_fatal ( &
2565 'frame/module_domain.f: Failed to allocate grid%em_dnw(sm33:em33). ')
2566  endif
2567 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_dnw=initial_data_value
2568 ELSE
2569 ALLOCATE(grid%em_dnw(1),STAT=ierr)
2570  if (ierr.ne.0) then
2571  CALL wrf_error_fatal ( &
2572 'frame/module_domain.f: Failed to allocate grid%em_dnw(1).  ')
2573  endif
2574 ENDIF
2575 IF(.NOT.inter_domain)THEN
2576 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2577 ALLOCATE(grid%em_dn(sm33:em33),STAT=ierr)
2578  if (ierr.ne.0) then
2579  CALL wrf_error_fatal ( &
2580 'frame/module_domain.f: Failed to allocate grid%em_dn(sm33:em33). ')
2581  endif
2582 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_dn=initial_data_value
2583 ELSE
2584 ALLOCATE(grid%em_dn(1),STAT=ierr)
2585  if (ierr.ne.0) then
2586  CALL wrf_error_fatal ( &
2587 'frame/module_domain.f: Failed to allocate grid%em_dn(1).  ')
2588  endif
2589 ENDIF
2590 IF(.NOT.inter_domain)THEN
2591 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2592 ALLOCATE(grid%em_znu(sm33:em33),STAT=ierr)
2593  if (ierr.ne.0) then
2594  CALL wrf_error_fatal ( &
2595 'frame/module_domain.f: Failed to allocate grid%em_znu(sm33:em33). ')
2596  endif
2597 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_znu=initial_data_value
2598 ELSE
2599 ALLOCATE(grid%em_znu(1),STAT=ierr)
2600  if (ierr.ne.0) then
2601  CALL wrf_error_fatal ( &
2602 'frame/module_domain.f: Failed to allocate grid%em_znu(1).  ')
2603  endif
2604 ENDIF
2605 IF(.NOT.inter_domain)THEN
2606 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2607 ALLOCATE(grid%em_znw(sm33:em33),STAT=ierr)
2608  if (ierr.ne.0) then
2609  CALL wrf_error_fatal ( &
2610 'frame/module_domain.f: Failed to allocate grid%em_znw(sm33:em33). ')
2611  endif
2612 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_znw=initial_data_value
2613 ELSE
2614 ALLOCATE(grid%em_znw(1),STAT=ierr)
2615  if (ierr.ne.0) then
2616  CALL wrf_error_fatal ( &
2617 'frame/module_domain.f: Failed to allocate grid%em_znw(1).  ')
2618  endif
2619 ENDIF
2620 IF(.NOT.inter_domain)THEN
2621 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2622 ALLOCATE(grid%em_t_base(sm33:em33),STAT=ierr)
2623  if (ierr.ne.0) then
2624  CALL wrf_error_fatal ( &
2625 'frame/module_domain.f: Failed to allocate grid%em_t_base(sm33:em33). ')
2626  endif
2627 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_t_base=initial_data_value
2628 ELSE
2629 ALLOCATE(grid%em_t_base(1),STAT=ierr)
2630  if (ierr.ne.0) then
2631  CALL wrf_error_fatal ( &
2632 'frame/module_domain.f: Failed to allocate grid%em_t_base(1).  ')
2633  endif
2634 ENDIF
2635 IF(.NOT.inter_domain)THEN
2636 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
2637 ALLOCATE(grid%em_z(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
2638  if (ierr.ne.0) then
2639  CALL wrf_error_fatal ( &
2640 'frame/module_domain.f: Failed to allocate grid%em_z(sm31:em31,sm32:em32,sm33:em33). ')
2641  endif
2642 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_z=initial_data_value
2643 ELSE
2644 ALLOCATE(grid%em_z(1,1,1),STAT=ierr)
2645  if (ierr.ne.0) then
2646  CALL wrf_error_fatal ( &
2647 'frame/module_domain.f: Failed to allocate grid%em_z(1,1,1).  ')
2648  endif
2649 ENDIF
2650 IF(.NOT.inter_domain)THEN
2651 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
2652 ALLOCATE(grid%a_z(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
2653  if (ierr.ne.0) then
2654  CALL wrf_error_fatal ( &
2655 'frame/module_domain.f: Failed to allocate grid%a_z(sm31:em31,sm32:em32,sm33:em33). ')
2656  endif
2657 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_z=initial_data_value
2658 ELSE
2659 ALLOCATE(grid%a_z(1,1,1),STAT=ierr)
2660  if (ierr.ne.0) then
2661  CALL wrf_error_fatal ( &
2662 'frame/module_domain.f: Failed to allocate grid%a_z(1,1,1).  ')
2663  endif
2664 ENDIF
2665 IF(.NOT.inter_domain)THEN
2666 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
2667 ALLOCATE(grid%g_z(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
2668  if (ierr.ne.0) then
2669  CALL wrf_error_fatal ( &
2670 'frame/module_domain.f: Failed to allocate grid%g_z(sm31:em31,sm32:em32,sm33:em33). ')
2671  endif
2672 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_z=initial_data_value
2673 ELSE
2674 ALLOCATE(grid%g_z(1,1,1),STAT=ierr)
2675  if (ierr.ne.0) then
2676  CALL wrf_error_fatal ( &
2677 'frame/module_domain.f: Failed to allocate grid%g_z(1,1,1).  ')
2678  endif
2679 ENDIF
2680 IF ( setinitval .EQ. 3 ) grid%cfn=initial_data_value
2681 IF ( setinitval .EQ. 3 ) grid%cfn1=initial_data_value
2682 IF ( setinitval .EQ. 3 ) grid%step_number=0
2683 IF(.NOT.inter_domain)THEN
2684 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2685 ALLOCATE(grid%kma_a(sm33:em33),STAT=ierr)
2686  if (ierr.ne.0) then
2687  CALL wrf_error_fatal ( &
2688 'frame/module_domain.f: Failed to allocate grid%kma_a(sm33:em33). ')
2689  endif
2690 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%kma_a=initial_data_value
2691 ELSE
2692 ALLOCATE(grid%kma_a(1),STAT=ierr)
2693  if (ierr.ne.0) then
2694  CALL wrf_error_fatal ( &
2695 'frame/module_domain.f: Failed to allocate grid%kma_a(1).  ')
2696  endif
2697 ENDIF
2698 IF(.NOT.inter_domain)THEN
2699 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
2700 ALLOCATE(grid%kma_b(sm33:em33),STAT=ierr)
2701  if (ierr.ne.0) then
2702  CALL wrf_error_fatal ( &
2703 'frame/module_domain.f: Failed to allocate grid%kma_b(sm33:em33). ')
2704  endif
2705 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%kma_b=initial_data_value
2706 ELSE
2707 ALLOCATE(grid%kma_b(1),STAT=ierr)
2708  if (ierr.ne.0) then
2709  CALL wrf_error_fatal ( &
2710 'frame/module_domain.f: Failed to allocate grid%kma_b(1).  ')
2711  endif
2712 ENDIF
2713 IF(.NOT.inter_domain)THEN
2714 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2715 ALLOCATE(grid%q2(sm31:em31,sm32:em32),STAT=ierr)
2716  if (ierr.ne.0) then
2717  CALL wrf_error_fatal ( &
2718 'frame/module_domain.f: Failed to allocate grid%q2(sm31:em31,sm32:em32). ')
2719  endif
2720 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%q2=initial_data_value
2721 ELSE
2722 ALLOCATE(grid%q2(1,1),STAT=ierr)
2723  if (ierr.ne.0) then
2724  CALL wrf_error_fatal ( &
2725 'frame/module_domain.f: Failed to allocate grid%q2(1,1).  ')
2726  endif
2727 ENDIF
2728 IF(.NOT.inter_domain)THEN
2729 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2730 ALLOCATE(grid%t2(sm31:em31,sm32:em32),STAT=ierr)
2731  if (ierr.ne.0) then
2732  CALL wrf_error_fatal ( &
2733 'frame/module_domain.f: Failed to allocate grid%t2(sm31:em31,sm32:em32). ')
2734  endif
2735 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%t2=initial_data_value
2736 ELSE
2737 ALLOCATE(grid%t2(1,1),STAT=ierr)
2738  if (ierr.ne.0) then
2739  CALL wrf_error_fatal ( &
2740 'frame/module_domain.f: Failed to allocate grid%t2(1,1).  ')
2741  endif
2742 ENDIF
2743 IF(.NOT.inter_domain)THEN
2744 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2745 ALLOCATE(grid%th2(sm31:em31,sm32:em32),STAT=ierr)
2746  if (ierr.ne.0) then
2747  CALL wrf_error_fatal ( &
2748 'frame/module_domain.f: Failed to allocate grid%th2(sm31:em31,sm32:em32). ')
2749  endif
2750 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%th2=initial_data_value
2751 ELSE
2752 ALLOCATE(grid%th2(1,1),STAT=ierr)
2753  if (ierr.ne.0) then
2754  CALL wrf_error_fatal ( &
2755 'frame/module_domain.f: Failed to allocate grid%th2(1,1).  ')
2756  endif
2757 ENDIF
2758 IF(.NOT.inter_domain)THEN
2759 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2760 ALLOCATE(grid%psfc(sm31:em31,sm32:em32),STAT=ierr)
2761  if (ierr.ne.0) then
2762  CALL wrf_error_fatal ( &
2763 'frame/module_domain.f: Failed to allocate grid%psfc(sm31:em31,sm32:em32). ')
2764  endif
2765 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%psfc=initial_data_value
2766 ELSE
2767 ALLOCATE(grid%psfc(1,1),STAT=ierr)
2768  if (ierr.ne.0) then
2769  CALL wrf_error_fatal ( &
2770 'frame/module_domain.f: Failed to allocate grid%psfc(1,1).  ')
2771  endif
2772 ENDIF
2773 IF(.NOT.inter_domain)THEN
2774 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2775 ALLOCATE(grid%u10(sm31:em31,sm32:em32),STAT=ierr)
2776  if (ierr.ne.0) then
2777  CALL wrf_error_fatal ( &
2778 'frame/module_domain.f: Failed to allocate grid%u10(sm31:em31,sm32:em32). ')
2779  endif
2780 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%u10=initial_data_value
2781 ELSE
2782 ALLOCATE(grid%u10(1,1),STAT=ierr)
2783  if (ierr.ne.0) then
2784  CALL wrf_error_fatal ( &
2785 'frame/module_domain.f: Failed to allocate grid%u10(1,1).  ')
2786  endif
2787 ENDIF
2788 IF(.NOT.inter_domain)THEN
2789 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2790 ALLOCATE(grid%v10(sm31:em31,sm32:em32),STAT=ierr)
2791  if (ierr.ne.0) then
2792  CALL wrf_error_fatal ( &
2793 'frame/module_domain.f: Failed to allocate grid%v10(sm31:em31,sm32:em32). ')
2794  endif
2795 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%v10=initial_data_value
2796 ELSE
2797 ALLOCATE(grid%v10(1,1),STAT=ierr)
2798  if (ierr.ne.0) then
2799  CALL wrf_error_fatal ( &
2800 'frame/module_domain.f: Failed to allocate grid%v10(1,1).  ')
2801  endif
2802 ENDIF
2803 IF(.NOT.inter_domain)THEN
2804 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2805 ALLOCATE(grid%uratx(sm31:em31,sm32:em32),STAT=ierr)
2806  if (ierr.ne.0) then
2807  CALL wrf_error_fatal ( &
2808 'frame/module_domain.f: Failed to allocate grid%uratx(sm31:em31,sm32:em32). ')
2809  endif
2810 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%uratx=initial_data_value
2811 ELSE
2812 ALLOCATE(grid%uratx(1,1),STAT=ierr)
2813  if (ierr.ne.0) then
2814  CALL wrf_error_fatal ( &
2815 'frame/module_domain.f: Failed to allocate grid%uratx(1,1).  ')
2816  endif
2817 ENDIF
2818 IF(.NOT.inter_domain)THEN
2819 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2820 ALLOCATE(grid%vratx(sm31:em31,sm32:em32),STAT=ierr)
2821  if (ierr.ne.0) then
2822  CALL wrf_error_fatal ( &
2823 'frame/module_domain.f: Failed to allocate grid%vratx(sm31:em31,sm32:em32). ')
2824  endif
2825 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vratx=initial_data_value
2826 ELSE
2827 ALLOCATE(grid%vratx(1,1),STAT=ierr)
2828  if (ierr.ne.0) then
2829  CALL wrf_error_fatal ( &
2830 'frame/module_domain.f: Failed to allocate grid%vratx(1,1).  ')
2831  endif
2832 ENDIF
2833 IF(.NOT.inter_domain)THEN
2834 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
2835 ALLOCATE(grid%tratx(sm31:em31,sm32:em32),STAT=ierr)
2836  if (ierr.ne.0) then
2837  CALL wrf_error_fatal ( &
2838 'frame/module_domain.f: Failed to allocate grid%tratx(sm31:em31,sm32:em32). ')
2839  endif
2840 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%tratx=initial_data_value
2841 ELSE
2842 ALLOCATE(grid%tratx(1,1),STAT=ierr)
2843  if (ierr.ne.0) then
2844  CALL wrf_error_fatal ( &
2845 'frame/module_domain.f: Failed to allocate grid%tratx(1,1).  ')
2846  endif
2847 ENDIF
2848 IF ( setinitval .EQ. 3 ) grid%rdx=initial_data_value
2849 IF ( setinitval .EQ. 3 ) grid%rdy=initial_data_value
2850 IF ( setinitval .EQ. 3 ) grid%dts=initial_data_value
2851 IF ( setinitval .EQ. 3 ) grid%dtseps=initial_data_value
2852 IF ( setinitval .EQ. 3 ) grid%resm=initial_data_value
2853 IF ( setinitval .EQ. 3 ) grid%zetatop=initial_data_value
2854 IF ( setinitval .EQ. 3 ) grid%cf1=initial_data_value
2855 IF ( setinitval .EQ. 3 ) grid%cf2=initial_data_value
2856 IF ( setinitval .EQ. 3 ) grid%cf3=initial_data_value
2857 IF ( setinitval .EQ. 3 ) grid%number_at_same_level=0
2858 IF ( setinitval .EQ. 3 ) grid%itimestep=0
2859 IF ( setinitval .EQ. 3 ) grid%xtime=initial_data_value
2860 IF ( setinitval .EQ. 3 ) grid%julian=initial_data_value
2861 IF ( setinitval .EQ. 3 ) grid%lbc_fid=0
2862 IF ( setinitval .EQ. 3 ) grid%tiled=.FALSE.
2863 IF ( setinitval .EQ. 3 ) grid%patched=.FALSE.
2864 IF(.NOT.inter_domain)THEN
2865 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
2866 ALLOCATE(grid%imask_nostag(sm31:em31,sm32:em32),STAT=ierr)
2867  if (ierr.ne.0) then
2868  CALL wrf_error_fatal ( &
2869 'frame/module_domain.f: Failed to allocate grid%imask_nostag(sm31:em31,sm32:em32). ')
2870  endif
2871 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%imask_nostag=0
2872 ELSE
2873 ALLOCATE(grid%imask_nostag(1,1),STAT=ierr)
2874  if (ierr.ne.0) then
2875  CALL wrf_error_fatal ( &
2876 'frame/module_domain.f: Failed to allocate grid%imask_nostag(1,1).  ')
2877  endif
2878 ENDIF
2879 IF(.NOT.inter_domain)THEN
2880 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
2881 ALLOCATE(grid%imask_xstag(sm31:em31,sm32:em32),STAT=ierr)
2882  if (ierr.ne.0) then
2883  CALL wrf_error_fatal ( &
2884 'frame/module_domain.f: Failed to allocate grid%imask_xstag(sm31:em31,sm32:em32). ')
2885  endif
2886 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%imask_xstag=0
2887 ELSE
2888 ALLOCATE(grid%imask_xstag(1,1),STAT=ierr)
2889  if (ierr.ne.0) then
2890  CALL wrf_error_fatal ( &
2891 'frame/module_domain.f: Failed to allocate grid%imask_xstag(1,1).  ')
2892  endif
2893 ENDIF
2894 IF(.NOT.inter_domain)THEN
2895 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
2896 ALLOCATE(grid%imask_ystag(sm31:em31,sm32:em32),STAT=ierr)
2897  if (ierr.ne.0) then
2898  CALL wrf_error_fatal ( &
2899 'frame/module_domain.f: Failed to allocate grid%imask_ystag(sm31:em31,sm32:em32). ')
2900  endif
2901 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%imask_ystag=0
2902 ELSE
2903 ALLOCATE(grid%imask_ystag(1,1),STAT=ierr)
2904  if (ierr.ne.0) then
2905  CALL wrf_error_fatal ( &
2906 'frame/module_domain.f: Failed to allocate grid%imask_ystag(1,1).  ')
2907  endif
2908 ENDIF
2909 IF(.NOT.inter_domain)THEN
2910 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
2911 ALLOCATE(grid%imask_xystag(sm31:em31,sm32:em32),STAT=ierr)
2912  if (ierr.ne.0) then
2913  CALL wrf_error_fatal ( &
2914 'frame/module_domain.f: Failed to allocate grid%imask_xystag(sm31:em31,sm32:em32). ')
2915  endif
2916 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%imask_xystag=0
2917 ELSE
2918 ALLOCATE(grid%imask_xystag(1,1),STAT=ierr)
2919  if (ierr.ne.0) then
2920  CALL wrf_error_fatal ( &
2921 'frame/module_domain.f: Failed to allocate grid%imask_xystag(1,1).  ')
2922  endif
2923 ENDIF
2924 IF ( setinitval .EQ. 3 ) grid%xi=initial_data_value
2925 IF ( setinitval .EQ. 3 ) grid%xj=initial_data_value
2926 IF ( setinitval .EQ. 3 ) grid%vc_i=initial_data_value
2927 IF ( setinitval .EQ. 3 ) grid%vc_j=initial_data_value
2928 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1)*num_moist)) * RWORDSIZE
2929 ALLOCATE(grid%moist(sm31:em31,sm32:em32,sm33:em33,num_moist),STAT=ierr)
2930  if (ierr.ne.0) then
2931  CALL wrf_error_fatal ( &
2932 'frame/module_domain.f: Failed to allocate grid%moist(sm31:em31,sm32:em32,sm33:em33,num_moist). ')
2933  endif
2934 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist=initial_data_value
2935 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1)*num_a_moist)) * RWORDSIZE
2936 ALLOCATE(grid%a_moist(sm31:em31,sm32:em32,sm33:em33,num_a_moist),STAT=ierr)
2937  if (ierr.ne.0) then
2938  CALL wrf_error_fatal ( &
2939 'frame/module_domain.f: Failed to allocate grid%a_moist(sm31:em31,sm32:em32,sm33:em33,num_a_moist). ')
2940  endif
2941 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist=initial_data_value
2942 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1)*num_g_moist)) * RWORDSIZE
2943 ALLOCATE(grid%g_moist(sm31:em31,sm32:em32,sm33:em33,num_g_moist),STAT=ierr)
2944  if (ierr.ne.0) then
2945  CALL wrf_error_fatal ( &
2946 'frame/module_domain.f: Failed to allocate grid%g_moist(sm31:em31,sm32:em32,sm33:em33,num_g_moist). ')
2947  endif
2948 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist=initial_data_value
2949 IF(.NOT.inter_domain)THEN
2950 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_moist)) * RWORDSIZE
2951 ALLOCATE(grid%moist_bxs(sm32:em32,sm33:em33,spec_bdy_width,num_moist),STAT=ierr)
2952  if (ierr.ne.0) then
2953  CALL wrf_error_fatal ( &
2954 'frame/module_domain.f: Failed to allocate grid%moist_bxs(sm32:em32,sm33:em33,spec_bdy_width,num_moist). ')
2955  endif
2956 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist_bxs=initial_data_value
2957 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_moist)) * RWORDSIZE
2958 ALLOCATE(grid%moist_bxe(sm32:em32,sm33:em33,spec_bdy_width,num_moist),STAT=ierr)
2959  if (ierr.ne.0) then
2960  CALL wrf_error_fatal ( &
2961 'frame/module_domain.f: Failed to allocate grid%moist_bxe(sm32:em32,sm33:em33,spec_bdy_width,num_moist). ')
2962  endif
2963 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist_bxe=initial_data_value
2964 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_moist)) * RWORDSIZE
2965 ALLOCATE(grid%moist_bys(sm31:em31,sm33:em33,spec_bdy_width,num_moist),STAT=ierr)
2966  if (ierr.ne.0) then
2967  CALL wrf_error_fatal ( &
2968 'frame/module_domain.f: Failed to allocate grid%moist_bys(sm31:em31,sm33:em33,spec_bdy_width,num_moist). ')
2969  endif
2970 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist_bys=initial_data_value
2971 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_moist)) * RWORDSIZE
2972 ALLOCATE(grid%moist_bye(sm31:em31,sm33:em33,spec_bdy_width,num_moist),STAT=ierr)
2973  if (ierr.ne.0) then
2974  CALL wrf_error_fatal ( &
2975 'frame/module_domain.f: Failed to allocate grid%moist_bye(sm31:em31,sm33:em33,spec_bdy_width,num_moist). ')
2976  endif
2977 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist_bye=initial_data_value
2978 ELSE
2979 ALLOCATE(grid%moist_bxs(1,1,1,num_moist),STAT=ierr)
2980  if (ierr.ne.0) then
2981  CALL wrf_error_fatal ( &
2982 'frame/module_domain.f: Failed to allocate grid%moist_bxs(1,1,1,num_moist).  ')
2983  endif
2984 ALLOCATE(grid%moist_bxe(1,1,1,num_moist),STAT=ierr)
2985  if (ierr.ne.0) then
2986  CALL wrf_error_fatal ( &
2987 'frame/module_domain.f: Failed to allocate grid%moist_bxe(1,1,1,num_moist).  ')
2988  endif
2989 ALLOCATE(grid%moist_bys(1,1,1,num_moist),STAT=ierr)
2990  if (ierr.ne.0) then
2991  CALL wrf_error_fatal ( &
2992 'frame/module_domain.f: Failed to allocate grid%moist_bys(1,1,1,num_moist).  ')
2993  endif
2994 ALLOCATE(grid%moist_bye(1,1,1,num_moist),STAT=ierr)
2995  if (ierr.ne.0) then
2996  CALL wrf_error_fatal ( &
2997 'frame/module_domain.f: Failed to allocate grid%moist_bye(1,1,1,num_moist).  ')
2998  endif
2999 ENDIF
3000 IF(.NOT.inter_domain)THEN
3001 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_moist)) * RWORDSIZE
3002 ALLOCATE(grid%moist_btxs(sm32:em32,sm33:em33,spec_bdy_width,num_moist),STAT=ierr)
3003  if (ierr.ne.0) then
3004  CALL wrf_error_fatal ( &
3005 'frame/module_domain.f: Failed to allocate grid%moist_btxs(sm32:em32,sm33:em33,spec_bdy_width,num_moist). ')
3006  endif
3007 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist_btxs=initial_data_value
3008 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_moist)) * RWORDSIZE
3009 ALLOCATE(grid%moist_btxe(sm32:em32,sm33:em33,spec_bdy_width,num_moist),STAT=ierr)
3010  if (ierr.ne.0) then
3011  CALL wrf_error_fatal ( &
3012 'frame/module_domain.f: Failed to allocate grid%moist_btxe(sm32:em32,sm33:em33,spec_bdy_width,num_moist). ')
3013  endif
3014 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist_btxe=initial_data_value
3015 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_moist)) * RWORDSIZE
3016 ALLOCATE(grid%moist_btys(sm31:em31,sm33:em33,spec_bdy_width,num_moist),STAT=ierr)
3017  if (ierr.ne.0) then
3018  CALL wrf_error_fatal ( &
3019 'frame/module_domain.f: Failed to allocate grid%moist_btys(sm31:em31,sm33:em33,spec_bdy_width,num_moist). ')
3020  endif
3021 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist_btys=initial_data_value
3022 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_moist)) * RWORDSIZE
3023 ALLOCATE(grid%moist_btye(sm31:em31,sm33:em33,spec_bdy_width,num_moist),STAT=ierr)
3024  if (ierr.ne.0) then
3025  CALL wrf_error_fatal ( &
3026 'frame/module_domain.f: Failed to allocate grid%moist_btye(sm31:em31,sm33:em33,spec_bdy_width,num_moist). ')
3027  endif
3028 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%moist_btye=initial_data_value
3029 ELSE
3030 ALLOCATE(grid%moist_btxs(1,1,1,num_moist),STAT=ierr)
3031  if (ierr.ne.0) then
3032  CALL wrf_error_fatal ( &
3033 'frame/module_domain.f: Failed to allocate grid%moist_btxs(1,1,1,num_moist).  ')
3034  endif
3035 ALLOCATE(grid%moist_btxe(1,1,1,num_moist),STAT=ierr)
3036  if (ierr.ne.0) then
3037  CALL wrf_error_fatal ( &
3038 'frame/module_domain.f: Failed to allocate grid%moist_btxe(1,1,1,num_moist).  ')
3039  endif
3040 ALLOCATE(grid%moist_btys(1,1,1,num_moist),STAT=ierr)
3041  if (ierr.ne.0) then
3042  CALL wrf_error_fatal ( &
3043 'frame/module_domain.f: Failed to allocate grid%moist_btys(1,1,1,num_moist).  ')
3044  endif
3045 ALLOCATE(grid%moist_btye(1,1,1,num_moist),STAT=ierr)
3046  if (ierr.ne.0) then
3047  CALL wrf_error_fatal ( &
3048 'frame/module_domain.f: Failed to allocate grid%moist_btye(1,1,1,num_moist).  ')
3049  endif
3050 ENDIF
3051 IF(.NOT.inter_domain)THEN
3052 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_a_moist)) * RWORDSIZE
3053 ALLOCATE(grid%a_moist_bxs(sm32:em32,sm33:em33,spec_bdy_width,num_a_moist),STAT=ierr)
3054  if (ierr.ne.0) then
3055  CALL wrf_error_fatal ( &
3056 'frame/module_domain.f: Failed to allocate grid%a_moist_bxs(sm32:em32,sm33:em33,spec_bdy_width,num_a_moist). ')
3057  endif
3058 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist_bxs=initial_data_value
3059 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_a_moist)) * RWORDSIZE
3060 ALLOCATE(grid%a_moist_bxe(sm32:em32,sm33:em33,spec_bdy_width,num_a_moist),STAT=ierr)
3061  if (ierr.ne.0) then
3062  CALL wrf_error_fatal ( &
3063 'frame/module_domain.f: Failed to allocate grid%a_moist_bxe(sm32:em32,sm33:em33,spec_bdy_width,num_a_moist). ')
3064  endif
3065 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist_bxe=initial_data_value
3066 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_a_moist)) * RWORDSIZE
3067 ALLOCATE(grid%a_moist_bys(sm31:em31,sm33:em33,spec_bdy_width,num_a_moist),STAT=ierr)
3068  if (ierr.ne.0) then
3069  CALL wrf_error_fatal ( &
3070 'frame/module_domain.f: Failed to allocate grid%a_moist_bys(sm31:em31,sm33:em33,spec_bdy_width,num_a_moist). ')
3071  endif
3072 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist_bys=initial_data_value
3073 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_a_moist)) * RWORDSIZE
3074 ALLOCATE(grid%a_moist_bye(sm31:em31,sm33:em33,spec_bdy_width,num_a_moist),STAT=ierr)
3075  if (ierr.ne.0) then
3076  CALL wrf_error_fatal ( &
3077 'frame/module_domain.f: Failed to allocate grid%a_moist_bye(sm31:em31,sm33:em33,spec_bdy_width,num_a_moist). ')
3078  endif
3079 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist_bye=initial_data_value
3080 ELSE
3081 ALLOCATE(grid%a_moist_bxs(1,1,1,num_a_moist),STAT=ierr)
3082  if (ierr.ne.0) then
3083  CALL wrf_error_fatal ( &
3084 'frame/module_domain.f: Failed to allocate grid%a_moist_bxs(1,1,1,num_a_moist).  ')
3085  endif
3086 ALLOCATE(grid%a_moist_bxe(1,1,1,num_a_moist),STAT=ierr)
3087  if (ierr.ne.0) then
3088  CALL wrf_error_fatal ( &
3089 'frame/module_domain.f: Failed to allocate grid%a_moist_bxe(1,1,1,num_a_moist).  ')
3090  endif
3091 ALLOCATE(grid%a_moist_bys(1,1,1,num_a_moist),STAT=ierr)
3092  if (ierr.ne.0) then
3093  CALL wrf_error_fatal ( &
3094 'frame/module_domain.f: Failed to allocate grid%a_moist_bys(1,1,1,num_a_moist).  ')
3095  endif
3096 ALLOCATE(grid%a_moist_bye(1,1,1,num_a_moist),STAT=ierr)
3097  if (ierr.ne.0) then
3098  CALL wrf_error_fatal ( &
3099 'frame/module_domain.f: Failed to allocate grid%a_moist_bye(1,1,1,num_a_moist).  ')
3100  endif
3101 ENDIF
3102 IF(.NOT.inter_domain)THEN
3103 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_a_moist)) * RWORDSIZE
3104 ALLOCATE(grid%a_moist_btxs(sm32:em32,sm33:em33,spec_bdy_width,num_a_moist),STAT=ierr)
3105  if (ierr.ne.0) then
3106  CALL wrf_error_fatal ( &
3107 'frame/module_domain.f: Failed to allocate grid%a_moist_btxs(sm32:em32,sm33:em33,spec_bdy_width,num_a_moist). ')
3108  endif
3109 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist_btxs=initial_data_value
3110 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_a_moist)) * RWORDSIZE
3111 ALLOCATE(grid%a_moist_btxe(sm32:em32,sm33:em33,spec_bdy_width,num_a_moist),STAT=ierr)
3112  if (ierr.ne.0) then
3113  CALL wrf_error_fatal ( &
3114 'frame/module_domain.f: Failed to allocate grid%a_moist_btxe(sm32:em32,sm33:em33,spec_bdy_width,num_a_moist). ')
3115  endif
3116 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist_btxe=initial_data_value
3117 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_a_moist)) * RWORDSIZE
3118 ALLOCATE(grid%a_moist_btys(sm31:em31,sm33:em33,spec_bdy_width,num_a_moist),STAT=ierr)
3119  if (ierr.ne.0) then
3120  CALL wrf_error_fatal ( &
3121 'frame/module_domain.f: Failed to allocate grid%a_moist_btys(sm31:em31,sm33:em33,spec_bdy_width,num_a_moist). ')
3122  endif
3123 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist_btys=initial_data_value
3124 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_a_moist)) * RWORDSIZE
3125 ALLOCATE(grid%a_moist_btye(sm31:em31,sm33:em33,spec_bdy_width,num_a_moist),STAT=ierr)
3126  if (ierr.ne.0) then
3127  CALL wrf_error_fatal ( &
3128 'frame/module_domain.f: Failed to allocate grid%a_moist_btye(sm31:em31,sm33:em33,spec_bdy_width,num_a_moist). ')
3129  endif
3130 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_moist_btye=initial_data_value
3131 ELSE
3132 ALLOCATE(grid%a_moist_btxs(1,1,1,num_a_moist),STAT=ierr)
3133  if (ierr.ne.0) then
3134  CALL wrf_error_fatal ( &
3135 'frame/module_domain.f: Failed to allocate grid%a_moist_btxs(1,1,1,num_a_moist).  ')
3136  endif
3137 ALLOCATE(grid%a_moist_btxe(1,1,1,num_a_moist),STAT=ierr)
3138  if (ierr.ne.0) then
3139  CALL wrf_error_fatal ( &
3140 'frame/module_domain.f: Failed to allocate grid%a_moist_btxe(1,1,1,num_a_moist).  ')
3141  endif
3142 ALLOCATE(grid%a_moist_btys(1,1,1,num_a_moist),STAT=ierr)
3143  if (ierr.ne.0) then
3144  CALL wrf_error_fatal ( &
3145 'frame/module_domain.f: Failed to allocate grid%a_moist_btys(1,1,1,num_a_moist).  ')
3146  endif
3147 ALLOCATE(grid%a_moist_btye(1,1,1,num_a_moist),STAT=ierr)
3148  if (ierr.ne.0) then
3149  CALL wrf_error_fatal ( &
3150 'frame/module_domain.f: Failed to allocate grid%a_moist_btye(1,1,1,num_a_moist).  ')
3151  endif
3152 ENDIF
3153 IF(.NOT.inter_domain)THEN
3154 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_g_moist)) * RWORDSIZE
3155 ALLOCATE(grid%g_moist_bxs(sm32:em32,sm33:em33,spec_bdy_width,num_g_moist),STAT=ierr)
3156  if (ierr.ne.0) then
3157  CALL wrf_error_fatal ( &
3158 'frame/module_domain.f: Failed to allocate grid%g_moist_bxs(sm32:em32,sm33:em33,spec_bdy_width,num_g_moist). ')
3159  endif
3160 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist_bxs=initial_data_value
3161 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_g_moist)) * RWORDSIZE
3162 ALLOCATE(grid%g_moist_bxe(sm32:em32,sm33:em33,spec_bdy_width,num_g_moist),STAT=ierr)
3163  if (ierr.ne.0) then
3164  CALL wrf_error_fatal ( &
3165 'frame/module_domain.f: Failed to allocate grid%g_moist_bxe(sm32:em32,sm33:em33,spec_bdy_width,num_g_moist). ')
3166  endif
3167 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist_bxe=initial_data_value
3168 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_g_moist)) * RWORDSIZE
3169 ALLOCATE(grid%g_moist_bys(sm31:em31,sm33:em33,spec_bdy_width,num_g_moist),STAT=ierr)
3170  if (ierr.ne.0) then
3171  CALL wrf_error_fatal ( &
3172 'frame/module_domain.f: Failed to allocate grid%g_moist_bys(sm31:em31,sm33:em33,spec_bdy_width,num_g_moist). ')
3173  endif
3174 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist_bys=initial_data_value
3175 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_g_moist)) * RWORDSIZE
3176 ALLOCATE(grid%g_moist_bye(sm31:em31,sm33:em33,spec_bdy_width,num_g_moist),STAT=ierr)
3177  if (ierr.ne.0) then
3178  CALL wrf_error_fatal ( &
3179 'frame/module_domain.f: Failed to allocate grid%g_moist_bye(sm31:em31,sm33:em33,spec_bdy_width,num_g_moist). ')
3180  endif
3181 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist_bye=initial_data_value
3182 ELSE
3183 ALLOCATE(grid%g_moist_bxs(1,1,1,num_g_moist),STAT=ierr)
3184  if (ierr.ne.0) then
3185  CALL wrf_error_fatal ( &
3186 'frame/module_domain.f: Failed to allocate grid%g_moist_bxs(1,1,1,num_g_moist).  ')
3187  endif
3188 ALLOCATE(grid%g_moist_bxe(1,1,1,num_g_moist),STAT=ierr)
3189  if (ierr.ne.0) then
3190  CALL wrf_error_fatal ( &
3191 'frame/module_domain.f: Failed to allocate grid%g_moist_bxe(1,1,1,num_g_moist).  ')
3192  endif
3193 ALLOCATE(grid%g_moist_bys(1,1,1,num_g_moist),STAT=ierr)
3194  if (ierr.ne.0) then
3195  CALL wrf_error_fatal ( &
3196 'frame/module_domain.f: Failed to allocate grid%g_moist_bys(1,1,1,num_g_moist).  ')
3197  endif
3198 ALLOCATE(grid%g_moist_bye(1,1,1,num_g_moist),STAT=ierr)
3199  if (ierr.ne.0) then
3200  CALL wrf_error_fatal ( &
3201 'frame/module_domain.f: Failed to allocate grid%g_moist_bye(1,1,1,num_g_moist).  ')
3202  endif
3203 ENDIF
3204 IF(.NOT.inter_domain)THEN
3205 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_g_moist)) * RWORDSIZE
3206 ALLOCATE(grid%g_moist_btxs(sm32:em32,sm33:em33,spec_bdy_width,num_g_moist),STAT=ierr)
3207  if (ierr.ne.0) then
3208  CALL wrf_error_fatal ( &
3209 'frame/module_domain.f: Failed to allocate grid%g_moist_btxs(sm32:em32,sm33:em33,spec_bdy_width,num_g_moist). ')
3210  endif
3211 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist_btxs=initial_data_value
3212 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_g_moist)) * RWORDSIZE
3213 ALLOCATE(grid%g_moist_btxe(sm32:em32,sm33:em33,spec_bdy_width,num_g_moist),STAT=ierr)
3214  if (ierr.ne.0) then
3215  CALL wrf_error_fatal ( &
3216 'frame/module_domain.f: Failed to allocate grid%g_moist_btxe(sm32:em32,sm33:em33,spec_bdy_width,num_g_moist). ')
3217  endif
3218 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist_btxe=initial_data_value
3219 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_g_moist)) * RWORDSIZE
3220 ALLOCATE(grid%g_moist_btys(sm31:em31,sm33:em33,spec_bdy_width,num_g_moist),STAT=ierr)
3221  if (ierr.ne.0) then
3222  CALL wrf_error_fatal ( &
3223 'frame/module_domain.f: Failed to allocate grid%g_moist_btys(sm31:em31,sm33:em33,spec_bdy_width,num_g_moist). ')
3224  endif
3225 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist_btys=initial_data_value
3226 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_g_moist)) * RWORDSIZE
3227 ALLOCATE(grid%g_moist_btye(sm31:em31,sm33:em33,spec_bdy_width,num_g_moist),STAT=ierr)
3228  if (ierr.ne.0) then
3229  CALL wrf_error_fatal ( &
3230 'frame/module_domain.f: Failed to allocate grid%g_moist_btye(sm31:em31,sm33:em33,spec_bdy_width,num_g_moist). ')
3231  endif
3232 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_moist_btye=initial_data_value
3233 ELSE
3234 ALLOCATE(grid%g_moist_btxs(1,1,1,num_g_moist),STAT=ierr)
3235  if (ierr.ne.0) then
3236  CALL wrf_error_fatal ( &
3237 'frame/module_domain.f: Failed to allocate grid%g_moist_btxs(1,1,1,num_g_moist).  ')
3238  endif
3239 ALLOCATE(grid%g_moist_btxe(1,1,1,num_g_moist),STAT=ierr)
3240  if (ierr.ne.0) then
3241  CALL wrf_error_fatal ( &
3242 'frame/module_domain.f: Failed to allocate grid%g_moist_btxe(1,1,1,num_g_moist).  ')
3243  endif
3244 ALLOCATE(grid%g_moist_btys(1,1,1,num_g_moist),STAT=ierr)
3245  if (ierr.ne.0) then
3246  CALL wrf_error_fatal ( &
3247 'frame/module_domain.f: Failed to allocate grid%g_moist_btys(1,1,1,num_g_moist).  ')
3248  endif
3249 ALLOCATE(grid%g_moist_btye(1,1,1,num_g_moist),STAT=ierr)
3250  if (ierr.ne.0) then
3251  CALL wrf_error_fatal ( &
3252 'frame/module_domain.f: Failed to allocate grid%g_moist_btye(1,1,1,num_g_moist).  ')
3253  endif
3254 ENDIF
3255 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1)*num_scalar)) * RWORDSIZE
3256 ALLOCATE(grid%scalar(sm31:em31,sm32:em32,sm33:em33,num_scalar),STAT=ierr)
3257  if (ierr.ne.0) then
3258  CALL wrf_error_fatal ( &
3259 'frame/module_domain.f: Failed to allocate grid%scalar(sm31:em31,sm32:em32,sm33:em33,num_scalar). ')
3260  endif
3261 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar=initial_data_value
3262 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1)*num_a_scalar)) * RWORDSIZE
3263 ALLOCATE(grid%a_scalar(sm31:em31,sm32:em32,sm33:em33,num_a_scalar),STAT=ierr)
3264  if (ierr.ne.0) then
3265  CALL wrf_error_fatal ( &
3266 'frame/module_domain.f: Failed to allocate grid%a_scalar(sm31:em31,sm32:em32,sm33:em33,num_a_scalar). ')
3267  endif
3268 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_scalar=initial_data_value
3269 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1)*num_g_scalar)) * RWORDSIZE
3270 ALLOCATE(grid%g_scalar(sm31:em31,sm32:em32,sm33:em33,num_g_scalar),STAT=ierr)
3271  if (ierr.ne.0) then
3272  CALL wrf_error_fatal ( &
3273 'frame/module_domain.f: Failed to allocate grid%g_scalar(sm31:em31,sm32:em32,sm33:em33,num_g_scalar). ')
3274  endif
3275 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_scalar=initial_data_value
3276 IF(.NOT.inter_domain)THEN
3277 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_scalar)) * RWORDSIZE
3278 ALLOCATE(grid%scalar_bxs(sm32:em32,sm33:em33,spec_bdy_width,num_scalar),STAT=ierr)
3279  if (ierr.ne.0) then
3280  CALL wrf_error_fatal ( &
3281 'frame/module_domain.f: Failed to allocate grid%scalar_bxs(sm32:em32,sm33:em33,spec_bdy_width,num_scalar). ')
3282  endif
3283 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar_bxs=initial_data_value
3284 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_scalar)) * RWORDSIZE
3285 ALLOCATE(grid%scalar_bxe(sm32:em32,sm33:em33,spec_bdy_width,num_scalar),STAT=ierr)
3286  if (ierr.ne.0) then
3287  CALL wrf_error_fatal ( &
3288 'frame/module_domain.f: Failed to allocate grid%scalar_bxe(sm32:em32,sm33:em33,spec_bdy_width,num_scalar). ')
3289  endif
3290 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar_bxe=initial_data_value
3291 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_scalar)) * RWORDSIZE
3292 ALLOCATE(grid%scalar_bys(sm31:em31,sm33:em33,spec_bdy_width,num_scalar),STAT=ierr)
3293  if (ierr.ne.0) then
3294  CALL wrf_error_fatal ( &
3295 'frame/module_domain.f: Failed to allocate grid%scalar_bys(sm31:em31,sm33:em33,spec_bdy_width,num_scalar). ')
3296  endif
3297 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar_bys=initial_data_value
3298 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_scalar)) * RWORDSIZE
3299 ALLOCATE(grid%scalar_bye(sm31:em31,sm33:em33,spec_bdy_width,num_scalar),STAT=ierr)
3300  if (ierr.ne.0) then
3301  CALL wrf_error_fatal ( &
3302 'frame/module_domain.f: Failed to allocate grid%scalar_bye(sm31:em31,sm33:em33,spec_bdy_width,num_scalar). ')
3303  endif
3304 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar_bye=initial_data_value
3305 ELSE
3306 ALLOCATE(grid%scalar_bxs(1,1,1,num_scalar),STAT=ierr)
3307  if (ierr.ne.0) then
3308  CALL wrf_error_fatal ( &
3309 'frame/module_domain.f: Failed to allocate grid%scalar_bxs(1,1,1,num_scalar).  ')
3310  endif
3311 ALLOCATE(grid%scalar_bxe(1,1,1,num_scalar),STAT=ierr)
3312  if (ierr.ne.0) then
3313  CALL wrf_error_fatal ( &
3314 'frame/module_domain.f: Failed to allocate grid%scalar_bxe(1,1,1,num_scalar).  ')
3315  endif
3316 ALLOCATE(grid%scalar_bys(1,1,1,num_scalar),STAT=ierr)
3317  if (ierr.ne.0) then
3318  CALL wrf_error_fatal ( &
3319 'frame/module_domain.f: Failed to allocate grid%scalar_bys(1,1,1,num_scalar).  ')
3320  endif
3321 ALLOCATE(grid%scalar_bye(1,1,1,num_scalar),STAT=ierr)
3322  if (ierr.ne.0) then
3323  CALL wrf_error_fatal ( &
3324 'frame/module_domain.f: Failed to allocate grid%scalar_bye(1,1,1,num_scalar).  ')
3325  endif
3326 ENDIF
3327 IF(.NOT.inter_domain)THEN
3328 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_scalar)) * RWORDSIZE
3329 ALLOCATE(grid%scalar_btxs(sm32:em32,sm33:em33,spec_bdy_width,num_scalar),STAT=ierr)
3330  if (ierr.ne.0) then
3331  CALL wrf_error_fatal ( &
3332 'frame/module_domain.f: Failed to allocate grid%scalar_btxs(sm32:em32,sm33:em33,spec_bdy_width,num_scalar). ')
3333  endif
3334 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar_btxs=initial_data_value
3335 num_bytes_allocated = num_bytes_allocated + (((em32-sm32+1)*(em33-sm33+1)*(spec_bdy_width)*num_scalar)) * RWORDSIZE
3336 ALLOCATE(grid%scalar_btxe(sm32:em32,sm33:em33,spec_bdy_width,num_scalar),STAT=ierr)
3337  if (ierr.ne.0) then
3338  CALL wrf_error_fatal ( &
3339 'frame/module_domain.f: Failed to allocate grid%scalar_btxe(sm32:em32,sm33:em33,spec_bdy_width,num_scalar). ')
3340  endif
3341 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar_btxe=initial_data_value
3342 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_scalar)) * RWORDSIZE
3343 ALLOCATE(grid%scalar_btys(sm31:em31,sm33:em33,spec_bdy_width,num_scalar),STAT=ierr)
3344  if (ierr.ne.0) then
3345  CALL wrf_error_fatal ( &
3346 'frame/module_domain.f: Failed to allocate grid%scalar_btys(sm31:em31,sm33:em33,spec_bdy_width,num_scalar). ')
3347  endif
3348 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar_btys=initial_data_value
3349 num_bytes_allocated = num_bytes_allocated + (((em31-sm31+1)*(em33-sm33+1)*(spec_bdy_width)*num_scalar)) * RWORDSIZE
3350 ALLOCATE(grid%scalar_btye(sm31:em31,sm33:em33,spec_bdy_width,num_scalar),STAT=ierr)
3351  if (ierr.ne.0) then
3352  CALL wrf_error_fatal ( &
3353 'frame/module_domain.f: Failed to allocate grid%scalar_btye(sm31:em31,sm33:em33,spec_bdy_width,num_scalar). ')
3354  endif
3355 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%scalar_btye=initial_data_value
3356 ELSE
3357 ALLOCATE(grid%scalar_btxs(1,1,1,num_scalar),STAT=ierr)
3358  if (ierr.ne.0) then
3359  CALL wrf_error_fatal ( &
3360 'frame/module_domain.f: Failed to allocate grid%scalar_btxs(1,1,1,num_scalar).  ')
3361  endif
3362 ALLOCATE(grid%scalar_btxe(1,1,1,num_scalar),STAT=ierr)
3363  if (ierr.ne.0) then
3364  CALL wrf_error_fatal ( &
3365 'frame/module_domain.f: Failed to allocate grid%scalar_btxe(1,1,1,num_scalar).  ')
3366  endif
3367 ALLOCATE(grid%scalar_btys(1,1,1,num_scalar),STAT=ierr)
3368  if (ierr.ne.0) then
3369  CALL wrf_error_fatal ( &
3370 'frame/module_domain.f: Failed to allocate grid%scalar_btys(1,1,1,num_scalar).  ')
3371  endif
3372 ALLOCATE(grid%scalar_btye(1,1,1,num_scalar),STAT=ierr)
3373  if (ierr.ne.0) then
3374  CALL wrf_error_fatal ( &
3375 'frame/module_domain.f: Failed to allocate grid%scalar_btye(1,1,1,num_scalar).  ')
3376  endif
3377 ENDIF
3378 IF(.NOT.inter_domain)THEN
3379 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%spec_bdy_width)-(1)+1))) * RWORDSIZE
3380 ALLOCATE(grid%fcx(1:model_config_rec%spec_bdy_width),STAT=ierr)
3381  if (ierr.ne.0) then
3382  CALL wrf_error_fatal ( &
3383 'frame/module_domain.f: Failed to allocate grid%fcx(1:model_config_rec%spec_bdy_width). ')
3384  endif
3385 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fcx=initial_data_value
3386 ELSE
3387 ALLOCATE(grid%fcx(1),STAT=ierr)
3388  if (ierr.ne.0) then
3389  CALL wrf_error_fatal ( &
3390 'frame/module_domain.f: Failed to allocate grid%fcx(1).  ')
3391  endif
3392 ENDIF
3393 IF(.NOT.inter_domain)THEN
3394 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%spec_bdy_width)-(1)+1))) * RWORDSIZE
3395 ALLOCATE(grid%gcx(1:model_config_rec%spec_bdy_width),STAT=ierr)
3396  if (ierr.ne.0) then
3397  CALL wrf_error_fatal ( &
3398 'frame/module_domain.f: Failed to allocate grid%gcx(1:model_config_rec%spec_bdy_width). ')
3399  endif
3400 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%gcx=initial_data_value
3401 ELSE
3402 ALLOCATE(grid%gcx(1),STAT=ierr)
3403  if (ierr.ne.0) then
3404  CALL wrf_error_fatal ( &
3405 'frame/module_domain.f: Failed to allocate grid%gcx(1).  ')
3406  endif
3407 ENDIF
3408 IF ( setinitval .EQ. 3 ) grid%dtbc=initial_data_value
3409 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3410 ALLOCATE(grid%landmask(sm31:em31,sm32:em32),STAT=ierr)
3411  if (ierr.ne.0) then
3412  CALL wrf_error_fatal ( &
3413 'frame/module_domain.f: Failed to allocate grid%landmask(sm31:em31,sm32:em32). ')
3414  endif
3415 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%landmask=initial_data_value
3416 IF(.NOT.inter_domain)THEN
3417 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3418 ALLOCATE(grid%shdmax(sm31:em31,sm32:em32),STAT=ierr)
3419  if (ierr.ne.0) then
3420  CALL wrf_error_fatal ( &
3421 'frame/module_domain.f: Failed to allocate grid%shdmax(sm31:em31,sm32:em32). ')
3422  endif
3423 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%shdmax=initial_data_value
3424 ELSE
3425 ALLOCATE(grid%shdmax(1,1),STAT=ierr)
3426  if (ierr.ne.0) then
3427  CALL wrf_error_fatal ( &
3428 'frame/module_domain.f: Failed to allocate grid%shdmax(1,1).  ')
3429  endif
3430 ENDIF
3431 IF(.NOT.inter_domain)THEN
3432 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3433 ALLOCATE(grid%shdmin(sm31:em31,sm32:em32),STAT=ierr)
3434  if (ierr.ne.0) then
3435  CALL wrf_error_fatal ( &
3436 'frame/module_domain.f: Failed to allocate grid%shdmin(sm31:em31,sm32:em32). ')
3437  endif
3438 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%shdmin=initial_data_value
3439 ELSE
3440 ALLOCATE(grid%shdmin(1,1),STAT=ierr)
3441  if (ierr.ne.0) then
3442  CALL wrf_error_fatal ( &
3443 'frame/module_domain.f: Failed to allocate grid%shdmin(1,1).  ')
3444  endif
3445 ENDIF
3446 IF(.NOT.inter_domain)THEN
3447 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3448 ALLOCATE(grid%snoalb(sm31:em31,sm32:em32),STAT=ierr)
3449  if (ierr.ne.0) then
3450  CALL wrf_error_fatal ( &
3451 'frame/module_domain.f: Failed to allocate grid%snoalb(sm31:em31,sm32:em32). ')
3452  endif
3453 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%snoalb=initial_data_value
3454 ELSE
3455 ALLOCATE(grid%snoalb(1,1),STAT=ierr)
3456  if (ierr.ne.0) then
3457  CALL wrf_error_fatal ( &
3458 'frame/module_domain.f: Failed to allocate grid%snoalb(1,1).  ')
3459  endif
3460 ENDIF
3461 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((model_config_rec%num_soil_layers)-(1)+1))) * RWORDSIZE
3462 ALLOCATE(grid%tslb(sm31:em31,sm32:em32,1:model_config_rec%num_soil_layers),STAT=ierr)
3463  if (ierr.ne.0) then
3464  CALL wrf_error_fatal ( &
3465 'frame/module_domain.f: Failed to allocate grid%tslb(sm31:em31,sm32:em32,1:model_config_rec%num_soil_layers). ')
3466  endif
3467 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%tslb=initial_data_value
3468 IF(.NOT.inter_domain)THEN
3469 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%num_soil_layers)-(1)+1))) * RWORDSIZE
3470 ALLOCATE(grid%zs(1:model_config_rec%num_soil_layers),STAT=ierr)
3471  if (ierr.ne.0) then
3472  CALL wrf_error_fatal ( &
3473 'frame/module_domain.f: Failed to allocate grid%zs(1:model_config_rec%num_soil_layers). ')
3474  endif
3475 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%zs=initial_data_value
3476 ELSE
3477 ALLOCATE(grid%zs(1),STAT=ierr)
3478  if (ierr.ne.0) then
3479  CALL wrf_error_fatal ( &
3480 'frame/module_domain.f: Failed to allocate grid%zs(1).  ')
3481  endif
3482 ENDIF
3483 IF(.NOT.inter_domain)THEN
3484 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%num_soil_layers)-(1)+1))) * RWORDSIZE
3485 ALLOCATE(grid%dzs(1:model_config_rec%num_soil_layers),STAT=ierr)
3486  if (ierr.ne.0) then
3487  CALL wrf_error_fatal ( &
3488 'frame/module_domain.f: Failed to allocate grid%dzs(1:model_config_rec%num_soil_layers). ')
3489  endif
3490 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%dzs=initial_data_value
3491 ELSE
3492 ALLOCATE(grid%dzs(1),STAT=ierr)
3493  if (ierr.ne.0) then
3494  CALL wrf_error_fatal ( &
3495 'frame/module_domain.f: Failed to allocate grid%dzs(1).  ')
3496  endif
3497 ENDIF
3498 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((model_config_rec%num_soil_layers)-(1)+1))) * RWORDSIZE
3499 ALLOCATE(grid%smois(sm31:em31,sm32:em32,1:model_config_rec%num_soil_layers),STAT=ierr)
3500  if (ierr.ne.0) then
3501  CALL wrf_error_fatal ( &
3502 'frame/module_domain.f: Failed to allocate grid%smois(sm31:em31,sm32:em32,1:model_config_rec%num_soil_layers). ')
3503  endif
3504 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%smois=initial_data_value
3505 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((model_config_rec%num_soil_layers)-(1)+1))) * RWORDSIZE
3506 ALLOCATE(grid%sh2o(sm31:em31,sm32:em32,1:model_config_rec%num_soil_layers),STAT=ierr)
3507  if (ierr.ne.0) then
3508  CALL wrf_error_fatal ( &
3509 'frame/module_domain.f: Failed to allocate grid%sh2o(sm31:em31,sm32:em32,1:model_config_rec%num_soil_layers). ')
3510  endif
3511 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%sh2o=initial_data_value
3512 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3513 ALLOCATE(grid%xice(sm31:em31,sm32:em32),STAT=ierr)
3514  if (ierr.ne.0) then
3515  CALL wrf_error_fatal ( &
3516 'frame/module_domain.f: Failed to allocate grid%xice(sm31:em31,sm32:em32). ')
3517  endif
3518 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xice=initial_data_value
3519 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3520 ALLOCATE(grid%sfcrunoff(sm31:em31,sm32:em32),STAT=ierr)
3521  if (ierr.ne.0) then
3522  CALL wrf_error_fatal ( &
3523 'frame/module_domain.f: Failed to allocate grid%sfcrunoff(sm31:em31,sm32:em32). ')
3524  endif
3525 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%sfcrunoff=initial_data_value
3526 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3527 ALLOCATE(grid%udrunoff(sm31:em31,sm32:em32),STAT=ierr)
3528  if (ierr.ne.0) then
3529  CALL wrf_error_fatal ( &
3530 'frame/module_domain.f: Failed to allocate grid%udrunoff(sm31:em31,sm32:em32). ')
3531  endif
3532 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%udrunoff=initial_data_value
3533 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
3534 ALLOCATE(grid%ivgtyp(sm31:em31,sm32:em32),STAT=ierr)
3535  if (ierr.ne.0) then
3536  CALL wrf_error_fatal ( &
3537 'frame/module_domain.f: Failed to allocate grid%ivgtyp(sm31:em31,sm32:em32). ')
3538  endif
3539 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ivgtyp=0
3540 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
3541 ALLOCATE(grid%isltyp(sm31:em31,sm32:em32),STAT=ierr)
3542  if (ierr.ne.0) then
3543  CALL wrf_error_fatal ( &
3544 'frame/module_domain.f: Failed to allocate grid%isltyp(sm31:em31,sm32:em32). ')
3545  endif
3546 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%isltyp=0
3547 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3548 ALLOCATE(grid%vegfra(sm31:em31,sm32:em32),STAT=ierr)
3549  if (ierr.ne.0) then
3550  CALL wrf_error_fatal ( &
3551 'frame/module_domain.f: Failed to allocate grid%vegfra(sm31:em31,sm32:em32). ')
3552  endif
3553 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vegfra=initial_data_value
3554 IF(.NOT.inter_domain)THEN
3555 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3556 ALLOCATE(grid%sfcevp(sm31:em31,sm32:em32),STAT=ierr)
3557  if (ierr.ne.0) then
3558  CALL wrf_error_fatal ( &
3559 'frame/module_domain.f: Failed to allocate grid%sfcevp(sm31:em31,sm32:em32). ')
3560  endif
3561 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%sfcevp=initial_data_value
3562 ELSE
3563 ALLOCATE(grid%sfcevp(1,1),STAT=ierr)
3564  if (ierr.ne.0) then
3565  CALL wrf_error_fatal ( &
3566 'frame/module_domain.f: Failed to allocate grid%sfcevp(1,1).  ')
3567  endif
3568 ENDIF
3569 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3570 ALLOCATE(grid%acsnow(sm31:em31,sm32:em32),STAT=ierr)
3571  if (ierr.ne.0) then
3572  CALL wrf_error_fatal ( &
3573 'frame/module_domain.f: Failed to allocate grid%acsnow(sm31:em31,sm32:em32). ')
3574  endif
3575 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%acsnow=initial_data_value
3576 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3577 ALLOCATE(grid%acsnom(sm31:em31,sm32:em32),STAT=ierr)
3578  if (ierr.ne.0) then
3579  CALL wrf_error_fatal ( &
3580 'frame/module_domain.f: Failed to allocate grid%acsnom(sm31:em31,sm32:em32). ')
3581  endif
3582 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%acsnom=initial_data_value
3583 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3584 ALLOCATE(grid%snow(sm31:em31,sm32:em32),STAT=ierr)
3585  if (ierr.ne.0) then
3586  CALL wrf_error_fatal ( &
3587 'frame/module_domain.f: Failed to allocate grid%snow(sm31:em31,sm32:em32). ')
3588  endif
3589 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%snow=initial_data_value
3590 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3591 ALLOCATE(grid%snowh(sm31:em31,sm32:em32),STAT=ierr)
3592  if (ierr.ne.0) then
3593  CALL wrf_error_fatal ( &
3594 'frame/module_domain.f: Failed to allocate grid%snowh(sm31:em31,sm32:em32). ')
3595  endif
3596 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%snowh=initial_data_value
3597 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3598 ALLOCATE(grid%rhosn(sm31:em31,sm32:em32),STAT=ierr)
3599  if (ierr.ne.0) then
3600  CALL wrf_error_fatal ( &
3601 'frame/module_domain.f: Failed to allocate grid%rhosn(sm31:em31,sm32:em32). ')
3602  endif
3603 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%rhosn=initial_data_value
3604 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3605 ALLOCATE(grid%canwat(sm31:em31,sm32:em32),STAT=ierr)
3606  if (ierr.ne.0) then
3607  CALL wrf_error_fatal ( &
3608 'frame/module_domain.f: Failed to allocate grid%canwat(sm31:em31,sm32:em32). ')
3609  endif
3610 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%canwat=initial_data_value
3611 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3612 ALLOCATE(grid%sst(sm31:em31,sm32:em32),STAT=ierr)
3613  if (ierr.ne.0) then
3614  CALL wrf_error_fatal ( &
3615 'frame/module_domain.f: Failed to allocate grid%sst(sm31:em31,sm32:em32). ')
3616  endif
3617 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%sst=initial_data_value
3618 IF ( setinitval .EQ. 3 ) grid%ifndsnowh=0
3619 IF ( setinitval .EQ. 3 ) grid%ifndsoilw=0
3620 IF(.NOT.inter_domain)THEN
3621 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3622 ALLOCATE(grid%htop(sm31:em31,sm32:em32),STAT=ierr)
3623  if (ierr.ne.0) then
3624  CALL wrf_error_fatal ( &
3625 'frame/module_domain.f: Failed to allocate grid%htop(sm31:em31,sm32:em32). ')
3626  endif
3627 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%htop=initial_data_value
3628 ELSE
3629 ALLOCATE(grid%htop(1,1),STAT=ierr)
3630  if (ierr.ne.0) then
3631  CALL wrf_error_fatal ( &
3632 'frame/module_domain.f: Failed to allocate grid%htop(1,1).  ')
3633  endif
3634 ENDIF
3635 IF(.NOT.inter_domain)THEN
3636 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3637 ALLOCATE(grid%hbot(sm31:em31,sm32:em32),STAT=ierr)
3638  if (ierr.ne.0) then
3639  CALL wrf_error_fatal ( &
3640 'frame/module_domain.f: Failed to allocate grid%hbot(sm31:em31,sm32:em32). ')
3641  endif
3642 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%hbot=initial_data_value
3643 ELSE
3644 ALLOCATE(grid%hbot(1,1),STAT=ierr)
3645  if (ierr.ne.0) then
3646  CALL wrf_error_fatal ( &
3647 'frame/module_domain.f: Failed to allocate grid%hbot(1,1).  ')
3648  endif
3649 ENDIF
3650 IF(.NOT.inter_domain)THEN
3651 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3652 ALLOCATE(grid%cuppt(sm31:em31,sm32:em32),STAT=ierr)
3653  if (ierr.ne.0) then
3654  CALL wrf_error_fatal ( &
3655 'frame/module_domain.f: Failed to allocate grid%cuppt(sm31:em31,sm32:em32). ')
3656  endif
3657 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%cuppt=initial_data_value
3658 ELSE
3659 ALLOCATE(grid%cuppt(1,1),STAT=ierr)
3660  if (ierr.ne.0) then
3661  CALL wrf_error_fatal ( &
3662 'frame/module_domain.f: Failed to allocate grid%cuppt(1,1).  ')
3663  endif
3664 ENDIF
3665 IF(.NOT.inter_domain)THEN
3666 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3667 ALLOCATE(grid%rswtoa(sm31:em31,sm32:em32),STAT=ierr)
3668  if (ierr.ne.0) then
3669  CALL wrf_error_fatal ( &
3670 'frame/module_domain.f: Failed to allocate grid%rswtoa(sm31:em31,sm32:em32). ')
3671  endif
3672 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%rswtoa=initial_data_value
3673 ELSE
3674 ALLOCATE(grid%rswtoa(1,1),STAT=ierr)
3675  if (ierr.ne.0) then
3676  CALL wrf_error_fatal ( &
3677 'frame/module_domain.f: Failed to allocate grid%rswtoa(1,1).  ')
3678  endif
3679 ENDIF
3680 IF(.NOT.inter_domain)THEN
3681 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3682 ALLOCATE(grid%rlwtoa(sm31:em31,sm32:em32),STAT=ierr)
3683  if (ierr.ne.0) then
3684  CALL wrf_error_fatal ( &
3685 'frame/module_domain.f: Failed to allocate grid%rlwtoa(sm31:em31,sm32:em32). ')
3686  endif
3687 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%rlwtoa=initial_data_value
3688 ELSE
3689 ALLOCATE(grid%rlwtoa(1,1),STAT=ierr)
3690  if (ierr.ne.0) then
3691  CALL wrf_error_fatal ( &
3692 'frame/module_domain.f: Failed to allocate grid%rlwtoa(1,1).  ')
3693  endif
3694 ENDIF
3695 IF(.NOT.inter_domain)THEN
3696 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3697 ALLOCATE(grid%czmean(sm31:em31,sm32:em32),STAT=ierr)
3698  if (ierr.ne.0) then
3699  CALL wrf_error_fatal ( &
3700 'frame/module_domain.f: Failed to allocate grid%czmean(sm31:em31,sm32:em32). ')
3701  endif
3702 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%czmean=initial_data_value
3703 ELSE
3704 ALLOCATE(grid%czmean(1,1),STAT=ierr)
3705  if (ierr.ne.0) then
3706  CALL wrf_error_fatal ( &
3707 'frame/module_domain.f: Failed to allocate grid%czmean(1,1).  ')
3708  endif
3709 ENDIF
3710 IF(.NOT.inter_domain)THEN
3711 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3712 ALLOCATE(grid%cfracl(sm31:em31,sm32:em32),STAT=ierr)
3713  if (ierr.ne.0) then
3714  CALL wrf_error_fatal ( &
3715 'frame/module_domain.f: Failed to allocate grid%cfracl(sm31:em31,sm32:em32). ')
3716  endif
3717 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%cfracl=initial_data_value
3718 ELSE
3719 ALLOCATE(grid%cfracl(1,1),STAT=ierr)
3720  if (ierr.ne.0) then
3721  CALL wrf_error_fatal ( &
3722 'frame/module_domain.f: Failed to allocate grid%cfracl(1,1).  ')
3723  endif
3724 ENDIF
3725 IF(.NOT.inter_domain)THEN
3726 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3727 ALLOCATE(grid%cfracm(sm31:em31,sm32:em32),STAT=ierr)
3728  if (ierr.ne.0) then
3729  CALL wrf_error_fatal ( &
3730 'frame/module_domain.f: Failed to allocate grid%cfracm(sm31:em31,sm32:em32). ')
3731  endif
3732 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%cfracm=initial_data_value
3733 ELSE
3734 ALLOCATE(grid%cfracm(1,1),STAT=ierr)
3735  if (ierr.ne.0) then
3736  CALL wrf_error_fatal ( &
3737 'frame/module_domain.f: Failed to allocate grid%cfracm(1,1).  ')
3738  endif
3739 ENDIF
3740 IF(.NOT.inter_domain)THEN
3741 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3742 ALLOCATE(grid%cfrach(sm31:em31,sm32:em32),STAT=ierr)
3743  if (ierr.ne.0) then
3744  CALL wrf_error_fatal ( &
3745 'frame/module_domain.f: Failed to allocate grid%cfrach(sm31:em31,sm32:em32). ')
3746  endif
3747 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%cfrach=initial_data_value
3748 ELSE
3749 ALLOCATE(grid%cfrach(1,1),STAT=ierr)
3750  if (ierr.ne.0) then
3751  CALL wrf_error_fatal ( &
3752 'frame/module_domain.f: Failed to allocate grid%cfrach(1,1).  ')
3753  endif
3754 ENDIF
3755 IF(.NOT.inter_domain)THEN
3756 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3757 ALLOCATE(grid%acfrst(sm31:em31,sm32:em32),STAT=ierr)
3758  if (ierr.ne.0) then
3759  CALL wrf_error_fatal ( &
3760 'frame/module_domain.f: Failed to allocate grid%acfrst(sm31:em31,sm32:em32). ')
3761  endif
3762 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%acfrst=initial_data_value
3763 ELSE
3764 ALLOCATE(grid%acfrst(1,1),STAT=ierr)
3765  if (ierr.ne.0) then
3766  CALL wrf_error_fatal ( &
3767 'frame/module_domain.f: Failed to allocate grid%acfrst(1,1).  ')
3768  endif
3769 ENDIF
3770 IF(.NOT.inter_domain)THEN
3771 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
3772 ALLOCATE(grid%ncfrst(sm31:em31,sm32:em32),STAT=ierr)
3773  if (ierr.ne.0) then
3774  CALL wrf_error_fatal ( &
3775 'frame/module_domain.f: Failed to allocate grid%ncfrst(sm31:em31,sm32:em32). ')
3776  endif
3777 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ncfrst=0
3778 ELSE
3779 ALLOCATE(grid%ncfrst(1,1),STAT=ierr)
3780  if (ierr.ne.0) then
3781  CALL wrf_error_fatal ( &
3782 'frame/module_domain.f: Failed to allocate grid%ncfrst(1,1).  ')
3783  endif
3784 ENDIF
3785 IF(.NOT.inter_domain)THEN
3786 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3787 ALLOCATE(grid%acfrcv(sm31:em31,sm32:em32),STAT=ierr)
3788  if (ierr.ne.0) then
3789  CALL wrf_error_fatal ( &
3790 'frame/module_domain.f: Failed to allocate grid%acfrcv(sm31:em31,sm32:em32). ')
3791  endif
3792 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%acfrcv=initial_data_value
3793 ELSE
3794 ALLOCATE(grid%acfrcv(1,1),STAT=ierr)
3795  if (ierr.ne.0) then
3796  CALL wrf_error_fatal ( &
3797 'frame/module_domain.f: Failed to allocate grid%acfrcv(1,1).  ')
3798  endif
3799 ENDIF
3800 IF(.NOT.inter_domain)THEN
3801 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
3802 ALLOCATE(grid%ncfrcv(sm31:em31,sm32:em32),STAT=ierr)
3803  if (ierr.ne.0) then
3804  CALL wrf_error_fatal ( &
3805 'frame/module_domain.f: Failed to allocate grid%ncfrcv(sm31:em31,sm32:em32). ')
3806  endif
3807 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ncfrcv=0
3808 ELSE
3809 ALLOCATE(grid%ncfrcv(1,1),STAT=ierr)
3810  if (ierr.ne.0) then
3811  CALL wrf_error_fatal ( &
3812 'frame/module_domain.f: Failed to allocate grid%ncfrcv(1,1).  ')
3813  endif
3814 ENDIF
3815 IF(.NOT.inter_domain)THEN
3816 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
3817 ALLOCATE(grid%h_diabatic(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
3818  if (ierr.ne.0) then
3819  CALL wrf_error_fatal ( &
3820 'frame/module_domain.f: Failed to allocate grid%h_diabatic(sm31:em31,sm32:em32,sm33:em33). ')
3821  endif
3822 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%h_diabatic=initial_data_value
3823 ELSE
3824 ALLOCATE(grid%h_diabatic(1,1,1),STAT=ierr)
3825  if (ierr.ne.0) then
3826  CALL wrf_error_fatal ( &
3827 'frame/module_domain.f: Failed to allocate grid%h_diabatic(1,1,1).  ')
3828  endif
3829 ENDIF
3830 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3831 ALLOCATE(grid%msft(sm31:em31,sm32:em32),STAT=ierr)
3832  if (ierr.ne.0) then
3833  CALL wrf_error_fatal ( &
3834 'frame/module_domain.f: Failed to allocate grid%msft(sm31:em31,sm32:em32). ')
3835  endif
3836 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%msft=initial_data_value
3837 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3838 ALLOCATE(grid%msfu(sm31:em31,sm32:em32),STAT=ierr)
3839  if (ierr.ne.0) then
3840  CALL wrf_error_fatal ( &
3841 'frame/module_domain.f: Failed to allocate grid%msfu(sm31:em31,sm32:em32). ')
3842  endif
3843 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%msfu=initial_data_value
3844 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3845 ALLOCATE(grid%msfv(sm31:em31,sm32:em32),STAT=ierr)
3846  if (ierr.ne.0) then
3847  CALL wrf_error_fatal ( &
3848 'frame/module_domain.f: Failed to allocate grid%msfv(sm31:em31,sm32:em32). ')
3849  endif
3850 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%msfv=initial_data_value
3851 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3852 ALLOCATE(grid%f(sm31:em31,sm32:em32),STAT=ierr)
3853  if (ierr.ne.0) then
3854  CALL wrf_error_fatal ( &
3855 'frame/module_domain.f: Failed to allocate grid%f(sm31:em31,sm32:em32). ')
3856  endif
3857 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%f=initial_data_value
3858 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3859 ALLOCATE(grid%e(sm31:em31,sm32:em32),STAT=ierr)
3860  if (ierr.ne.0) then
3861  CALL wrf_error_fatal ( &
3862 'frame/module_domain.f: Failed to allocate grid%e(sm31:em31,sm32:em32). ')
3863  endif
3864 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%e=initial_data_value
3865 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3866 ALLOCATE(grid%sina(sm31:em31,sm32:em32),STAT=ierr)
3867  if (ierr.ne.0) then
3868  CALL wrf_error_fatal ( &
3869 'frame/module_domain.f: Failed to allocate grid%sina(sm31:em31,sm32:em32). ')
3870  endif
3871 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%sina=initial_data_value
3872 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3873 ALLOCATE(grid%cosa(sm31:em31,sm32:em32),STAT=ierr)
3874  if (ierr.ne.0) then
3875  CALL wrf_error_fatal ( &
3876 'frame/module_domain.f: Failed to allocate grid%cosa(sm31:em31,sm32:em32). ')
3877  endif
3878 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%cosa=initial_data_value
3879 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3880 ALLOCATE(grid%ht(sm31:em31,sm32:em32),STAT=ierr)
3881  if (ierr.ne.0) then
3882  CALL wrf_error_fatal ( &
3883 'frame/module_domain.f: Failed to allocate grid%ht(sm31:em31,sm32:em32). ')
3884  endif
3885 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ht=initial_data_value
3886 IF(.NOT.inter_domain)THEN
3887 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3888 ALLOCATE(grid%ht_fine(sm31:em31,sm32:em32),STAT=ierr)
3889  if (ierr.ne.0) then
3890  CALL wrf_error_fatal ( &
3891 'frame/module_domain.f: Failed to allocate grid%ht_fine(sm31:em31,sm32:em32). ')
3892  endif
3893 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ht_fine=initial_data_value
3894 ELSE
3895 ALLOCATE(grid%ht_fine(1,1),STAT=ierr)
3896  if (ierr.ne.0) then
3897  CALL wrf_error_fatal ( &
3898 'frame/module_domain.f: Failed to allocate grid%ht_fine(1,1).  ')
3899  endif
3900 ENDIF
3901 IF(.NOT.inter_domain)THEN
3902 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3903 ALLOCATE(grid%ht_int(sm31:em31,sm32:em32),STAT=ierr)
3904  if (ierr.ne.0) then
3905  CALL wrf_error_fatal ( &
3906 'frame/module_domain.f: Failed to allocate grid%ht_int(sm31:em31,sm32:em32). ')
3907  endif
3908 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ht_int=initial_data_value
3909 ELSE
3910 ALLOCATE(grid%ht_int(1,1),STAT=ierr)
3911  if (ierr.ne.0) then
3912  CALL wrf_error_fatal ( &
3913 'frame/module_domain.f: Failed to allocate grid%ht_int(1,1).  ')
3914  endif
3915 ENDIF
3916 IF(.NOT.inter_domain)THEN
3917 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3918 ALLOCATE(grid%ht_input(sm31:em31,sm32:em32),STAT=ierr)
3919  if (ierr.ne.0) then
3920  CALL wrf_error_fatal ( &
3921 'frame/module_domain.f: Failed to allocate grid%ht_input(sm31:em31,sm32:em32). ')
3922  endif
3923 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ht_input=initial_data_value
3924 ELSE
3925 ALLOCATE(grid%ht_input(1,1),STAT=ierr)
3926  if (ierr.ne.0) then
3927  CALL wrf_error_fatal ( &
3928 'frame/module_domain.f: Failed to allocate grid%ht_input(1,1).  ')
3929  endif
3930 ENDIF
3931 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3932 ALLOCATE(grid%tsk(sm31:em31,sm32:em32),STAT=ierr)
3933  if (ierr.ne.0) then
3934  CALL wrf_error_fatal ( &
3935 'frame/module_domain.f: Failed to allocate grid%tsk(sm31:em31,sm32:em32). ')
3936  endif
3937 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%tsk=initial_data_value
3938 IF(.NOT.inter_domain)THEN
3939 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
3940 ALLOCATE(grid%tsk_save(sm31:em31,sm32:em32),STAT=ierr)
3941  if (ierr.ne.0) then
3942  CALL wrf_error_fatal ( &
3943 'frame/module_domain.f: Failed to allocate grid%tsk_save(sm31:em31,sm32:em32). ')
3944  endif
3945 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%tsk_save=initial_data_value
3946 ELSE
3947 ALLOCATE(grid%tsk_save(1,1),STAT=ierr)
3948  if (ierr.ne.0) then
3949  CALL wrf_error_fatal ( &
3950 'frame/module_domain.f: Failed to allocate grid%tsk_save(1,1).  ')
3951  endif
3952 ENDIF
3953 IF(.NOT.inter_domain)THEN
3954 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
3955 ALLOCATE(grid%u_base(sm33:em33),STAT=ierr)
3956  if (ierr.ne.0) then
3957  CALL wrf_error_fatal ( &
3958 'frame/module_domain.f: Failed to allocate grid%u_base(sm33:em33). ')
3959  endif
3960 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%u_base=initial_data_value
3961 ELSE
3962 ALLOCATE(grid%u_base(1),STAT=ierr)
3963  if (ierr.ne.0) then
3964  CALL wrf_error_fatal ( &
3965 'frame/module_domain.f: Failed to allocate grid%u_base(1).  ')
3966  endif
3967 ENDIF
3968 IF(.NOT.inter_domain)THEN
3969 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
3970 ALLOCATE(grid%v_base(sm33:em33),STAT=ierr)
3971  if (ierr.ne.0) then
3972  CALL wrf_error_fatal ( &
3973 'frame/module_domain.f: Failed to allocate grid%v_base(sm33:em33). ')
3974  endif
3975 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%v_base=initial_data_value
3976 ELSE
3977 ALLOCATE(grid%v_base(1),STAT=ierr)
3978  if (ierr.ne.0) then
3979  CALL wrf_error_fatal ( &
3980 'frame/module_domain.f: Failed to allocate grid%v_base(1).  ')
3981  endif
3982 ENDIF
3983 IF(.NOT.inter_domain)THEN
3984 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
3985 ALLOCATE(grid%qv_base(sm33:em33),STAT=ierr)
3986  if (ierr.ne.0) then
3987  CALL wrf_error_fatal ( &
3988 'frame/module_domain.f: Failed to allocate grid%qv_base(sm33:em33). ')
3989  endif
3990 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%qv_base=initial_data_value
3991 ELSE
3992 ALLOCATE(grid%qv_base(1),STAT=ierr)
3993  if (ierr.ne.0) then
3994  CALL wrf_error_fatal ( &
3995 'frame/module_domain.f: Failed to allocate grid%qv_base(1).  ')
3996  endif
3997 ENDIF
3998 IF(.NOT.inter_domain)THEN
3999 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
4000 ALLOCATE(grid%z_base(sm33:em33),STAT=ierr)
4001  if (ierr.ne.0) then
4002  CALL wrf_error_fatal ( &
4003 'frame/module_domain.f: Failed to allocate grid%z_base(sm33:em33). ')
4004  endif
4005 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%z_base=initial_data_value
4006 ELSE
4007 ALLOCATE(grid%z_base(1),STAT=ierr)
4008  if (ierr.ne.0) then
4009  CALL wrf_error_fatal ( &
4010 'frame/module_domain.f: Failed to allocate grid%z_base(1).  ')
4011  endif
4012 ENDIF
4013 IF ( setinitval .EQ. 3 ) grid%u_frame=initial_data_value
4014 IF ( setinitval .EQ. 3 ) grid%v_frame=initial_data_value
4015 IF ( setinitval .EQ. 3 ) grid%p_top=initial_data_value
4016 IF ( setinitval .EQ. 3 ) grid%imicrogram=0
4017 IF ( setinitval .EQ. 3 ) grid%em_lat_ll_t=initial_data_value
4018 IF ( setinitval .EQ. 3 ) grid%em_lat_ul_t=initial_data_value
4019 IF ( setinitval .EQ. 3 ) grid%em_lat_ur_t=initial_data_value
4020 IF ( setinitval .EQ. 3 ) grid%em_lat_lr_t=initial_data_value
4021 IF ( setinitval .EQ. 3 ) grid%em_lat_ll_u=initial_data_value
4022 IF ( setinitval .EQ. 3 ) grid%em_lat_ul_u=initial_data_value
4023 IF ( setinitval .EQ. 3 ) grid%em_lat_ur_u=initial_data_value
4024 IF ( setinitval .EQ. 3 ) grid%em_lat_lr_u=initial_data_value
4025 IF ( setinitval .EQ. 3 ) grid%em_lat_ll_v=initial_data_value
4026 IF ( setinitval .EQ. 3 ) grid%em_lat_ul_v=initial_data_value
4027 IF ( setinitval .EQ. 3 ) grid%em_lat_ur_v=initial_data_value
4028 IF ( setinitval .EQ. 3 ) grid%em_lat_lr_v=initial_data_value
4029 IF ( setinitval .EQ. 3 ) grid%em_lat_ll_d=initial_data_value
4030 IF ( setinitval .EQ. 3 ) grid%em_lat_ul_d=initial_data_value
4031 IF ( setinitval .EQ. 3 ) grid%em_lat_ur_d=initial_data_value
4032 IF ( setinitval .EQ. 3 ) grid%em_lat_lr_d=initial_data_value
4033 IF ( setinitval .EQ. 3 ) grid%em_lon_ll_t=initial_data_value
4034 IF ( setinitval .EQ. 3 ) grid%em_lon_ul_t=initial_data_value
4035 IF ( setinitval .EQ. 3 ) grid%em_lon_ur_t=initial_data_value
4036 IF ( setinitval .EQ. 3 ) grid%em_lon_lr_t=initial_data_value
4037 IF ( setinitval .EQ. 3 ) grid%em_lon_ll_u=initial_data_value
4038 IF ( setinitval .EQ. 3 ) grid%em_lon_ul_u=initial_data_value
4039 IF ( setinitval .EQ. 3 ) grid%em_lon_ur_u=initial_data_value
4040 IF ( setinitval .EQ. 3 ) grid%em_lon_lr_u=initial_data_value
4041 IF ( setinitval .EQ. 3 ) grid%em_lon_ll_v=initial_data_value
4042 IF ( setinitval .EQ. 3 ) grid%em_lon_ul_v=initial_data_value
4043 IF ( setinitval .EQ. 3 ) grid%em_lon_ur_v=initial_data_value
4044 IF ( setinitval .EQ. 3 ) grid%em_lon_lr_v=initial_data_value
4045 IF ( setinitval .EQ. 3 ) grid%em_lon_ll_d=initial_data_value
4046 IF ( setinitval .EQ. 3 ) grid%em_lon_ul_d=initial_data_value
4047 IF ( setinitval .EQ. 3 ) grid%em_lon_ur_d=initial_data_value
4048 IF ( setinitval .EQ. 3 ) grid%em_lon_lr_d=initial_data_value
4049 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4050 ALLOCATE(grid%rainc(sm31:em31,sm32:em32),STAT=ierr)
4051  if (ierr.ne.0) then
4052  CALL wrf_error_fatal ( &
4053 'frame/module_domain.f: Failed to allocate grid%rainc(sm31:em31,sm32:em32). ')
4054  endif
4055 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%rainc=initial_data_value
4056 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4057 ALLOCATE(grid%rainnc(sm31:em31,sm32:em32),STAT=ierr)
4058  if (ierr.ne.0) then
4059  CALL wrf_error_fatal ( &
4060 'frame/module_domain.f: Failed to allocate grid%rainnc(sm31:em31,sm32:em32). ')
4061  endif
4062 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%rainnc=initial_data_value
4063 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4064 ALLOCATE(grid%xlat(sm31:em31,sm32:em32),STAT=ierr)
4065  if (ierr.ne.0) then
4066  CALL wrf_error_fatal ( &
4067 'frame/module_domain.f: Failed to allocate grid%xlat(sm31:em31,sm32:em32). ')
4068  endif
4069 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xlat=initial_data_value
4070 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4071 ALLOCATE(grid%xlong(sm31:em31,sm32:em32),STAT=ierr)
4072  if (ierr.ne.0) then
4073  CALL wrf_error_fatal ( &
4074 'frame/module_domain.f: Failed to allocate grid%xlong(sm31:em31,sm32:em32). ')
4075  endif
4076 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xlong=initial_data_value
4077 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4078 ALLOCATE(grid%em_xlat_u(sm31:em31,sm32:em32),STAT=ierr)
4079  if (ierr.ne.0) then
4080  CALL wrf_error_fatal ( &
4081 'frame/module_domain.f: Failed to allocate grid%em_xlat_u(sm31:em31,sm32:em32). ')
4082  endif
4083 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_xlat_u=initial_data_value
4084 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4085 ALLOCATE(grid%em_xlong_u(sm31:em31,sm32:em32),STAT=ierr)
4086  if (ierr.ne.0) then
4087  CALL wrf_error_fatal ( &
4088 'frame/module_domain.f: Failed to allocate grid%em_xlong_u(sm31:em31,sm32:em32). ')
4089  endif
4090 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_xlong_u=initial_data_value
4091 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4092 ALLOCATE(grid%em_xlat_v(sm31:em31,sm32:em32),STAT=ierr)
4093  if (ierr.ne.0) then
4094  CALL wrf_error_fatal ( &
4095 'frame/module_domain.f: Failed to allocate grid%em_xlat_v(sm31:em31,sm32:em32). ')
4096  endif
4097 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_xlat_v=initial_data_value
4098 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4099 ALLOCATE(grid%em_xlong_v(sm31:em31,sm32:em32),STAT=ierr)
4100  if (ierr.ne.0) then
4101  CALL wrf_error_fatal ( &
4102 'frame/module_domain.f: Failed to allocate grid%em_xlong_v(sm31:em31,sm32:em32). ')
4103  endif
4104 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_xlong_v=initial_data_value
4105 IF(.NOT.inter_domain)THEN
4106 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4107 ALLOCATE(grid%albbck(sm31:em31,sm32:em32),STAT=ierr)
4108  if (ierr.ne.0) then
4109  CALL wrf_error_fatal ( &
4110 'frame/module_domain.f: Failed to allocate grid%albbck(sm31:em31,sm32:em32). ')
4111  endif
4112 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%albbck=initial_data_value
4113 ELSE
4114 ALLOCATE(grid%albbck(1,1),STAT=ierr)
4115  if (ierr.ne.0) then
4116  CALL wrf_error_fatal ( &
4117 'frame/module_domain.f: Failed to allocate grid%albbck(1,1).  ')
4118  endif
4119 ENDIF
4120 IF(.NOT.inter_domain)THEN
4121 num_bytes_allocated = num_bytes_allocated + ((((7501)-(1)+1))) * RWORDSIZE
4122 ALLOCATE(grid%mp_restart_state(1:7501),STAT=ierr)
4123  if (ierr.ne.0) then
4124  CALL wrf_error_fatal ( &
4125 'frame/module_domain.f: Failed to allocate grid%mp_restart_state(1:7501). ')
4126  endif
4127 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%mp_restart_state=initial_data_value
4128 ELSE
4129 ALLOCATE(grid%mp_restart_state(1),STAT=ierr)
4130  if (ierr.ne.0) then
4131  CALL wrf_error_fatal ( &
4132 'frame/module_domain.f: Failed to allocate grid%mp_restart_state(1).  ')
4133  endif
4134 ENDIF
4135 IF(.NOT.inter_domain)THEN
4136 num_bytes_allocated = num_bytes_allocated + ((((7501)-(1)+1))) * RWORDSIZE
4137 ALLOCATE(grid%tbpvs_state(1:7501),STAT=ierr)
4138  if (ierr.ne.0) then
4139  CALL wrf_error_fatal ( &
4140 'frame/module_domain.f: Failed to allocate grid%tbpvs_state(1:7501). ')
4141  endif
4142 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%tbpvs_state=initial_data_value
4143 ELSE
4144 ALLOCATE(grid%tbpvs_state(1),STAT=ierr)
4145  if (ierr.ne.0) then
4146  CALL wrf_error_fatal ( &
4147 'frame/module_domain.f: Failed to allocate grid%tbpvs_state(1).  ')
4148  endif
4149 ENDIF
4150 IF(.NOT.inter_domain)THEN
4151 num_bytes_allocated = num_bytes_allocated + ((((7501)-(1)+1))) * RWORDSIZE
4152 ALLOCATE(grid%tbpvs0_state(1:7501),STAT=ierr)
4153  if (ierr.ne.0) then
4154  CALL wrf_error_fatal ( &
4155 'frame/module_domain.f: Failed to allocate grid%tbpvs0_state(1:7501). ')
4156  endif
4157 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%tbpvs0_state=initial_data_value
4158 ELSE
4159 ALLOCATE(grid%tbpvs0_state(1),STAT=ierr)
4160  if (ierr.ne.0) then
4161  CALL wrf_error_fatal ( &
4162 'frame/module_domain.f: Failed to allocate grid%tbpvs0_state(1).  ')
4163  endif
4164 ENDIF
4165 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4166 ALLOCATE(grid%tmn(sm31:em31,sm32:em32),STAT=ierr)
4167  if (ierr.ne.0) then
4168  CALL wrf_error_fatal ( &
4169 'frame/module_domain.f: Failed to allocate grid%tmn(sm31:em31,sm32:em32). ')
4170  endif
4171 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%tmn=initial_data_value
4172 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4173 ALLOCATE(grid%xland(sm31:em31,sm32:em32),STAT=ierr)
4174  if (ierr.ne.0) then
4175  CALL wrf_error_fatal ( &
4176 'frame/module_domain.f: Failed to allocate grid%xland(sm31:em31,sm32:em32). ')
4177  endif
4178 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xland=initial_data_value
4179 IF(.NOT.inter_domain)THEN
4180 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4181 ALLOCATE(grid%znt(sm31:em31,sm32:em32),STAT=ierr)
4182  if (ierr.ne.0) then
4183  CALL wrf_error_fatal ( &
4184 'frame/module_domain.f: Failed to allocate grid%znt(sm31:em31,sm32:em32). ')
4185  endif
4186 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%znt=initial_data_value
4187 ELSE
4188 ALLOCATE(grid%znt(1,1),STAT=ierr)
4189  if (ierr.ne.0) then
4190  CALL wrf_error_fatal ( &
4191 'frame/module_domain.f: Failed to allocate grid%znt(1,1).  ')
4192  endif
4193 ENDIF
4194 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
4195 ALLOCATE(grid%snowc(sm31:em31,sm32:em32),STAT=ierr)
4196  if (ierr.ne.0) then
4197  CALL wrf_error_fatal ( &
4198 'frame/module_domain.f: Failed to allocate grid%snowc(sm31:em31,sm32:em32). ')
4199  endif
4200 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%snowc=initial_data_value
4201 IF ( setinitval .EQ. 3 ) grid%stepbl=0
4202 IF(.NOT.inter_domain)THEN
4203 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
4204 ALLOCATE(grid%xkmv(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
4205  if (ierr.ne.0) then
4206  CALL wrf_error_fatal ( &
4207 'frame/module_domain.f: Failed to allocate grid%xkmv(sm31:em31,sm32:em32,sm33:em33). ')
4208  endif
4209 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xkmv=initial_data_value
4210 ELSE
4211 ALLOCATE(grid%xkmv(1,1,1),STAT=ierr)
4212  if (ierr.ne.0) then
4213  CALL wrf_error_fatal ( &
4214 'frame/module_domain.f: Failed to allocate grid%xkmv(1,1,1).  ')
4215  endif
4216 ENDIF
4217 IF(.NOT.inter_domain)THEN
4218 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
4219 ALLOCATE(grid%xkmh(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
4220  if (ierr.ne.0) then
4221  CALL wrf_error_fatal ( &
4222 'frame/module_domain.f: Failed to allocate grid%xkmh(sm31:em31,sm32:em32,sm33:em33). ')
4223  endif
4224 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xkmh=initial_data_value
4225 ELSE
4226 ALLOCATE(grid%xkmh(1,1,1),STAT=ierr)
4227  if (ierr.ne.0) then
4228  CALL wrf_error_fatal ( &
4229 'frame/module_domain.f: Failed to allocate grid%xkmh(1,1,1).  ')
4230  endif
4231 ENDIF
4232 IF(.NOT.inter_domain)THEN
4233 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
4234 ALLOCATE(grid%xkmhd(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
4235  if (ierr.ne.0) then
4236  CALL wrf_error_fatal ( &
4237 'frame/module_domain.f: Failed to allocate grid%xkmhd(sm31:em31,sm32:em32,sm33:em33). ')
4238  endif
4239 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xkmhd=initial_data_value
4240 ELSE
4241 ALLOCATE(grid%xkmhd(1,1,1),STAT=ierr)
4242  if (ierr.ne.0) then
4243  CALL wrf_error_fatal ( &
4244 'frame/module_domain.f: Failed to allocate grid%xkmhd(1,1,1).  ')
4245  endif
4246 ENDIF
4247 IF(.NOT.inter_domain)THEN
4248 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
4249 ALLOCATE(grid%a_xkmhd(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
4250  if (ierr.ne.0) then
4251  CALL wrf_error_fatal ( &
4252 'frame/module_domain.f: Failed to allocate grid%a_xkmhd(sm31:em31,sm32:em32,sm33:em33). ')
4253  endif
4254 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%a_xkmhd=initial_data_value
4255 ELSE
4256 ALLOCATE(grid%a_xkmhd(1,1,1),STAT=ierr)
4257  if (ierr.ne.0) then
4258  CALL wrf_error_fatal ( &
4259 'frame/module_domain.f: Failed to allocate grid%a_xkmhd(1,1,1).  ')
4260  endif
4261 ENDIF
4262 IF(.NOT.inter_domain)THEN
4263 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
4264 ALLOCATE(grid%g_xkmhd(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
4265  if (ierr.ne.0) then
4266  CALL wrf_error_fatal ( &
4267 'frame/module_domain.f: Failed to allocate grid%g_xkmhd(sm31:em31,sm32:em32,sm33:em33). ')
4268  endif
4269 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%g_xkmhd=initial_data_value
4270 ELSE
4271 ALLOCATE(grid%g_xkmhd(1,1,1),STAT=ierr)
4272  if (ierr.ne.0) then
4273  CALL wrf_error_fatal ( &
4274 'frame/module_domain.f: Failed to allocate grid%g_xkmhd(1,1,1).  ')
4275  endif
4276 ENDIF
4277 IF(.NOT.inter_domain)THEN
4278 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
4279 ALLOCATE(grid%xkhv(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
4280  if (ierr.ne.0) then
4281  CALL wrf_error_fatal ( &
4282 'frame/module_domain.f: Failed to allocate grid%xkhv(sm31:em31,sm32:em32,sm33:em33). ')
4283  endif
4284 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xkhv=initial_data_value
4285 ELSE
4286 ALLOCATE(grid%xkhv(1,1,1),STAT=ierr)
4287  if (ierr.ne.0) then
4288  CALL wrf_error_fatal ( &
4289 'frame/module_domain.f: Failed to allocate grid%xkhv(1,1,1).  ')
4290  endif
4291 ENDIF
4292 IF(.NOT.inter_domain)THEN
4293 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
4294 ALLOCATE(grid%xkhh(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
4295  if (ierr.ne.0) then
4296  CALL wrf_error_fatal ( &
4297 'frame/module_domain.f: Failed to allocate grid%xkhh(sm31:em31,sm32:em32,sm33:em33). ')
4298  endif
4299 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xkhh=initial_data_value
4300 ELSE
4301 ALLOCATE(grid%xkhh(1,1,1),STAT=ierr)
4302  if (ierr.ne.0) then
4303  CALL wrf_error_fatal ( &
4304 'frame/module_domain.f: Failed to allocate grid%xkhh(1,1,1).  ')
4305  endif
4306 ENDIF
4307 IF ( setinitval .EQ. 3 ) grid%warm_rain=.FALSE.
4308 IF ( setinitval .EQ. 3 ) grid%adv_moist_cond=.FALSE.
4309 IF ( setinitval .EQ. 3 ) grid%moved=.FALSE.
4310 IF ( setinitval .EQ. 3 ) grid%write_increments=.FALSE.
4311 IF ( setinitval .EQ. 3 ) grid%var4d=.FALSE.
4312 IF ( setinitval .EQ. 3 ) grid%var4d_multi_inc=0
4313 IF ( setinitval .EQ. 3 ) grid%var4d_coupling=0
4314 IF ( setinitval .EQ. 3 ) grid%global=.FALSE.
4315 IF ( setinitval .EQ. 3 ) grid%oi_use=.FALSE.
4316 IF ( setinitval .EQ. 3 ) grid%print_detail_airep=.FALSE.
4317 IF ( setinitval .EQ. 3 ) grid%print_detail_radar=.FALSE.
4318 IF ( setinitval .EQ. 3 ) grid%print_detail_rad=.FALSE.
4319 IF ( setinitval .EQ. 3 ) grid%print_detail_xa=.FALSE.
4320 IF ( setinitval .EQ. 3 ) grid%print_detail_xb=.FALSE.
4321 IF ( setinitval .EQ. 3 ) grid%print_detail_obs=.FALSE.
4322 IF ( setinitval .EQ. 3 ) grid%print_detail_f_obs=.FALSE.
4323 IF ( setinitval .EQ. 3 ) grid%print_detail_map=.FALSE.
4324 IF ( setinitval .EQ. 3 ) grid%print_detail_grad=.FALSE.
4325 IF ( setinitval .EQ. 3 ) grid%print_detail_regression=.FALSE.
4326 IF ( setinitval .EQ. 3 ) grid%print_detail_spectral=.FALSE.
4327 IF ( setinitval .EQ. 3 ) grid%print_detail_testing=.FALSE.
4328 IF ( setinitval .EQ. 3 ) grid%print_detail_parallel=.FALSE.
4329 IF ( setinitval .EQ. 3 ) grid%print_detail_be=.FALSE.
4330 IF ( setinitval .EQ. 3 ) grid%print_detail_timing=.FALSE.
4331 IF ( setinitval .EQ. 3 ) grid%check_max_iv_print=.FALSE.
4332 IF ( setinitval .EQ. 3 ) grid%analysis_accu=0
4333 IF ( setinitval .EQ. 3 ) grid%calc_w_increment=.FALSE.
4334 IF ( setinitval .EQ. 3 ) grid%dt_cloud_model=.FALSE.
4335 IF ( setinitval .EQ. 3 ) grid%write_qcw=.FALSE.
4336 IF ( setinitval .EQ. 3 ) grid%write_qrn=.FALSE.
4337 IF ( setinitval .EQ. 3 ) grid%write_qci=.FALSE.
4338 IF ( setinitval .EQ. 3 ) grid%write_qsn=.FALSE.
4339 IF ( setinitval .EQ. 3 ) grid%write_qgr=.FALSE.
4340 IF ( setinitval .EQ. 3 ) grid%write_filtered_obs=.FALSE.
4341 IF ( setinitval .EQ. 3 ) grid%fg_format=0
4342 IF ( setinitval .EQ. 3 ) grid%ob_format=0
4343 IF ( setinitval .EQ. 3 ) grid%num_fgat_time=0
4344 IF ( setinitval .EQ. 3 ) grid%use_synopobs=.FALSE.
4345 IF ( setinitval .EQ. 3 ) grid%use_shipsobs=.FALSE.
4346 IF ( setinitval .EQ. 3 ) grid%use_metarobs=.FALSE.
4347 IF ( setinitval .EQ. 3 ) grid%use_soundobs=.FALSE.
4348 IF ( setinitval .EQ. 3 ) grid%use_pilotobs=.FALSE.
4349 IF ( setinitval .EQ. 3 ) grid%use_airepobs=.FALSE.
4350 IF ( setinitval .EQ. 3 ) grid%use_geoamvobs=.FALSE.
4351 IF ( setinitval .EQ. 3 ) grid%use_polaramvobs=.FALSE.
4352 IF ( setinitval .EQ. 3 ) grid%use_bogusobs=.FALSE.
4353 IF ( setinitval .EQ. 3 ) grid%use_buoyobs=.FALSE.
4354 IF ( setinitval .EQ. 3 ) grid%use_profilerobs=.FALSE.
4355 IF ( setinitval .EQ. 3 ) grid%use_satemobs=.FALSE.
4356 IF ( setinitval .EQ. 3 ) grid%use_gpspwobs=.FALSE.
4357 IF ( setinitval .EQ. 3 ) grid%use_gpsrefobs=.FALSE.
4358 IF ( setinitval .EQ. 3 ) grid%use_ssmiretrievalobs=.FALSE.
4359 IF ( setinitval .EQ. 3 ) grid%use_ssmitbobs=.FALSE.
4360 IF ( setinitval .EQ. 3 ) grid%use_ssmt1obs=.FALSE.
4361 IF ( setinitval .EQ. 3 ) grid%use_ssmt2obs=.FALSE.
4362 IF ( setinitval .EQ. 3 ) grid%use_qscatobs=.FALSE.
4363 IF ( setinitval .EQ. 3 ) grid%use_radarobs=.FALSE.
4364 IF ( setinitval .EQ. 3 ) grid%use_radar_rv=.FALSE.
4365 IF ( setinitval .EQ. 3 ) grid%use_radar_rf=.FALSE.
4366 IF ( setinitval .EQ. 3 ) grid%use_hirs2obs=.FALSE.
4367 IF ( setinitval .EQ. 3 ) grid%use_hirs3obs=.FALSE.
4368 IF ( setinitval .EQ. 3 ) grid%use_hirs4obs=.FALSE.
4369 IF ( setinitval .EQ. 3 ) grid%use_mhsobs=.FALSE.
4370 IF ( setinitval .EQ. 3 ) grid%use_msuobs=.FALSE.
4371 IF ( setinitval .EQ. 3 ) grid%use_amsuaobs=.FALSE.
4372 IF ( setinitval .EQ. 3 ) grid%use_amsubobs=.FALSE.
4373 IF ( setinitval .EQ. 3 ) grid%use_airsobs=.FALSE.
4374 IF ( setinitval .EQ. 3 ) grid%use_airsretobs=.FALSE.
4375 IF ( setinitval .EQ. 3 ) grid%use_eos_amsuaobs=.FALSE.
4376 IF ( setinitval .EQ. 3 ) grid%use_eos_radobs=.FALSE.
4377 IF ( setinitval .EQ. 3 ) grid%use_hsbobs=.FALSE.
4378 IF ( setinitval .EQ. 3 ) grid%use_ssmisobs=.FALSE.
4379 IF ( setinitval .EQ. 3 ) grid%use_kma1dvar=.FALSE.
4380 IF ( setinitval .EQ. 3 ) grid%use_filtered_rad=.FALSE.
4381 IF ( setinitval .EQ. 3 ) grid%use_obs_errfac=.FALSE.
4382 IF ( setinitval .EQ. 3 ) grid%check_max_iv=.FALSE.
4383 IF ( setinitval .EQ. 3 ) grid%put_rand_seed=.FALSE.
4384 IF ( setinitval .EQ. 3 ) grid%omb_set_rand=.FALSE.
4385 IF ( setinitval .EQ. 3 ) grid%omb_add_noise=.FALSE.
4386 IF ( setinitval .EQ. 3 ) grid%position_lev_dependant=.FALSE.
4387 IF ( setinitval .EQ. 3 ) grid%obs_qc_pointer=0
4388 IF ( setinitval .EQ. 3 ) grid%max_sound_input=0
4389 IF ( setinitval .EQ. 3 ) grid%max_synop_input=0
4390 IF ( setinitval .EQ. 3 ) grid%max_geoamv_input=0
4391 IF ( setinitval .EQ. 3 ) grid%max_polaramv_input=0
4392 IF ( setinitval .EQ. 3 ) grid%max_airep_input=0
4393 IF ( setinitval .EQ. 3 ) grid%max_satem_input=0
4394 IF ( setinitval .EQ. 3 ) grid%max_pilot_input=0
4395 IF ( setinitval .EQ. 3 ) grid%max_radar_input=0
4396 IF ( setinitval .EQ. 3 ) grid%max_metar_input=0
4397 IF ( setinitval .EQ. 3 ) grid%max_gpspw_input=0
4398 IF ( setinitval .EQ. 3 ) grid%max_ships_input=0
4399 IF ( setinitval .EQ. 3 ) grid%max_profiler_input=0
4400 IF ( setinitval .EQ. 3 ) grid%max_bogus_input=0
4401 IF ( setinitval .EQ. 3 ) grid%max_buoy_input=0
4402 IF ( setinitval .EQ. 3 ) grid%max_ssmi_rv_input=0
4403 IF ( setinitval .EQ. 3 ) grid%max_ssmi_tb_input=0
4404 IF ( setinitval .EQ. 3 ) grid%max_ssmt1_input=0
4405 IF ( setinitval .EQ. 3 ) grid%max_ssmt2_input=0
4406 IF ( setinitval .EQ. 3 ) grid%max_qscat_input=0
4407 IF ( setinitval .EQ. 3 ) grid%max_gpsref_input=0
4408 IF ( setinitval .EQ. 3 ) grid%max_airsr_input=0
4409 IF ( setinitval .EQ. 3 ) grid%max_tovs_input=0
4410 IF ( setinitval .EQ. 3 ) grid%max_ssmis_input=0
4411 IF ( setinitval .EQ. 3 ) grid%report_start=0
4412 IF ( setinitval .EQ. 3 ) grid%report_end=0
4413 IF ( setinitval .EQ. 3 ) grid%tovs_start=0
4414 IF ( setinitval .EQ. 3 ) grid%tovs_end=0
4415 IF ( setinitval .EQ. 3 ) grid%max_ext_its=0
4416 IF ( setinitval .EQ. 3 ) grid%ntmax=0
4417 IF ( setinitval .EQ. 3 ) grid%nsave=0
4418 IF ( setinitval .EQ. 3 ) grid%write_interval=0
4419 IF ( setinitval .EQ. 3 ) grid%eps=initial_data_value
4420 IF ( setinitval .EQ. 3 ) grid%rf_passes=0
4421 IF ( setinitval .EQ. 3 ) grid%var_scaling1=initial_data_value
4422 IF ( setinitval .EQ. 3 ) grid%var_scaling2=initial_data_value
4423 IF ( setinitval .EQ. 3 ) grid%var_scaling3=initial_data_value
4424 IF ( setinitval .EQ. 3 ) grid%var_scaling4=initial_data_value
4425 IF ( setinitval .EQ. 3 ) grid%var_scaling5=initial_data_value
4426 IF ( setinitval .EQ. 3 ) grid%len_scaling1=initial_data_value
4427 IF ( setinitval .EQ. 3 ) grid%len_scaling2=initial_data_value
4428 IF ( setinitval .EQ. 3 ) grid%len_scaling3=initial_data_value
4429 IF ( setinitval .EQ. 3 ) grid%len_scaling4=initial_data_value
4430 IF ( setinitval .EQ. 3 ) grid%len_scaling5=initial_data_value
4431 IF ( setinitval .EQ. 3 ) grid%jb_factor=initial_data_value
4432 IF ( setinitval .EQ. 3 ) grid%je_factor=initial_data_value
4433 IF ( setinitval .EQ. 3 ) grid%power_truncation=initial_data_value
4434 IF ( setinitval .EQ. 3 ) grid%def_sub_domain=.FALSE.
4435 IF ( setinitval .EQ. 3 ) grid%x_start_sub_domain=initial_data_value
4436 IF ( setinitval .EQ. 3 ) grid%y_start_sub_domain=initial_data_value
4437 IF ( setinitval .EQ. 3 ) grid%x_end_sub_domain=initial_data_value
4438 IF ( setinitval .EQ. 3 ) grid%y_end_sub_domain=initial_data_value
4439 IF ( setinitval .EQ. 3 ) grid%stdout=0
4440 IF ( setinitval .EQ. 3 ) grid%stderr=0
4441 IF ( setinitval .EQ. 3 ) grid%trace_unit=0
4442 IF ( setinitval .EQ. 3 ) grid%trace_pe=0
4443 IF ( setinitval .EQ. 3 ) grid%trace_repeat_head=0
4444 IF ( setinitval .EQ. 3 ) grid%trace_repeat_body=0
4445 IF ( setinitval .EQ. 3 ) grid%trace_max_depth=0
4446 IF ( setinitval .EQ. 3 ) grid%trace_use=.FALSE.
4447 IF ( setinitval .EQ. 3 ) grid%trace_use_frequent=.FALSE.
4448 IF ( setinitval .EQ. 3 ) grid%trace_use_dull=.FALSE.
4449 IF ( setinitval .EQ. 3 ) grid%trace_memory=.FALSE.
4450 IF ( setinitval .EQ. 3 ) grid%trace_all_pes=.FALSE.
4451 IF ( setinitval .EQ. 3 ) grid%trace_csv=.FALSE.
4452 IF ( setinitval .EQ. 3 ) grid%use_html=.FALSE.
4453 IF ( setinitval .EQ. 3 ) grid%warnings_are_fatal=.FALSE.
4454 IF ( setinitval .EQ. 3 ) grid%test_wrfvar=.FALSE.
4455 IF ( setinitval .EQ. 3 ) grid%test_transforms=.FALSE.
4456 IF ( setinitval .EQ. 3 ) grid%test_statistics=.FALSE.
4457 IF ( setinitval .EQ. 3 ) grid%interpolate_stats=.FALSE.
4458 IF ( setinitval .EQ. 3 ) grid%test_dm_exact=.FALSE.
4459 IF ( setinitval .EQ. 3 ) grid%cv_options_hum=0
4460 IF ( setinitval .EQ. 3 ) grid%check_rh=0
4461 IF ( setinitval .EQ. 3 ) grid%set_omb_rand_fac=0
4462 IF ( setinitval .EQ. 3 ) grid%seed_array1=0
4463 IF ( setinitval .EQ. 3 ) grid%seed_array2=0
4464 IF ( setinitval .EQ. 3 ) grid%sfc_assi_options=0
4465 IF ( setinitval .EQ. 3 ) grid%calculate_cg_cost_fn=.FALSE.
4466 IF ( setinitval .EQ. 3 ) grid%lat_stats_option=.FALSE.
4467 IF ( setinitval .EQ. 3 ) grid%balance_type=0
4468 IF ( setinitval .EQ. 3 ) grid%vert_corr=0
4469 IF ( setinitval .EQ. 3 ) grid%vertical_ip=0
4470 IF ( setinitval .EQ. 3 ) grid%vert_evalue=0
4471 IF ( setinitval .EQ. 3 ) grid%max_vert_var1=initial_data_value
4472 IF ( setinitval .EQ. 3 ) grid%max_vert_var2=initial_data_value
4473 IF ( setinitval .EQ. 3 ) grid%max_vert_var3=initial_data_value
4474 IF ( setinitval .EQ. 3 ) grid%max_vert_var4=initial_data_value
4475 IF ( setinitval .EQ. 3 ) grid%max_vert_var5=initial_data_value
4476 IF ( setinitval .EQ. 3 ) grid%rtminit_print=0
4477 IF ( setinitval .EQ. 3 ) grid%rtminit_nsensor=0
4478 IF ( setinitval .EQ. 3 ) grid%rtminit_platform=0
4479 IF ( setinitval .EQ. 3 ) grid%rtminit_satid=0
4480 IF ( setinitval .EQ. 3 ) grid%rtminit_sensor=0
4481 IF ( setinitval .EQ. 3 ) grid%rad_monitoring=0
4482 IF ( setinitval .EQ. 3 ) grid%thinning_mesh=initial_data_value
4483 IF ( setinitval .EQ. 3 ) grid%thinning=.FALSE.
4484 IF ( setinitval .EQ. 3 ) grid%read_biascoef=.FALSE.
4485 IF ( setinitval .EQ. 3 ) grid%biascorr=.FALSE.
4486 IF ( setinitval .EQ. 3 ) grid%biasprep=.FALSE.
4487 IF ( setinitval .EQ. 3 ) grid%rttov_scatt=.FALSE.
4488 IF ( setinitval .EQ. 3 ) grid%write_profile=.FALSE.
4489 IF ( setinitval .EQ. 3 ) grid%qc_rad=.FALSE.
4490 IF ( setinitval .EQ. 3 ) grid%write_iv_rad_ascii=.FALSE.
4491 IF ( setinitval .EQ. 3 ) grid%write_oa_rad_ascii=.FALSE.
4492 IF ( setinitval .EQ. 3 ) grid%write_filtered_rad=.FALSE.
4493 IF ( setinitval .EQ. 3 ) grid%use_error_factor_rad=.FALSE.
4494 IF ( setinitval .EQ. 3 ) grid%use_landem=.FALSE.
4495 IF ( setinitval .EQ. 3 ) grid%mw_emis_sea=0
4496 IF ( setinitval .EQ. 3 ) grid%tovs_min_transfer=0
4497 IF ( setinitval .EQ. 3 ) grid%tovs_batch=.FALSE.
4498 IF ( setinitval .EQ. 3 ) grid%rtm_option=0
4499 IF ( setinitval .EQ. 3 ) grid%use_crtm_kmatrix=.FALSE.
4500 IF ( setinitval .EQ. 3 ) grid%use_crtm_kmatrix_fast=.FALSE.
4501 IF ( setinitval .EQ. 3 ) grid%crtm_cloud=.FALSE.
4502 IF ( setinitval .EQ. 3 ) grid%num_pseudo=0
4503 IF ( setinitval .EQ. 3 ) grid%pseudo_x=initial_data_value
4504 IF ( setinitval .EQ. 3 ) grid%pseudo_y=initial_data_value
4505 IF ( setinitval .EQ. 3 ) grid%pseudo_z=initial_data_value
4506 IF ( setinitval .EQ. 3 ) grid%pseudo_val=initial_data_value
4507 IF ( setinitval .EQ. 3 ) grid%pseudo_err=initial_data_value
4508 IF ( setinitval .EQ. 3 ) grid%alphacv_method=0
4509 IF ( setinitval .EQ. 3 ) grid%ensdim_alpha=0
4510 IF ( setinitval .EQ. 3 ) grid%alpha_truncation=0
4511 IF ( setinitval .EQ. 3 ) grid%alpha_corr_type=0
4512 IF ( setinitval .EQ. 3 ) grid%alpha_corr_scale=initial_data_value
4513 IF ( setinitval .EQ. 3 ) grid%alpha_std_dev=initial_data_value
4514 IF ( setinitval .EQ. 3 ) grid%jcdfi_use=.FALSE.
4515 IF ( setinitval .EQ. 3 ) grid%jcdfi_tauc=initial_data_value
4516 IF ( setinitval .EQ. 3 ) grid%jcdfi_gama=initial_data_value
4517 IF ( setinitval .EQ. 3 ) grid%jcdfi_error_wind=initial_data_value
4518 IF ( setinitval .EQ. 3 ) grid%jcdfi_error_t=initial_data_value
4519 IF ( setinitval .EQ. 3 ) grid%jcdfi_error_q=initial_data_value
4520 IF ( setinitval .EQ. 3 ) grid%jcdfi_error_mu=initial_data_value
4521 IF ( setinitval .EQ. 3 ) grid%run_days=0
4522 IF ( setinitval .EQ. 3 ) grid%run_hours=0
4523 IF ( setinitval .EQ. 3 ) grid%run_minutes=0
4524 IF ( setinitval .EQ. 3 ) grid%run_seconds=0
4525 IF ( setinitval .EQ. 3 ) grid%start_year=0
4526 IF ( setinitval .EQ. 3 ) grid%start_month=0
4527 IF ( setinitval .EQ. 3 ) grid%start_day=0
4528 IF ( setinitval .EQ. 3 ) grid%start_hour=0
4529 IF ( setinitval .EQ. 3 ) grid%start_minute=0
4530 IF ( setinitval .EQ. 3 ) grid%start_second=0
4531 IF ( setinitval .EQ. 3 ) grid%end_year=0
4532 IF ( setinitval .EQ. 3 ) grid%end_month=0
4533 IF ( setinitval .EQ. 3 ) grid%end_day=0
4534 IF ( setinitval .EQ. 3 ) grid%end_hour=0
4535 IF ( setinitval .EQ. 3 ) grid%end_minute=0
4536 IF ( setinitval .EQ. 3 ) grid%end_second=0
4537 IF ( setinitval .EQ. 3 ) grid%interval_seconds=0
4538 IF ( setinitval .EQ. 3 ) grid%input_from_file=.FALSE.
4539 IF ( setinitval .EQ. 3 ) grid%fine_input_stream=0
4540 IF ( setinitval .EQ. 3 ) grid%input_from_hires=.FALSE.
4541 IF ( setinitval .EQ. 3 ) grid%oid=0
4542 IF ( setinitval .EQ. 3 ) grid%auxhist1_oid=0
4543 IF ( setinitval .EQ. 3 ) grid%auxhist2_oid=0
4544 IF ( setinitval .EQ. 3 ) grid%auxhist3_oid=0
4545 IF ( setinitval .EQ. 3 ) grid%auxhist4_oid=0
4546 IF ( setinitval .EQ. 3 ) grid%auxhist5_oid=0
4547 IF ( setinitval .EQ. 3 ) grid%auxhist6_oid=0
4548 IF ( setinitval .EQ. 3 ) grid%auxhist7_oid=0
4549 IF ( setinitval .EQ. 3 ) grid%auxhist8_oid=0
4550 IF ( setinitval .EQ. 3 ) grid%auxhist9_oid=0
4551 IF ( setinitval .EQ. 3 ) grid%auxhist10_oid=0
4552 IF ( setinitval .EQ. 3 ) grid%auxhist11_oid=0
4553 IF ( setinitval .EQ. 3 ) grid%auxinput1_oid=0
4554 IF ( setinitval .EQ. 3 ) grid%auxinput2_oid=0
4555 IF ( setinitval .EQ. 3 ) grid%auxinput3_oid=0
4556 IF ( setinitval .EQ. 3 ) grid%auxinput4_oid=0
4557 IF ( setinitval .EQ. 3 ) grid%auxinput5_oid=0
4558 IF ( setinitval .EQ. 3 ) grid%auxinput6_oid=0
4559 IF ( setinitval .EQ. 3 ) grid%auxinput7_oid=0
4560 IF ( setinitval .EQ. 3 ) grid%auxinput8_oid=0
4561 IF ( setinitval .EQ. 3 ) grid%auxinput9_oid=0
4562 IF ( setinitval .EQ. 3 ) grid%auxinput10_oid=0
4563 IF ( setinitval .EQ. 3 ) grid%auxinput11_oid=0
4564 IF ( setinitval .EQ. 3 ) grid%history_interval=0
4565 IF ( setinitval .EQ. 3 ) grid%frames_per_outfile=0
4566 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist1=0
4567 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist2=0
4568 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist3=0
4569 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist4=0
4570 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist5=0
4571 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist6=0
4572 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist7=0
4573 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist8=0
4574 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist9=0
4575 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist10=0
4576 IF ( setinitval .EQ. 3 ) grid%frames_per_auxhist11=0
4577 IF ( setinitval .EQ. 3 ) grid%restart=.FALSE.
4578 IF ( setinitval .EQ. 3 ) grid%restart_interval=0
4579 IF ( setinitval .EQ. 3 ) grid%io_form_input=0
4580 IF ( setinitval .EQ. 3 ) grid%io_form_history=0
4581 IF ( setinitval .EQ. 3 ) grid%io_form_restart=0
4582 IF ( setinitval .EQ. 3 ) grid%io_form_boundary=0
4583 IF ( setinitval .EQ. 3 ) grid%debug_level=0
4584 IF ( setinitval .EQ. 3 ) grid%self_test_domain=.FALSE.
4585 IF ( setinitval .EQ. 3 ) grid%history_interval_mo=0
4586 IF ( setinitval .EQ. 3 ) grid%history_interval_d=0
4587 IF ( setinitval .EQ. 3 ) grid%history_interval_h=0
4588 IF ( setinitval .EQ. 3 ) grid%history_interval_m=0
4589 IF ( setinitval .EQ. 3 ) grid%history_interval_s=0
4590 IF ( setinitval .EQ. 3 ) grid%inputout_interval_mo=0
4591 IF ( setinitval .EQ. 3 ) grid%inputout_interval_d=0
4592 IF ( setinitval .EQ. 3 ) grid%inputout_interval_h=0
4593 IF ( setinitval .EQ. 3 ) grid%inputout_interval_m=0
4594 IF ( setinitval .EQ. 3 ) grid%inputout_interval_s=0
4595 IF ( setinitval .EQ. 3 ) grid%inputout_interval=0
4596 IF ( setinitval .EQ. 3 ) grid%auxhist1_interval_mo=0
4597 IF ( setinitval .EQ. 3 ) grid%auxhist1_interval_d=0
4598 IF ( setinitval .EQ. 3 ) grid%auxhist1_interval_h=0
4599 IF ( setinitval .EQ. 3 ) grid%auxhist1_interval_m=0
4600 IF ( setinitval .EQ. 3 ) grid%auxhist1_interval_s=0
4601 IF ( setinitval .EQ. 3 ) grid%auxhist1_interval=0
4602 IF ( setinitval .EQ. 3 ) grid%auxhist2_interval_mo=0
4603 IF ( setinitval .EQ. 3 ) grid%auxhist2_interval_d=0
4604 IF ( setinitval .EQ. 3 ) grid%auxhist2_interval_h=0
4605 IF ( setinitval .EQ. 3 ) grid%auxhist2_interval_m=0
4606 IF ( setinitval .EQ. 3 ) grid%auxhist2_interval_s=0
4607 IF ( setinitval .EQ. 3 ) grid%auxhist2_interval=0
4608 IF ( setinitval .EQ. 3 ) grid%auxhist3_interval_mo=0
4609 IF ( setinitval .EQ. 3 ) grid%auxhist3_interval_d=0
4610 IF ( setinitval .EQ. 3 ) grid%auxhist3_interval_h=0
4611 IF ( setinitval .EQ. 3 ) grid%auxhist3_interval_m=0
4612 IF ( setinitval .EQ. 3 ) grid%auxhist3_interval_s=0
4613 IF ( setinitval .EQ. 3 ) grid%auxhist3_interval=0
4614 IF ( setinitval .EQ. 3 ) grid%auxhist4_interval_mo=0
4615 IF ( setinitval .EQ. 3 ) grid%auxhist4_interval_d=0
4616 IF ( setinitval .EQ. 3 ) grid%auxhist4_interval_h=0
4617 IF ( setinitval .EQ. 3 ) grid%auxhist4_interval_m=0
4618 IF ( setinitval .EQ. 3 ) grid%auxhist4_interval_s=0
4619 IF ( setinitval .EQ. 3 ) grid%auxhist4_interval=0
4620 IF ( setinitval .EQ. 3 ) grid%auxhist5_interval_mo=0
4621 IF ( setinitval .EQ. 3 ) grid%auxhist5_interval_d=0
4622 IF ( setinitval .EQ. 3 ) grid%auxhist5_interval_h=0
4623 IF ( setinitval .EQ. 3 ) grid%auxhist5_interval_m=0
4624 IF ( setinitval .EQ. 3 ) grid%auxhist5_interval_s=0
4625 IF ( setinitval .EQ. 3 ) grid%auxhist5_interval=0
4626 IF ( setinitval .EQ. 3 ) grid%auxhist6_interval_mo=0
4627 IF ( setinitval .EQ. 3 ) grid%auxhist6_interval_d=0
4628 IF ( setinitval .EQ. 3 ) grid%auxhist6_interval_h=0
4629 IF ( setinitval .EQ. 3 ) grid%auxhist6_interval_m=0
4630 IF ( setinitval .EQ. 3 ) grid%auxhist6_interval_s=0
4631 IF ( setinitval .EQ. 3 ) grid%auxhist6_interval=0
4632 IF ( setinitval .EQ. 3 ) grid%auxhist7_interval_mo=0
4633 IF ( setinitval .EQ. 3 ) grid%auxhist7_interval_d=0
4634 IF ( setinitval .EQ. 3 ) grid%auxhist7_interval_h=0
4635 IF ( setinitval .EQ. 3 ) grid%auxhist7_interval_m=0
4636 IF ( setinitval .EQ. 3 ) grid%auxhist7_interval_s=0
4637 IF ( setinitval .EQ. 3 ) grid%auxhist7_interval=0
4638 IF ( setinitval .EQ. 3 ) grid%auxhist8_interval_mo=0
4639 IF ( setinitval .EQ. 3 ) grid%auxhist8_interval_d=0
4640 IF ( setinitval .EQ. 3 ) grid%auxhist8_interval_h=0
4641 IF ( setinitval .EQ. 3 ) grid%auxhist8_interval_m=0
4642 IF ( setinitval .EQ. 3 ) grid%auxhist8_interval_s=0
4643 IF ( setinitval .EQ. 3 ) grid%auxhist8_interval=0
4644 IF ( setinitval .EQ. 3 ) grid%auxhist9_interval_mo=0
4645 IF ( setinitval .EQ. 3 ) grid%auxhist9_interval_d=0
4646 IF ( setinitval .EQ. 3 ) grid%auxhist9_interval_h=0
4647 IF ( setinitval .EQ. 3 ) grid%auxhist9_interval_m=0
4648 IF ( setinitval .EQ. 3 ) grid%auxhist9_interval_s=0
4649 IF ( setinitval .EQ. 3 ) grid%auxhist9_interval=0
4650 IF ( setinitval .EQ. 3 ) grid%auxhist10_interval_mo=0
4651 IF ( setinitval .EQ. 3 ) grid%auxhist10_interval_d=0
4652 IF ( setinitval .EQ. 3 ) grid%auxhist10_interval_h=0
4653 IF ( setinitval .EQ. 3 ) grid%auxhist10_interval_m=0
4654 IF ( setinitval .EQ. 3 ) grid%auxhist10_interval_s=0
4655 IF ( setinitval .EQ. 3 ) grid%auxhist10_interval=0
4656 IF ( setinitval .EQ. 3 ) grid%auxhist11_interval_mo=0
4657 IF ( setinitval .EQ. 3 ) grid%auxhist11_interval_d=0
4658 IF ( setinitval .EQ. 3 ) grid%auxhist11_interval_h=0
4659 IF ( setinitval .EQ. 3 ) grid%auxhist11_interval_m=0
4660 IF ( setinitval .EQ. 3 ) grid%auxhist11_interval_s=0
4661 IF ( setinitval .EQ. 3 ) grid%auxhist11_interval=0
4662 IF ( setinitval .EQ. 3 ) grid%auxinput1_interval_mo=0
4663 IF ( setinitval .EQ. 3 ) grid%auxinput1_interval_d=0
4664 IF ( setinitval .EQ. 3 ) grid%auxinput1_interval_h=0
4665 IF ( setinitval .EQ. 3 ) grid%auxinput1_interval_m=0
4666 IF ( setinitval .EQ. 3 ) grid%auxinput1_interval_s=0
4667 IF ( setinitval .EQ. 3 ) grid%auxinput1_interval=0
4668 IF ( setinitval .EQ. 3 ) grid%auxinput2_interval_mo=0
4669 IF ( setinitval .EQ. 3 ) grid%auxinput2_interval_d=0
4670 IF ( setinitval .EQ. 3 ) grid%auxinput2_interval_h=0
4671 IF ( setinitval .EQ. 3 ) grid%auxinput2_interval_m=0
4672 IF ( setinitval .EQ. 3 ) grid%auxinput2_interval_s=0
4673 IF ( setinitval .EQ. 3 ) grid%auxinput2_interval=0
4674 IF ( setinitval .EQ. 3 ) grid%auxinput3_interval_mo=0
4675 IF ( setinitval .EQ. 3 ) grid%auxinput3_interval_d=0
4676 IF ( setinitval .EQ. 3 ) grid%auxinput3_interval_h=0
4677 IF ( setinitval .EQ. 3 ) grid%auxinput3_interval_m=0
4678 IF ( setinitval .EQ. 3 ) grid%auxinput3_interval_s=0
4679 IF ( setinitval .EQ. 3 ) grid%auxinput3_interval=0
4680 IF ( setinitval .EQ. 3 ) grid%auxinput4_interval_mo=0
4681 IF ( setinitval .EQ. 3 ) grid%auxinput4_interval_d=0
4682 IF ( setinitval .EQ. 3 ) grid%auxinput4_interval_h=0
4683 IF ( setinitval .EQ. 3 ) grid%auxinput4_interval_m=0
4684 IF ( setinitval .EQ. 3 ) grid%auxinput4_interval_s=0
4685 IF ( setinitval .EQ. 3 ) grid%auxinput4_interval=0
4686 IF ( setinitval .EQ. 3 ) grid%auxinput5_interval_mo=0
4687 IF ( setinitval .EQ. 3 ) grid%auxinput5_interval_d=0
4688 IF ( setinitval .EQ. 3 ) grid%auxinput5_interval_h=0
4689 IF ( setinitval .EQ. 3 ) grid%auxinput5_interval_m=0
4690 IF ( setinitval .EQ. 3 ) grid%auxinput5_interval_s=0
4691 IF ( setinitval .EQ. 3 ) grid%auxinput5_interval=0
4692 IF ( setinitval .EQ. 3 ) grid%auxinput6_interval_mo=0
4693 IF ( setinitval .EQ. 3 ) grid%auxinput6_interval_d=0
4694 IF ( setinitval .EQ. 3 ) grid%auxinput6_interval_h=0
4695 IF ( setinitval .EQ. 3 ) grid%auxinput6_interval_m=0
4696 IF ( setinitval .EQ. 3 ) grid%auxinput6_interval_s=0
4697 IF ( setinitval .EQ. 3 ) grid%auxinput6_interval=0
4698 IF ( setinitval .EQ. 3 ) grid%auxinput7_interval_mo=0
4699 IF ( setinitval .EQ. 3 ) grid%auxinput7_interval_d=0
4700 IF ( setinitval .EQ. 3 ) grid%auxinput7_interval_h=0
4701 IF ( setinitval .EQ. 3 ) grid%auxinput7_interval_m=0
4702 IF ( setinitval .EQ. 3 ) grid%auxinput7_interval_s=0
4703 IF ( setinitval .EQ. 3 ) grid%auxinput7_interval=0
4704 IF ( setinitval .EQ. 3 ) grid%auxinput8_interval_mo=0
4705 IF ( setinitval .EQ. 3 ) grid%auxinput8_interval_d=0
4706 IF ( setinitval .EQ. 3 ) grid%auxinput8_interval_h=0
4707 IF ( setinitval .EQ. 3 ) grid%auxinput8_interval_m=0
4708 IF ( setinitval .EQ. 3 ) grid%auxinput8_interval_s=0
4709 IF ( setinitval .EQ. 3 ) grid%auxinput8_interval=0
4710 IF ( setinitval .EQ. 3 ) grid%auxinput9_interval_mo=0
4711 IF ( setinitval .EQ. 3 ) grid%auxinput9_interval_d=0
4712 IF ( setinitval .EQ. 3 ) grid%auxinput9_interval_h=0
4713 IF ( setinitval .EQ. 3 ) grid%auxinput9_interval_m=0
4714 IF ( setinitval .EQ. 3 ) grid%auxinput9_interval_s=0
4715 IF ( setinitval .EQ. 3 ) grid%auxinput9_interval=0
4716 IF ( setinitval .EQ. 3 ) grid%gfdda_interval_mo=0
4717 IF ( setinitval .EQ. 3 ) grid%gfdda_interval_d=0
4718 IF ( setinitval .EQ. 3 ) grid%gfdda_interval_h=0
4719 IF ( setinitval .EQ. 3 ) grid%gfdda_interval_m=0
4720 IF ( setinitval .EQ. 3 ) grid%gfdda_interval_s=0
4721 IF ( setinitval .EQ. 3 ) grid%gfdda_interval=0
4722 IF ( setinitval .EQ. 3 ) grid%auxinput11_interval_mo=0
4723 IF ( setinitval .EQ. 3 ) grid%auxinput11_interval_d=0
4724 IF ( setinitval .EQ. 3 ) grid%auxinput11_interval_h=0
4725 IF ( setinitval .EQ. 3 ) grid%auxinput11_interval_m=0
4726 IF ( setinitval .EQ. 3 ) grid%auxinput11_interval_s=0
4727 IF ( setinitval .EQ. 3 ) grid%auxinput11_interval=0
4728 IF ( setinitval .EQ. 3 ) grid%restart_interval_mo=0
4729 IF ( setinitval .EQ. 3 ) grid%restart_interval_d=0
4730 IF ( setinitval .EQ. 3 ) grid%restart_interval_h=0
4731 IF ( setinitval .EQ. 3 ) grid%restart_interval_m=0
4732 IF ( setinitval .EQ. 3 ) grid%restart_interval_s=0
4733 IF ( setinitval .EQ. 3 ) grid%history_begin_y=0
4734 IF ( setinitval .EQ. 3 ) grid%history_begin_mo=0
4735 IF ( setinitval .EQ. 3 ) grid%history_begin_d=0
4736 IF ( setinitval .EQ. 3 ) grid%history_begin_h=0
4737 IF ( setinitval .EQ. 3 ) grid%history_begin_m=0
4738 IF ( setinitval .EQ. 3 ) grid%history_begin_s=0
4739 IF ( setinitval .EQ. 3 ) grid%inputout_begin_y=0
4740 IF ( setinitval .EQ. 3 ) grid%inputout_begin_mo=0
4741 IF ( setinitval .EQ. 3 ) grid%inputout_begin_d=0
4742 IF ( setinitval .EQ. 3 ) grid%inputout_begin_h=0
4743 IF ( setinitval .EQ. 3 ) grid%inputout_begin_m=0
4744 IF ( setinitval .EQ. 3 ) grid%inputout_begin_s=0
4745 IF ( setinitval .EQ. 3 ) grid%auxhist1_begin_y=0
4746 IF ( setinitval .EQ. 3 ) grid%auxhist1_begin_mo=0
4747 IF ( setinitval .EQ. 3 ) grid%auxhist1_begin_d=0
4748 IF ( setinitval .EQ. 3 ) grid%auxhist1_begin_h=0
4749 IF ( setinitval .EQ. 3 ) grid%auxhist1_begin_m=0
4750 IF ( setinitval .EQ. 3 ) grid%auxhist1_begin_s=0
4751 IF ( setinitval .EQ. 3 ) grid%auxhist2_begin_y=0
4752 IF ( setinitval .EQ. 3 ) grid%auxhist2_begin_mo=0
4753 IF ( setinitval .EQ. 3 ) grid%auxhist2_begin_d=0
4754 IF ( setinitval .EQ. 3 ) grid%auxhist2_begin_h=0
4755 IF ( setinitval .EQ. 3 ) grid%auxhist2_begin_m=0
4756 IF ( setinitval .EQ. 3 ) grid%auxhist2_begin_s=0
4757 IF ( setinitval .EQ. 3 ) grid%auxhist3_begin_y=0
4758 IF ( setinitval .EQ. 3 ) grid%auxhist3_begin_mo=0
4759 IF ( setinitval .EQ. 3 ) grid%auxhist3_begin_d=0
4760 IF ( setinitval .EQ. 3 ) grid%auxhist3_begin_h=0
4761 IF ( setinitval .EQ. 3 ) grid%auxhist3_begin_m=0
4762 IF ( setinitval .EQ. 3 ) grid%auxhist3_begin_s=0
4763 IF ( setinitval .EQ. 3 ) grid%auxhist4_begin_y=0
4764 IF ( setinitval .EQ. 3 ) grid%auxhist4_begin_mo=0
4765 IF ( setinitval .EQ. 3 ) grid%auxhist4_begin_d=0
4766 IF ( setinitval .EQ. 3 ) grid%auxhist4_begin_h=0
4767 IF ( setinitval .EQ. 3 ) grid%auxhist4_begin_m=0
4768 IF ( setinitval .EQ. 3 ) grid%auxhist4_begin_s=0
4769 IF ( setinitval .EQ. 3 ) grid%auxhist5_begin_y=0
4770 IF ( setinitval .EQ. 3 ) grid%auxhist5_begin_mo=0
4771 IF ( setinitval .EQ. 3 ) grid%auxhist5_begin_d=0
4772 IF ( setinitval .EQ. 3 ) grid%auxhist5_begin_h=0
4773 IF ( setinitval .EQ. 3 ) grid%auxhist5_begin_m=0
4774 IF ( setinitval .EQ. 3 ) grid%auxhist5_begin_s=0
4775 IF ( setinitval .EQ. 3 ) grid%auxhist6_begin_y=0
4776 IF ( setinitval .EQ. 3 ) grid%auxhist6_begin_mo=0
4777 IF ( setinitval .EQ. 3 ) grid%auxhist6_begin_d=0
4778 IF ( setinitval .EQ. 3 ) grid%auxhist6_begin_h=0
4779 IF ( setinitval .EQ. 3 ) grid%auxhist6_begin_m=0
4780 IF ( setinitval .EQ. 3 ) grid%auxhist6_begin_s=0
4781 IF ( setinitval .EQ. 3 ) grid%auxhist7_begin_y=0
4782 IF ( setinitval .EQ. 3 ) grid%auxhist7_begin_mo=0
4783 IF ( setinitval .EQ. 3 ) grid%auxhist7_begin_d=0
4784 IF ( setinitval .EQ. 3 ) grid%auxhist7_begin_h=0
4785 IF ( setinitval .EQ. 3 ) grid%auxhist7_begin_m=0
4786 IF ( setinitval .EQ. 3 ) grid%auxhist7_begin_s=0
4787 IF ( setinitval .EQ. 3 ) grid%auxhist8_begin_y=0
4788 IF ( setinitval .EQ. 3 ) grid%auxhist8_begin_mo=0
4789 IF ( setinitval .EQ. 3 ) grid%auxhist8_begin_d=0
4790 IF ( setinitval .EQ. 3 ) grid%auxhist8_begin_h=0
4791 IF ( setinitval .EQ. 3 ) grid%auxhist8_begin_m=0
4792 IF ( setinitval .EQ. 3 ) grid%auxhist8_begin_s=0
4793 IF ( setinitval .EQ. 3 ) grid%auxhist9_begin_y=0
4794 IF ( setinitval .EQ. 3 ) grid%auxhist9_begin_mo=0
4795 IF ( setinitval .EQ. 3 ) grid%auxhist9_begin_d=0
4796 IF ( setinitval .EQ. 3 ) grid%auxhist9_begin_h=0
4797 IF ( setinitval .EQ. 3 ) grid%auxhist9_begin_m=0
4798 IF ( setinitval .EQ. 3 ) grid%auxhist9_begin_s=0
4799 IF ( setinitval .EQ. 3 ) grid%auxhist10_begin_y=0
4800 IF ( setinitval .EQ. 3 ) grid%auxhist10_begin_mo=0
4801 IF ( setinitval .EQ. 3 ) grid%auxhist10_begin_d=0
4802 IF ( setinitval .EQ. 3 ) grid%auxhist10_begin_h=0
4803 IF ( setinitval .EQ. 3 ) grid%auxhist10_begin_m=0
4804 IF ( setinitval .EQ. 3 ) grid%auxhist10_begin_s=0
4805 IF ( setinitval .EQ. 3 ) grid%auxhist11_begin_y=0
4806 IF ( setinitval .EQ. 3 ) grid%auxhist11_begin_mo=0
4807 IF ( setinitval .EQ. 3 ) grid%auxhist11_begin_d=0
4808 IF ( setinitval .EQ. 3 ) grid%auxhist11_begin_h=0
4809 IF ( setinitval .EQ. 3 ) grid%auxhist11_begin_m=0
4810 IF ( setinitval .EQ. 3 ) grid%auxhist11_begin_s=0
4811 IF ( setinitval .EQ. 3 ) grid%auxinput1_begin_y=0
4812 IF ( setinitval .EQ. 3 ) grid%auxinput1_begin_mo=0
4813 IF ( setinitval .EQ. 3 ) grid%auxinput1_begin_d=0
4814 IF ( setinitval .EQ. 3 ) grid%auxinput1_begin_h=0
4815 IF ( setinitval .EQ. 3 ) grid%auxinput1_begin_m=0
4816 IF ( setinitval .EQ. 3 ) grid%auxinput1_begin_s=0
4817 IF ( setinitval .EQ. 3 ) grid%auxinput2_begin_y=0
4818 IF ( setinitval .EQ. 3 ) grid%auxinput2_begin_mo=0
4819 IF ( setinitval .EQ. 3 ) grid%auxinput2_begin_d=0
4820 IF ( setinitval .EQ. 3 ) grid%auxinput2_begin_h=0
4821 IF ( setinitval .EQ. 3 ) grid%auxinput2_begin_m=0
4822 IF ( setinitval .EQ. 3 ) grid%auxinput2_begin_s=0
4823 IF ( setinitval .EQ. 3 ) grid%auxinput3_begin_y=0
4824 IF ( setinitval .EQ. 3 ) grid%auxinput3_begin_mo=0
4825 IF ( setinitval .EQ. 3 ) grid%auxinput3_begin_d=0
4826 IF ( setinitval .EQ. 3 ) grid%auxinput3_begin_h=0
4827 IF ( setinitval .EQ. 3 ) grid%auxinput3_begin_m=0
4828 IF ( setinitval .EQ. 3 ) grid%auxinput3_begin_s=0
4829 IF ( setinitval .EQ. 3 ) grid%auxinput4_begin_y=0
4830 IF ( setinitval .EQ. 3 ) grid%auxinput4_begin_mo=0
4831 IF ( setinitval .EQ. 3 ) grid%auxinput4_begin_d=0
4832 IF ( setinitval .EQ. 3 ) grid%auxinput4_begin_h=0
4833 IF ( setinitval .EQ. 3 ) grid%auxinput4_begin_m=0
4834 IF ( setinitval .EQ. 3 ) grid%auxinput4_begin_s=0
4835 IF ( setinitval .EQ. 3 ) grid%auxinput5_begin_y=0
4836 IF ( setinitval .EQ. 3 ) grid%auxinput5_begin_mo=0
4837 IF ( setinitval .EQ. 3 ) grid%auxinput5_begin_d=0
4838 IF ( setinitval .EQ. 3 ) grid%auxinput5_begin_h=0
4839 IF ( setinitval .EQ. 3 ) grid%auxinput5_begin_m=0
4840 IF ( setinitval .EQ. 3 ) grid%auxinput5_begin_s=0
4841 IF ( setinitval .EQ. 3 ) grid%auxinput6_begin_y=0
4842 IF ( setinitval .EQ. 3 ) grid%auxinput6_begin_mo=0
4843 IF ( setinitval .EQ. 3 ) grid%auxinput6_begin_d=0
4844 IF ( setinitval .EQ. 3 ) grid%auxinput6_begin_h=0
4845 IF ( setinitval .EQ. 3 ) grid%auxinput6_begin_m=0
4846 IF ( setinitval .EQ. 3 ) grid%auxinput6_begin_s=0
4847 IF ( setinitval .EQ. 3 ) grid%auxinput7_begin_y=0
4848 IF ( setinitval .EQ. 3 ) grid%auxinput7_begin_mo=0
4849 IF ( setinitval .EQ. 3 ) grid%auxinput7_begin_d=0
4850 IF ( setinitval .EQ. 3 ) grid%auxinput7_begin_h=0
4851 IF ( setinitval .EQ. 3 ) grid%auxinput7_begin_m=0
4852 IF ( setinitval .EQ. 3 ) grid%auxinput7_begin_s=0
4853 IF ( setinitval .EQ. 3 ) grid%auxinput8_begin_y=0
4854 IF ( setinitval .EQ. 3 ) grid%auxinput8_begin_mo=0
4855 IF ( setinitval .EQ. 3 ) grid%auxinput8_begin_d=0
4856 IF ( setinitval .EQ. 3 ) grid%auxinput8_begin_h=0
4857 IF ( setinitval .EQ. 3 ) grid%auxinput8_begin_m=0
4858 IF ( setinitval .EQ. 3 ) grid%auxinput8_begin_s=0
4859 IF ( setinitval .EQ. 3 ) grid%auxinput9_begin_y=0
4860 IF ( setinitval .EQ. 3 ) grid%auxinput9_begin_mo=0
4861 IF ( setinitval .EQ. 3 ) grid%auxinput9_begin_d=0
4862 IF ( setinitval .EQ. 3 ) grid%auxinput9_begin_h=0
4863 IF ( setinitval .EQ. 3 ) grid%auxinput9_begin_m=0
4864 IF ( setinitval .EQ. 3 ) grid%auxinput9_begin_s=0
4865 IF ( setinitval .EQ. 3 ) grid%gfdda_begin_y=0
4866 IF ( setinitval .EQ. 3 ) grid%gfdda_begin_mo=0
4867 IF ( setinitval .EQ. 3 ) grid%gfdda_begin_d=0
4868 IF ( setinitval .EQ. 3 ) grid%gfdda_begin_h=0
4869 IF ( setinitval .EQ. 3 ) grid%gfdda_begin_m=0
4870 IF ( setinitval .EQ. 3 ) grid%gfdda_begin_s=0
4871 IF ( setinitval .EQ. 3 ) grid%auxinput11_begin_y=0
4872 IF ( setinitval .EQ. 3 ) grid%auxinput11_begin_mo=0
4873 IF ( setinitval .EQ. 3 ) grid%auxinput11_begin_d=0
4874 IF ( setinitval .EQ. 3 ) grid%auxinput11_begin_h=0
4875 IF ( setinitval .EQ. 3 ) grid%auxinput11_begin_m=0
4876 IF ( setinitval .EQ. 3 ) grid%auxinput11_begin_s=0
4877 IF ( setinitval .EQ. 3 ) grid%restart_begin_y=0
4878 IF ( setinitval .EQ. 3 ) grid%restart_begin_mo=0
4879 IF ( setinitval .EQ. 3 ) grid%restart_begin_d=0
4880 IF ( setinitval .EQ. 3 ) grid%restart_begin_h=0
4881 IF ( setinitval .EQ. 3 ) grid%restart_begin_m=0
4882 IF ( setinitval .EQ. 3 ) grid%restart_begin_s=0
4883 IF ( setinitval .EQ. 3 ) grid%history_end_y=0
4884 IF ( setinitval .EQ. 3 ) grid%history_end_mo=0
4885 IF ( setinitval .EQ. 3 ) grid%history_end_d=0
4886 IF ( setinitval .EQ. 3 ) grid%history_end_h=0
4887 IF ( setinitval .EQ. 3 ) grid%history_end_m=0
4888 IF ( setinitval .EQ. 3 ) grid%history_end_s=0
4889 IF ( setinitval .EQ. 3 ) grid%inputout_end_y=0
4890 IF ( setinitval .EQ. 3 ) grid%inputout_end_mo=0
4891 IF ( setinitval .EQ. 3 ) grid%inputout_end_d=0
4892 IF ( setinitval .EQ. 3 ) grid%inputout_end_h=0
4893 IF ( setinitval .EQ. 3 ) grid%inputout_end_m=0
4894 IF ( setinitval .EQ. 3 ) grid%inputout_end_s=0
4895 IF ( setinitval .EQ. 3 ) grid%auxhist1_end_y=0
4896 IF ( setinitval .EQ. 3 ) grid%auxhist1_end_mo=0
4897 IF ( setinitval .EQ. 3 ) grid%auxhist1_end_d=0
4898 IF ( setinitval .EQ. 3 ) grid%auxhist1_end_h=0
4899 IF ( setinitval .EQ. 3 ) grid%auxhist1_end_m=0
4900 IF ( setinitval .EQ. 3 ) grid%auxhist1_end_s=0
4901 IF ( setinitval .EQ. 3 ) grid%auxhist2_end_y=0
4902 IF ( setinitval .EQ. 3 ) grid%auxhist2_end_mo=0
4903 IF ( setinitval .EQ. 3 ) grid%auxhist2_end_d=0
4904 IF ( setinitval .EQ. 3 ) grid%auxhist2_end_h=0
4905 IF ( setinitval .EQ. 3 ) grid%auxhist2_end_m=0
4906 IF ( setinitval .EQ. 3 ) grid%auxhist2_end_s=0
4907 IF ( setinitval .EQ. 3 ) grid%auxhist3_end_y=0
4908 IF ( setinitval .EQ. 3 ) grid%auxhist3_end_mo=0
4909 IF ( setinitval .EQ. 3 ) grid%auxhist3_end_d=0
4910 IF ( setinitval .EQ. 3 ) grid%auxhist3_end_h=0
4911 IF ( setinitval .EQ. 3 ) grid%auxhist3_end_m=0
4912 IF ( setinitval .EQ. 3 ) grid%auxhist3_end_s=0
4913 IF ( setinitval .EQ. 3 ) grid%auxhist4_end_y=0
4914 IF ( setinitval .EQ. 3 ) grid%auxhist4_end_mo=0
4915 IF ( setinitval .EQ. 3 ) grid%auxhist4_end_d=0
4916 IF ( setinitval .EQ. 3 ) grid%auxhist4_end_h=0
4917 IF ( setinitval .EQ. 3 ) grid%auxhist4_end_m=0
4918 IF ( setinitval .EQ. 3 ) grid%auxhist4_end_s=0
4919 IF ( setinitval .EQ. 3 ) grid%auxhist5_end_y=0
4920 IF ( setinitval .EQ. 3 ) grid%auxhist5_end_mo=0
4921 IF ( setinitval .EQ. 3 ) grid%auxhist5_end_d=0
4922 IF ( setinitval .EQ. 3 ) grid%auxhist5_end_h=0
4923 IF ( setinitval .EQ. 3 ) grid%auxhist5_end_m=0
4924 IF ( setinitval .EQ. 3 ) grid%auxhist5_end_s=0
4925 IF ( setinitval .EQ. 3 ) grid%auxhist6_end_y=0
4926 IF ( setinitval .EQ. 3 ) grid%auxhist6_end_mo=0
4927 IF ( setinitval .EQ. 3 ) grid%auxhist6_end_d=0
4928 IF ( setinitval .EQ. 3 ) grid%auxhist6_end_h=0
4929 IF ( setinitval .EQ. 3 ) grid%auxhist6_end_m=0
4930 IF ( setinitval .EQ. 3 ) grid%auxhist6_end_s=0
4931 IF ( setinitval .EQ. 3 ) grid%auxhist7_end_y=0
4932 IF ( setinitval .EQ. 3 ) grid%auxhist7_end_mo=0
4933 IF ( setinitval .EQ. 3 ) grid%auxhist7_end_d=0
4934 IF ( setinitval .EQ. 3 ) grid%auxhist7_end_h=0
4935 IF ( setinitval .EQ. 3 ) grid%auxhist7_end_m=0
4936 IF ( setinitval .EQ. 3 ) grid%auxhist7_end_s=0
4937 IF ( setinitval .EQ. 3 ) grid%auxhist8_end_y=0
4938 IF ( setinitval .EQ. 3 ) grid%auxhist8_end_mo=0
4939 IF ( setinitval .EQ. 3 ) grid%auxhist8_end_d=0
4940 IF ( setinitval .EQ. 3 ) grid%auxhist8_end_h=0
4941 IF ( setinitval .EQ. 3 ) grid%auxhist8_end_m=0
4942 IF ( setinitval .EQ. 3 ) grid%auxhist8_end_s=0
4943 IF ( setinitval .EQ. 3 ) grid%auxhist9_end_y=0
4944 IF ( setinitval .EQ. 3 ) grid%auxhist9_end_mo=0
4945 IF ( setinitval .EQ. 3 ) grid%auxhist9_end_d=0
4946 IF ( setinitval .EQ. 3 ) grid%auxhist9_end_h=0
4947 IF ( setinitval .EQ. 3 ) grid%auxhist9_end_m=0
4948 IF ( setinitval .EQ. 3 ) grid%auxhist9_end_s=0
4949 IF ( setinitval .EQ. 3 ) grid%auxhist10_end_y=0
4950 IF ( setinitval .EQ. 3 ) grid%auxhist10_end_mo=0
4951 IF ( setinitval .EQ. 3 ) grid%auxhist10_end_d=0
4952 IF ( setinitval .EQ. 3 ) grid%auxhist10_end_h=0
4953 IF ( setinitval .EQ. 3 ) grid%auxhist10_end_m=0
4954 IF ( setinitval .EQ. 3 ) grid%auxhist10_end_s=0
4955 IF ( setinitval .EQ. 3 ) grid%auxhist11_end_y=0
4956 IF ( setinitval .EQ. 3 ) grid%auxhist11_end_mo=0
4957 IF ( setinitval .EQ. 3 ) grid%auxhist11_end_d=0
4958 IF ( setinitval .EQ. 3 ) grid%auxhist11_end_h=0
4959 IF ( setinitval .EQ. 3 ) grid%auxhist11_end_m=0
4960 IF ( setinitval .EQ. 3 ) grid%auxhist11_end_s=0
4961 IF ( setinitval .EQ. 3 ) grid%auxinput1_end_y=0
4962 IF ( setinitval .EQ. 3 ) grid%auxinput1_end_mo=0
4963 IF ( setinitval .EQ. 3 ) grid%auxinput1_end_d=0
4964 IF ( setinitval .EQ. 3 ) grid%auxinput1_end_h=0
4965 IF ( setinitval .EQ. 3 ) grid%auxinput1_end_m=0
4966 IF ( setinitval .EQ. 3 ) grid%auxinput1_end_s=0
4967 IF ( setinitval .EQ. 3 ) grid%auxinput2_end_y=0
4968 IF ( setinitval .EQ. 3 ) grid%auxinput2_end_mo=0
4969 IF ( setinitval .EQ. 3 ) grid%auxinput2_end_d=0
4970 IF ( setinitval .EQ. 3 ) grid%auxinput2_end_h=0
4971 IF ( setinitval .EQ. 3 ) grid%auxinput2_end_m=0
4972 IF ( setinitval .EQ. 3 ) grid%auxinput2_end_s=0
4973 IF ( setinitval .EQ. 3 ) grid%auxinput3_end_y=0
4974 IF ( setinitval .EQ. 3 ) grid%auxinput3_end_mo=0
4975 IF ( setinitval .EQ. 3 ) grid%auxinput3_end_d=0
4976 IF ( setinitval .EQ. 3 ) grid%auxinput3_end_h=0
4977 IF ( setinitval .EQ. 3 ) grid%auxinput3_end_m=0
4978 IF ( setinitval .EQ. 3 ) grid%auxinput3_end_s=0
4979 IF ( setinitval .EQ. 3 ) grid%auxinput4_end_y=0
4980 IF ( setinitval .EQ. 3 ) grid%auxinput4_end_mo=0
4981 IF ( setinitval .EQ. 3 ) grid%auxinput4_end_d=0
4982 IF ( setinitval .EQ. 3 ) grid%auxinput4_end_h=0
4983 IF ( setinitval .EQ. 3 ) grid%auxinput4_end_m=0
4984 IF ( setinitval .EQ. 3 ) grid%auxinput4_end_s=0
4985 IF ( setinitval .EQ. 3 ) grid%auxinput5_end_y=0
4986 IF ( setinitval .EQ. 3 ) grid%auxinput5_end_mo=0
4987 IF ( setinitval .EQ. 3 ) grid%auxinput5_end_d=0
4988 IF ( setinitval .EQ. 3 ) grid%auxinput5_end_h=0
4989 IF ( setinitval .EQ. 3 ) grid%auxinput5_end_m=0
4990 IF ( setinitval .EQ. 3 ) grid%auxinput5_end_s=0
4991 IF ( setinitval .EQ. 3 ) grid%auxinput6_end_y=0
4992 IF ( setinitval .EQ. 3 ) grid%auxinput6_end_mo=0
4993 IF ( setinitval .EQ. 3 ) grid%auxinput6_end_d=0
4994 IF ( setinitval .EQ. 3 ) grid%auxinput6_end_h=0
4995 IF ( setinitval .EQ. 3 ) grid%auxinput6_end_m=0
4996 IF ( setinitval .EQ. 3 ) grid%auxinput6_end_s=0
4997 IF ( setinitval .EQ. 3 ) grid%auxinput7_end_y=0
4998 IF ( setinitval .EQ. 3 ) grid%auxinput7_end_mo=0
4999 IF ( setinitval .EQ. 3 ) grid%auxinput7_end_d=0
5000 IF ( setinitval .EQ. 3 ) grid%auxinput7_end_h=0
5001 IF ( setinitval .EQ. 3 ) grid%auxinput7_end_m=0
5002 IF ( setinitval .EQ. 3 ) grid%auxinput7_end_s=0
5003 IF ( setinitval .EQ. 3 ) grid%auxinput8_end_y=0
5004 IF ( setinitval .EQ. 3 ) grid%auxinput8_end_mo=0
5005 IF ( setinitval .EQ. 3 ) grid%auxinput8_end_d=0
5006 IF ( setinitval .EQ. 3 ) grid%auxinput8_end_h=0
5007 IF ( setinitval .EQ. 3 ) grid%auxinput8_end_m=0
5008 IF ( setinitval .EQ. 3 ) grid%auxinput8_end_s=0
5009 IF ( setinitval .EQ. 3 ) grid%auxinput9_end_y=0
5010 IF ( setinitval .EQ. 3 ) grid%auxinput9_end_mo=0
5011 IF ( setinitval .EQ. 3 ) grid%auxinput9_end_d=0
5012 IF ( setinitval .EQ. 3 ) grid%auxinput9_end_h=0
5013 IF ( setinitval .EQ. 3 ) grid%auxinput9_end_m=0
5014 IF ( setinitval .EQ. 3 ) grid%auxinput9_end_s=0
5015 IF ( setinitval .EQ. 3 ) grid%gfdda_end_y=0
5016 IF ( setinitval .EQ. 3 ) grid%gfdda_end_mo=0
5017 IF ( setinitval .EQ. 3 ) grid%gfdda_end_d=0
5018 IF ( setinitval .EQ. 3 ) grid%gfdda_end_h=0
5019 IF ( setinitval .EQ. 3 ) grid%gfdda_end_m=0
5020 IF ( setinitval .EQ. 3 ) grid%gfdda_end_s=0
5021 IF ( setinitval .EQ. 3 ) grid%auxinput11_end_y=0
5022 IF ( setinitval .EQ. 3 ) grid%auxinput11_end_mo=0
5023 IF ( setinitval .EQ. 3 ) grid%auxinput11_end_d=0
5024 IF ( setinitval .EQ. 3 ) grid%auxinput11_end_h=0
5025 IF ( setinitval .EQ. 3 ) grid%auxinput11_end_m=0
5026 IF ( setinitval .EQ. 3 ) grid%auxinput11_end_s=0
5027 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput1=0
5028 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput2=0
5029 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput3=0
5030 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput4=0
5031 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput5=0
5032 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput6=0
5033 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput7=0
5034 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput8=0
5035 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput9=0
5036 IF ( setinitval .EQ. 3 ) grid%io_form_gfdda=0
5037 IF ( setinitval .EQ. 3 ) grid%io_form_auxinput11=0
5038 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist1=0
5039 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist2=0
5040 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist3=0
5041 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist4=0
5042 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist5=0
5043 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist6=0
5044 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist7=0
5045 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist8=0
5046 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist9=0
5047 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist10=0
5048 IF ( setinitval .EQ. 3 ) grid%io_form_auxhist11=0
5049 IF ( setinitval .EQ. 3 ) grid%simulation_start_year=0
5050 IF ( setinitval .EQ. 3 ) grid%simulation_start_month=0
5051 IF ( setinitval .EQ. 3 ) grid%simulation_start_day=0
5052 IF ( setinitval .EQ. 3 ) grid%simulation_start_hour=0
5053 IF ( setinitval .EQ. 3 ) grid%simulation_start_minute=0
5054 IF ( setinitval .EQ. 3 ) grid%simulation_start_second=0
5055 IF ( setinitval .EQ. 3 ) grid%reset_simulation_start=.FALSE.
5056 IF ( setinitval .EQ. 3 ) grid%sr_x=0
5057 IF ( setinitval .EQ. 3 ) grid%sr_y=0
5058 IF ( setinitval .EQ. 3 ) grid%julyr=0
5059 IF ( setinitval .EQ. 3 ) grid%julday=0
5060 IF ( setinitval .EQ. 3 ) grid%gmt=initial_data_value
5061 IF ( setinitval .EQ. 3 ) grid%write_input=.FALSE.
5062 IF ( setinitval .EQ. 3 ) grid%write_restart_at_0h=.FALSE.
5063 IF ( setinitval .EQ. 3 ) grid%adjust_output_times=.FALSE.
5064 IF ( setinitval .EQ. 3 ) grid%adjust_input_times=.FALSE.
5065 IF ( setinitval .EQ. 3 ) grid%diag_print=0
5066 IF ( setinitval .EQ. 3 ) grid%nocolons=.FALSE.
5067 IF ( setinitval .EQ. 3 ) grid%time_step=0
5068 IF ( setinitval .EQ. 3 ) grid%time_step_fract_num=0
5069 IF ( setinitval .EQ. 3 ) grid%time_step_fract_den=0
5070 IF ( setinitval .EQ. 3 ) grid%max_dom=0
5071 IF ( setinitval .EQ. 3 ) grid%s_we=0
5072 IF ( setinitval .EQ. 3 ) grid%e_we=0
5073 IF ( setinitval .EQ. 3 ) grid%s_sn=0
5074 IF ( setinitval .EQ. 3 ) grid%e_sn=0
5075 IF ( setinitval .EQ. 3 ) grid%s_vert=0
5076 IF ( setinitval .EQ. 3 ) grid%e_vert=0
5077 IF ( setinitval .EQ. 3 ) grid%num_metgrid_levels=0
5078 IF ( setinitval .EQ. 3 ) grid%p_top_requested=initial_data_value
5079 IF ( setinitval .EQ. 3 ) grid%interp_type=0
5080 IF ( setinitval .EQ. 3 ) grid%extrap_type=0
5081 IF ( setinitval .EQ. 3 ) grid%t_extrap_type=0
5082 IF ( setinitval .EQ. 3 ) grid%lowest_lev_from_sfc=.FALSE.
5083 IF ( setinitval .EQ. 3 ) grid%use_levels_below_ground=.FALSE.
5084 IF ( setinitval .EQ. 3 ) grid%use_surface=.FALSE.
5085 IF ( setinitval .EQ. 3 ) grid%lagrange_order=0
5086 IF ( setinitval .EQ. 3 ) grid%force_sfc_in_vinterp=0
5087 IF ( setinitval .EQ. 3 ) grid%zap_close_levels=initial_data_value
5088 IF ( setinitval .EQ. 3 ) grid%sfcp_to_sfcp=.FALSE.
5089 IF ( setinitval .EQ. 3 ) grid%adjust_heights=.FALSE.
5090 IF ( setinitval .EQ. 3 ) grid%dx=initial_data_value
5091 IF ( setinitval .EQ. 3 ) grid%dy=initial_data_value
5092 IF ( setinitval .EQ. 3 ) grid%grid_id=0
5093 IF ( setinitval .EQ. 3 ) grid%parent_id=0
5094 IF ( setinitval .EQ. 3 ) grid%i_parent_start=0
5095 IF ( setinitval .EQ. 3 ) grid%j_parent_start=0
5096 IF ( setinitval .EQ. 3 ) grid%parent_grid_ratio=0
5097 IF ( setinitval .EQ. 3 ) grid%parent_time_step_ratio=0
5098 IF ( setinitval .EQ. 3 ) grid%feedback=0
5099 IF ( setinitval .EQ. 3 ) grid%smooth_option=0
5100 IF ( setinitval .EQ. 3 ) grid%blend_width=0
5101 IF ( setinitval .EQ. 3 ) grid%ztop=initial_data_value
5102 IF ( setinitval .EQ. 3 ) grid%moad_grid_ratio=0
5103 IF ( setinitval .EQ. 3 ) grid%moad_time_step_ratio=0
5104 IF ( setinitval .EQ. 3 ) grid%shw=0
5105 IF ( setinitval .EQ. 3 ) grid%tile_sz_x=0
5106 IF ( setinitval .EQ. 3 ) grid%tile_sz_y=0
5107 IF ( setinitval .EQ. 3 ) grid%numtiles=0
5108 IF ( setinitval .EQ. 3 ) grid%nproc_x=0
5109 IF ( setinitval .EQ. 3 ) grid%nproc_y=0
5110 IF ( setinitval .EQ. 3 ) grid%irand=0
5111 IF ( setinitval .EQ. 3 ) grid%dt=initial_data_value
5112 IF ( setinitval .EQ. 3 ) grid%num_moves=0
5113 IF ( setinitval .EQ. 3 ) grid%vortex_interval=0
5114 IF ( setinitval .EQ. 3 ) grid%max_vortex_speed=0
5115 IF ( setinitval .EQ. 3 ) grid%corral_dist=0
5116 IF ( setinitval .EQ. 3 ) grid%move_id=0
5117 IF ( setinitval .EQ. 3 ) grid%move_interval=0
5118 IF ( setinitval .EQ. 3 ) grid%move_cd_x=0
5119 IF ( setinitval .EQ. 3 ) grid%move_cd_y=0
5120 IF ( setinitval .EQ. 3 ) grid%swap_x=.FALSE.
5121 IF ( setinitval .EQ. 3 ) grid%swap_y=.FALSE.
5122 IF ( setinitval .EQ. 3 ) grid%cycle_x=.FALSE.
5123 IF ( setinitval .EQ. 3 ) grid%cycle_y=.FALSE.
5124 IF ( setinitval .EQ. 3 ) grid%reorder_mesh=.FALSE.
5125 IF ( setinitval .EQ. 3 ) grid%perturb_input=.FALSE.
5126 IF ( setinitval .EQ. 3 ) grid%eta_levels=initial_data_value
5127 IF ( setinitval .EQ. 3 ) grid%max_dz=initial_data_value
5128 IF ( setinitval .EQ. 3 ) grid%mp_physics=0
5129 IF ( setinitval .EQ. 3 ) grid%progn=0
5130 IF ( setinitval .EQ. 3 ) grid%ra_lw_physics=0
5131 IF ( setinitval .EQ. 3 ) grid%ra_sw_physics=0
5132 IF ( setinitval .EQ. 3 ) grid%radt=initial_data_value
5133 IF ( setinitval .EQ. 3 ) grid%naer=initial_data_value
5134 IF ( setinitval .EQ. 3 ) grid%sf_sfclay_physics=0
5135 IF ( setinitval .EQ. 3 ) grid%sf_surface_physics=0
5136 IF ( setinitval .EQ. 3 ) grid%bl_pbl_physics=0
5137 IF ( setinitval .EQ. 3 ) grid%bldt=initial_data_value
5138 IF ( setinitval .EQ. 3 ) grid%cu_physics=0
5139 IF ( setinitval .EQ. 3 ) grid%cudt=initial_data_value
5140 IF ( setinitval .EQ. 3 ) grid%gsmdt=initial_data_value
5141 IF ( setinitval .EQ. 3 ) grid%isfflx=0
5142 IF ( setinitval .EQ. 3 ) grid%ifsnow=0
5143 IF ( setinitval .EQ. 3 ) grid%icloud=0
5144 IF ( setinitval .EQ. 3 ) grid%swrad_scat=initial_data_value
5145 IF ( setinitval .EQ. 3 ) grid%surface_input_source=0
5146 IF ( setinitval .EQ. 3 ) grid%num_soil_layers=0
5147 IF ( setinitval .EQ. 3 ) grid%num_months=0
5148 IF ( setinitval .EQ. 3 ) grid%maxiens=0
5149 IF ( setinitval .EQ. 3 ) grid%maxens=0
5150 IF ( setinitval .EQ. 3 ) grid%maxens2=0
5151 IF ( setinitval .EQ. 3 ) grid%maxens3=0
5152 IF ( setinitval .EQ. 3 ) grid%ensdim=0
5153 IF ( setinitval .EQ. 3 ) grid%chem_opt=0
5154 IF ( setinitval .EQ. 3 ) grid%num_land_cat=0
5155 IF ( setinitval .EQ. 3 ) grid%num_soil_cat=0
5156 IF ( setinitval .EQ. 3 ) grid%mp_zero_out=0
5157 IF ( setinitval .EQ. 3 ) grid%mp_zero_out_thresh=initial_data_value
5158 IF ( setinitval .EQ. 3 ) grid%seaice_threshold=initial_data_value
5159 IF ( setinitval .EQ. 3 ) grid%sst_update=0
5160 IF ( setinitval .EQ. 3 ) grid%ucmcall=0
5161 IF ( setinitval .EQ. 3 ) grid%co2tf=0
5162 IF ( setinitval .EQ. 3 ) grid%ra_call_offset=0
5163 IF ( setinitval .EQ. 3 ) grid%cam_abs_freq_s=initial_data_value
5164 IF ( setinitval .EQ. 3 ) grid%levsiz=0
5165 IF ( setinitval .EQ. 3 ) grid%paerlev=0
5166 IF ( setinitval .EQ. 3 ) grid%cam_abs_dim1=0
5167 IF ( setinitval .EQ. 3 ) grid%cam_abs_dim2=0
5168 IF ( setinitval .EQ. 3 ) grid%cu_rad_feedback=.FALSE.
5169 IF ( setinitval .EQ. 3 ) grid%fgdt=initial_data_value
5170 IF ( setinitval .EQ. 3 ) grid%grid_fdda=0
5171 IF ( setinitval .EQ. 3 ) grid%if_no_pbl_nudging_uv=0
5172 IF ( setinitval .EQ. 3 ) grid%if_no_pbl_nudging_t=0
5173 IF ( setinitval .EQ. 3 ) grid%if_no_pbl_nudging_q=0
5174 IF ( setinitval .EQ. 3 ) grid%if_zfac_uv=0
5175 IF ( setinitval .EQ. 3 ) grid%k_zfac_uv=0
5176 IF ( setinitval .EQ. 3 ) grid%if_zfac_t=0
5177 IF ( setinitval .EQ. 3 ) grid%k_zfac_t=0
5178 IF ( setinitval .EQ. 3 ) grid%if_zfac_q=0
5179 IF ( setinitval .EQ. 3 ) grid%k_zfac_q=0
5180 IF ( setinitval .EQ. 3 ) grid%guv=initial_data_value
5181 IF ( setinitval .EQ. 3 ) grid%gt=initial_data_value
5182 IF ( setinitval .EQ. 3 ) grid%gq=initial_data_value
5183 IF ( setinitval .EQ. 3 ) grid%dtramp_min=initial_data_value
5184 IF ( setinitval .EQ. 3 ) grid%if_ramping=0
5185 IF ( setinitval .EQ. 3 ) grid%obs_nudge_opt=0
5186 IF ( setinitval .EQ. 3 ) grid%max_obs=0
5187 IF ( setinitval .EQ. 3 ) grid%nobs_ndg_vars=0
5188 IF ( setinitval .EQ. 3 ) grid%nobs_err_flds=0
5189 IF ( setinitval .EQ. 3 ) grid%fdda_start=initial_data_value
5190 IF ( setinitval .EQ. 3 ) grid%fdda_end=initial_data_value
5191 IF ( setinitval .EQ. 3 ) grid%obs_nudge_wind=0
5192 IF ( setinitval .EQ. 3 ) grid%obs_coef_wind=initial_data_value
5193 IF ( setinitval .EQ. 3 ) grid%obs_nudge_temp=0
5194 IF ( setinitval .EQ. 3 ) grid%obs_coef_temp=initial_data_value
5195 IF ( setinitval .EQ. 3 ) grid%obs_nudge_mois=0
5196 IF ( setinitval .EQ. 3 ) grid%obs_coef_mois=initial_data_value
5197 IF ( setinitval .EQ. 3 ) grid%obs_nudge_pstr=0
5198 IF ( setinitval .EQ. 3 ) grid%obs_coef_pstr=initial_data_value
5199 IF ( setinitval .EQ. 3 ) grid%obs_rinxy=initial_data_value
5200 IF ( setinitval .EQ. 3 ) grid%obs_rinsig=initial_data_value
5201 IF ( setinitval .EQ. 3 ) grid%obs_twindo=initial_data_value
5202 IF ( setinitval .EQ. 3 ) grid%obs_npfi=0
5203 IF ( setinitval .EQ. 3 ) grid%obs_ionf=0
5204 IF ( setinitval .EQ. 3 ) grid%obs_idynin=0
5205 IF ( setinitval .EQ. 3 ) grid%obs_dtramp=initial_data_value
5206 IF ( setinitval .EQ. 3 ) grid%obs_ipf_in4dob=.FALSE.
5207 IF ( setinitval .EQ. 3 ) grid%obs_ipf_errob=.FALSE.
5208 IF ( setinitval .EQ. 3 ) grid%obs_ipf_nudob=.FALSE.
5209 IF ( setinitval .EQ. 3 ) grid%dyn_opt=0
5210 IF ( setinitval .EQ. 3 ) grid%rk_ord=0
5211 IF ( setinitval .EQ. 3 ) grid%w_damping=0
5212 IF ( setinitval .EQ. 3 ) grid%diff_opt=0
5213 IF ( setinitval .EQ. 3 ) grid%km_opt=0
5214 IF ( setinitval .EQ. 3 ) grid%damp_opt=0
5215 IF ( setinitval .EQ. 3 ) grid%zdamp=initial_data_value
5216 IF ( setinitval .EQ. 3 ) grid%dampcoef=initial_data_value
5217 IF ( setinitval .EQ. 3 ) grid%khdif=initial_data_value
5218 IF ( setinitval .EQ. 3 ) grid%kvdif=initial_data_value
5219 IF ( setinitval .EQ. 3 ) grid%diff_6th_factor=initial_data_value
5220 IF ( setinitval .EQ. 3 ) grid%diff_6th_opt=0
5221 IF ( setinitval .EQ. 3 ) grid%smdiv=initial_data_value
5222 IF ( setinitval .EQ. 3 ) grid%emdiv=initial_data_value
5223 IF ( setinitval .EQ. 3 ) grid%epssm=initial_data_value
5224 IF ( setinitval .EQ. 3 ) grid%non_hydrostatic=.FALSE.
5225 IF ( setinitval .EQ. 3 ) grid%time_step_sound=0
5226 IF ( setinitval .EQ. 3 ) grid%h_mom_adv_order=0
5227 IF ( setinitval .EQ. 3 ) grid%v_mom_adv_order=0
5228 IF ( setinitval .EQ. 3 ) grid%h_sca_adv_order=0
5229 IF ( setinitval .EQ. 3 ) grid%v_sca_adv_order=0
5230 IF ( setinitval .EQ. 3 ) grid%pd_moist=.FALSE.
5231 IF ( setinitval .EQ. 3 ) grid%pd_chem=.FALSE.
5232 IF ( setinitval .EQ. 3 ) grid%pd_scalar=.FALSE.
5233 IF ( setinitval .EQ. 3 ) grid%pd_tke=.FALSE.
5234 IF ( setinitval .EQ. 3 ) grid%top_radiation=.FALSE.
5235 IF ( setinitval .EQ. 3 ) grid%mix_cr_len=initial_data_value
5236 IF ( setinitval .EQ. 3 ) grid%tke_upper_bound=initial_data_value
5237 IF ( setinitval .EQ. 3 ) grid%kh_tke_upper_bound=initial_data_value
5238 IF ( setinitval .EQ. 3 ) grid%kv_tke_upper_bound=initial_data_value
5239 IF ( setinitval .EQ. 3 ) grid%tke_drag_coefficient=initial_data_value
5240 IF ( setinitval .EQ. 3 ) grid%tke_heat_flux=initial_data_value
5241 IF ( setinitval .EQ. 3 ) grid%pert_coriolis=.FALSE.
5242 IF ( setinitval .EQ. 3 ) grid%mix_full_fields=.FALSE.
5243 IF ( setinitval .EQ. 3 ) grid%base_pres=initial_data_value
5244 IF ( setinitval .EQ. 3 ) grid%base_temp=initial_data_value
5245 IF ( setinitval .EQ. 3 ) grid%base_lapse=initial_data_value
5246 IF ( setinitval .EQ. 3 ) grid%spec_bdy_width=0
5247 IF ( setinitval .EQ. 3 ) grid%spec_zone=0
5248 IF ( setinitval .EQ. 3 ) grid%relax_zone=0
5249 IF ( setinitval .EQ. 3 ) grid%specified=.FALSE.
5250 IF ( setinitval .EQ. 3 ) grid%periodic_x=.FALSE.
5251 IF ( setinitval .EQ. 3 ) grid%symmetric_xs=.FALSE.
5252 IF ( setinitval .EQ. 3 ) grid%symmetric_xe=.FALSE.
5253 IF ( setinitval .EQ. 3 ) grid%open_xs=.FALSE.
5254 IF ( setinitval .EQ. 3 ) grid%open_xe=.FALSE.
5255 IF ( setinitval .EQ. 3 ) grid%periodic_y=.FALSE.
5256 IF ( setinitval .EQ. 3 ) grid%symmetric_ys=.FALSE.
5257 IF ( setinitval .EQ. 3 ) grid%symmetric_ye=.FALSE.
5258 IF ( setinitval .EQ. 3 ) grid%open_ys=.FALSE.
5259 IF ( setinitval .EQ. 3 ) grid%open_ye=.FALSE.
5260 IF ( setinitval .EQ. 3 ) grid%nested=.FALSE.
5261 IF ( setinitval .EQ. 3 ) grid%real_data_init_type=0
5262 IF ( setinitval .EQ. 3 ) grid%background_proc_id=0
5263 IF ( setinitval .EQ. 3 ) grid%forecast_proc_id=0
5264 IF ( setinitval .EQ. 3 ) grid%production_status=0
5265 IF ( setinitval .EQ. 3 ) grid%compression=0
5266 IF ( setinitval .EQ. 3 ) grid%cen_lat=initial_data_value
5267 IF ( setinitval .EQ. 3 ) grid%cen_lon=initial_data_value
5268 IF ( setinitval .EQ. 3 ) grid%truelat1=initial_data_value
5269 IF ( setinitval .EQ. 3 ) grid%truelat2=initial_data_value
5270 IF ( setinitval .EQ. 3 ) grid%moad_cen_lat=initial_data_value
5271 IF ( setinitval .EQ. 3 ) grid%stand_lon=initial_data_value
5272 IF ( setinitval .EQ. 3 ) grid%bdyfrq=initial_data_value
5273 IF ( setinitval .EQ. 3 ) grid%iswater=0
5274 IF ( setinitval .EQ. 3 ) grid%isice=0
5275 IF ( setinitval .EQ. 3 ) grid%isurban=0
5276 IF ( setinitval .EQ. 3 ) grid%isoilwater=0
5277 IF ( setinitval .EQ. 3 ) grid%map_proj=0
5278 IF(.NOT.inter_domain)THEN
5279 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))) * RWORDSIZE
5280 ALLOCATE(grid%em_dummy(sm31:em31),STAT=ierr)
5281  if (ierr.ne.0) then
5282  CALL wrf_error_fatal ( &
5283 'frame/module_domain.f: Failed to allocate grid%em_dummy(sm31:em31). ')
5284  endif
5285 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%em_dummy=initial_data_value
5286 ELSE
5287 ALLOCATE(grid%em_dummy(1),STAT=ierr)
5288  if (ierr.ne.0) then
5289  CALL wrf_error_fatal ( &
5290 'frame/module_domain.f: Failed to allocate grid%em_dummy(1).  ')
5291  endif
5292 ENDIF
5293 IF(.NOT.inter_domain)THEN
5294 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5295 ALLOCATE(grid%vv%v1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5296  if (ierr.ne.0) then
5297  CALL wrf_error_fatal ( &
5298 'frame/module_domain.f: Failed to allocate grid%vv%v1(sm31:em31,sm32:em32,sm33:em33). ')
5299  endif
5300 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vv%v1=initial_data_value
5301 ELSE
5302 ALLOCATE(grid%vv%v1(1,1,1),STAT=ierr)
5303  if (ierr.ne.0) then
5304  CALL wrf_error_fatal ( &
5305 'frame/module_domain.f: Failed to allocate grid%vv%v1(1,1,1).  ')
5306  endif
5307 ENDIF
5308 IF(.NOT.inter_domain)THEN
5309 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5310 ALLOCATE(grid%vv%v2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5311  if (ierr.ne.0) then
5312  CALL wrf_error_fatal ( &
5313 'frame/module_domain.f: Failed to allocate grid%vv%v2(sm31:em31,sm32:em32,sm33:em33). ')
5314  endif
5315 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vv%v2=initial_data_value
5316 ELSE
5317 ALLOCATE(grid%vv%v2(1,1,1),STAT=ierr)
5318  if (ierr.ne.0) then
5319  CALL wrf_error_fatal ( &
5320 'frame/module_domain.f: Failed to allocate grid%vv%v2(1,1,1).  ')
5321  endif
5322 ENDIF
5323 IF(.NOT.inter_domain)THEN
5324 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5325 ALLOCATE(grid%vv%v3(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5326  if (ierr.ne.0) then
5327  CALL wrf_error_fatal ( &
5328 'frame/module_domain.f: Failed to allocate grid%vv%v3(sm31:em31,sm32:em32,sm33:em33). ')
5329  endif
5330 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vv%v3=initial_data_value
5331 ELSE
5332 ALLOCATE(grid%vv%v3(1,1,1),STAT=ierr)
5333  if (ierr.ne.0) then
5334  CALL wrf_error_fatal ( &
5335 'frame/module_domain.f: Failed to allocate grid%vv%v3(1,1,1).  ')
5336  endif
5337 ENDIF
5338 IF(.NOT.inter_domain)THEN
5339 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5340 ALLOCATE(grid%vv%v4(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5341  if (ierr.ne.0) then
5342  CALL wrf_error_fatal ( &
5343 'frame/module_domain.f: Failed to allocate grid%vv%v4(sm31:em31,sm32:em32,sm33:em33). ')
5344  endif
5345 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vv%v4=initial_data_value
5346 ELSE
5347 ALLOCATE(grid%vv%v4(1,1,1),STAT=ierr)
5348  if (ierr.ne.0) then
5349  CALL wrf_error_fatal ( &
5350 'frame/module_domain.f: Failed to allocate grid%vv%v4(1,1,1).  ')
5351  endif
5352 ENDIF
5353 IF(.NOT.inter_domain)THEN
5354 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5355 ALLOCATE(grid%vv%v5(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5356  if (ierr.ne.0) then
5357  CALL wrf_error_fatal ( &
5358 'frame/module_domain.f: Failed to allocate grid%vv%v5(sm31:em31,sm32:em32,sm33:em33). ')
5359  endif
5360 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vv%v5=initial_data_value
5361 ELSE
5362 ALLOCATE(grid%vv%v5(1,1,1),STAT=ierr)
5363  if (ierr.ne.0) then
5364  CALL wrf_error_fatal ( &
5365 'frame/module_domain.f: Failed to allocate grid%vv%v5(1,1,1).  ')
5366  endif
5367 ENDIF
5368 IF(.NOT.inter_domain)THEN
5369 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((model_config_rec%ensdim_alpha)-(1)+1))) * RWORDSIZE
5370 ALLOCATE(grid%vv%alpha(sm31:em31,sm32:em32,1:model_config_rec%ensdim_alpha),STAT=ierr)
5371  if (ierr.ne.0) then
5372  CALL wrf_error_fatal ( &
5373 'frame/module_domain.f: Failed to allocate grid%vv%alpha(sm31:em31,sm32:em32,1:model_config_rec%ensdim_alpha). ')
5374  endif
5375 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vv%alpha=initial_data_value
5376 ELSE
5377 ALLOCATE(grid%vv%alpha(1,1,1),STAT=ierr)
5378  if (ierr.ne.0) then
5379  CALL wrf_error_fatal ( &
5380 'frame/module_domain.f: Failed to allocate grid%vv%alpha(1,1,1).  ')
5381  endif
5382 ENDIF
5383 IF(.NOT.inter_domain)THEN
5384 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5385 ALLOCATE(grid%vp%v1(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5386  if (ierr.ne.0) then
5387  CALL wrf_error_fatal ( &
5388 'frame/module_domain.f: Failed to allocate grid%vp%v1(sm31:em31,sm32:em32,sm33:em33). ')
5389  endif
5390 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vp%v1=initial_data_value
5391 ELSE
5392 ALLOCATE(grid%vp%v1(1,1,1),STAT=ierr)
5393  if (ierr.ne.0) then
5394  CALL wrf_error_fatal ( &
5395 'frame/module_domain.f: Failed to allocate grid%vp%v1(1,1,1).  ')
5396  endif
5397 ENDIF
5398 IF(.NOT.inter_domain)THEN
5399 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5400 ALLOCATE(grid%vp%v2(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5401  if (ierr.ne.0) then
5402  CALL wrf_error_fatal ( &
5403 'frame/module_domain.f: Failed to allocate grid%vp%v2(sm31:em31,sm32:em32,sm33:em33). ')
5404  endif
5405 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vp%v2=initial_data_value
5406 ELSE
5407 ALLOCATE(grid%vp%v2(1,1,1),STAT=ierr)
5408  if (ierr.ne.0) then
5409  CALL wrf_error_fatal ( &
5410 'frame/module_domain.f: Failed to allocate grid%vp%v2(1,1,1).  ')
5411  endif
5412 ENDIF
5413 IF(.NOT.inter_domain)THEN
5414 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5415 ALLOCATE(grid%vp%v3(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5416  if (ierr.ne.0) then
5417  CALL wrf_error_fatal ( &
5418 'frame/module_domain.f: Failed to allocate grid%vp%v3(sm31:em31,sm32:em32,sm33:em33). ')
5419  endif
5420 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vp%v3=initial_data_value
5421 ELSE
5422 ALLOCATE(grid%vp%v3(1,1,1),STAT=ierr)
5423  if (ierr.ne.0) then
5424  CALL wrf_error_fatal ( &
5425 'frame/module_domain.f: Failed to allocate grid%vp%v3(1,1,1).  ')
5426  endif
5427 ENDIF
5428 IF(.NOT.inter_domain)THEN
5429 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5430 ALLOCATE(grid%vp%v4(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5431  if (ierr.ne.0) then
5432  CALL wrf_error_fatal ( &
5433 'frame/module_domain.f: Failed to allocate grid%vp%v4(sm31:em31,sm32:em32,sm33:em33). ')
5434  endif
5435 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vp%v4=initial_data_value
5436 ELSE
5437 ALLOCATE(grid%vp%v4(1,1,1),STAT=ierr)
5438  if (ierr.ne.0) then
5439  CALL wrf_error_fatal ( &
5440 'frame/module_domain.f: Failed to allocate grid%vp%v4(1,1,1).  ')
5441  endif
5442 ENDIF
5443 IF(.NOT.inter_domain)THEN
5444 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5445 ALLOCATE(grid%vp%v5(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5446  if (ierr.ne.0) then
5447  CALL wrf_error_fatal ( &
5448 'frame/module_domain.f: Failed to allocate grid%vp%v5(sm31:em31,sm32:em32,sm33:em33). ')
5449  endif
5450 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vp%v5=initial_data_value
5451 ELSE
5452 ALLOCATE(grid%vp%v5(1,1,1),STAT=ierr)
5453  if (ierr.ne.0) then
5454  CALL wrf_error_fatal ( &
5455 'frame/module_domain.f: Failed to allocate grid%vp%v5(1,1,1).  ')
5456  endif
5457 ENDIF
5458 IF(.NOT.inter_domain)THEN
5459 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((model_config_rec%ensdim_alpha)-(1)+1))) * RWORDSIZE
5460 ALLOCATE(grid%vp%alpha(sm31:em31,sm32:em32,1:model_config_rec%ensdim_alpha),STAT=ierr)
5461  if (ierr.ne.0) then
5462  CALL wrf_error_fatal ( &
5463 'frame/module_domain.f: Failed to allocate grid%vp%alpha(sm31:em31,sm32:em32,1:model_config_rec%ensdim_alpha). ')
5464  endif
5465 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%vp%alpha=initial_data_value
5466 ELSE
5467 ALLOCATE(grid%vp%alpha(1,1,1),STAT=ierr)
5468  if (ierr.ne.0) then
5469  CALL wrf_error_fatal ( &
5470 'frame/module_domain.f: Failed to allocate grid%vp%alpha(1,1,1).  ')
5471  endif
5472 ENDIF
5473 IF ( setinitval .EQ. 3 ) grid%ep%ne=0
5474 IF(.NOT.inter_domain)THEN
5475 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))*(((model_config_rec%ensdim_alpha)-(1)+1))) * RWORDSIZE
5476 ALLOCATE(grid%ep%v1(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha),STAT=ierr)
5477  if (ierr.ne.0) then
5478  CALL wrf_error_fatal ( &
5479 'frame/module_domain.f: Failed to allocate grid%ep%v1(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha). ')
5480  endif
5481 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ep%v1=initial_data_value
5482 ELSE
5483 ALLOCATE(grid%ep%v1(1,1,1,1),STAT=ierr)
5484  if (ierr.ne.0) then
5485  CALL wrf_error_fatal ( &
5486 'frame/module_domain.f: Failed to allocate grid%ep%v1(1,1,1,1).  ')
5487  endif
5488 ENDIF
5489 IF(.NOT.inter_domain)THEN
5490 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))*(((model_config_rec%ensdim_alpha)-(1)+1))) * RWORDSIZE
5491 ALLOCATE(grid%ep%v2(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha),STAT=ierr)
5492  if (ierr.ne.0) then
5493  CALL wrf_error_fatal ( &
5494 'frame/module_domain.f: Failed to allocate grid%ep%v2(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha). ')
5495  endif
5496 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ep%v2=initial_data_value
5497 ELSE
5498 ALLOCATE(grid%ep%v2(1,1,1,1),STAT=ierr)
5499  if (ierr.ne.0) then
5500  CALL wrf_error_fatal ( &
5501 'frame/module_domain.f: Failed to allocate grid%ep%v2(1,1,1,1).  ')
5502  endif
5503 ENDIF
5504 IF(.NOT.inter_domain)THEN
5505 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))*(((model_config_rec%ensdim_alpha)-(1)+1))) * RWORDSIZE
5506 ALLOCATE(grid%ep%v3(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha),STAT=ierr)
5507  if (ierr.ne.0) then
5508  CALL wrf_error_fatal ( &
5509 'frame/module_domain.f: Failed to allocate grid%ep%v3(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha). ')
5510  endif
5511 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ep%v3=initial_data_value
5512 ELSE
5513 ALLOCATE(grid%ep%v3(1,1,1,1),STAT=ierr)
5514  if (ierr.ne.0) then
5515  CALL wrf_error_fatal ( &
5516 'frame/module_domain.f: Failed to allocate grid%ep%v3(1,1,1,1).  ')
5517  endif
5518 ENDIF
5519 IF(.NOT.inter_domain)THEN
5520 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))*(((model_config_rec%ensdim_alpha)-(1)+1))) * RWORDSIZE
5521 ALLOCATE(grid%ep%v4(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha),STAT=ierr)
5522  if (ierr.ne.0) then
5523  CALL wrf_error_fatal ( &
5524 'frame/module_domain.f: Failed to allocate grid%ep%v4(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha). ')
5525  endif
5526 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ep%v4=initial_data_value
5527 ELSE
5528 ALLOCATE(grid%ep%v4(1,1,1,1),STAT=ierr)
5529  if (ierr.ne.0) then
5530  CALL wrf_error_fatal ( &
5531 'frame/module_domain.f: Failed to allocate grid%ep%v4(1,1,1,1).  ')
5532  endif
5533 ENDIF
5534 IF(.NOT.inter_domain)THEN
5535 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))*(((model_config_rec%ensdim_alpha)-(1)+1))) * RWORDSIZE
5536 ALLOCATE(grid%ep%v5(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha),STAT=ierr)
5537  if (ierr.ne.0) then
5538  CALL wrf_error_fatal ( &
5539 'frame/module_domain.f: Failed to allocate grid%ep%v5(sm31:em31,sm32:em32,sm33:em33,1:model_config_rec%ensdim_alpha). ')
5540  endif
5541 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%ep%v5=initial_data_value
5542 ELSE
5543 ALLOCATE(grid%ep%v5(1,1,1,1),STAT=ierr)
5544  if (ierr.ne.0) then
5545  CALL wrf_error_fatal ( &
5546 'frame/module_domain.f: Failed to allocate grid%ep%v5(1,1,1,1).  ')
5547  endif
5548 ENDIF
5549 IF ( setinitval .EQ. 3 ) grid%xb%map=0
5550 IF ( setinitval .EQ. 3 ) grid%xb%ptop=initial_data_value
5551 IF ( setinitval .EQ. 3 ) grid%xb%ztop=initial_data_value
5552 IF ( setinitval .EQ. 3 ) grid%xb%ds=initial_data_value
5553 IF ( setinitval .EQ. 3 ) grid%xb%sigmaf_0=initial_data_value
5554 IF ( setinitval .EQ. 3 ) grid%xb%mix=0
5555 IF ( setinitval .EQ. 3 ) grid%xb%mjy=0
5556 IF ( setinitval .EQ. 3 ) grid%xb%mkz=0
5557 IF ( setinitval .EQ. 3 ) grid%xb%num_of_var=0
5558 IF ( setinitval .EQ. 3 ) grid%xb%ids=0
5559 IF ( setinitval .EQ. 3 ) grid%xb%ide=0
5560 IF ( setinitval .EQ. 3 ) grid%xb%jds=0
5561 IF ( setinitval .EQ. 3 ) grid%xb%jde=0
5562 IF ( setinitval .EQ. 3 ) grid%xb%kds=0
5563 IF ( setinitval .EQ. 3 ) grid%xb%kde=0
5564 IF ( setinitval .EQ. 3 ) grid%xb%ims=0
5565 IF ( setinitval .EQ. 3 ) grid%xb%ime=0
5566 IF ( setinitval .EQ. 3 ) grid%xb%jms=0
5567 IF ( setinitval .EQ. 3 ) grid%xb%jme=0
5568 IF ( setinitval .EQ. 3 ) grid%xb%kms=0
5569 IF ( setinitval .EQ. 3 ) grid%xb%kme=0
5570 IF ( setinitval .EQ. 3 ) grid%xb%its=0
5571 IF ( setinitval .EQ. 3 ) grid%xb%ite=0
5572 IF ( setinitval .EQ. 3 ) grid%xb%jts=0
5573 IF ( setinitval .EQ. 3 ) grid%xb%jte=0
5574 IF ( setinitval .EQ. 3 ) grid%xb%kts=0
5575 IF ( setinitval .EQ. 3 ) grid%xb%kte=0
5576 IF(.NOT.inter_domain)THEN
5577 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
5578 ALLOCATE(grid%xb%grid_box_area(sm31:em31,sm32:em32),STAT=ierr)
5579  if (ierr.ne.0) then
5580  CALL wrf_error_fatal ( &
5581 'frame/module_domain.f: Failed to allocate grid%xb%grid_box_area(sm31:em31,sm32:em32). ')
5582  endif
5583 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%grid_box_area=initial_data_value
5584 ELSE
5585 ALLOCATE(grid%xb%grid_box_area(1,1),STAT=ierr)
5586  if (ierr.ne.0) then
5587  CALL wrf_error_fatal ( &
5588 'frame/module_domain.f: Failed to allocate grid%xb%grid_box_area(1,1).  ')
5589  endif
5590 ENDIF
5591 IF(.NOT.inter_domain)THEN
5592 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
5593 ALLOCATE(grid%xb%map_factor(sm31:em31,sm32:em32),STAT=ierr)
5594  if (ierr.ne.0) then
5595  CALL wrf_error_fatal ( &
5596 'frame/module_domain.f: Failed to allocate grid%xb%map_factor(sm31:em31,sm32:em32). ')
5597  endif
5598 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%map_factor=initial_data_value
5599 ELSE
5600 ALLOCATE(grid%xb%map_factor(1,1),STAT=ierr)
5601  if (ierr.ne.0) then
5602  CALL wrf_error_fatal ( &
5603 'frame/module_domain.f: Failed to allocate grid%xb%map_factor(1,1).  ')
5604  endif
5605 ENDIF
5606 IF(.NOT.inter_domain)THEN
5607 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5608 ALLOCATE(grid%xb%u(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5609  if (ierr.ne.0) then
5610  CALL wrf_error_fatal ( &
5611 'frame/module_domain.f: Failed to allocate grid%xb%u(sm31:em31,sm32:em32,sm33:em33). ')
5612  endif
5613 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%u=initial_data_value
5614 ELSE
5615 ALLOCATE(grid%xb%u(1,1,1),STAT=ierr)
5616  if (ierr.ne.0) then
5617  CALL wrf_error_fatal ( &
5618 'frame/module_domain.f: Failed to allocate grid%xb%u(1,1,1).  ')
5619  endif
5620 ENDIF
5621 IF(.NOT.inter_domain)THEN
5622 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5623 ALLOCATE(grid%xb%v(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5624  if (ierr.ne.0) then
5625  CALL wrf_error_fatal ( &
5626 'frame/module_domain.f: Failed to allocate grid%xb%v(sm31:em31,sm32:em32,sm33:em33). ')
5627  endif
5628 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%v=initial_data_value
5629 ELSE
5630 ALLOCATE(grid%xb%v(1,1,1),STAT=ierr)
5631  if (ierr.ne.0) then
5632  CALL wrf_error_fatal ( &
5633 'frame/module_domain.f: Failed to allocate grid%xb%v(1,1,1).  ')
5634  endif
5635 ENDIF
5636 IF(.NOT.inter_domain)THEN
5637 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5638 ALLOCATE(grid%xb%w(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5639  if (ierr.ne.0) then
5640  CALL wrf_error_fatal ( &
5641 'frame/module_domain.f: Failed to allocate grid%xb%w(sm31:em31,sm32:em32,sm33:em33). ')
5642  endif
5643 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%w=initial_data_value
5644 ELSE
5645 ALLOCATE(grid%xb%w(1,1,1),STAT=ierr)
5646  if (ierr.ne.0) then
5647  CALL wrf_error_fatal ( &
5648 'frame/module_domain.f: Failed to allocate grid%xb%w(1,1,1).  ')
5649  endif
5650 ENDIF
5651 IF(.NOT.inter_domain)THEN
5652 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5653 ALLOCATE(grid%xb%t(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5654  if (ierr.ne.0) then
5655  CALL wrf_error_fatal ( &
5656 'frame/module_domain.f: Failed to allocate grid%xb%t(sm31:em31,sm32:em32,sm33:em33). ')
5657  endif
5658 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%t=initial_data_value
5659 ELSE
5660 ALLOCATE(grid%xb%t(1,1,1),STAT=ierr)
5661  if (ierr.ne.0) then
5662  CALL wrf_error_fatal ( &
5663 'frame/module_domain.f: Failed to allocate grid%xb%t(1,1,1).  ')
5664  endif
5665 ENDIF
5666 IF(.NOT.inter_domain)THEN
5667 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5668 ALLOCATE(grid%xb%p(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5669  if (ierr.ne.0) then
5670  CALL wrf_error_fatal ( &
5671 'frame/module_domain.f: Failed to allocate grid%xb%p(sm31:em31,sm32:em32,sm33:em33). ')
5672  endif
5673 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%p=initial_data_value
5674 ELSE
5675 ALLOCATE(grid%xb%p(1,1,1),STAT=ierr)
5676  if (ierr.ne.0) then
5677  CALL wrf_error_fatal ( &
5678 'frame/module_domain.f: Failed to allocate grid%xb%p(1,1,1).  ')
5679  endif
5680 ENDIF
5681 IF(.NOT.inter_domain)THEN
5682 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5683 ALLOCATE(grid%xb%q(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5684  if (ierr.ne.0) then
5685  CALL wrf_error_fatal ( &
5686 'frame/module_domain.f: Failed to allocate grid%xb%q(sm31:em31,sm32:em32,sm33:em33). ')
5687  endif
5688 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%q=initial_data_value
5689 ELSE
5690 ALLOCATE(grid%xb%q(1,1,1),STAT=ierr)
5691  if (ierr.ne.0) then
5692  CALL wrf_error_fatal ( &
5693 'frame/module_domain.f: Failed to allocate grid%xb%q(1,1,1).  ')
5694  endif
5695 ENDIF
5696 IF(.NOT.inter_domain)THEN
5697 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5698 ALLOCATE(grid%xb%qrn(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5699  if (ierr.ne.0) then
5700  CALL wrf_error_fatal ( &
5701 'frame/module_domain.f: Failed to allocate grid%xb%qrn(sm31:em31,sm32:em32,sm33:em33). ')
5702  endif
5703 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%qrn=initial_data_value
5704 ELSE
5705 ALLOCATE(grid%xb%qrn(1,1,1),STAT=ierr)
5706  if (ierr.ne.0) then
5707  CALL wrf_error_fatal ( &
5708 'frame/module_domain.f: Failed to allocate grid%xb%qrn(1,1,1).  ')
5709  endif
5710 ENDIF
5711 IF(.NOT.inter_domain)THEN
5712 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5713 ALLOCATE(grid%xb%qcw(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5714  if (ierr.ne.0) then
5715  CALL wrf_error_fatal ( &
5716 'frame/module_domain.f: Failed to allocate grid%xb%qcw(sm31:em31,sm32:em32,sm33:em33). ')
5717  endif
5718 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%qcw=initial_data_value
5719 ELSE
5720 ALLOCATE(grid%xb%qcw(1,1,1),STAT=ierr)
5721  if (ierr.ne.0) then
5722  CALL wrf_error_fatal ( &
5723 'frame/module_domain.f: Failed to allocate grid%xb%qcw(1,1,1).  ')
5724  endif
5725 ENDIF
5726 IF(.NOT.inter_domain)THEN
5727 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5728 ALLOCATE(grid%xb%qci(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5729  if (ierr.ne.0) then
5730  CALL wrf_error_fatal ( &
5731 'frame/module_domain.f: Failed to allocate grid%xb%qci(sm31:em31,sm32:em32,sm33:em33). ')
5732  endif
5733 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%qci=initial_data_value
5734 ELSE
5735 ALLOCATE(grid%xb%qci(1,1,1),STAT=ierr)
5736  if (ierr.ne.0) then
5737  CALL wrf_error_fatal ( &
5738 'frame/module_domain.f: Failed to allocate grid%xb%qci(1,1,1).  ')
5739  endif
5740 ENDIF
5741 IF(.NOT.inter_domain)THEN
5742 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5743 ALLOCATE(grid%xb%qsn(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5744  if (ierr.ne.0) then
5745  CALL wrf_error_fatal ( &
5746 'frame/module_domain.f: Failed to allocate grid%xb%qsn(sm31:em31,sm32:em32,sm33:em33). ')
5747  endif
5748 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%qsn=initial_data_value
5749 ELSE
5750 ALLOCATE(grid%xb%qsn(1,1,1),STAT=ierr)
5751  if (ierr.ne.0) then
5752  CALL wrf_error_fatal ( &
5753 'frame/module_domain.f: Failed to allocate grid%xb%qsn(1,1,1).  ')
5754  endif
5755 ENDIF
5756 IF(.NOT.inter_domain)THEN
5757 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5758 ALLOCATE(grid%xb%qgr(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5759  if (ierr.ne.0) then
5760  CALL wrf_error_fatal ( &
5761 'frame/module_domain.f: Failed to allocate grid%xb%qgr(sm31:em31,sm32:em32,sm33:em33). ')
5762  endif
5763 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%qgr=initial_data_value
5764 ELSE
5765 ALLOCATE(grid%xb%qgr(1,1,1),STAT=ierr)
5766  if (ierr.ne.0) then
5767  CALL wrf_error_fatal ( &
5768 'frame/module_domain.f: Failed to allocate grid%xb%qgr(1,1,1).  ')
5769  endif
5770 ENDIF
5771 IF(.NOT.inter_domain)THEN
5772 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5773 ALLOCATE(grid%xb%qt(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5774  if (ierr.ne.0) then
5775  CALL wrf_error_fatal ( &
5776 'frame/module_domain.f: Failed to allocate grid%xb%qt(sm31:em31,sm32:em32,sm33:em33). ')
5777  endif
5778 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%qt=initial_data_value
5779 ELSE
5780 ALLOCATE(grid%xb%qt(1,1,1),STAT=ierr)
5781  if (ierr.ne.0) then
5782  CALL wrf_error_fatal ( &
5783 'frame/module_domain.f: Failed to allocate grid%xb%qt(1,1,1).  ')
5784  endif
5785 ENDIF
5786 IF(.NOT.inter_domain)THEN
5787 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5788 ALLOCATE(grid%xb%delt(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5789  if (ierr.ne.0) then
5790  CALL wrf_error_fatal ( &
5791 'frame/module_domain.f: Failed to allocate grid%xb%delt(sm31:em31,sm32:em32,sm33:em33). ')
5792  endif
5793 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%delt=initial_data_value
5794 ELSE
5795 ALLOCATE(grid%xb%delt(1,1,1),STAT=ierr)
5796  if (ierr.ne.0) then
5797  CALL wrf_error_fatal ( &
5798 'frame/module_domain.f: Failed to allocate grid%xb%delt(1,1,1).  ')
5799  endif
5800 ENDIF
5801 IF(.NOT.inter_domain)THEN
5802 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5803 ALLOCATE(grid%xb%h(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5804  if (ierr.ne.0) then
5805  CALL wrf_error_fatal ( &
5806 'frame/module_domain.f: Failed to allocate grid%xb%h(sm31:em31,sm32:em32,sm33:em33). ')
5807  endif
5808 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%h=initial_data_value
5809 ELSE
5810 ALLOCATE(grid%xb%h(1,1,1),STAT=ierr)
5811  if (ierr.ne.0) then
5812  CALL wrf_error_fatal ( &
5813 'frame/module_domain.f: Failed to allocate grid%xb%h(1,1,1).  ')
5814  endif
5815 ENDIF
5816 IF(.NOT.inter_domain)THEN
5817 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5818 ALLOCATE(grid%xb%hf(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5819  if (ierr.ne.0) then
5820  CALL wrf_error_fatal ( &
5821 'frame/module_domain.f: Failed to allocate grid%xb%hf(sm31:em31,sm32:em32,sm33:em33). ')
5822  endif
5823 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%hf=initial_data_value
5824 ELSE
5825 ALLOCATE(grid%xb%hf(1,1,1),STAT=ierr)
5826  if (ierr.ne.0) then
5827  CALL wrf_error_fatal ( &
5828 'frame/module_domain.f: Failed to allocate grid%xb%hf(1,1,1).  ')
5829  endif
5830 ENDIF
5831 IF(.NOT.inter_domain)THEN
5832 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5833 ALLOCATE(grid%xb%wh(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5834  if (ierr.ne.0) then
5835  CALL wrf_error_fatal ( &
5836 'frame/module_domain.f: Failed to allocate grid%xb%wh(sm31:em31,sm32:em32,sm33:em33). ')
5837  endif
5838 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%wh=initial_data_value
5839 ELSE
5840 ALLOCATE(grid%xb%wh(1,1,1),STAT=ierr)
5841  if (ierr.ne.0) then
5842  CALL wrf_error_fatal ( &
5843 'frame/module_domain.f: Failed to allocate grid%xb%wh(1,1,1).  ')
5844  endif
5845 ENDIF
5846 IF(.NOT.inter_domain)THEN
5847 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5848 ALLOCATE(grid%xb%rho(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5849  if (ierr.ne.0) then
5850  CALL wrf_error_fatal ( &
5851 'frame/module_domain.f: Failed to allocate grid%xb%rho(sm31:em31,sm32:em32,sm33:em33). ')
5852  endif
5853 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%rho=initial_data_value
5854 ELSE
5855 ALLOCATE(grid%xb%rho(1,1,1),STAT=ierr)
5856  if (ierr.ne.0) then
5857  CALL wrf_error_fatal ( &
5858 'frame/module_domain.f: Failed to allocate grid%xb%rho(1,1,1).  ')
5859  endif
5860 ENDIF
5861 IF(.NOT.inter_domain)THEN
5862 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5863 ALLOCATE(grid%xb%rh(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5864  if (ierr.ne.0) then
5865  CALL wrf_error_fatal ( &
5866 'frame/module_domain.f: Failed to allocate grid%xb%rh(sm31:em31,sm32:em32,sm33:em33). ')
5867  endif
5868 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%rh=initial_data_value
5869 ELSE
5870 ALLOCATE(grid%xb%rh(1,1,1),STAT=ierr)
5871  if (ierr.ne.0) then
5872  CALL wrf_error_fatal ( &
5873 'frame/module_domain.f: Failed to allocate grid%xb%rh(1,1,1).  ')
5874  endif
5875 ENDIF
5876 IF(.NOT.inter_domain)THEN
5877 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5878 ALLOCATE(grid%xb%es(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5879  if (ierr.ne.0) then
5880  CALL wrf_error_fatal ( &
5881 'frame/module_domain.f: Failed to allocate grid%xb%es(sm31:em31,sm32:em32,sm33:em33). ')
5882  endif
5883 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%es=initial_data_value
5884 ELSE
5885 ALLOCATE(grid%xb%es(1,1,1),STAT=ierr)
5886  if (ierr.ne.0) then
5887  CALL wrf_error_fatal ( &
5888 'frame/module_domain.f: Failed to allocate grid%xb%es(1,1,1).  ')
5889  endif
5890 ENDIF
5891 IF(.NOT.inter_domain)THEN
5892 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5893 ALLOCATE(grid%xb%qs(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5894  if (ierr.ne.0) then
5895  CALL wrf_error_fatal ( &
5896 'frame/module_domain.f: Failed to allocate grid%xb%qs(sm31:em31,sm32:em32,sm33:em33). ')
5897  endif
5898 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%qs=initial_data_value
5899 ELSE
5900 ALLOCATE(grid%xb%qs(1,1,1),STAT=ierr)
5901  if (ierr.ne.0) then
5902  CALL wrf_error_fatal ( &
5903 'frame/module_domain.f: Failed to allocate grid%xb%qs(1,1,1).  ')
5904  endif
5905 ENDIF
5906 IF(.NOT.inter_domain)THEN
5907 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5908 ALLOCATE(grid%xb%td(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5909  if (ierr.ne.0) then
5910  CALL wrf_error_fatal ( &
5911 'frame/module_domain.f: Failed to allocate grid%xb%td(sm31:em31,sm32:em32,sm33:em33). ')
5912  endif
5913 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%td=initial_data_value
5914 ELSE
5915 ALLOCATE(grid%xb%td(1,1,1),STAT=ierr)
5916  if (ierr.ne.0) then
5917  CALL wrf_error_fatal ( &
5918 'frame/module_domain.f: Failed to allocate grid%xb%td(1,1,1).  ')
5919  endif
5920 ENDIF
5921 IF(.NOT.inter_domain)THEN
5922 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5923 ALLOCATE(grid%xb%vertical_inner_product(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5924  if (ierr.ne.0) then
5925  CALL wrf_error_fatal ( &
5926 'frame/module_domain.f: Failed to allocate grid%xb%vertical_inner_product(sm31:em31,sm32:em32,sm33:em33). ')
5927  endif
5928 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%vertical_inner_product=initial_data_value
5929 ELSE
5930 ALLOCATE(grid%xb%vertical_inner_product(1,1,1),STAT=ierr)
5931  if (ierr.ne.0) then
5932  CALL wrf_error_fatal ( &
5933 'frame/module_domain.f: Failed to allocate grid%xb%vertical_inner_product(1,1,1).  ')
5934  endif
5935 ENDIF
5936 IF(.NOT.inter_domain)THEN
5937 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
5938 ALLOCATE(grid%xb%ref(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
5939  if (ierr.ne.0) then
5940  CALL wrf_error_fatal ( &
5941 'frame/module_domain.f: Failed to allocate grid%xb%ref(sm31:em31,sm32:em32,sm33:em33). ')
5942  endif
5943 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%ref=initial_data_value
5944 ELSE
5945 ALLOCATE(grid%xb%ref(1,1,1),STAT=ierr)
5946  if (ierr.ne.0) then
5947  CALL wrf_error_fatal ( &
5948 'frame/module_domain.f: Failed to allocate grid%xb%ref(1,1,1).  ')
5949  endif
5950 ENDIF
5951 IF(.NOT.inter_domain)THEN
5952 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
5953 ALLOCATE(grid%xb%rough(sm31:em31,sm32:em32),STAT=ierr)
5954  if (ierr.ne.0) then
5955  CALL wrf_error_fatal ( &
5956 'frame/module_domain.f: Failed to allocate grid%xb%rough(sm31:em31,sm32:em32). ')
5957  endif
5958 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%rough=initial_data_value
5959 ELSE
5960 ALLOCATE(grid%xb%rough(1,1),STAT=ierr)
5961  if (ierr.ne.0) then
5962  CALL wrf_error_fatal ( &
5963 'frame/module_domain.f: Failed to allocate grid%xb%rough(1,1).  ')
5964  endif
5965 ENDIF
5966 IF(.NOT.inter_domain)THEN
5967 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
5968 ALLOCATE(grid%xb%tpw(sm31:em31,sm32:em32),STAT=ierr)
5969  if (ierr.ne.0) then
5970  CALL wrf_error_fatal ( &
5971 'frame/module_domain.f: Failed to allocate grid%xb%tpw(sm31:em31,sm32:em32). ')
5972  endif
5973 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tpw=initial_data_value
5974 ELSE
5975 ALLOCATE(grid%xb%tpw(1,1),STAT=ierr)
5976  if (ierr.ne.0) then
5977  CALL wrf_error_fatal ( &
5978 'frame/module_domain.f: Failed to allocate grid%xb%tpw(1,1).  ')
5979  endif
5980 ENDIF
5981 IF(.NOT.inter_domain)THEN
5982 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
5983 ALLOCATE(grid%xb%slp(sm31:em31,sm32:em32),STAT=ierr)
5984  if (ierr.ne.0) then
5985  CALL wrf_error_fatal ( &
5986 'frame/module_domain.f: Failed to allocate grid%xb%slp(sm31:em31,sm32:em32). ')
5987  endif
5988 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%slp=initial_data_value
5989 ELSE
5990 ALLOCATE(grid%xb%slp(1,1),STAT=ierr)
5991  if (ierr.ne.0) then
5992  CALL wrf_error_fatal ( &
5993 'frame/module_domain.f: Failed to allocate grid%xb%slp(1,1).  ')
5994  endif
5995 ENDIF
5996 IF(.NOT.inter_domain)THEN
5997 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
5998 ALLOCATE(grid%xb%speed(sm31:em31,sm32:em32),STAT=ierr)
5999  if (ierr.ne.0) then
6000  CALL wrf_error_fatal ( &
6001 'frame/module_domain.f: Failed to allocate grid%xb%speed(sm31:em31,sm32:em32). ')
6002  endif
6003 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%speed=initial_data_value
6004 ELSE
6005 ALLOCATE(grid%xb%speed(1,1),STAT=ierr)
6006  if (ierr.ne.0) then
6007  CALL wrf_error_fatal ( &
6008 'frame/module_domain.f: Failed to allocate grid%xb%speed(1,1).  ')
6009  endif
6010 ENDIF
6011 IF(.NOT.inter_domain)THEN
6012 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6013 ALLOCATE(grid%xb%tb19v(sm31:em31,sm32:em32),STAT=ierr)
6014  if (ierr.ne.0) then
6015  CALL wrf_error_fatal ( &
6016 'frame/module_domain.f: Failed to allocate grid%xb%tb19v(sm31:em31,sm32:em32). ')
6017  endif
6018 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tb19v=initial_data_value
6019 ELSE
6020 ALLOCATE(grid%xb%tb19v(1,1),STAT=ierr)
6021  if (ierr.ne.0) then
6022  CALL wrf_error_fatal ( &
6023 'frame/module_domain.f: Failed to allocate grid%xb%tb19v(1,1).  ')
6024  endif
6025 ENDIF
6026 IF(.NOT.inter_domain)THEN
6027 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6028 ALLOCATE(grid%xb%tb19h(sm31:em31,sm32:em32),STAT=ierr)
6029  if (ierr.ne.0) then
6030  CALL wrf_error_fatal ( &
6031 'frame/module_domain.f: Failed to allocate grid%xb%tb19h(sm31:em31,sm32:em32). ')
6032  endif
6033 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tb19h=initial_data_value
6034 ELSE
6035 ALLOCATE(grid%xb%tb19h(1,1),STAT=ierr)
6036  if (ierr.ne.0) then
6037  CALL wrf_error_fatal ( &
6038 'frame/module_domain.f: Failed to allocate grid%xb%tb19h(1,1).  ')
6039  endif
6040 ENDIF
6041 IF(.NOT.inter_domain)THEN
6042 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6043 ALLOCATE(grid%xb%tb22v(sm31:em31,sm32:em32),STAT=ierr)
6044  if (ierr.ne.0) then
6045  CALL wrf_error_fatal ( &
6046 'frame/module_domain.f: Failed to allocate grid%xb%tb22v(sm31:em31,sm32:em32). ')
6047  endif
6048 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tb22v=initial_data_value
6049 ELSE
6050 ALLOCATE(grid%xb%tb22v(1,1),STAT=ierr)
6051  if (ierr.ne.0) then
6052  CALL wrf_error_fatal ( &
6053 'frame/module_domain.f: Failed to allocate grid%xb%tb22v(1,1).  ')
6054  endif
6055 ENDIF
6056 IF(.NOT.inter_domain)THEN
6057 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6058 ALLOCATE(grid%xb%tb37v(sm31:em31,sm32:em32),STAT=ierr)
6059  if (ierr.ne.0) then
6060  CALL wrf_error_fatal ( &
6061 'frame/module_domain.f: Failed to allocate grid%xb%tb37v(sm31:em31,sm32:em32). ')
6062  endif
6063 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tb37v=initial_data_value
6064 ELSE
6065 ALLOCATE(grid%xb%tb37v(1,1),STAT=ierr)
6066  if (ierr.ne.0) then
6067  CALL wrf_error_fatal ( &
6068 'frame/module_domain.f: Failed to allocate grid%xb%tb37v(1,1).  ')
6069  endif
6070 ENDIF
6071 IF(.NOT.inter_domain)THEN
6072 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6073 ALLOCATE(grid%xb%tb37h(sm31:em31,sm32:em32),STAT=ierr)
6074  if (ierr.ne.0) then
6075  CALL wrf_error_fatal ( &
6076 'frame/module_domain.f: Failed to allocate grid%xb%tb37h(sm31:em31,sm32:em32). ')
6077  endif
6078 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tb37h=initial_data_value
6079 ELSE
6080 ALLOCATE(grid%xb%tb37h(1,1),STAT=ierr)
6081  if (ierr.ne.0) then
6082  CALL wrf_error_fatal ( &
6083 'frame/module_domain.f: Failed to allocate grid%xb%tb37h(1,1).  ')
6084  endif
6085 ENDIF
6086 IF(.NOT.inter_domain)THEN
6087 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6088 ALLOCATE(grid%xb%tb85v(sm31:em31,sm32:em32),STAT=ierr)
6089  if (ierr.ne.0) then
6090  CALL wrf_error_fatal ( &
6091 'frame/module_domain.f: Failed to allocate grid%xb%tb85v(sm31:em31,sm32:em32). ')
6092  endif
6093 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tb85v=initial_data_value
6094 ELSE
6095 ALLOCATE(grid%xb%tb85v(1,1),STAT=ierr)
6096  if (ierr.ne.0) then
6097  CALL wrf_error_fatal ( &
6098 'frame/module_domain.f: Failed to allocate grid%xb%tb85v(1,1).  ')
6099  endif
6100 ENDIF
6101 IF(.NOT.inter_domain)THEN
6102 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6103 ALLOCATE(grid%xb%tb85h(sm31:em31,sm32:em32),STAT=ierr)
6104  if (ierr.ne.0) then
6105  CALL wrf_error_fatal ( &
6106 'frame/module_domain.f: Failed to allocate grid%xb%tb85h(sm31:em31,sm32:em32). ')
6107  endif
6108 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tb85h=initial_data_value
6109 ELSE
6110 ALLOCATE(grid%xb%tb85h(1,1),STAT=ierr)
6111  if (ierr.ne.0) then
6112  CALL wrf_error_fatal ( &
6113 'frame/module_domain.f: Failed to allocate grid%xb%tb85h(1,1).  ')
6114  endif
6115 ENDIF
6116 IF(.NOT.inter_domain)THEN
6117 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6118 ALLOCATE(grid%xb%cori(sm31:em31,sm32:em32),STAT=ierr)
6119  if (ierr.ne.0) then
6120  CALL wrf_error_fatal ( &
6121 'frame/module_domain.f: Failed to allocate grid%xb%cori(sm31:em31,sm32:em32). ')
6122  endif
6123 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%cori=initial_data_value
6124 ELSE
6125 ALLOCATE(grid%xb%cori(1,1),STAT=ierr)
6126  if (ierr.ne.0) then
6127  CALL wrf_error_fatal ( &
6128 'frame/module_domain.f: Failed to allocate grid%xb%cori(1,1).  ')
6129  endif
6130 ENDIF
6131 IF(.NOT.inter_domain)THEN
6132 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6133 ALLOCATE(grid%xb%tgrn(sm31:em31,sm32:em32),STAT=ierr)
6134  if (ierr.ne.0) then
6135  CALL wrf_error_fatal ( &
6136 'frame/module_domain.f: Failed to allocate grid%xb%tgrn(sm31:em31,sm32:em32). ')
6137  endif
6138 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tgrn=initial_data_value
6139 ELSE
6140 ALLOCATE(grid%xb%tgrn(1,1),STAT=ierr)
6141  if (ierr.ne.0) then
6142  CALL wrf_error_fatal ( &
6143 'frame/module_domain.f: Failed to allocate grid%xb%tgrn(1,1).  ')
6144  endif
6145 ENDIF
6146 IF(.NOT.inter_domain)THEN
6147 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6148 ALLOCATE(grid%xb%lat(sm31:em31,sm32:em32),STAT=ierr)
6149  if (ierr.ne.0) then
6150  CALL wrf_error_fatal ( &
6151 'frame/module_domain.f: Failed to allocate grid%xb%lat(sm31:em31,sm32:em32). ')
6152  endif
6153 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%lat=initial_data_value
6154 ELSE
6155 ALLOCATE(grid%xb%lat(1,1),STAT=ierr)
6156  if (ierr.ne.0) then
6157  CALL wrf_error_fatal ( &
6158 'frame/module_domain.f: Failed to allocate grid%xb%lat(1,1).  ')
6159  endif
6160 ENDIF
6161 IF(.NOT.inter_domain)THEN
6162 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6163 ALLOCATE(grid%xb%lon(sm31:em31,sm32:em32),STAT=ierr)
6164  if (ierr.ne.0) then
6165  CALL wrf_error_fatal ( &
6166 'frame/module_domain.f: Failed to allocate grid%xb%lon(sm31:em31,sm32:em32). ')
6167  endif
6168 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%lon=initial_data_value
6169 ELSE
6170 ALLOCATE(grid%xb%lon(1,1),STAT=ierr)
6171  if (ierr.ne.0) then
6172  CALL wrf_error_fatal ( &
6173 'frame/module_domain.f: Failed to allocate grid%xb%lon(1,1).  ')
6174  endif
6175 ENDIF
6176 IF(.NOT.inter_domain)THEN
6177 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6178 ALLOCATE(grid%xb%terr(sm31:em31,sm32:em32),STAT=ierr)
6179  if (ierr.ne.0) then
6180  CALL wrf_error_fatal ( &
6181 'frame/module_domain.f: Failed to allocate grid%xb%terr(sm31:em31,sm32:em32). ')
6182  endif
6183 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%terr=initial_data_value
6184 ELSE
6185 ALLOCATE(grid%xb%terr(1,1),STAT=ierr)
6186  if (ierr.ne.0) then
6187  CALL wrf_error_fatal ( &
6188 'frame/module_domain.f: Failed to allocate grid%xb%terr(1,1).  ')
6189  endif
6190 ENDIF
6191 IF(.NOT.inter_domain)THEN
6192 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6193 ALLOCATE(grid%xb%psac(sm31:em31,sm32:em32),STAT=ierr)
6194  if (ierr.ne.0) then
6195  CALL wrf_error_fatal ( &
6196 'frame/module_domain.f: Failed to allocate grid%xb%psac(sm31:em31,sm32:em32). ')
6197  endif
6198 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%psac=initial_data_value
6199 ELSE
6200 ALLOCATE(grid%xb%psac(1,1),STAT=ierr)
6201  if (ierr.ne.0) then
6202  CALL wrf_error_fatal ( &
6203 'frame/module_domain.f: Failed to allocate grid%xb%psac(1,1).  ')
6204  endif
6205 ENDIF
6206 IF(.NOT.inter_domain)THEN
6207 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6208 ALLOCATE(grid%xb%lanu(sm31:em31,sm32:em32),STAT=ierr)
6209  if (ierr.ne.0) then
6210  CALL wrf_error_fatal ( &
6211 'frame/module_domain.f: Failed to allocate grid%xb%lanu(sm31:em31,sm32:em32). ')
6212  endif
6213 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%lanu=initial_data_value
6214 ELSE
6215 ALLOCATE(grid%xb%lanu(1,1),STAT=ierr)
6216  if (ierr.ne.0) then
6217  CALL wrf_error_fatal ( &
6218 'frame/module_domain.f: Failed to allocate grid%xb%lanu(1,1).  ')
6219  endif
6220 ENDIF
6221 IF(.NOT.inter_domain)THEN
6222 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6223 ALLOCATE(grid%xb%snow(sm31:em31,sm32:em32),STAT=ierr)
6224  if (ierr.ne.0) then
6225  CALL wrf_error_fatal ( &
6226 'frame/module_domain.f: Failed to allocate grid%xb%snow(sm31:em31,sm32:em32). ')
6227  endif
6228 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%snow=initial_data_value
6229 ELSE
6230 ALLOCATE(grid%xb%snow(1,1),STAT=ierr)
6231  if (ierr.ne.0) then
6232  CALL wrf_error_fatal ( &
6233 'frame/module_domain.f: Failed to allocate grid%xb%snow(1,1).  ')
6234  endif
6235 ENDIF
6236 IF(.NOT.inter_domain)THEN
6237 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6238 ALLOCATE(grid%xb%xland(sm31:em31,sm32:em32),STAT=ierr)
6239  if (ierr.ne.0) then
6240  CALL wrf_error_fatal ( &
6241 'frame/module_domain.f: Failed to allocate grid%xb%xland(sm31:em31,sm32:em32). ')
6242  endif
6243 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%xland=initial_data_value
6244 ELSE
6245 ALLOCATE(grid%xb%xland(1,1),STAT=ierr)
6246  if (ierr.ne.0) then
6247  CALL wrf_error_fatal ( &
6248 'frame/module_domain.f: Failed to allocate grid%xb%xland(1,1).  ')
6249  endif
6250 ENDIF
6251 IF(.NOT.inter_domain)THEN
6252 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6253 ALLOCATE(grid%xb%landmask(sm31:em31,sm32:em32),STAT=ierr)
6254  if (ierr.ne.0) then
6255  CALL wrf_error_fatal ( &
6256 'frame/module_domain.f: Failed to allocate grid%xb%landmask(sm31:em31,sm32:em32). ')
6257  endif
6258 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%landmask=initial_data_value
6259 ELSE
6260 ALLOCATE(grid%xb%landmask(1,1),STAT=ierr)
6261  if (ierr.ne.0) then
6262  CALL wrf_error_fatal ( &
6263 'frame/module_domain.f: Failed to allocate grid%xb%landmask(1,1).  ')
6264  endif
6265 ENDIF
6266 IF(.NOT.inter_domain)THEN
6267 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6268 ALLOCATE(grid%xb%u10(sm31:em31,sm32:em32),STAT=ierr)
6269  if (ierr.ne.0) then
6270  CALL wrf_error_fatal ( &
6271 'frame/module_domain.f: Failed to allocate grid%xb%u10(sm31:em31,sm32:em32). ')
6272  endif
6273 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%u10=initial_data_value
6274 ELSE
6275 ALLOCATE(grid%xb%u10(1,1),STAT=ierr)
6276  if (ierr.ne.0) then
6277  CALL wrf_error_fatal ( &
6278 'frame/module_domain.f: Failed to allocate grid%xb%u10(1,1).  ')
6279  endif
6280 ENDIF
6281 IF(.NOT.inter_domain)THEN
6282 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6283 ALLOCATE(grid%xb%v10(sm31:em31,sm32:em32),STAT=ierr)
6284  if (ierr.ne.0) then
6285  CALL wrf_error_fatal ( &
6286 'frame/module_domain.f: Failed to allocate grid%xb%v10(sm31:em31,sm32:em32). ')
6287  endif
6288 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%v10=initial_data_value
6289 ELSE
6290 ALLOCATE(grid%xb%v10(1,1),STAT=ierr)
6291  if (ierr.ne.0) then
6292  CALL wrf_error_fatal ( &
6293 'frame/module_domain.f: Failed to allocate grid%xb%v10(1,1).  ')
6294  endif
6295 ENDIF
6296 IF(.NOT.inter_domain)THEN
6297 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6298 ALLOCATE(grid%xb%t2(sm31:em31,sm32:em32),STAT=ierr)
6299  if (ierr.ne.0) then
6300  CALL wrf_error_fatal ( &
6301 'frame/module_domain.f: Failed to allocate grid%xb%t2(sm31:em31,sm32:em32). ')
6302  endif
6303 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%t2=initial_data_value
6304 ELSE
6305 ALLOCATE(grid%xb%t2(1,1),STAT=ierr)
6306  if (ierr.ne.0) then
6307  CALL wrf_error_fatal ( &
6308 'frame/module_domain.f: Failed to allocate grid%xb%t2(1,1).  ')
6309  endif
6310 ENDIF
6311 IF(.NOT.inter_domain)THEN
6312 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6313 ALLOCATE(grid%xb%q2(sm31:em31,sm32:em32),STAT=ierr)
6314  if (ierr.ne.0) then
6315  CALL wrf_error_fatal ( &
6316 'frame/module_domain.f: Failed to allocate grid%xb%q2(sm31:em31,sm32:em32). ')
6317  endif
6318 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%q2=initial_data_value
6319 ELSE
6320 ALLOCATE(grid%xb%q2(1,1),STAT=ierr)
6321  if (ierr.ne.0) then
6322  CALL wrf_error_fatal ( &
6323 'frame/module_domain.f: Failed to allocate grid%xb%q2(1,1).  ')
6324  endif
6325 ENDIF
6326 IF(.NOT.inter_domain)THEN
6327 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6328 ALLOCATE(grid%xb%psfc(sm31:em31,sm32:em32),STAT=ierr)
6329  if (ierr.ne.0) then
6330  CALL wrf_error_fatal ( &
6331 'frame/module_domain.f: Failed to allocate grid%xb%psfc(sm31:em31,sm32:em32). ')
6332  endif
6333 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%psfc=initial_data_value
6334 ELSE
6335 ALLOCATE(grid%xb%psfc(1,1),STAT=ierr)
6336  if (ierr.ne.0) then
6337  CALL wrf_error_fatal ( &
6338 'frame/module_domain.f: Failed to allocate grid%xb%psfc(1,1).  ')
6339  endif
6340 ENDIF
6341 IF(.NOT.inter_domain)THEN
6342 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6343 ALLOCATE(grid%xb%tsk(sm31:em31,sm32:em32),STAT=ierr)
6344  if (ierr.ne.0) then
6345  CALL wrf_error_fatal ( &
6346 'frame/module_domain.f: Failed to allocate grid%xb%tsk(sm31:em31,sm32:em32). ')
6347  endif
6348 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tsk=initial_data_value
6349 ELSE
6350 ALLOCATE(grid%xb%tsk(1,1),STAT=ierr)
6351  if (ierr.ne.0) then
6352  CALL wrf_error_fatal ( &
6353 'frame/module_domain.f: Failed to allocate grid%xb%tsk(1,1).  ')
6354  endif
6355 ENDIF
6356 IF(.NOT.inter_domain)THEN
6357 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6358 ALLOCATE(grid%xb%smois(sm31:em31,sm32:em32),STAT=ierr)
6359  if (ierr.ne.0) then
6360  CALL wrf_error_fatal ( &
6361 'frame/module_domain.f: Failed to allocate grid%xb%smois(sm31:em31,sm32:em32). ')
6362  endif
6363 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%smois=initial_data_value
6364 ELSE
6365 ALLOCATE(grid%xb%smois(1,1),STAT=ierr)
6366  if (ierr.ne.0) then
6367  CALL wrf_error_fatal ( &
6368 'frame/module_domain.f: Failed to allocate grid%xb%smois(1,1).  ')
6369  endif
6370 ENDIF
6371 IF(.NOT.inter_domain)THEN
6372 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6373 ALLOCATE(grid%xb%tslb(sm31:em31,sm32:em32),STAT=ierr)
6374  if (ierr.ne.0) then
6375  CALL wrf_error_fatal ( &
6376 'frame/module_domain.f: Failed to allocate grid%xb%tslb(sm31:em31,sm32:em32). ')
6377  endif
6378 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%tslb=initial_data_value
6379 ELSE
6380 ALLOCATE(grid%xb%tslb(1,1),STAT=ierr)
6381  if (ierr.ne.0) then
6382  CALL wrf_error_fatal ( &
6383 'frame/module_domain.f: Failed to allocate grid%xb%tslb(1,1).  ')
6384  endif
6385 ENDIF
6386 IF(.NOT.inter_domain)THEN
6387 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6388 ALLOCATE(grid%xb%xice(sm31:em31,sm32:em32),STAT=ierr)
6389  if (ierr.ne.0) then
6390  CALL wrf_error_fatal ( &
6391 'frame/module_domain.f: Failed to allocate grid%xb%xice(sm31:em31,sm32:em32). ')
6392  endif
6393 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%xice=initial_data_value
6394 ELSE
6395 ALLOCATE(grid%xb%xice(1,1),STAT=ierr)
6396  if (ierr.ne.0) then
6397  CALL wrf_error_fatal ( &
6398 'frame/module_domain.f: Failed to allocate grid%xb%xice(1,1).  ')
6399  endif
6400 ENDIF
6401 IF(.NOT.inter_domain)THEN
6402 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
6403 ALLOCATE(grid%xb%ivgtyp(sm31:em31,sm32:em32),STAT=ierr)
6404  if (ierr.ne.0) then
6405  CALL wrf_error_fatal ( &
6406 'frame/module_domain.f: Failed to allocate grid%xb%ivgtyp(sm31:em31,sm32:em32). ')
6407  endif
6408 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%ivgtyp=0
6409 ELSE
6410 ALLOCATE(grid%xb%ivgtyp(1,1),STAT=ierr)
6411  if (ierr.ne.0) then
6412  CALL wrf_error_fatal ( &
6413 'frame/module_domain.f: Failed to allocate grid%xb%ivgtyp(1,1).  ')
6414  endif
6415 ENDIF
6416 IF(.NOT.inter_domain)THEN
6417 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * IWORDSIZE
6418 ALLOCATE(grid%xb%isltyp(sm31:em31,sm32:em32),STAT=ierr)
6419  if (ierr.ne.0) then
6420  CALL wrf_error_fatal ( &
6421 'frame/module_domain.f: Failed to allocate grid%xb%isltyp(sm31:em31,sm32:em32). ')
6422  endif
6423 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%isltyp=0
6424 ELSE
6425 ALLOCATE(grid%xb%isltyp(1,1),STAT=ierr)
6426  if (ierr.ne.0) then
6427  CALL wrf_error_fatal ( &
6428 'frame/module_domain.f: Failed to allocate grid%xb%isltyp(1,1).  ')
6429  endif
6430 ENDIF
6431 IF(.NOT.inter_domain)THEN
6432 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6433 ALLOCATE(grid%xb%vegfra(sm31:em31,sm32:em32),STAT=ierr)
6434  if (ierr.ne.0) then
6435  CALL wrf_error_fatal ( &
6436 'frame/module_domain.f: Failed to allocate grid%xb%vegfra(sm31:em31,sm32:em32). ')
6437  endif
6438 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%vegfra=initial_data_value
6439 ELSE
6440 ALLOCATE(grid%xb%vegfra(1,1),STAT=ierr)
6441  if (ierr.ne.0) then
6442  CALL wrf_error_fatal ( &
6443 'frame/module_domain.f: Failed to allocate grid%xb%vegfra(1,1).  ')
6444  endif
6445 ENDIF
6446 IF(.NOT.inter_domain)THEN
6447 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6448 ALLOCATE(grid%xb%snowh(sm31:em31,sm32:em32),STAT=ierr)
6449  if (ierr.ne.0) then
6450  CALL wrf_error_fatal ( &
6451 'frame/module_domain.f: Failed to allocate grid%xb%snowh(sm31:em31,sm32:em32). ')
6452  endif
6453 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%snowh=initial_data_value
6454 ELSE
6455 ALLOCATE(grid%xb%snowh(1,1),STAT=ierr)
6456  if (ierr.ne.0) then
6457  CALL wrf_error_fatal ( &
6458 'frame/module_domain.f: Failed to allocate grid%xb%snowh(1,1).  ')
6459  endif
6460 ENDIF
6461 IF(.NOT.inter_domain)THEN
6462 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6463 ALLOCATE(grid%xb%regime(sm31:em31,sm32:em32),STAT=ierr)
6464  if (ierr.ne.0) then
6465  CALL wrf_error_fatal ( &
6466 'frame/module_domain.f: Failed to allocate grid%xb%regime(sm31:em31,sm32:em32). ')
6467  endif
6468 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%regime=initial_data_value
6469 ELSE
6470 ALLOCATE(grid%xb%regime(1,1),STAT=ierr)
6471  if (ierr.ne.0) then
6472  CALL wrf_error_fatal ( &
6473 'frame/module_domain.f: Failed to allocate grid%xb%regime(1,1).  ')
6474  endif
6475 ENDIF
6476 IF(.NOT.inter_domain)THEN
6477 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
6478 ALLOCATE(grid%xb%znu(sm33:em33),STAT=ierr)
6479  if (ierr.ne.0) then
6480  CALL wrf_error_fatal ( &
6481 'frame/module_domain.f: Failed to allocate grid%xb%znu(sm33:em33). ')
6482  endif
6483 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%znu=initial_data_value
6484 ELSE
6485 ALLOCATE(grid%xb%znu(1),STAT=ierr)
6486  if (ierr.ne.0) then
6487  CALL wrf_error_fatal ( &
6488 'frame/module_domain.f: Failed to allocate grid%xb%znu(1).  ')
6489  endif
6490 ENDIF
6491 IF(.NOT.inter_domain)THEN
6492 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
6493 ALLOCATE(grid%xb%znw(sm33:em33),STAT=ierr)
6494  if (ierr.ne.0) then
6495  CALL wrf_error_fatal ( &
6496 'frame/module_domain.f: Failed to allocate grid%xb%znw(sm33:em33). ')
6497  endif
6498 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%znw=initial_data_value
6499 ELSE
6500 ALLOCATE(grid%xb%znw(1),STAT=ierr)
6501  if (ierr.ne.0) then
6502  CALL wrf_error_fatal ( &
6503 'frame/module_domain.f: Failed to allocate grid%xb%znw(1).  ')
6504  endif
6505 ENDIF
6506 IF(.NOT.inter_domain)THEN
6507 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
6508 ALLOCATE(grid%xb%dn(sm33:em33),STAT=ierr)
6509  if (ierr.ne.0) then
6510  CALL wrf_error_fatal ( &
6511 'frame/module_domain.f: Failed to allocate grid%xb%dn(sm33:em33). ')
6512  endif
6513 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%dn=initial_data_value
6514 ELSE
6515 ALLOCATE(grid%xb%dn(1),STAT=ierr)
6516  if (ierr.ne.0) then
6517  CALL wrf_error_fatal ( &
6518 'frame/module_domain.f: Failed to allocate grid%xb%dn(1).  ')
6519  endif
6520 ENDIF
6521 IF(.NOT.inter_domain)THEN
6522 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
6523 ALLOCATE(grid%xb%dnw(sm33:em33),STAT=ierr)
6524  if (ierr.ne.0) then
6525  CALL wrf_error_fatal ( &
6526 'frame/module_domain.f: Failed to allocate grid%xb%dnw(sm33:em33). ')
6527  endif
6528 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%dnw=initial_data_value
6529 ELSE
6530 ALLOCATE(grid%xb%dnw(1),STAT=ierr)
6531  if (ierr.ne.0) then
6532  CALL wrf_error_fatal ( &
6533 'frame/module_domain.f: Failed to allocate grid%xb%dnw(1).  ')
6534  endif
6535 ENDIF
6536 IF(.NOT.inter_domain)THEN
6537 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
6538 ALLOCATE(grid%xb%sigmah(sm33:em33),STAT=ierr)
6539  if (ierr.ne.0) then
6540  CALL wrf_error_fatal ( &
6541 'frame/module_domain.f: Failed to allocate grid%xb%sigmah(sm33:em33). ')
6542  endif
6543 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%sigmah=initial_data_value
6544 ELSE
6545 ALLOCATE(grid%xb%sigmah(1),STAT=ierr)
6546  if (ierr.ne.0) then
6547  CALL wrf_error_fatal ( &
6548 'frame/module_domain.f: Failed to allocate grid%xb%sigmah(1).  ')
6549  endif
6550 ENDIF
6551 IF(.NOT.inter_domain)THEN
6552 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
6553 ALLOCATE(grid%xb%sigmaf(sm33:em33),STAT=ierr)
6554  if (ierr.ne.0) then
6555  CALL wrf_error_fatal ( &
6556 'frame/module_domain.f: Failed to allocate grid%xb%sigmaf(sm33:em33). ')
6557  endif
6558 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%sigmaf=initial_data_value
6559 ELSE
6560 ALLOCATE(grid%xb%sigmaf(1),STAT=ierr)
6561  if (ierr.ne.0) then
6562  CALL wrf_error_fatal ( &
6563 'frame/module_domain.f: Failed to allocate grid%xb%sigmaf(1).  ')
6564  endif
6565 ENDIF
6566 IF(.NOT.inter_domain)THEN
6567 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6568 ALLOCATE(grid%xb%coefx(sm31:em31,sm32:em32),STAT=ierr)
6569  if (ierr.ne.0) then
6570  CALL wrf_error_fatal ( &
6571 'frame/module_domain.f: Failed to allocate grid%xb%coefx(sm31:em31,sm32:em32). ')
6572  endif
6573 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%coefx=initial_data_value
6574 ELSE
6575 ALLOCATE(grid%xb%coefx(1,1),STAT=ierr)
6576  if (ierr.ne.0) then
6577  CALL wrf_error_fatal ( &
6578 'frame/module_domain.f: Failed to allocate grid%xb%coefx(1,1).  ')
6579  endif
6580 ENDIF
6581 IF(.NOT.inter_domain)THEN
6582 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6583 ALLOCATE(grid%xb%coefy(sm31:em31,sm32:em32),STAT=ierr)
6584  if (ierr.ne.0) then
6585  CALL wrf_error_fatal ( &
6586 'frame/module_domain.f: Failed to allocate grid%xb%coefy(sm31:em31,sm32:em32). ')
6587  endif
6588 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%coefy=initial_data_value
6589 ELSE
6590 ALLOCATE(grid%xb%coefy(1,1),STAT=ierr)
6591  if (ierr.ne.0) then
6592  CALL wrf_error_fatal ( &
6593 'frame/module_domain.f: Failed to allocate grid%xb%coefy(1,1).  ')
6594  endif
6595 ENDIF
6596 IF(.NOT.inter_domain)THEN
6597 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6598 ALLOCATE(grid%xb%coefz(sm31:em31,sm32:em32),STAT=ierr)
6599  if (ierr.ne.0) then
6600  CALL wrf_error_fatal ( &
6601 'frame/module_domain.f: Failed to allocate grid%xb%coefz(sm31:em31,sm32:em32). ')
6602  endif
6603 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%coefz=initial_data_value
6604 ELSE
6605 ALLOCATE(grid%xb%coefz(1,1),STAT=ierr)
6606  if (ierr.ne.0) then
6607  CALL wrf_error_fatal ( &
6608 'frame/module_domain.f: Failed to allocate grid%xb%coefz(1,1).  ')
6609  endif
6610 ENDIF
6611 IF(.NOT.inter_domain)THEN
6612 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
6613 ALLOCATE(grid%xb%kma_a(sm33:em33),STAT=ierr)
6614  if (ierr.ne.0) then
6615  CALL wrf_error_fatal ( &
6616 'frame/module_domain.f: Failed to allocate grid%xb%kma_a(sm33:em33). ')
6617  endif
6618 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%kma_a=initial_data_value
6619 ELSE
6620 ALLOCATE(grid%xb%kma_a(1),STAT=ierr)
6621  if (ierr.ne.0) then
6622  CALL wrf_error_fatal ( &
6623 'frame/module_domain.f: Failed to allocate grid%xb%kma_a(1).  ')
6624  endif
6625 ENDIF
6626 IF(.NOT.inter_domain)THEN
6627 num_bytes_allocated = num_bytes_allocated + ((((em33)-(sm33)+1))) * RWORDSIZE
6628 ALLOCATE(grid%xb%kma_b(sm33:em33),STAT=ierr)
6629  if (ierr.ne.0) then
6630  CALL wrf_error_fatal ( &
6631 'frame/module_domain.f: Failed to allocate grid%xb%kma_b(sm33:em33). ')
6632  endif
6633 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xb%kma_b=initial_data_value
6634 ELSE
6635 ALLOCATE(grid%xb%kma_b(1),STAT=ierr)
6636  if (ierr.ne.0) then
6637  CALL wrf_error_fatal ( &
6638 'frame/module_domain.f: Failed to allocate grid%xb%kma_b(1).  ')
6639  endif
6640 ENDIF
6641 IF(.NOT.inter_domain)THEN
6642 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6643 ALLOCATE(grid%xa%u(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6644  if (ierr.ne.0) then
6645  CALL wrf_error_fatal ( &
6646 'frame/module_domain.f: Failed to allocate grid%xa%u(sm31:em31,sm32:em32,sm33:em33). ')
6647  endif
6648 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%u=initial_data_value
6649 ELSE
6650 ALLOCATE(grid%xa%u(1,1,1),STAT=ierr)
6651  if (ierr.ne.0) then
6652  CALL wrf_error_fatal ( &
6653 'frame/module_domain.f: Failed to allocate grid%xa%u(1,1,1).  ')
6654  endif
6655 ENDIF
6656 IF(.NOT.inter_domain)THEN
6657 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6658 ALLOCATE(grid%xa%v(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6659  if (ierr.ne.0) then
6660  CALL wrf_error_fatal ( &
6661 'frame/module_domain.f: Failed to allocate grid%xa%v(sm31:em31,sm32:em32,sm33:em33). ')
6662  endif
6663 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%v=initial_data_value
6664 ELSE
6665 ALLOCATE(grid%xa%v(1,1,1),STAT=ierr)
6666  if (ierr.ne.0) then
6667  CALL wrf_error_fatal ( &
6668 'frame/module_domain.f: Failed to allocate grid%xa%v(1,1,1).  ')
6669  endif
6670 ENDIF
6671 IF(.NOT.inter_domain)THEN
6672 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6673 ALLOCATE(grid%xa%w(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6674  if (ierr.ne.0) then
6675  CALL wrf_error_fatal ( &
6676 'frame/module_domain.f: Failed to allocate grid%xa%w(sm31:em31,sm32:em32,sm33:em33). ')
6677  endif
6678 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%w=initial_data_value
6679 ELSE
6680 ALLOCATE(grid%xa%w(1,1,1),STAT=ierr)
6681  if (ierr.ne.0) then
6682  CALL wrf_error_fatal ( &
6683 'frame/module_domain.f: Failed to allocate grid%xa%w(1,1,1).  ')
6684  endif
6685 ENDIF
6686 IF(.NOT.inter_domain)THEN
6687 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6688 ALLOCATE(grid%xa%t(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6689  if (ierr.ne.0) then
6690  CALL wrf_error_fatal ( &
6691 'frame/module_domain.f: Failed to allocate grid%xa%t(sm31:em31,sm32:em32,sm33:em33). ')
6692  endif
6693 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%t=initial_data_value
6694 ELSE
6695 ALLOCATE(grid%xa%t(1,1,1),STAT=ierr)
6696  if (ierr.ne.0) then
6697  CALL wrf_error_fatal ( &
6698 'frame/module_domain.f: Failed to allocate grid%xa%t(1,1,1).  ')
6699  endif
6700 ENDIF
6701 IF(.NOT.inter_domain)THEN
6702 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6703 ALLOCATE(grid%xa%q(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6704  if (ierr.ne.0) then
6705  CALL wrf_error_fatal ( &
6706 'frame/module_domain.f: Failed to allocate grid%xa%q(sm31:em31,sm32:em32,sm33:em33). ')
6707  endif
6708 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%q=initial_data_value
6709 ELSE
6710 ALLOCATE(grid%xa%q(1,1,1),STAT=ierr)
6711  if (ierr.ne.0) then
6712  CALL wrf_error_fatal ( &
6713 'frame/module_domain.f: Failed to allocate grid%xa%q(1,1,1).  ')
6714  endif
6715 ENDIF
6716 IF(.NOT.inter_domain)THEN
6717 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6718 ALLOCATE(grid%xa%p(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6719  if (ierr.ne.0) then
6720  CALL wrf_error_fatal ( &
6721 'frame/module_domain.f: Failed to allocate grid%xa%p(sm31:em31,sm32:em32,sm33:em33). ')
6722  endif
6723 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%p=initial_data_value
6724 ELSE
6725 ALLOCATE(grid%xa%p(1,1,1),STAT=ierr)
6726  if (ierr.ne.0) then
6727  CALL wrf_error_fatal ( &
6728 'frame/module_domain.f: Failed to allocate grid%xa%p(1,1,1).  ')
6729  endif
6730 ENDIF
6731 IF(.NOT.inter_domain)THEN
6732 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6733 ALLOCATE(grid%xa%rh(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6734  if (ierr.ne.0) then
6735  CALL wrf_error_fatal ( &
6736 'frame/module_domain.f: Failed to allocate grid%xa%rh(sm31:em31,sm32:em32,sm33:em33). ')
6737  endif
6738 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%rh=initial_data_value
6739 ELSE
6740 ALLOCATE(grid%xa%rh(1,1,1),STAT=ierr)
6741  if (ierr.ne.0) then
6742  CALL wrf_error_fatal ( &
6743 'frame/module_domain.f: Failed to allocate grid%xa%rh(1,1,1).  ')
6744  endif
6745 ENDIF
6746 IF(.NOT.inter_domain)THEN
6747 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6748 ALLOCATE(grid%xa%rho(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6749  if (ierr.ne.0) then
6750  CALL wrf_error_fatal ( &
6751 'frame/module_domain.f: Failed to allocate grid%xa%rho(sm31:em31,sm32:em32,sm33:em33). ')
6752  endif
6753 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%rho=initial_data_value
6754 ELSE
6755 ALLOCATE(grid%xa%rho(1,1,1),STAT=ierr)
6756  if (ierr.ne.0) then
6757  CALL wrf_error_fatal ( &
6758 'frame/module_domain.f: Failed to allocate grid%xa%rho(1,1,1).  ')
6759  endif
6760 ENDIF
6761 IF(.NOT.inter_domain)THEN
6762 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6763 ALLOCATE(grid%xa%wh(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6764  if (ierr.ne.0) then
6765  CALL wrf_error_fatal ( &
6766 'frame/module_domain.f: Failed to allocate grid%xa%wh(sm31:em31,sm32:em32,sm33:em33). ')
6767  endif
6768 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%wh=initial_data_value
6769 ELSE
6770 ALLOCATE(grid%xa%wh(1,1,1),STAT=ierr)
6771  if (ierr.ne.0) then
6772  CALL wrf_error_fatal ( &
6773 'frame/module_domain.f: Failed to allocate grid%xa%wh(1,1,1).  ')
6774  endif
6775 ENDIF
6776 IF(.NOT.inter_domain)THEN
6777 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6778 ALLOCATE(grid%xa%qrn(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6779  if (ierr.ne.0) then
6780  CALL wrf_error_fatal ( &
6781 'frame/module_domain.f: Failed to allocate grid%xa%qrn(sm31:em31,sm32:em32,sm33:em33). ')
6782  endif
6783 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%qrn=initial_data_value
6784 ELSE
6785 ALLOCATE(grid%xa%qrn(1,1,1),STAT=ierr)
6786  if (ierr.ne.0) then
6787  CALL wrf_error_fatal ( &
6788 'frame/module_domain.f: Failed to allocate grid%xa%qrn(1,1,1).  ')
6789  endif
6790 ENDIF
6791 IF(.NOT.inter_domain)THEN
6792 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6793 ALLOCATE(grid%xa%qcw(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6794  if (ierr.ne.0) then
6795  CALL wrf_error_fatal ( &
6796 'frame/module_domain.f: Failed to allocate grid%xa%qcw(sm31:em31,sm32:em32,sm33:em33). ')
6797  endif
6798 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%qcw=initial_data_value
6799 ELSE
6800 ALLOCATE(grid%xa%qcw(1,1,1),STAT=ierr)
6801  if (ierr.ne.0) then
6802  CALL wrf_error_fatal ( &
6803 'frame/module_domain.f: Failed to allocate grid%xa%qcw(1,1,1).  ')
6804  endif
6805 ENDIF
6806 IF(.NOT.inter_domain)THEN
6807 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6808 ALLOCATE(grid%xa%qci(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6809  if (ierr.ne.0) then
6810  CALL wrf_error_fatal ( &
6811 'frame/module_domain.f: Failed to allocate grid%xa%qci(sm31:em31,sm32:em32,sm33:em33). ')
6812  endif
6813 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%qci=initial_data_value
6814 ELSE
6815 ALLOCATE(grid%xa%qci(1,1,1),STAT=ierr)
6816  if (ierr.ne.0) then
6817  CALL wrf_error_fatal ( &
6818 'frame/module_domain.f: Failed to allocate grid%xa%qci(1,1,1).  ')
6819  endif
6820 ENDIF
6821 IF(.NOT.inter_domain)THEN
6822 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6823 ALLOCATE(grid%xa%qsn(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6824  if (ierr.ne.0) then
6825  CALL wrf_error_fatal ( &
6826 'frame/module_domain.f: Failed to allocate grid%xa%qsn(sm31:em31,sm32:em32,sm33:em33). ')
6827  endif
6828 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%qsn=initial_data_value
6829 ELSE
6830 ALLOCATE(grid%xa%qsn(1,1,1),STAT=ierr)
6831  if (ierr.ne.0) then
6832  CALL wrf_error_fatal ( &
6833 'frame/module_domain.f: Failed to allocate grid%xa%qsn(1,1,1).  ')
6834  endif
6835 ENDIF
6836 IF(.NOT.inter_domain)THEN
6837 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6838 ALLOCATE(grid%xa%qgr(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6839  if (ierr.ne.0) then
6840  CALL wrf_error_fatal ( &
6841 'frame/module_domain.f: Failed to allocate grid%xa%qgr(sm31:em31,sm32:em32,sm33:em33). ')
6842  endif
6843 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%qgr=initial_data_value
6844 ELSE
6845 ALLOCATE(grid%xa%qgr(1,1,1),STAT=ierr)
6846  if (ierr.ne.0) then
6847  CALL wrf_error_fatal ( &
6848 'frame/module_domain.f: Failed to allocate grid%xa%qgr(1,1,1).  ')
6849  endif
6850 ENDIF
6851 IF(.NOT.inter_domain)THEN
6852 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6853 ALLOCATE(grid%xa%qt(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6854  if (ierr.ne.0) then
6855  CALL wrf_error_fatal ( &
6856 'frame/module_domain.f: Failed to allocate grid%xa%qt(sm31:em31,sm32:em32,sm33:em33). ')
6857  endif
6858 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%qt=initial_data_value
6859 ELSE
6860 ALLOCATE(grid%xa%qt(1,1,1),STAT=ierr)
6861  if (ierr.ne.0) then
6862  CALL wrf_error_fatal ( &
6863 'frame/module_domain.f: Failed to allocate grid%xa%qt(1,1,1).  ')
6864  endif
6865 ENDIF
6866 IF(.NOT.inter_domain)THEN
6867 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6868 ALLOCATE(grid%xa%tgrn(sm31:em31,sm32:em32),STAT=ierr)
6869  if (ierr.ne.0) then
6870  CALL wrf_error_fatal ( &
6871 'frame/module_domain.f: Failed to allocate grid%xa%tgrn(sm31:em31,sm32:em32). ')
6872  endif
6873 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tgrn=initial_data_value
6874 ELSE
6875 ALLOCATE(grid%xa%tgrn(1,1),STAT=ierr)
6876  if (ierr.ne.0) then
6877  CALL wrf_error_fatal ( &
6878 'frame/module_domain.f: Failed to allocate grid%xa%tgrn(1,1).  ')
6879  endif
6880 ENDIF
6881 IF(.NOT.inter_domain)THEN
6882 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6883 ALLOCATE(grid%xa%psfc(sm31:em31,sm32:em32),STAT=ierr)
6884  if (ierr.ne.0) then
6885  CALL wrf_error_fatal ( &
6886 'frame/module_domain.f: Failed to allocate grid%xa%psfc(sm31:em31,sm32:em32). ')
6887  endif
6888 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%psfc=initial_data_value
6889 ELSE
6890 ALLOCATE(grid%xa%psfc(1,1),STAT=ierr)
6891  if (ierr.ne.0) then
6892  CALL wrf_error_fatal ( &
6893 'frame/module_domain.f: Failed to allocate grid%xa%psfc(1,1).  ')
6894  endif
6895 ENDIF
6896 IF(.NOT.inter_domain)THEN
6897 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6898 ALLOCATE(grid%xa%u10(sm31:em31,sm32:em32),STAT=ierr)
6899  if (ierr.ne.0) then
6900  CALL wrf_error_fatal ( &
6901 'frame/module_domain.f: Failed to allocate grid%xa%u10(sm31:em31,sm32:em32). ')
6902  endif
6903 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%u10=initial_data_value
6904 ELSE
6905 ALLOCATE(grid%xa%u10(1,1),STAT=ierr)
6906  if (ierr.ne.0) then
6907  CALL wrf_error_fatal ( &
6908 'frame/module_domain.f: Failed to allocate grid%xa%u10(1,1).  ')
6909  endif
6910 ENDIF
6911 IF(.NOT.inter_domain)THEN
6912 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6913 ALLOCATE(grid%xa%v10(sm31:em31,sm32:em32),STAT=ierr)
6914  if (ierr.ne.0) then
6915  CALL wrf_error_fatal ( &
6916 'frame/module_domain.f: Failed to allocate grid%xa%v10(sm31:em31,sm32:em32). ')
6917  endif
6918 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%v10=initial_data_value
6919 ELSE
6920 ALLOCATE(grid%xa%v10(1,1),STAT=ierr)
6921  if (ierr.ne.0) then
6922  CALL wrf_error_fatal ( &
6923 'frame/module_domain.f: Failed to allocate grid%xa%v10(1,1).  ')
6924  endif
6925 ENDIF
6926 IF(.NOT.inter_domain)THEN
6927 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6928 ALLOCATE(grid%xa%t2(sm31:em31,sm32:em32),STAT=ierr)
6929  if (ierr.ne.0) then
6930  CALL wrf_error_fatal ( &
6931 'frame/module_domain.f: Failed to allocate grid%xa%t2(sm31:em31,sm32:em32). ')
6932  endif
6933 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%t2=initial_data_value
6934 ELSE
6935 ALLOCATE(grid%xa%t2(1,1),STAT=ierr)
6936  if (ierr.ne.0) then
6937  CALL wrf_error_fatal ( &
6938 'frame/module_domain.f: Failed to allocate grid%xa%t2(1,1).  ')
6939  endif
6940 ENDIF
6941 IF(.NOT.inter_domain)THEN
6942 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6943 ALLOCATE(grid%xa%q2(sm31:em31,sm32:em32),STAT=ierr)
6944  if (ierr.ne.0) then
6945  CALL wrf_error_fatal ( &
6946 'frame/module_domain.f: Failed to allocate grid%xa%q2(sm31:em31,sm32:em32). ')
6947  endif
6948 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%q2=initial_data_value
6949 ELSE
6950 ALLOCATE(grid%xa%q2(1,1),STAT=ierr)
6951  if (ierr.ne.0) then
6952  CALL wrf_error_fatal ( &
6953 'frame/module_domain.f: Failed to allocate grid%xa%q2(1,1).  ')
6954  endif
6955 ENDIF
6956 IF(.NOT.inter_domain)THEN
6957 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
6958 ALLOCATE(grid%xa%ref(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
6959  if (ierr.ne.0) then
6960  CALL wrf_error_fatal ( &
6961 'frame/module_domain.f: Failed to allocate grid%xa%ref(sm31:em31,sm32:em32,sm33:em33). ')
6962  endif
6963 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%ref=initial_data_value
6964 ELSE
6965 ALLOCATE(grid%xa%ref(1,1,1),STAT=ierr)
6966  if (ierr.ne.0) then
6967  CALL wrf_error_fatal ( &
6968 'frame/module_domain.f: Failed to allocate grid%xa%ref(1,1,1).  ')
6969  endif
6970 ENDIF
6971 IF(.NOT.inter_domain)THEN
6972 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6973 ALLOCATE(grid%xa%tpw(sm31:em31,sm32:em32),STAT=ierr)
6974  if (ierr.ne.0) then
6975  CALL wrf_error_fatal ( &
6976 'frame/module_domain.f: Failed to allocate grid%xa%tpw(sm31:em31,sm32:em32). ')
6977  endif
6978 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tpw=initial_data_value
6979 ELSE
6980 ALLOCATE(grid%xa%tpw(1,1),STAT=ierr)
6981  if (ierr.ne.0) then
6982  CALL wrf_error_fatal ( &
6983 'frame/module_domain.f: Failed to allocate grid%xa%tpw(1,1).  ')
6984  endif
6985 ENDIF
6986 IF(.NOT.inter_domain)THEN
6987 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
6988 ALLOCATE(grid%xa%speed(sm31:em31,sm32:em32),STAT=ierr)
6989  if (ierr.ne.0) then
6990  CALL wrf_error_fatal ( &
6991 'frame/module_domain.f: Failed to allocate grid%xa%speed(sm31:em31,sm32:em32). ')
6992  endif
6993 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%speed=initial_data_value
6994 ELSE
6995 ALLOCATE(grid%xa%speed(1,1),STAT=ierr)
6996  if (ierr.ne.0) then
6997  CALL wrf_error_fatal ( &
6998 'frame/module_domain.f: Failed to allocate grid%xa%speed(1,1).  ')
6999  endif
7000 ENDIF
7001 IF(.NOT.inter_domain)THEN
7002 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
7003 ALLOCATE(grid%xa%tb19v(sm31:em31,sm32:em32),STAT=ierr)
7004  if (ierr.ne.0) then
7005  CALL wrf_error_fatal ( &
7006 'frame/module_domain.f: Failed to allocate grid%xa%tb19v(sm31:em31,sm32:em32). ')
7007  endif
7008 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tb19v=initial_data_value
7009 ELSE
7010 ALLOCATE(grid%xa%tb19v(1,1),STAT=ierr)
7011  if (ierr.ne.0) then
7012  CALL wrf_error_fatal ( &
7013 'frame/module_domain.f: Failed to allocate grid%xa%tb19v(1,1).  ')
7014  endif
7015 ENDIF
7016 IF(.NOT.inter_domain)THEN
7017 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
7018 ALLOCATE(grid%xa%tb19h(sm31:em31,sm32:em32),STAT=ierr)
7019  if (ierr.ne.0) then
7020  CALL wrf_error_fatal ( &
7021 'frame/module_domain.f: Failed to allocate grid%xa%tb19h(sm31:em31,sm32:em32). ')
7022  endif
7023 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tb19h=initial_data_value
7024 ELSE
7025 ALLOCATE(grid%xa%tb19h(1,1),STAT=ierr)
7026  if (ierr.ne.0) then
7027  CALL wrf_error_fatal ( &
7028 'frame/module_domain.f: Failed to allocate grid%xa%tb19h(1,1).  ')
7029  endif
7030 ENDIF
7031 IF(.NOT.inter_domain)THEN
7032 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
7033 ALLOCATE(grid%xa%tb22v(sm31:em31,sm32:em32),STAT=ierr)
7034  if (ierr.ne.0) then
7035  CALL wrf_error_fatal ( &
7036 'frame/module_domain.f: Failed to allocate grid%xa%tb22v(sm31:em31,sm32:em32). ')
7037  endif
7038 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tb22v=initial_data_value
7039 ELSE
7040 ALLOCATE(grid%xa%tb22v(1,1),STAT=ierr)
7041  if (ierr.ne.0) then
7042  CALL wrf_error_fatal ( &
7043 'frame/module_domain.f: Failed to allocate grid%xa%tb22v(1,1).  ')
7044  endif
7045 ENDIF
7046 IF(.NOT.inter_domain)THEN
7047 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
7048 ALLOCATE(grid%xa%tb37v(sm31:em31,sm32:em32),STAT=ierr)
7049  if (ierr.ne.0) then
7050  CALL wrf_error_fatal ( &
7051 'frame/module_domain.f: Failed to allocate grid%xa%tb37v(sm31:em31,sm32:em32). ')
7052  endif
7053 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tb37v=initial_data_value
7054 ELSE
7055 ALLOCATE(grid%xa%tb37v(1,1),STAT=ierr)
7056  if (ierr.ne.0) then
7057  CALL wrf_error_fatal ( &
7058 'frame/module_domain.f: Failed to allocate grid%xa%tb37v(1,1).  ')
7059  endif
7060 ENDIF
7061 IF(.NOT.inter_domain)THEN
7062 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
7063 ALLOCATE(grid%xa%tb37h(sm31:em31,sm32:em32),STAT=ierr)
7064  if (ierr.ne.0) then
7065  CALL wrf_error_fatal ( &
7066 'frame/module_domain.f: Failed to allocate grid%xa%tb37h(sm31:em31,sm32:em32). ')
7067  endif
7068 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tb37h=initial_data_value
7069 ELSE
7070 ALLOCATE(grid%xa%tb37h(1,1),STAT=ierr)
7071  if (ierr.ne.0) then
7072  CALL wrf_error_fatal ( &
7073 'frame/module_domain.f: Failed to allocate grid%xa%tb37h(1,1).  ')
7074  endif
7075 ENDIF
7076 IF(.NOT.inter_domain)THEN
7077 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
7078 ALLOCATE(grid%xa%tb85v(sm31:em31,sm32:em32),STAT=ierr)
7079  if (ierr.ne.0) then
7080  CALL wrf_error_fatal ( &
7081 'frame/module_domain.f: Failed to allocate grid%xa%tb85v(sm31:em31,sm32:em32). ')
7082  endif
7083 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tb85v=initial_data_value
7084 ELSE
7085 ALLOCATE(grid%xa%tb85v(1,1),STAT=ierr)
7086  if (ierr.ne.0) then
7087  CALL wrf_error_fatal ( &
7088 'frame/module_domain.f: Failed to allocate grid%xa%tb85v(1,1).  ')
7089  endif
7090 ENDIF
7091 IF(.NOT.inter_domain)THEN
7092 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
7093 ALLOCATE(grid%xa%tb85h(sm31:em31,sm32:em32),STAT=ierr)
7094  if (ierr.ne.0) then
7095  CALL wrf_error_fatal ( &
7096 'frame/module_domain.f: Failed to allocate grid%xa%tb85h(sm31:em31,sm32:em32). ')
7097  endif
7098 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xa%tb85h=initial_data_value
7099 ELSE
7100 ALLOCATE(grid%xa%tb85h(1,1),STAT=ierr)
7101  if (ierr.ne.0) then
7102  CALL wrf_error_fatal ( &
7103 'frame/module_domain.f: Failed to allocate grid%xa%tb85h(1,1).  ')
7104  endif
7105 ENDIF
7106 IF ( setinitval .EQ. 3 ) grid%xp%domdesc=0
7107 IF ( setinitval .EQ. 3 ) grid%xp%comms(max_comms)=0
7108 IF ( setinitval .EQ. 3 ) grid%xp%ids=0
7109 IF ( setinitval .EQ. 3 ) grid%xp%ide=0
7110 IF ( setinitval .EQ. 3 ) grid%xp%jds=0
7111 IF ( setinitval .EQ. 3 ) grid%xp%jde=0
7112 IF ( setinitval .EQ. 3 ) grid%xp%kds=0
7113 IF ( setinitval .EQ. 3 ) grid%xp%kde=0
7114 IF ( setinitval .EQ. 3 ) grid%xp%ims=0
7115 IF ( setinitval .EQ. 3 ) grid%xp%ime=0
7116 IF ( setinitval .EQ. 3 ) grid%xp%jms=0
7117 IF ( setinitval .EQ. 3 ) grid%xp%jme=0
7118 IF ( setinitval .EQ. 3 ) grid%xp%kms=0
7119 IF ( setinitval .EQ. 3 ) grid%xp%kme=0
7120 IF ( setinitval .EQ. 3 ) grid%xp%its=0
7121 IF ( setinitval .EQ. 3 ) grid%xp%ite=0
7122 IF ( setinitval .EQ. 3 ) grid%xp%jts=0
7123 IF ( setinitval .EQ. 3 ) grid%xp%jte=0
7124 IF ( setinitval .EQ. 3 ) grid%xp%kts=0
7125 IF ( setinitval .EQ. 3 ) grid%xp%kte=0
7126 IF ( setinitval .EQ. 3 ) grid%xp%ips=0
7127 IF ( setinitval .EQ. 3 ) grid%xp%ipe=0
7128 IF ( setinitval .EQ. 3 ) grid%xp%jps=0
7129 IF ( setinitval .EQ. 3 ) grid%xp%jpe=0
7130 IF ( setinitval .EQ. 3 ) grid%xp%kps=0
7131 IF ( setinitval .EQ. 3 ) grid%xp%kpe=0
7132 IF ( setinitval .EQ. 3 ) grid%xp%idsx=0
7133 IF ( setinitval .EQ. 3 ) grid%xp%idex=0
7134 IF ( setinitval .EQ. 3 ) grid%xp%jdsx=0
7135 IF ( setinitval .EQ. 3 ) grid%xp%jdex=0
7136 IF ( setinitval .EQ. 3 ) grid%xp%kdsx=0
7137 IF ( setinitval .EQ. 3 ) grid%xp%kdex=0
7138 IF ( setinitval .EQ. 3 ) grid%xp%imsx=0
7139 IF ( setinitval .EQ. 3 ) grid%xp%imex=0
7140 IF ( setinitval .EQ. 3 ) grid%xp%jmsx=0
7141 IF ( setinitval .EQ. 3 ) grid%xp%jmex=0
7142 IF ( setinitval .EQ. 3 ) grid%xp%kmsx=0
7143 IF ( setinitval .EQ. 3 ) grid%xp%kmex=0
7144 IF ( setinitval .EQ. 3 ) grid%xp%itsx=0
7145 IF ( setinitval .EQ. 3 ) grid%xp%itex=0
7146 IF ( setinitval .EQ. 3 ) grid%xp%jtsx=0
7147 IF ( setinitval .EQ. 3 ) grid%xp%jtex=0
7148 IF ( setinitval .EQ. 3 ) grid%xp%ktsx=0
7149 IF ( setinitval .EQ. 3 ) grid%xp%ktex=0
7150 IF ( setinitval .EQ. 3 ) grid%xp%ipsx=0
7151 IF ( setinitval .EQ. 3 ) grid%xp%ipex=0
7152 IF ( setinitval .EQ. 3 ) grid%xp%jpsx=0
7153 IF ( setinitval .EQ. 3 ) grid%xp%jpex=0
7154 IF ( setinitval .EQ. 3 ) grid%xp%kpsx=0
7155 IF ( setinitval .EQ. 3 ) grid%xp%kpex=0
7156 IF ( setinitval .EQ. 3 ) grid%xp%idsy=0
7157 IF ( setinitval .EQ. 3 ) grid%xp%idey=0
7158 IF ( setinitval .EQ. 3 ) grid%xp%jdsy=0
7159 IF ( setinitval .EQ. 3 ) grid%xp%jdey=0
7160 IF ( setinitval .EQ. 3 ) grid%xp%kdsy=0
7161 IF ( setinitval .EQ. 3 ) grid%xp%kdey=0
7162 IF ( setinitval .EQ. 3 ) grid%xp%imsy=0
7163 IF ( setinitval .EQ. 3 ) grid%xp%imey=0
7164 IF ( setinitval .EQ. 3 ) grid%xp%jmsy=0
7165 IF ( setinitval .EQ. 3 ) grid%xp%jmey=0
7166 IF ( setinitval .EQ. 3 ) grid%xp%kmsy=0
7167 IF ( setinitval .EQ. 3 ) grid%xp%kmey=0
7168 IF ( setinitval .EQ. 3 ) grid%xp%itsy=0
7169 IF ( setinitval .EQ. 3 ) grid%xp%itey=0
7170 IF ( setinitval .EQ. 3 ) grid%xp%jtsy=0
7171 IF ( setinitval .EQ. 3 ) grid%xp%jtey=0
7172 IF ( setinitval .EQ. 3 ) grid%xp%ktsy=0
7173 IF ( setinitval .EQ. 3 ) grid%xp%ktey=0
7174 IF ( setinitval .EQ. 3 ) grid%xp%ipsy=0
7175 IF ( setinitval .EQ. 3 ) grid%xp%ipey=0
7176 IF ( setinitval .EQ. 3 ) grid%xp%jpsy=0
7177 IF ( setinitval .EQ. 3 ) grid%xp%jpey=0
7178 IF ( setinitval .EQ. 3 ) grid%xp%kpsy=0
7179 IF ( setinitval .EQ. 3 ) grid%xp%kpey=0
7180 IF(.NOT.inter_domain)THEN
7181 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))) * RWORDSIZE
7182 ALLOCATE(grid%xp%vxy(sm31:em31,sm32:em32),STAT=ierr)
7183  if (ierr.ne.0) then
7184  CALL wrf_error_fatal ( &
7185 'frame/module_domain.f: Failed to allocate grid%xp%vxy(sm31:em31,sm32:em32). ')
7186  endif
7187 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xp%vxy=initial_data_value
7188 ELSE
7189 ALLOCATE(grid%xp%vxy(1,1),STAT=ierr)
7190  if (ierr.ne.0) then
7191  CALL wrf_error_fatal ( &
7192 'frame/module_domain.f: Failed to allocate grid%xp%vxy(1,1).  ')
7193  endif
7194 ENDIF
7195 IF(.NOT.inter_domain)THEN
7196 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
7197 ALLOCATE(grid%xp%v1z(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
7198  if (ierr.ne.0) then
7199  CALL wrf_error_fatal ( &
7200 'frame/module_domain.f: Failed to allocate grid%xp%v1z(sm31:em31,sm32:em32,sm33:em33). ')
7201  endif
7202 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xp%v1z=initial_data_value
7203 ELSE
7204 ALLOCATE(grid%xp%v1z(1,1,1),STAT=ierr)
7205  if (ierr.ne.0) then
7206  CALL wrf_error_fatal ( &
7207 'frame/module_domain.f: Failed to allocate grid%xp%v1z(1,1,1).  ')
7208  endif
7209 ENDIF
7210 IF(.NOT.inter_domain)THEN
7211 num_bytes_allocated = num_bytes_allocated + ((((em31x)-(sm31x)+1))*(((em32x)-(sm32x)+1))*(((em33x)-(sm33x)+1))) * RWORDSIZE
7212 ALLOCATE(grid%xp%v1x(sm31x:em31x,sm32x:em32x,sm33x:em33x),STAT=ierr)
7213  if (ierr.ne.0) then
7214  CALL wrf_error_fatal ( &
7215 'frame/module_domain.f: Failed to allocate grid%xp%v1x(sm31x:em31x,sm32x:em32x,sm33x:em33x). ')
7216  endif
7217 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xp%v1x=initial_data_value
7218 ELSE
7219 ALLOCATE(grid%xp%v1x(1,1,1),STAT=ierr)
7220  if (ierr.ne.0) then
7221  CALL wrf_error_fatal ( &
7222 'frame/module_domain.f: Failed to allocate grid%xp%v1x(1,1,1).  ')
7223  endif
7224 ENDIF
7225 IF(.NOT.inter_domain)THEN
7226 num_bytes_allocated = num_bytes_allocated + ((((em31y)-(sm31y)+1))*(((em32y)-(sm32y)+1))*(((em33y)-(sm33y)+1))) * RWORDSIZE
7227 ALLOCATE(grid%xp%v1y(sm31y:em31y,sm32y:em32y,sm33y:em33y),STAT=ierr)
7228  if (ierr.ne.0) then
7229  CALL wrf_error_fatal ( &
7230 'frame/module_domain.f: Failed to allocate grid%xp%v1y(sm31y:em31y,sm32y:em32y,sm33y:em33y). ')
7231  endif
7232 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xp%v1y=initial_data_value
7233 ELSE
7234 ALLOCATE(grid%xp%v1y(1,1,1),STAT=ierr)
7235  if (ierr.ne.0) then
7236  CALL wrf_error_fatal ( &
7237 'frame/module_domain.f: Failed to allocate grid%xp%v1y(1,1,1).  ')
7238  endif
7239 ENDIF
7240 IF(.NOT.inter_domain)THEN
7241 num_bytes_allocated = num_bytes_allocated + ((((em31)-(sm31)+1))*(((em32)-(sm32)+1))*(((em33)-(sm33)+1))) * RWORDSIZE
7242 ALLOCATE(grid%xp%v2z(sm31:em31,sm32:em32,sm33:em33),STAT=ierr)
7243  if (ierr.ne.0) then
7244  CALL wrf_error_fatal ( &
7245 'frame/module_domain.f: Failed to allocate grid%xp%v2z(sm31:em31,sm32:em32,sm33:em33). ')
7246  endif
7247 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xp%v2z=initial_data_value
7248 ELSE
7249 ALLOCATE(grid%xp%v2z(1,1,1),STAT=ierr)
7250  if (ierr.ne.0) then
7251  CALL wrf_error_fatal ( &
7252 'frame/module_domain.f: Failed to allocate grid%xp%v2z(1,1,1).  ')
7253  endif
7254 ENDIF
7255 IF(.NOT.inter_domain)THEN
7256 num_bytes_allocated = num_bytes_allocated + ((((em31x)-(sm31x)+1))*(((em32x)-(sm32x)+1))*(((em33x)-(sm33x)+1))) * RWORDSIZE
7257 ALLOCATE(grid%xp%v2x(sm31x:em31x,sm32x:em32x,sm33x:em33x),STAT=ierr)
7258  if (ierr.ne.0) then
7259  CALL wrf_error_fatal ( &
7260 'frame/module_domain.f: Failed to allocate grid%xp%v2x(sm31x:em31x,sm32x:em32x,sm33x:em33x). ')
7261  endif
7262 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xp%v2x=initial_data_value
7263 ELSE
7264 ALLOCATE(grid%xp%v2x(1,1,1),STAT=ierr)
7265  if (ierr.ne.0) then
7266  CALL wrf_error_fatal ( &
7267 'frame/module_domain.f: Failed to allocate grid%xp%v2x(1,1,1).  ')
7268  endif
7269 ENDIF
7270 IF(.NOT.inter_domain)THEN
7271 num_bytes_allocated = num_bytes_allocated + ((((em31y)-(sm31y)+1))*(((em32y)-(sm32y)+1))*(((em33y)-(sm33y)+1))) * RWORDSIZE
7272 ALLOCATE(grid%xp%v2y(sm31y:em31y,sm32y:em32y,sm33y:em33y),STAT=ierr)
7273  if (ierr.ne.0) then
7274  CALL wrf_error_fatal ( &
7275 'frame/module_domain.f: Failed to allocate grid%xp%v2y(sm31y:em31y,sm32y:em32y,sm33y:em33y). ')
7276  endif
7277 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%xp%v2y=initial_data_value
7278 ELSE
7279 ALLOCATE(grid%xp%v2y(1,1,1),STAT=ierr)
7280  if (ierr.ne.0) then
7281  CALL wrf_error_fatal ( &
7282 'frame/module_domain.f: Failed to allocate grid%xp%v2y(1,1,1).  ')
7283  endif
7284 ENDIF
7285 IF ( setinitval .EQ. 3 ) grid%fdob%domain_tot=0
7286 IF ( setinitval .EQ. 3 ) grid%fdob%domain_init=0
7287 IF ( setinitval .EQ. 3 ) grid%fdob%ieodi=0
7288 IF ( setinitval .EQ. 3 ) grid%fdob%iwtsig=0
7289 IF ( setinitval .EQ. 3 ) grid%fdob%nstat=0
7290 IF ( setinitval .EQ. 3 ) grid%fdob%ktaur=0
7291 IF ( setinitval .EQ. 3 ) grid%fdob%sn_maxcg=0
7292 IF ( setinitval .EQ. 3 ) grid%fdob%we_maxcg=0
7293 IF ( setinitval .EQ. 3 ) grid%fdob%sn_end=0
7294 IF ( setinitval .EQ. 3 ) grid%fdob%levidn(max_domains)=0
7295 IF ( setinitval .EQ. 3 ) grid%fdob%ds_cg=initial_data_value
7296 IF ( setinitval .EQ. 3 ) grid%fdob%window=initial_data_value
7297 IF ( setinitval .EQ. 3 ) grid%fdob%rtlast=initial_data_value
7298 IF ( setinitval .EQ. 3 ) grid%fdob%datend=initial_data_value
7299 IF ( setinitval .EQ. 3 ) grid%fdob%rinfmn=initial_data_value
7300 IF ( setinitval .EQ. 3 ) grid%fdob%rinfmx=initial_data_value
7301 IF ( setinitval .EQ. 3 ) grid%fdob%pfree=initial_data_value
7302 IF ( setinitval .EQ. 3 ) grid%fdob%dcon=initial_data_value
7303 IF ( setinitval .EQ. 3 ) grid%fdob%dpsmx=initial_data_value
7304 IF ( setinitval .EQ. 3 ) grid%fdob%tfaci=initial_data_value
7305 IF ( setinitval .EQ. 3 ) grid%fdob%xn=initial_data_value
7306 IF(.NOT.inter_domain)THEN
7307 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%nobs_ndg_vars)-(1)+1))*(((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7308 ALLOCATE(grid%fdob%varobs(1:model_config_rec%nobs_ndg_vars,1:model_config_rec%max_obs),STAT=ierr)
7309  if (ierr.ne.0) then
7310  CALL wrf_error_fatal ( &
7311 'frame/module_domain.f: Failed to allocate grid%fdob%varobs(1:model_config_rec%nobs_ndg_vars,1:model_config_rec%max_obs). ')
7312  endif
7313 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%varobs=initial_data_value
7314 ELSE
7315 ALLOCATE(grid%fdob%varobs(1,1),STAT=ierr)
7316  if (ierr.ne.0) then
7317  CALL wrf_error_fatal ( &
7318 'frame/module_domain.f: Failed to allocate grid%fdob%varobs(1,1).  ')
7319  endif
7320 ENDIF
7321 IF(.NOT.inter_domain)THEN
7322 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%nobs_err_flds)-(1)+1))*(((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7323 ALLOCATE(grid%fdob%errf(1:model_config_rec%nobs_err_flds,1:model_config_rec%max_obs),STAT=ierr)
7324  if (ierr.ne.0) then
7325  CALL wrf_error_fatal ( &
7326 'frame/module_domain.f: Failed to allocate grid%fdob%errf(1:model_config_rec%nobs_err_flds,1:model_config_rec%max_obs). ')
7327  endif
7328 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%errf=initial_data_value
7329 ELSE
7330 ALLOCATE(grid%fdob%errf(1,1),STAT=ierr)
7331  if (ierr.ne.0) then
7332  CALL wrf_error_fatal ( &
7333 'frame/module_domain.f: Failed to allocate grid%fdob%errf(1,1).  ')
7334  endif
7335 ENDIF
7336 IF(.NOT.inter_domain)THEN
7337 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7338 ALLOCATE(grid%fdob%timeob(1:model_config_rec%max_obs),STAT=ierr)
7339  if (ierr.ne.0) then
7340  CALL wrf_error_fatal ( &
7341 'frame/module_domain.f: Failed to allocate grid%fdob%timeob(1:model_config_rec%max_obs). ')
7342  endif
7343 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%timeob=initial_data_value
7344 ELSE
7345 ALLOCATE(grid%fdob%timeob(1),STAT=ierr)
7346  if (ierr.ne.0) then
7347  CALL wrf_error_fatal ( &
7348 'frame/module_domain.f: Failed to allocate grid%fdob%timeob(1).  ')
7349  endif
7350 ENDIF
7351 IF(.NOT.inter_domain)THEN
7352 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7353 ALLOCATE(grid%fdob%nlevs_ob(1:model_config_rec%max_obs),STAT=ierr)
7354  if (ierr.ne.0) then
7355  CALL wrf_error_fatal ( &
7356 'frame/module_domain.f: Failed to allocate grid%fdob%nlevs_ob(1:model_config_rec%max_obs). ')
7357  endif
7358 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%nlevs_ob=initial_data_value
7359 ELSE
7360 ALLOCATE(grid%fdob%nlevs_ob(1),STAT=ierr)
7361  if (ierr.ne.0) then
7362  CALL wrf_error_fatal ( &
7363 'frame/module_domain.f: Failed to allocate grid%fdob%nlevs_ob(1).  ')
7364  endif
7365 ENDIF
7366 IF(.NOT.inter_domain)THEN
7367 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7368 ALLOCATE(grid%fdob%lev_in_ob(1:model_config_rec%max_obs),STAT=ierr)
7369  if (ierr.ne.0) then
7370  CALL wrf_error_fatal ( &
7371 'frame/module_domain.f: Failed to allocate grid%fdob%lev_in_ob(1:model_config_rec%max_obs). ')
7372  endif
7373 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%lev_in_ob=initial_data_value
7374 ELSE
7375 ALLOCATE(grid%fdob%lev_in_ob(1),STAT=ierr)
7376  if (ierr.ne.0) then
7377  CALL wrf_error_fatal ( &
7378 'frame/module_domain.f: Failed to allocate grid%fdob%lev_in_ob(1).  ')
7379  endif
7380 ENDIF
7381 IF(.NOT.inter_domain)THEN
7382 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7383 ALLOCATE(grid%fdob%plfo(1:model_config_rec%max_obs),STAT=ierr)
7384  if (ierr.ne.0) then
7385  CALL wrf_error_fatal ( &
7386 'frame/module_domain.f: Failed to allocate grid%fdob%plfo(1:model_config_rec%max_obs). ')
7387  endif
7388 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%plfo=initial_data_value
7389 ELSE
7390 ALLOCATE(grid%fdob%plfo(1),STAT=ierr)
7391  if (ierr.ne.0) then
7392  CALL wrf_error_fatal ( &
7393 'frame/module_domain.f: Failed to allocate grid%fdob%plfo(1).  ')
7394  endif
7395 ENDIF
7396 IF(.NOT.inter_domain)THEN
7397 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7398 ALLOCATE(grid%fdob%elevob(1:model_config_rec%max_obs),STAT=ierr)
7399  if (ierr.ne.0) then
7400  CALL wrf_error_fatal ( &
7401 'frame/module_domain.f: Failed to allocate grid%fdob%elevob(1:model_config_rec%max_obs). ')
7402  endif
7403 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%elevob=initial_data_value
7404 ELSE
7405 ALLOCATE(grid%fdob%elevob(1),STAT=ierr)
7406  if (ierr.ne.0) then
7407  CALL wrf_error_fatal ( &
7408 'frame/module_domain.f: Failed to allocate grid%fdob%elevob(1).  ')
7409  endif
7410 ENDIF
7411 IF(.NOT.inter_domain)THEN
7412 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7413 ALLOCATE(grid%fdob%rio(1:model_config_rec%max_obs),STAT=ierr)
7414  if (ierr.ne.0) then
7415  CALL wrf_error_fatal ( &
7416 'frame/module_domain.f: Failed to allocate grid%fdob%rio(1:model_config_rec%max_obs). ')
7417  endif
7418 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%rio=initial_data_value
7419 ELSE
7420 ALLOCATE(grid%fdob%rio(1),STAT=ierr)
7421  if (ierr.ne.0) then
7422  CALL wrf_error_fatal ( &
7423 'frame/module_domain.f: Failed to allocate grid%fdob%rio(1).  ')
7424  endif
7425 ENDIF
7426 IF(.NOT.inter_domain)THEN
7427 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7428 ALLOCATE(grid%fdob%rjo(1:model_config_rec%max_obs),STAT=ierr)
7429  if (ierr.ne.0) then
7430  CALL wrf_error_fatal ( &
7431 'frame/module_domain.f: Failed to allocate grid%fdob%rjo(1:model_config_rec%max_obs). ')
7432  endif
7433 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%rjo=initial_data_value
7434 ELSE
7435 ALLOCATE(grid%fdob%rjo(1),STAT=ierr)
7436  if (ierr.ne.0) then
7437  CALL wrf_error_fatal ( &
7438 'frame/module_domain.f: Failed to allocate grid%fdob%rjo(1).  ')
7439  endif
7440 ENDIF
7441 IF(.NOT.inter_domain)THEN
7442 num_bytes_allocated = num_bytes_allocated + ((((model_config_rec%max_obs)-(1)+1))) * RWORDSIZE
7443 ALLOCATE(grid%fdob%rko(1:model_config_rec%max_obs),STAT=ierr)
7444  if (ierr.ne.0) then
7445  CALL wrf_error_fatal ( &
7446 'frame/module_domain.f: Failed to allocate grid%fdob%rko(1:model_config_rec%max_obs). ')
7447  endif
7448 IF ( setinitval .EQ. 1 .OR. setinitval .EQ. 3 ) grid%fdob%rko=initial_data_value
7449 ELSE
7450 ALLOCATE(grid%fdob%rko(1),STAT=ierr)
7451  if (ierr.ne.0) then
7452  CALL wrf_error_fatal ( &
7453 'frame/module_domain.f: Failed to allocate grid%fdob%rko(1).  ')
7454  endif
7455 ENDIF
7456 !ENDOFREGISTRYGENERATEDINCLUDE