em_deallocs.inc

References to this file elsewhere.
1 !STARTOFREGISTRYGENERATEDINCLUDE 'inc/em_deallocs.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 IF ( ASSOCIATED( grid%lu_index ) ) THEN 
8   DEALLOCATE(grid%lu_index,STAT=ierr)
9  if (ierr.ne.0) then
10  CALL wrf_error_fatal ( &
11 'frame/module_domain.f: Failed to dallocate grid%lu_index. ')
12  endif
13   NULLIFY(grid%lu_index)
14 ENDIF
15 IF ( ASSOCIATED( grid%lu_mask ) ) THEN 
16   DEALLOCATE(grid%lu_mask,STAT=ierr)
17  if (ierr.ne.0) then
18  CALL wrf_error_fatal ( &
19 'frame/module_domain.f: Failed to dallocate grid%lu_mask. ')
20  endif
21   NULLIFY(grid%lu_mask)
22 ENDIF
23 IF ( ASSOCIATED( grid%em_qv_gc ) ) THEN 
24   DEALLOCATE(grid%em_qv_gc,STAT=ierr)
25  if (ierr.ne.0) then
26  CALL wrf_error_fatal ( &
27 'frame/module_domain.f: Failed to dallocate grid%em_qv_gc. ')
28  endif
29   NULLIFY(grid%em_qv_gc)
30 ENDIF
31 IF ( ASSOCIATED( grid%em_u_1 ) ) THEN 
32   DEALLOCATE(grid%em_u_1,STAT=ierr)
33  if (ierr.ne.0) then
34  CALL wrf_error_fatal ( &
35 'frame/module_domain.f: Failed to dallocate grid%em_u_1. ')
36  endif
37   NULLIFY(grid%em_u_1)
38 ENDIF
39 IF ( ASSOCIATED( grid%em_u_2 ) ) THEN 
40   DEALLOCATE(grid%em_u_2,STAT=ierr)
41  if (ierr.ne.0) then
42  CALL wrf_error_fatal ( &
43 'frame/module_domain.f: Failed to dallocate grid%em_u_2. ')
44  endif
45   NULLIFY(grid%em_u_2)
46 ENDIF
47 IF ( ASSOCIATED( grid%em_u_bxs ) ) THEN 
48   DEALLOCATE(grid%em_u_bxs,STAT=ierr)
49  if (ierr.ne.0) then
50  CALL wrf_error_fatal ( &
51 'frame/module_domain.f: Failed to dallocate grid%em_u_bxs. ')
52  endif
53   NULLIFY(grid%em_u_bxs)
54 ENDIF
55 IF ( ASSOCIATED( grid%em_u_bxe ) ) THEN 
56   DEALLOCATE(grid%em_u_bxe,STAT=ierr)
57  if (ierr.ne.0) then
58  CALL wrf_error_fatal ( &
59 'frame/module_domain.f: Failed to dallocate grid%em_u_bxe. ')
60  endif
61   NULLIFY(grid%em_u_bxe)
62 ENDIF
63 IF ( ASSOCIATED( grid%em_u_bys ) ) THEN 
64   DEALLOCATE(grid%em_u_bys,STAT=ierr)
65  if (ierr.ne.0) then
66  CALL wrf_error_fatal ( &
67 'frame/module_domain.f: Failed to dallocate grid%em_u_bys. ')
68  endif
69   NULLIFY(grid%em_u_bys)
70 ENDIF
71 IF ( ASSOCIATED( grid%em_u_bye ) ) THEN 
72   DEALLOCATE(grid%em_u_bye,STAT=ierr)
73  if (ierr.ne.0) then
74  CALL wrf_error_fatal ( &
75 'frame/module_domain.f: Failed to dallocate grid%em_u_bye. ')
76  endif
77   NULLIFY(grid%em_u_bye)
78 ENDIF
79 IF ( ASSOCIATED( grid%em_u_btxs ) ) THEN 
80   DEALLOCATE(grid%em_u_btxs,STAT=ierr)
81  if (ierr.ne.0) then
82  CALL wrf_error_fatal ( &
83 'frame/module_domain.f: Failed to dallocate grid%em_u_btxs. ')
84  endif
85   NULLIFY(grid%em_u_btxs)
86 ENDIF
87 IF ( ASSOCIATED( grid%em_u_btxe ) ) THEN 
88   DEALLOCATE(grid%em_u_btxe,STAT=ierr)
89  if (ierr.ne.0) then
90  CALL wrf_error_fatal ( &
91 'frame/module_domain.f: Failed to dallocate grid%em_u_btxe. ')
92  endif
93   NULLIFY(grid%em_u_btxe)
94 ENDIF
95 IF ( ASSOCIATED( grid%em_u_btys ) ) THEN 
96   DEALLOCATE(grid%em_u_btys,STAT=ierr)
97  if (ierr.ne.0) then
98  CALL wrf_error_fatal ( &
99 'frame/module_domain.f: Failed to dallocate grid%em_u_btys. ')
100  endif
101   NULLIFY(grid%em_u_btys)
102 ENDIF
103 IF ( ASSOCIATED( grid%em_u_btye ) ) THEN 
104   DEALLOCATE(grid%em_u_btye,STAT=ierr)
105  if (ierr.ne.0) then
106  CALL wrf_error_fatal ( &
107 'frame/module_domain.f: Failed to dallocate grid%em_u_btye. ')
108  endif
109   NULLIFY(grid%em_u_btye)
110 ENDIF
111 IF ( ASSOCIATED( grid%a_u_1 ) ) THEN 
112   DEALLOCATE(grid%a_u_1,STAT=ierr)
113  if (ierr.ne.0) then
114  CALL wrf_error_fatal ( &
115 'frame/module_domain.f: Failed to dallocate grid%a_u_1. ')
116  endif
117   NULLIFY(grid%a_u_1)
118 ENDIF
119 IF ( ASSOCIATED( grid%a_u_2 ) ) THEN 
120   DEALLOCATE(grid%a_u_2,STAT=ierr)
121  if (ierr.ne.0) then
122  CALL wrf_error_fatal ( &
123 'frame/module_domain.f: Failed to dallocate grid%a_u_2. ')
124  endif
125   NULLIFY(grid%a_u_2)
126 ENDIF
127 IF ( ASSOCIATED( grid%a_u_bxs ) ) THEN 
128   DEALLOCATE(grid%a_u_bxs,STAT=ierr)
129  if (ierr.ne.0) then
130  CALL wrf_error_fatal ( &
131 'frame/module_domain.f: Failed to dallocate grid%a_u_bxs. ')
132  endif
133   NULLIFY(grid%a_u_bxs)
134 ENDIF
135 IF ( ASSOCIATED( grid%a_u_bxe ) ) THEN 
136   DEALLOCATE(grid%a_u_bxe,STAT=ierr)
137  if (ierr.ne.0) then
138  CALL wrf_error_fatal ( &
139 'frame/module_domain.f: Failed to dallocate grid%a_u_bxe. ')
140  endif
141   NULLIFY(grid%a_u_bxe)
142 ENDIF
143 IF ( ASSOCIATED( grid%a_u_bys ) ) THEN 
144   DEALLOCATE(grid%a_u_bys,STAT=ierr)
145  if (ierr.ne.0) then
146  CALL wrf_error_fatal ( &
147 'frame/module_domain.f: Failed to dallocate grid%a_u_bys. ')
148  endif
149   NULLIFY(grid%a_u_bys)
150 ENDIF
151 IF ( ASSOCIATED( grid%a_u_bye ) ) THEN 
152   DEALLOCATE(grid%a_u_bye,STAT=ierr)
153  if (ierr.ne.0) then
154  CALL wrf_error_fatal ( &
155 'frame/module_domain.f: Failed to dallocate grid%a_u_bye. ')
156  endif
157   NULLIFY(grid%a_u_bye)
158 ENDIF
159 IF ( ASSOCIATED( grid%a_u_btxs ) ) THEN 
160   DEALLOCATE(grid%a_u_btxs,STAT=ierr)
161  if (ierr.ne.0) then
162  CALL wrf_error_fatal ( &
163 'frame/module_domain.f: Failed to dallocate grid%a_u_btxs. ')
164  endif
165   NULLIFY(grid%a_u_btxs)
166 ENDIF
167 IF ( ASSOCIATED( grid%a_u_btxe ) ) THEN 
168   DEALLOCATE(grid%a_u_btxe,STAT=ierr)
169  if (ierr.ne.0) then
170  CALL wrf_error_fatal ( &
171 'frame/module_domain.f: Failed to dallocate grid%a_u_btxe. ')
172  endif
173   NULLIFY(grid%a_u_btxe)
174 ENDIF
175 IF ( ASSOCIATED( grid%a_u_btys ) ) THEN 
176   DEALLOCATE(grid%a_u_btys,STAT=ierr)
177  if (ierr.ne.0) then
178  CALL wrf_error_fatal ( &
179 'frame/module_domain.f: Failed to dallocate grid%a_u_btys. ')
180  endif
181   NULLIFY(grid%a_u_btys)
182 ENDIF
183 IF ( ASSOCIATED( grid%a_u_btye ) ) THEN 
184   DEALLOCATE(grid%a_u_btye,STAT=ierr)
185  if (ierr.ne.0) then
186  CALL wrf_error_fatal ( &
187 'frame/module_domain.f: Failed to dallocate grid%a_u_btye. ')
188  endif
189   NULLIFY(grid%a_u_btye)
190 ENDIF
191 IF ( ASSOCIATED( grid%g_u_1 ) ) THEN 
192   DEALLOCATE(grid%g_u_1,STAT=ierr)
193  if (ierr.ne.0) then
194  CALL wrf_error_fatal ( &
195 'frame/module_domain.f: Failed to dallocate grid%g_u_1. ')
196  endif
197   NULLIFY(grid%g_u_1)
198 ENDIF
199 IF ( ASSOCIATED( grid%g_u_2 ) ) THEN 
200   DEALLOCATE(grid%g_u_2,STAT=ierr)
201  if (ierr.ne.0) then
202  CALL wrf_error_fatal ( &
203 'frame/module_domain.f: Failed to dallocate grid%g_u_2. ')
204  endif
205   NULLIFY(grid%g_u_2)
206 ENDIF
207 IF ( ASSOCIATED( grid%g_u_bxs ) ) THEN 
208   DEALLOCATE(grid%g_u_bxs,STAT=ierr)
209  if (ierr.ne.0) then
210  CALL wrf_error_fatal ( &
211 'frame/module_domain.f: Failed to dallocate grid%g_u_bxs. ')
212  endif
213   NULLIFY(grid%g_u_bxs)
214 ENDIF
215 IF ( ASSOCIATED( grid%g_u_bxe ) ) THEN 
216   DEALLOCATE(grid%g_u_bxe,STAT=ierr)
217  if (ierr.ne.0) then
218  CALL wrf_error_fatal ( &
219 'frame/module_domain.f: Failed to dallocate grid%g_u_bxe. ')
220  endif
221   NULLIFY(grid%g_u_bxe)
222 ENDIF
223 IF ( ASSOCIATED( grid%g_u_bys ) ) THEN 
224   DEALLOCATE(grid%g_u_bys,STAT=ierr)
225  if (ierr.ne.0) then
226  CALL wrf_error_fatal ( &
227 'frame/module_domain.f: Failed to dallocate grid%g_u_bys. ')
228  endif
229   NULLIFY(grid%g_u_bys)
230 ENDIF
231 IF ( ASSOCIATED( grid%g_u_bye ) ) THEN 
232   DEALLOCATE(grid%g_u_bye,STAT=ierr)
233  if (ierr.ne.0) then
234  CALL wrf_error_fatal ( &
235 'frame/module_domain.f: Failed to dallocate grid%g_u_bye. ')
236  endif
237   NULLIFY(grid%g_u_bye)
238 ENDIF
239 IF ( ASSOCIATED( grid%g_u_btxs ) ) THEN 
240   DEALLOCATE(grid%g_u_btxs,STAT=ierr)
241  if (ierr.ne.0) then
242  CALL wrf_error_fatal ( &
243 'frame/module_domain.f: Failed to dallocate grid%g_u_btxs. ')
244  endif
245   NULLIFY(grid%g_u_btxs)
246 ENDIF
247 IF ( ASSOCIATED( grid%g_u_btxe ) ) THEN 
248   DEALLOCATE(grid%g_u_btxe,STAT=ierr)
249  if (ierr.ne.0) then
250  CALL wrf_error_fatal ( &
251 'frame/module_domain.f: Failed to dallocate grid%g_u_btxe. ')
252  endif
253   NULLIFY(grid%g_u_btxe)
254 ENDIF
255 IF ( ASSOCIATED( grid%g_u_btys ) ) THEN 
256   DEALLOCATE(grid%g_u_btys,STAT=ierr)
257  if (ierr.ne.0) then
258  CALL wrf_error_fatal ( &
259 'frame/module_domain.f: Failed to dallocate grid%g_u_btys. ')
260  endif
261   NULLIFY(grid%g_u_btys)
262 ENDIF
263 IF ( ASSOCIATED( grid%g_u_btye ) ) THEN 
264   DEALLOCATE(grid%g_u_btye,STAT=ierr)
265  if (ierr.ne.0) then
266  CALL wrf_error_fatal ( &
267 'frame/module_domain.f: Failed to dallocate grid%g_u_btye. ')
268  endif
269   NULLIFY(grid%g_u_btye)
270 ENDIF
271 IF ( ASSOCIATED( grid%em_v_1 ) ) THEN 
272   DEALLOCATE(grid%em_v_1,STAT=ierr)
273  if (ierr.ne.0) then
274  CALL wrf_error_fatal ( &
275 'frame/module_domain.f: Failed to dallocate grid%em_v_1. ')
276  endif
277   NULLIFY(grid%em_v_1)
278 ENDIF
279 IF ( ASSOCIATED( grid%em_v_2 ) ) THEN 
280   DEALLOCATE(grid%em_v_2,STAT=ierr)
281  if (ierr.ne.0) then
282  CALL wrf_error_fatal ( &
283 'frame/module_domain.f: Failed to dallocate grid%em_v_2. ')
284  endif
285   NULLIFY(grid%em_v_2)
286 ENDIF
287 IF ( ASSOCIATED( grid%em_v_bxs ) ) THEN 
288   DEALLOCATE(grid%em_v_bxs,STAT=ierr)
289  if (ierr.ne.0) then
290  CALL wrf_error_fatal ( &
291 'frame/module_domain.f: Failed to dallocate grid%em_v_bxs. ')
292  endif
293   NULLIFY(grid%em_v_bxs)
294 ENDIF
295 IF ( ASSOCIATED( grid%em_v_bxe ) ) THEN 
296   DEALLOCATE(grid%em_v_bxe,STAT=ierr)
297  if (ierr.ne.0) then
298  CALL wrf_error_fatal ( &
299 'frame/module_domain.f: Failed to dallocate grid%em_v_bxe. ')
300  endif
301   NULLIFY(grid%em_v_bxe)
302 ENDIF
303 IF ( ASSOCIATED( grid%em_v_bys ) ) THEN 
304   DEALLOCATE(grid%em_v_bys,STAT=ierr)
305  if (ierr.ne.0) then
306  CALL wrf_error_fatal ( &
307 'frame/module_domain.f: Failed to dallocate grid%em_v_bys. ')
308  endif
309   NULLIFY(grid%em_v_bys)
310 ENDIF
311 IF ( ASSOCIATED( grid%em_v_bye ) ) THEN 
312   DEALLOCATE(grid%em_v_bye,STAT=ierr)
313  if (ierr.ne.0) then
314  CALL wrf_error_fatal ( &
315 'frame/module_domain.f: Failed to dallocate grid%em_v_bye. ')
316  endif
317   NULLIFY(grid%em_v_bye)
318 ENDIF
319 IF ( ASSOCIATED( grid%em_v_btxs ) ) THEN 
320   DEALLOCATE(grid%em_v_btxs,STAT=ierr)
321  if (ierr.ne.0) then
322  CALL wrf_error_fatal ( &
323 'frame/module_domain.f: Failed to dallocate grid%em_v_btxs. ')
324  endif
325   NULLIFY(grid%em_v_btxs)
326 ENDIF
327 IF ( ASSOCIATED( grid%em_v_btxe ) ) THEN 
328   DEALLOCATE(grid%em_v_btxe,STAT=ierr)
329  if (ierr.ne.0) then
330  CALL wrf_error_fatal ( &
331 'frame/module_domain.f: Failed to dallocate grid%em_v_btxe. ')
332  endif
333   NULLIFY(grid%em_v_btxe)
334 ENDIF
335 IF ( ASSOCIATED( grid%em_v_btys ) ) THEN 
336   DEALLOCATE(grid%em_v_btys,STAT=ierr)
337  if (ierr.ne.0) then
338  CALL wrf_error_fatal ( &
339 'frame/module_domain.f: Failed to dallocate grid%em_v_btys. ')
340  endif
341   NULLIFY(grid%em_v_btys)
342 ENDIF
343 IF ( ASSOCIATED( grid%em_v_btye ) ) THEN 
344   DEALLOCATE(grid%em_v_btye,STAT=ierr)
345  if (ierr.ne.0) then
346  CALL wrf_error_fatal ( &
347 'frame/module_domain.f: Failed to dallocate grid%em_v_btye. ')
348  endif
349   NULLIFY(grid%em_v_btye)
350 ENDIF
351 IF ( ASSOCIATED( grid%a_v_1 ) ) THEN 
352   DEALLOCATE(grid%a_v_1,STAT=ierr)
353  if (ierr.ne.0) then
354  CALL wrf_error_fatal ( &
355 'frame/module_domain.f: Failed to dallocate grid%a_v_1. ')
356  endif
357   NULLIFY(grid%a_v_1)
358 ENDIF
359 IF ( ASSOCIATED( grid%a_v_2 ) ) THEN 
360   DEALLOCATE(grid%a_v_2,STAT=ierr)
361  if (ierr.ne.0) then
362  CALL wrf_error_fatal ( &
363 'frame/module_domain.f: Failed to dallocate grid%a_v_2. ')
364  endif
365   NULLIFY(grid%a_v_2)
366 ENDIF
367 IF ( ASSOCIATED( grid%a_v_bxs ) ) THEN 
368   DEALLOCATE(grid%a_v_bxs,STAT=ierr)
369  if (ierr.ne.0) then
370  CALL wrf_error_fatal ( &
371 'frame/module_domain.f: Failed to dallocate grid%a_v_bxs. ')
372  endif
373   NULLIFY(grid%a_v_bxs)
374 ENDIF
375 IF ( ASSOCIATED( grid%a_v_bxe ) ) THEN 
376   DEALLOCATE(grid%a_v_bxe,STAT=ierr)
377  if (ierr.ne.0) then
378  CALL wrf_error_fatal ( &
379 'frame/module_domain.f: Failed to dallocate grid%a_v_bxe. ')
380  endif
381   NULLIFY(grid%a_v_bxe)
382 ENDIF
383 IF ( ASSOCIATED( grid%a_v_bys ) ) THEN 
384   DEALLOCATE(grid%a_v_bys,STAT=ierr)
385  if (ierr.ne.0) then
386  CALL wrf_error_fatal ( &
387 'frame/module_domain.f: Failed to dallocate grid%a_v_bys. ')
388  endif
389   NULLIFY(grid%a_v_bys)
390 ENDIF
391 IF ( ASSOCIATED( grid%a_v_bye ) ) THEN 
392   DEALLOCATE(grid%a_v_bye,STAT=ierr)
393  if (ierr.ne.0) then
394  CALL wrf_error_fatal ( &
395 'frame/module_domain.f: Failed to dallocate grid%a_v_bye. ')
396  endif
397   NULLIFY(grid%a_v_bye)
398 ENDIF
399 IF ( ASSOCIATED( grid%a_v_btxs ) ) THEN 
400   DEALLOCATE(grid%a_v_btxs,STAT=ierr)
401  if (ierr.ne.0) then
402  CALL wrf_error_fatal ( &
403 'frame/module_domain.f: Failed to dallocate grid%a_v_btxs. ')
404  endif
405   NULLIFY(grid%a_v_btxs)
406 ENDIF
407 IF ( ASSOCIATED( grid%a_v_btxe ) ) THEN 
408   DEALLOCATE(grid%a_v_btxe,STAT=ierr)
409  if (ierr.ne.0) then
410  CALL wrf_error_fatal ( &
411 'frame/module_domain.f: Failed to dallocate grid%a_v_btxe. ')
412  endif
413   NULLIFY(grid%a_v_btxe)
414 ENDIF
415 IF ( ASSOCIATED( grid%a_v_btys ) ) THEN 
416   DEALLOCATE(grid%a_v_btys,STAT=ierr)
417  if (ierr.ne.0) then
418  CALL wrf_error_fatal ( &
419 'frame/module_domain.f: Failed to dallocate grid%a_v_btys. ')
420  endif
421   NULLIFY(grid%a_v_btys)
422 ENDIF
423 IF ( ASSOCIATED( grid%a_v_btye ) ) THEN 
424   DEALLOCATE(grid%a_v_btye,STAT=ierr)
425  if (ierr.ne.0) then
426  CALL wrf_error_fatal ( &
427 'frame/module_domain.f: Failed to dallocate grid%a_v_btye. ')
428  endif
429   NULLIFY(grid%a_v_btye)
430 ENDIF
431 IF ( ASSOCIATED( grid%g_v_1 ) ) THEN 
432   DEALLOCATE(grid%g_v_1,STAT=ierr)
433  if (ierr.ne.0) then
434  CALL wrf_error_fatal ( &
435 'frame/module_domain.f: Failed to dallocate grid%g_v_1. ')
436  endif
437   NULLIFY(grid%g_v_1)
438 ENDIF
439 IF ( ASSOCIATED( grid%g_v_2 ) ) THEN 
440   DEALLOCATE(grid%g_v_2,STAT=ierr)
441  if (ierr.ne.0) then
442  CALL wrf_error_fatal ( &
443 'frame/module_domain.f: Failed to dallocate grid%g_v_2. ')
444  endif
445   NULLIFY(grid%g_v_2)
446 ENDIF
447 IF ( ASSOCIATED( grid%g_v_bxs ) ) THEN 
448   DEALLOCATE(grid%g_v_bxs,STAT=ierr)
449  if (ierr.ne.0) then
450  CALL wrf_error_fatal ( &
451 'frame/module_domain.f: Failed to dallocate grid%g_v_bxs. ')
452  endif
453   NULLIFY(grid%g_v_bxs)
454 ENDIF
455 IF ( ASSOCIATED( grid%g_v_bxe ) ) THEN 
456   DEALLOCATE(grid%g_v_bxe,STAT=ierr)
457  if (ierr.ne.0) then
458  CALL wrf_error_fatal ( &
459 'frame/module_domain.f: Failed to dallocate grid%g_v_bxe. ')
460  endif
461   NULLIFY(grid%g_v_bxe)
462 ENDIF
463 IF ( ASSOCIATED( grid%g_v_bys ) ) THEN 
464   DEALLOCATE(grid%g_v_bys,STAT=ierr)
465  if (ierr.ne.0) then
466  CALL wrf_error_fatal ( &
467 'frame/module_domain.f: Failed to dallocate grid%g_v_bys. ')
468  endif
469   NULLIFY(grid%g_v_bys)
470 ENDIF
471 IF ( ASSOCIATED( grid%g_v_bye ) ) THEN 
472   DEALLOCATE(grid%g_v_bye,STAT=ierr)
473  if (ierr.ne.0) then
474  CALL wrf_error_fatal ( &
475 'frame/module_domain.f: Failed to dallocate grid%g_v_bye. ')
476  endif
477   NULLIFY(grid%g_v_bye)
478 ENDIF
479 IF ( ASSOCIATED( grid%g_v_btxs ) ) THEN 
480   DEALLOCATE(grid%g_v_btxs,STAT=ierr)
481  if (ierr.ne.0) then
482  CALL wrf_error_fatal ( &
483 'frame/module_domain.f: Failed to dallocate grid%g_v_btxs. ')
484  endif
485   NULLIFY(grid%g_v_btxs)
486 ENDIF
487 IF ( ASSOCIATED( grid%g_v_btxe ) ) THEN 
488   DEALLOCATE(grid%g_v_btxe,STAT=ierr)
489  if (ierr.ne.0) then
490  CALL wrf_error_fatal ( &
491 'frame/module_domain.f: Failed to dallocate grid%g_v_btxe. ')
492  endif
493   NULLIFY(grid%g_v_btxe)
494 ENDIF
495 IF ( ASSOCIATED( grid%g_v_btys ) ) THEN 
496   DEALLOCATE(grid%g_v_btys,STAT=ierr)
497  if (ierr.ne.0) then
498  CALL wrf_error_fatal ( &
499 'frame/module_domain.f: Failed to dallocate grid%g_v_btys. ')
500  endif
501   NULLIFY(grid%g_v_btys)
502 ENDIF
503 IF ( ASSOCIATED( grid%g_v_btye ) ) THEN 
504   DEALLOCATE(grid%g_v_btye,STAT=ierr)
505  if (ierr.ne.0) then
506  CALL wrf_error_fatal ( &
507 'frame/module_domain.f: Failed to dallocate grid%g_v_btye. ')
508  endif
509   NULLIFY(grid%g_v_btye)
510 ENDIF
511 IF ( ASSOCIATED( grid%em_w_1 ) ) THEN 
512   DEALLOCATE(grid%em_w_1,STAT=ierr)
513  if (ierr.ne.0) then
514  CALL wrf_error_fatal ( &
515 'frame/module_domain.f: Failed to dallocate grid%em_w_1. ')
516  endif
517   NULLIFY(grid%em_w_1)
518 ENDIF
519 IF ( ASSOCIATED( grid%em_w_2 ) ) THEN 
520   DEALLOCATE(grid%em_w_2,STAT=ierr)
521  if (ierr.ne.0) then
522  CALL wrf_error_fatal ( &
523 'frame/module_domain.f: Failed to dallocate grid%em_w_2. ')
524  endif
525   NULLIFY(grid%em_w_2)
526 ENDIF
527 IF ( ASSOCIATED( grid%em_w_bxs ) ) THEN 
528   DEALLOCATE(grid%em_w_bxs,STAT=ierr)
529  if (ierr.ne.0) then
530  CALL wrf_error_fatal ( &
531 'frame/module_domain.f: Failed to dallocate grid%em_w_bxs. ')
532  endif
533   NULLIFY(grid%em_w_bxs)
534 ENDIF
535 IF ( ASSOCIATED( grid%em_w_bxe ) ) THEN 
536   DEALLOCATE(grid%em_w_bxe,STAT=ierr)
537  if (ierr.ne.0) then
538  CALL wrf_error_fatal ( &
539 'frame/module_domain.f: Failed to dallocate grid%em_w_bxe. ')
540  endif
541   NULLIFY(grid%em_w_bxe)
542 ENDIF
543 IF ( ASSOCIATED( grid%em_w_bys ) ) THEN 
544   DEALLOCATE(grid%em_w_bys,STAT=ierr)
545  if (ierr.ne.0) then
546  CALL wrf_error_fatal ( &
547 'frame/module_domain.f: Failed to dallocate grid%em_w_bys. ')
548  endif
549   NULLIFY(grid%em_w_bys)
550 ENDIF
551 IF ( ASSOCIATED( grid%em_w_bye ) ) THEN 
552   DEALLOCATE(grid%em_w_bye,STAT=ierr)
553  if (ierr.ne.0) then
554  CALL wrf_error_fatal ( &
555 'frame/module_domain.f: Failed to dallocate grid%em_w_bye. ')
556  endif
557   NULLIFY(grid%em_w_bye)
558 ENDIF
559 IF ( ASSOCIATED( grid%em_w_btxs ) ) THEN 
560   DEALLOCATE(grid%em_w_btxs,STAT=ierr)
561  if (ierr.ne.0) then
562  CALL wrf_error_fatal ( &
563 'frame/module_domain.f: Failed to dallocate grid%em_w_btxs. ')
564  endif
565   NULLIFY(grid%em_w_btxs)
566 ENDIF
567 IF ( ASSOCIATED( grid%em_w_btxe ) ) THEN 
568   DEALLOCATE(grid%em_w_btxe,STAT=ierr)
569  if (ierr.ne.0) then
570  CALL wrf_error_fatal ( &
571 'frame/module_domain.f: Failed to dallocate grid%em_w_btxe. ')
572  endif
573   NULLIFY(grid%em_w_btxe)
574 ENDIF
575 IF ( ASSOCIATED( grid%em_w_btys ) ) THEN 
576   DEALLOCATE(grid%em_w_btys,STAT=ierr)
577  if (ierr.ne.0) then
578  CALL wrf_error_fatal ( &
579 'frame/module_domain.f: Failed to dallocate grid%em_w_btys. ')
580  endif
581   NULLIFY(grid%em_w_btys)
582 ENDIF
583 IF ( ASSOCIATED( grid%em_w_btye ) ) THEN 
584   DEALLOCATE(grid%em_w_btye,STAT=ierr)
585  if (ierr.ne.0) then
586  CALL wrf_error_fatal ( &
587 'frame/module_domain.f: Failed to dallocate grid%em_w_btye. ')
588  endif
589   NULLIFY(grid%em_w_btye)
590 ENDIF
591 IF ( ASSOCIATED( grid%a_w_1 ) ) THEN 
592   DEALLOCATE(grid%a_w_1,STAT=ierr)
593  if (ierr.ne.0) then
594  CALL wrf_error_fatal ( &
595 'frame/module_domain.f: Failed to dallocate grid%a_w_1. ')
596  endif
597   NULLIFY(grid%a_w_1)
598 ENDIF
599 IF ( ASSOCIATED( grid%a_w_2 ) ) THEN 
600   DEALLOCATE(grid%a_w_2,STAT=ierr)
601  if (ierr.ne.0) then
602  CALL wrf_error_fatal ( &
603 'frame/module_domain.f: Failed to dallocate grid%a_w_2. ')
604  endif
605   NULLIFY(grid%a_w_2)
606 ENDIF
607 IF ( ASSOCIATED( grid%a_w_bxs ) ) THEN 
608   DEALLOCATE(grid%a_w_bxs,STAT=ierr)
609  if (ierr.ne.0) then
610  CALL wrf_error_fatal ( &
611 'frame/module_domain.f: Failed to dallocate grid%a_w_bxs. ')
612  endif
613   NULLIFY(grid%a_w_bxs)
614 ENDIF
615 IF ( ASSOCIATED( grid%a_w_bxe ) ) THEN 
616   DEALLOCATE(grid%a_w_bxe,STAT=ierr)
617  if (ierr.ne.0) then
618  CALL wrf_error_fatal ( &
619 'frame/module_domain.f: Failed to dallocate grid%a_w_bxe. ')
620  endif
621   NULLIFY(grid%a_w_bxe)
622 ENDIF
623 IF ( ASSOCIATED( grid%a_w_bys ) ) THEN 
624   DEALLOCATE(grid%a_w_bys,STAT=ierr)
625  if (ierr.ne.0) then
626  CALL wrf_error_fatal ( &
627 'frame/module_domain.f: Failed to dallocate grid%a_w_bys. ')
628  endif
629   NULLIFY(grid%a_w_bys)
630 ENDIF
631 IF ( ASSOCIATED( grid%a_w_bye ) ) THEN 
632   DEALLOCATE(grid%a_w_bye,STAT=ierr)
633  if (ierr.ne.0) then
634  CALL wrf_error_fatal ( &
635 'frame/module_domain.f: Failed to dallocate grid%a_w_bye. ')
636  endif
637   NULLIFY(grid%a_w_bye)
638 ENDIF
639 IF ( ASSOCIATED( grid%a_w_btxs ) ) THEN 
640   DEALLOCATE(grid%a_w_btxs,STAT=ierr)
641  if (ierr.ne.0) then
642  CALL wrf_error_fatal ( &
643 'frame/module_domain.f: Failed to dallocate grid%a_w_btxs. ')
644  endif
645   NULLIFY(grid%a_w_btxs)
646 ENDIF
647 IF ( ASSOCIATED( grid%a_w_btxe ) ) THEN 
648   DEALLOCATE(grid%a_w_btxe,STAT=ierr)
649  if (ierr.ne.0) then
650  CALL wrf_error_fatal ( &
651 'frame/module_domain.f: Failed to dallocate grid%a_w_btxe. ')
652  endif
653   NULLIFY(grid%a_w_btxe)
654 ENDIF
655 IF ( ASSOCIATED( grid%a_w_btys ) ) THEN 
656   DEALLOCATE(grid%a_w_btys,STAT=ierr)
657  if (ierr.ne.0) then
658  CALL wrf_error_fatal ( &
659 'frame/module_domain.f: Failed to dallocate grid%a_w_btys. ')
660  endif
661   NULLIFY(grid%a_w_btys)
662 ENDIF
663 IF ( ASSOCIATED( grid%a_w_btye ) ) THEN 
664   DEALLOCATE(grid%a_w_btye,STAT=ierr)
665  if (ierr.ne.0) then
666  CALL wrf_error_fatal ( &
667 'frame/module_domain.f: Failed to dallocate grid%a_w_btye. ')
668  endif
669   NULLIFY(grid%a_w_btye)
670 ENDIF
671 IF ( ASSOCIATED( grid%g_w_1 ) ) THEN 
672   DEALLOCATE(grid%g_w_1,STAT=ierr)
673  if (ierr.ne.0) then
674  CALL wrf_error_fatal ( &
675 'frame/module_domain.f: Failed to dallocate grid%g_w_1. ')
676  endif
677   NULLIFY(grid%g_w_1)
678 ENDIF
679 IF ( ASSOCIATED( grid%g_w_2 ) ) THEN 
680   DEALLOCATE(grid%g_w_2,STAT=ierr)
681  if (ierr.ne.0) then
682  CALL wrf_error_fatal ( &
683 'frame/module_domain.f: Failed to dallocate grid%g_w_2. ')
684  endif
685   NULLIFY(grid%g_w_2)
686 ENDIF
687 IF ( ASSOCIATED( grid%g_w_bxs ) ) THEN 
688   DEALLOCATE(grid%g_w_bxs,STAT=ierr)
689  if (ierr.ne.0) then
690  CALL wrf_error_fatal ( &
691 'frame/module_domain.f: Failed to dallocate grid%g_w_bxs. ')
692  endif
693   NULLIFY(grid%g_w_bxs)
694 ENDIF
695 IF ( ASSOCIATED( grid%g_w_bxe ) ) THEN 
696   DEALLOCATE(grid%g_w_bxe,STAT=ierr)
697  if (ierr.ne.0) then
698  CALL wrf_error_fatal ( &
699 'frame/module_domain.f: Failed to dallocate grid%g_w_bxe. ')
700  endif
701   NULLIFY(grid%g_w_bxe)
702 ENDIF
703 IF ( ASSOCIATED( grid%g_w_bys ) ) THEN 
704   DEALLOCATE(grid%g_w_bys,STAT=ierr)
705  if (ierr.ne.0) then
706  CALL wrf_error_fatal ( &
707 'frame/module_domain.f: Failed to dallocate grid%g_w_bys. ')
708  endif
709   NULLIFY(grid%g_w_bys)
710 ENDIF
711 IF ( ASSOCIATED( grid%g_w_bye ) ) THEN 
712   DEALLOCATE(grid%g_w_bye,STAT=ierr)
713  if (ierr.ne.0) then
714  CALL wrf_error_fatal ( &
715 'frame/module_domain.f: Failed to dallocate grid%g_w_bye. ')
716  endif
717   NULLIFY(grid%g_w_bye)
718 ENDIF
719 IF ( ASSOCIATED( grid%g_w_btxs ) ) THEN 
720   DEALLOCATE(grid%g_w_btxs,STAT=ierr)
721  if (ierr.ne.0) then
722  CALL wrf_error_fatal ( &
723 'frame/module_domain.f: Failed to dallocate grid%g_w_btxs. ')
724  endif
725   NULLIFY(grid%g_w_btxs)
726 ENDIF
727 IF ( ASSOCIATED( grid%g_w_btxe ) ) THEN 
728   DEALLOCATE(grid%g_w_btxe,STAT=ierr)
729  if (ierr.ne.0) then
730  CALL wrf_error_fatal ( &
731 'frame/module_domain.f: Failed to dallocate grid%g_w_btxe. ')
732  endif
733   NULLIFY(grid%g_w_btxe)
734 ENDIF
735 IF ( ASSOCIATED( grid%g_w_btys ) ) THEN 
736   DEALLOCATE(grid%g_w_btys,STAT=ierr)
737  if (ierr.ne.0) then
738  CALL wrf_error_fatal ( &
739 'frame/module_domain.f: Failed to dallocate grid%g_w_btys. ')
740  endif
741   NULLIFY(grid%g_w_btys)
742 ENDIF
743 IF ( ASSOCIATED( grid%g_w_btye ) ) THEN 
744   DEALLOCATE(grid%g_w_btye,STAT=ierr)
745  if (ierr.ne.0) then
746  CALL wrf_error_fatal ( &
747 'frame/module_domain.f: Failed to dallocate grid%g_w_btye. ')
748  endif
749   NULLIFY(grid%g_w_btye)
750 ENDIF
751 IF ( ASSOCIATED( grid%em_ph_1 ) ) THEN 
752   DEALLOCATE(grid%em_ph_1,STAT=ierr)
753  if (ierr.ne.0) then
754  CALL wrf_error_fatal ( &
755 'frame/module_domain.f: Failed to dallocate grid%em_ph_1. ')
756  endif
757   NULLIFY(grid%em_ph_1)
758 ENDIF
759 IF ( ASSOCIATED( grid%em_ph_2 ) ) THEN 
760   DEALLOCATE(grid%em_ph_2,STAT=ierr)
761  if (ierr.ne.0) then
762  CALL wrf_error_fatal ( &
763 'frame/module_domain.f: Failed to dallocate grid%em_ph_2. ')
764  endif
765   NULLIFY(grid%em_ph_2)
766 ENDIF
767 IF ( ASSOCIATED( grid%em_ph_bxs ) ) THEN 
768   DEALLOCATE(grid%em_ph_bxs,STAT=ierr)
769  if (ierr.ne.0) then
770  CALL wrf_error_fatal ( &
771 'frame/module_domain.f: Failed to dallocate grid%em_ph_bxs. ')
772  endif
773   NULLIFY(grid%em_ph_bxs)
774 ENDIF
775 IF ( ASSOCIATED( grid%em_ph_bxe ) ) THEN 
776   DEALLOCATE(grid%em_ph_bxe,STAT=ierr)
777  if (ierr.ne.0) then
778  CALL wrf_error_fatal ( &
779 'frame/module_domain.f: Failed to dallocate grid%em_ph_bxe. ')
780  endif
781   NULLIFY(grid%em_ph_bxe)
782 ENDIF
783 IF ( ASSOCIATED( grid%em_ph_bys ) ) THEN 
784   DEALLOCATE(grid%em_ph_bys,STAT=ierr)
785  if (ierr.ne.0) then
786  CALL wrf_error_fatal ( &
787 'frame/module_domain.f: Failed to dallocate grid%em_ph_bys. ')
788  endif
789   NULLIFY(grid%em_ph_bys)
790 ENDIF
791 IF ( ASSOCIATED( grid%em_ph_bye ) ) THEN 
792   DEALLOCATE(grid%em_ph_bye,STAT=ierr)
793  if (ierr.ne.0) then
794  CALL wrf_error_fatal ( &
795 'frame/module_domain.f: Failed to dallocate grid%em_ph_bye. ')
796  endif
797   NULLIFY(grid%em_ph_bye)
798 ENDIF
799 IF ( ASSOCIATED( grid%em_ph_btxs ) ) THEN 
800   DEALLOCATE(grid%em_ph_btxs,STAT=ierr)
801  if (ierr.ne.0) then
802  CALL wrf_error_fatal ( &
803 'frame/module_domain.f: Failed to dallocate grid%em_ph_btxs. ')
804  endif
805   NULLIFY(grid%em_ph_btxs)
806 ENDIF
807 IF ( ASSOCIATED( grid%em_ph_btxe ) ) THEN 
808   DEALLOCATE(grid%em_ph_btxe,STAT=ierr)
809  if (ierr.ne.0) then
810  CALL wrf_error_fatal ( &
811 'frame/module_domain.f: Failed to dallocate grid%em_ph_btxe. ')
812  endif
813   NULLIFY(grid%em_ph_btxe)
814 ENDIF
815 IF ( ASSOCIATED( grid%em_ph_btys ) ) THEN 
816   DEALLOCATE(grid%em_ph_btys,STAT=ierr)
817  if (ierr.ne.0) then
818  CALL wrf_error_fatal ( &
819 'frame/module_domain.f: Failed to dallocate grid%em_ph_btys. ')
820  endif
821   NULLIFY(grid%em_ph_btys)
822 ENDIF
823 IF ( ASSOCIATED( grid%em_ph_btye ) ) THEN 
824   DEALLOCATE(grid%em_ph_btye,STAT=ierr)
825  if (ierr.ne.0) then
826  CALL wrf_error_fatal ( &
827 'frame/module_domain.f: Failed to dallocate grid%em_ph_btye. ')
828  endif
829   NULLIFY(grid%em_ph_btye)
830 ENDIF
831 IF ( ASSOCIATED( grid%a_ph_1 ) ) THEN 
832   DEALLOCATE(grid%a_ph_1,STAT=ierr)
833  if (ierr.ne.0) then
834  CALL wrf_error_fatal ( &
835 'frame/module_domain.f: Failed to dallocate grid%a_ph_1. ')
836  endif
837   NULLIFY(grid%a_ph_1)
838 ENDIF
839 IF ( ASSOCIATED( grid%a_ph_2 ) ) THEN 
840   DEALLOCATE(grid%a_ph_2,STAT=ierr)
841  if (ierr.ne.0) then
842  CALL wrf_error_fatal ( &
843 'frame/module_domain.f: Failed to dallocate grid%a_ph_2. ')
844  endif
845   NULLIFY(grid%a_ph_2)
846 ENDIF
847 IF ( ASSOCIATED( grid%a_ph_bxs ) ) THEN 
848   DEALLOCATE(grid%a_ph_bxs,STAT=ierr)
849  if (ierr.ne.0) then
850  CALL wrf_error_fatal ( &
851 'frame/module_domain.f: Failed to dallocate grid%a_ph_bxs. ')
852  endif
853   NULLIFY(grid%a_ph_bxs)
854 ENDIF
855 IF ( ASSOCIATED( grid%a_ph_bxe ) ) THEN 
856   DEALLOCATE(grid%a_ph_bxe,STAT=ierr)
857  if (ierr.ne.0) then
858  CALL wrf_error_fatal ( &
859 'frame/module_domain.f: Failed to dallocate grid%a_ph_bxe. ')
860  endif
861   NULLIFY(grid%a_ph_bxe)
862 ENDIF
863 IF ( ASSOCIATED( grid%a_ph_bys ) ) THEN 
864   DEALLOCATE(grid%a_ph_bys,STAT=ierr)
865  if (ierr.ne.0) then
866  CALL wrf_error_fatal ( &
867 'frame/module_domain.f: Failed to dallocate grid%a_ph_bys. ')
868  endif
869   NULLIFY(grid%a_ph_bys)
870 ENDIF
871 IF ( ASSOCIATED( grid%a_ph_bye ) ) THEN 
872   DEALLOCATE(grid%a_ph_bye,STAT=ierr)
873  if (ierr.ne.0) then
874  CALL wrf_error_fatal ( &
875 'frame/module_domain.f: Failed to dallocate grid%a_ph_bye. ')
876  endif
877   NULLIFY(grid%a_ph_bye)
878 ENDIF
879 IF ( ASSOCIATED( grid%a_ph_btxs ) ) THEN 
880   DEALLOCATE(grid%a_ph_btxs,STAT=ierr)
881  if (ierr.ne.0) then
882  CALL wrf_error_fatal ( &
883 'frame/module_domain.f: Failed to dallocate grid%a_ph_btxs. ')
884  endif
885   NULLIFY(grid%a_ph_btxs)
886 ENDIF
887 IF ( ASSOCIATED( grid%a_ph_btxe ) ) THEN 
888   DEALLOCATE(grid%a_ph_btxe,STAT=ierr)
889  if (ierr.ne.0) then
890  CALL wrf_error_fatal ( &
891 'frame/module_domain.f: Failed to dallocate grid%a_ph_btxe. ')
892  endif
893   NULLIFY(grid%a_ph_btxe)
894 ENDIF
895 IF ( ASSOCIATED( grid%a_ph_btys ) ) THEN 
896   DEALLOCATE(grid%a_ph_btys,STAT=ierr)
897  if (ierr.ne.0) then
898  CALL wrf_error_fatal ( &
899 'frame/module_domain.f: Failed to dallocate grid%a_ph_btys. ')
900  endif
901   NULLIFY(grid%a_ph_btys)
902 ENDIF
903 IF ( ASSOCIATED( grid%a_ph_btye ) ) THEN 
904   DEALLOCATE(grid%a_ph_btye,STAT=ierr)
905  if (ierr.ne.0) then
906  CALL wrf_error_fatal ( &
907 'frame/module_domain.f: Failed to dallocate grid%a_ph_btye. ')
908  endif
909   NULLIFY(grid%a_ph_btye)
910 ENDIF
911 IF ( ASSOCIATED( grid%g_ph_1 ) ) THEN 
912   DEALLOCATE(grid%g_ph_1,STAT=ierr)
913  if (ierr.ne.0) then
914  CALL wrf_error_fatal ( &
915 'frame/module_domain.f: Failed to dallocate grid%g_ph_1. ')
916  endif
917   NULLIFY(grid%g_ph_1)
918 ENDIF
919 IF ( ASSOCIATED( grid%g_ph_2 ) ) THEN 
920   DEALLOCATE(grid%g_ph_2,STAT=ierr)
921  if (ierr.ne.0) then
922  CALL wrf_error_fatal ( &
923 'frame/module_domain.f: Failed to dallocate grid%g_ph_2. ')
924  endif
925   NULLIFY(grid%g_ph_2)
926 ENDIF
927 IF ( ASSOCIATED( grid%g_ph_bxs ) ) THEN 
928   DEALLOCATE(grid%g_ph_bxs,STAT=ierr)
929  if (ierr.ne.0) then
930  CALL wrf_error_fatal ( &
931 'frame/module_domain.f: Failed to dallocate grid%g_ph_bxs. ')
932  endif
933   NULLIFY(grid%g_ph_bxs)
934 ENDIF
935 IF ( ASSOCIATED( grid%g_ph_bxe ) ) THEN 
936   DEALLOCATE(grid%g_ph_bxe,STAT=ierr)
937  if (ierr.ne.0) then
938  CALL wrf_error_fatal ( &
939 'frame/module_domain.f: Failed to dallocate grid%g_ph_bxe. ')
940  endif
941   NULLIFY(grid%g_ph_bxe)
942 ENDIF
943 IF ( ASSOCIATED( grid%g_ph_bys ) ) THEN 
944   DEALLOCATE(grid%g_ph_bys,STAT=ierr)
945  if (ierr.ne.0) then
946  CALL wrf_error_fatal ( &
947 'frame/module_domain.f: Failed to dallocate grid%g_ph_bys. ')
948  endif
949   NULLIFY(grid%g_ph_bys)
950 ENDIF
951 IF ( ASSOCIATED( grid%g_ph_bye ) ) THEN 
952   DEALLOCATE(grid%g_ph_bye,STAT=ierr)
953  if (ierr.ne.0) then
954  CALL wrf_error_fatal ( &
955 'frame/module_domain.f: Failed to dallocate grid%g_ph_bye. ')
956  endif
957   NULLIFY(grid%g_ph_bye)
958 ENDIF
959 IF ( ASSOCIATED( grid%g_ph_btxs ) ) THEN 
960   DEALLOCATE(grid%g_ph_btxs,STAT=ierr)
961  if (ierr.ne.0) then
962  CALL wrf_error_fatal ( &
963 'frame/module_domain.f: Failed to dallocate grid%g_ph_btxs. ')
964  endif
965   NULLIFY(grid%g_ph_btxs)
966 ENDIF
967 IF ( ASSOCIATED( grid%g_ph_btxe ) ) THEN 
968   DEALLOCATE(grid%g_ph_btxe,STAT=ierr)
969  if (ierr.ne.0) then
970  CALL wrf_error_fatal ( &
971 'frame/module_domain.f: Failed to dallocate grid%g_ph_btxe. ')
972  endif
973   NULLIFY(grid%g_ph_btxe)
974 ENDIF
975 IF ( ASSOCIATED( grid%g_ph_btys ) ) THEN 
976   DEALLOCATE(grid%g_ph_btys,STAT=ierr)
977  if (ierr.ne.0) then
978  CALL wrf_error_fatal ( &
979 'frame/module_domain.f: Failed to dallocate grid%g_ph_btys. ')
980  endif
981   NULLIFY(grid%g_ph_btys)
982 ENDIF
983 IF ( ASSOCIATED( grid%g_ph_btye ) ) THEN 
984   DEALLOCATE(grid%g_ph_btye,STAT=ierr)
985  if (ierr.ne.0) then
986  CALL wrf_error_fatal ( &
987 'frame/module_domain.f: Failed to dallocate grid%g_ph_btye. ')
988  endif
989   NULLIFY(grid%g_ph_btye)
990 ENDIF
991 IF ( ASSOCIATED( grid%em_phb ) ) THEN 
992   DEALLOCATE(grid%em_phb,STAT=ierr)
993  if (ierr.ne.0) then
994  CALL wrf_error_fatal ( &
995 'frame/module_domain.f: Failed to dallocate grid%em_phb. ')
996  endif
997   NULLIFY(grid%em_phb)
998 ENDIF
999 IF ( ASSOCIATED( grid%em_t_1 ) ) THEN 
1000   DEALLOCATE(grid%em_t_1,STAT=ierr)
1001  if (ierr.ne.0) then
1002  CALL wrf_error_fatal ( &
1003 'frame/module_domain.f: Failed to dallocate grid%em_t_1. ')
1004  endif
1005   NULLIFY(grid%em_t_1)
1006 ENDIF
1007 IF ( ASSOCIATED( grid%em_t_2 ) ) THEN 
1008   DEALLOCATE(grid%em_t_2,STAT=ierr)
1009  if (ierr.ne.0) then
1010  CALL wrf_error_fatal ( &
1011 'frame/module_domain.f: Failed to dallocate grid%em_t_2. ')
1012  endif
1013   NULLIFY(grid%em_t_2)
1014 ENDIF
1015 IF ( ASSOCIATED( grid%em_t_bxs ) ) THEN 
1016   DEALLOCATE(grid%em_t_bxs,STAT=ierr)
1017  if (ierr.ne.0) then
1018  CALL wrf_error_fatal ( &
1019 'frame/module_domain.f: Failed to dallocate grid%em_t_bxs. ')
1020  endif
1021   NULLIFY(grid%em_t_bxs)
1022 ENDIF
1023 IF ( ASSOCIATED( grid%em_t_bxe ) ) THEN 
1024   DEALLOCATE(grid%em_t_bxe,STAT=ierr)
1025  if (ierr.ne.0) then
1026  CALL wrf_error_fatal ( &
1027 'frame/module_domain.f: Failed to dallocate grid%em_t_bxe. ')
1028  endif
1029   NULLIFY(grid%em_t_bxe)
1030 ENDIF
1031 IF ( ASSOCIATED( grid%em_t_bys ) ) THEN 
1032   DEALLOCATE(grid%em_t_bys,STAT=ierr)
1033  if (ierr.ne.0) then
1034  CALL wrf_error_fatal ( &
1035 'frame/module_domain.f: Failed to dallocate grid%em_t_bys. ')
1036  endif
1037   NULLIFY(grid%em_t_bys)
1038 ENDIF
1039 IF ( ASSOCIATED( grid%em_t_bye ) ) THEN 
1040   DEALLOCATE(grid%em_t_bye,STAT=ierr)
1041  if (ierr.ne.0) then
1042  CALL wrf_error_fatal ( &
1043 'frame/module_domain.f: Failed to dallocate grid%em_t_bye. ')
1044  endif
1045   NULLIFY(grid%em_t_bye)
1046 ENDIF
1047 IF ( ASSOCIATED( grid%em_t_btxs ) ) THEN 
1048   DEALLOCATE(grid%em_t_btxs,STAT=ierr)
1049  if (ierr.ne.0) then
1050  CALL wrf_error_fatal ( &
1051 'frame/module_domain.f: Failed to dallocate grid%em_t_btxs. ')
1052  endif
1053   NULLIFY(grid%em_t_btxs)
1054 ENDIF
1055 IF ( ASSOCIATED( grid%em_t_btxe ) ) THEN 
1056   DEALLOCATE(grid%em_t_btxe,STAT=ierr)
1057  if (ierr.ne.0) then
1058  CALL wrf_error_fatal ( &
1059 'frame/module_domain.f: Failed to dallocate grid%em_t_btxe. ')
1060  endif
1061   NULLIFY(grid%em_t_btxe)
1062 ENDIF
1063 IF ( ASSOCIATED( grid%em_t_btys ) ) THEN 
1064   DEALLOCATE(grid%em_t_btys,STAT=ierr)
1065  if (ierr.ne.0) then
1066  CALL wrf_error_fatal ( &
1067 'frame/module_domain.f: Failed to dallocate grid%em_t_btys. ')
1068  endif
1069   NULLIFY(grid%em_t_btys)
1070 ENDIF
1071 IF ( ASSOCIATED( grid%em_t_btye ) ) THEN 
1072   DEALLOCATE(grid%em_t_btye,STAT=ierr)
1073  if (ierr.ne.0) then
1074  CALL wrf_error_fatal ( &
1075 'frame/module_domain.f: Failed to dallocate grid%em_t_btye. ')
1076  endif
1077   NULLIFY(grid%em_t_btye)
1078 ENDIF
1079 IF ( ASSOCIATED( grid%a_t_1 ) ) THEN 
1080   DEALLOCATE(grid%a_t_1,STAT=ierr)
1081  if (ierr.ne.0) then
1082  CALL wrf_error_fatal ( &
1083 'frame/module_domain.f: Failed to dallocate grid%a_t_1. ')
1084  endif
1085   NULLIFY(grid%a_t_1)
1086 ENDIF
1087 IF ( ASSOCIATED( grid%a_t_2 ) ) THEN 
1088   DEALLOCATE(grid%a_t_2,STAT=ierr)
1089  if (ierr.ne.0) then
1090  CALL wrf_error_fatal ( &
1091 'frame/module_domain.f: Failed to dallocate grid%a_t_2. ')
1092  endif
1093   NULLIFY(grid%a_t_2)
1094 ENDIF
1095 IF ( ASSOCIATED( grid%a_t_bxs ) ) THEN 
1096   DEALLOCATE(grid%a_t_bxs,STAT=ierr)
1097  if (ierr.ne.0) then
1098  CALL wrf_error_fatal ( &
1099 'frame/module_domain.f: Failed to dallocate grid%a_t_bxs. ')
1100  endif
1101   NULLIFY(grid%a_t_bxs)
1102 ENDIF
1103 IF ( ASSOCIATED( grid%a_t_bxe ) ) THEN 
1104   DEALLOCATE(grid%a_t_bxe,STAT=ierr)
1105  if (ierr.ne.0) then
1106  CALL wrf_error_fatal ( &
1107 'frame/module_domain.f: Failed to dallocate grid%a_t_bxe. ')
1108  endif
1109   NULLIFY(grid%a_t_bxe)
1110 ENDIF
1111 IF ( ASSOCIATED( grid%a_t_bys ) ) THEN 
1112   DEALLOCATE(grid%a_t_bys,STAT=ierr)
1113  if (ierr.ne.0) then
1114  CALL wrf_error_fatal ( &
1115 'frame/module_domain.f: Failed to dallocate grid%a_t_bys. ')
1116  endif
1117   NULLIFY(grid%a_t_bys)
1118 ENDIF
1119 IF ( ASSOCIATED( grid%a_t_bye ) ) THEN 
1120   DEALLOCATE(grid%a_t_bye,STAT=ierr)
1121  if (ierr.ne.0) then
1122  CALL wrf_error_fatal ( &
1123 'frame/module_domain.f: Failed to dallocate grid%a_t_bye. ')
1124  endif
1125   NULLIFY(grid%a_t_bye)
1126 ENDIF
1127 IF ( ASSOCIATED( grid%a_t_btxs ) ) THEN 
1128   DEALLOCATE(grid%a_t_btxs,STAT=ierr)
1129  if (ierr.ne.0) then
1130  CALL wrf_error_fatal ( &
1131 'frame/module_domain.f: Failed to dallocate grid%a_t_btxs. ')
1132  endif
1133   NULLIFY(grid%a_t_btxs)
1134 ENDIF
1135 IF ( ASSOCIATED( grid%a_t_btxe ) ) THEN 
1136   DEALLOCATE(grid%a_t_btxe,STAT=ierr)
1137  if (ierr.ne.0) then
1138  CALL wrf_error_fatal ( &
1139 'frame/module_domain.f: Failed to dallocate grid%a_t_btxe. ')
1140  endif
1141   NULLIFY(grid%a_t_btxe)
1142 ENDIF
1143 IF ( ASSOCIATED( grid%a_t_btys ) ) THEN 
1144   DEALLOCATE(grid%a_t_btys,STAT=ierr)
1145  if (ierr.ne.0) then
1146  CALL wrf_error_fatal ( &
1147 'frame/module_domain.f: Failed to dallocate grid%a_t_btys. ')
1148  endif
1149   NULLIFY(grid%a_t_btys)
1150 ENDIF
1151 IF ( ASSOCIATED( grid%a_t_btye ) ) THEN 
1152   DEALLOCATE(grid%a_t_btye,STAT=ierr)
1153  if (ierr.ne.0) then
1154  CALL wrf_error_fatal ( &
1155 'frame/module_domain.f: Failed to dallocate grid%a_t_btye. ')
1156  endif
1157   NULLIFY(grid%a_t_btye)
1158 ENDIF
1159 IF ( ASSOCIATED( grid%g_t_1 ) ) THEN 
1160   DEALLOCATE(grid%g_t_1,STAT=ierr)
1161  if (ierr.ne.0) then
1162  CALL wrf_error_fatal ( &
1163 'frame/module_domain.f: Failed to dallocate grid%g_t_1. ')
1164  endif
1165   NULLIFY(grid%g_t_1)
1166 ENDIF
1167 IF ( ASSOCIATED( grid%g_t_2 ) ) THEN 
1168   DEALLOCATE(grid%g_t_2,STAT=ierr)
1169  if (ierr.ne.0) then
1170  CALL wrf_error_fatal ( &
1171 'frame/module_domain.f: Failed to dallocate grid%g_t_2. ')
1172  endif
1173   NULLIFY(grid%g_t_2)
1174 ENDIF
1175 IF ( ASSOCIATED( grid%g_t_bxs ) ) THEN 
1176   DEALLOCATE(grid%g_t_bxs,STAT=ierr)
1177  if (ierr.ne.0) then
1178  CALL wrf_error_fatal ( &
1179 'frame/module_domain.f: Failed to dallocate grid%g_t_bxs. ')
1180  endif
1181   NULLIFY(grid%g_t_bxs)
1182 ENDIF
1183 IF ( ASSOCIATED( grid%g_t_bxe ) ) THEN 
1184   DEALLOCATE(grid%g_t_bxe,STAT=ierr)
1185  if (ierr.ne.0) then
1186  CALL wrf_error_fatal ( &
1187 'frame/module_domain.f: Failed to dallocate grid%g_t_bxe. ')
1188  endif
1189   NULLIFY(grid%g_t_bxe)
1190 ENDIF
1191 IF ( ASSOCIATED( grid%g_t_bys ) ) THEN 
1192   DEALLOCATE(grid%g_t_bys,STAT=ierr)
1193  if (ierr.ne.0) then
1194  CALL wrf_error_fatal ( &
1195 'frame/module_domain.f: Failed to dallocate grid%g_t_bys. ')
1196  endif
1197   NULLIFY(grid%g_t_bys)
1198 ENDIF
1199 IF ( ASSOCIATED( grid%g_t_bye ) ) THEN 
1200   DEALLOCATE(grid%g_t_bye,STAT=ierr)
1201  if (ierr.ne.0) then
1202  CALL wrf_error_fatal ( &
1203 'frame/module_domain.f: Failed to dallocate grid%g_t_bye. ')
1204  endif
1205   NULLIFY(grid%g_t_bye)
1206 ENDIF
1207 IF ( ASSOCIATED( grid%g_t_btxs ) ) THEN 
1208   DEALLOCATE(grid%g_t_btxs,STAT=ierr)
1209  if (ierr.ne.0) then
1210  CALL wrf_error_fatal ( &
1211 'frame/module_domain.f: Failed to dallocate grid%g_t_btxs. ')
1212  endif
1213   NULLIFY(grid%g_t_btxs)
1214 ENDIF
1215 IF ( ASSOCIATED( grid%g_t_btxe ) ) THEN 
1216   DEALLOCATE(grid%g_t_btxe,STAT=ierr)
1217  if (ierr.ne.0) then
1218  CALL wrf_error_fatal ( &
1219 'frame/module_domain.f: Failed to dallocate grid%g_t_btxe. ')
1220  endif
1221   NULLIFY(grid%g_t_btxe)
1222 ENDIF
1223 IF ( ASSOCIATED( grid%g_t_btys ) ) THEN 
1224   DEALLOCATE(grid%g_t_btys,STAT=ierr)
1225  if (ierr.ne.0) then
1226  CALL wrf_error_fatal ( &
1227 'frame/module_domain.f: Failed to dallocate grid%g_t_btys. ')
1228  endif
1229   NULLIFY(grid%g_t_btys)
1230 ENDIF
1231 IF ( ASSOCIATED( grid%g_t_btye ) ) THEN 
1232   DEALLOCATE(grid%g_t_btye,STAT=ierr)
1233  if (ierr.ne.0) then
1234  CALL wrf_error_fatal ( &
1235 'frame/module_domain.f: Failed to dallocate grid%g_t_btye. ')
1236  endif
1237   NULLIFY(grid%g_t_btye)
1238 ENDIF
1239 IF ( ASSOCIATED( grid%em_mu_1 ) ) THEN 
1240   DEALLOCATE(grid%em_mu_1,STAT=ierr)
1241  if (ierr.ne.0) then
1242  CALL wrf_error_fatal ( &
1243 'frame/module_domain.f: Failed to dallocate grid%em_mu_1. ')
1244  endif
1245   NULLIFY(grid%em_mu_1)
1246 ENDIF
1247 IF ( ASSOCIATED( grid%em_mu_2 ) ) THEN 
1248   DEALLOCATE(grid%em_mu_2,STAT=ierr)
1249  if (ierr.ne.0) then
1250  CALL wrf_error_fatal ( &
1251 'frame/module_domain.f: Failed to dallocate grid%em_mu_2. ')
1252  endif
1253   NULLIFY(grid%em_mu_2)
1254 ENDIF
1255 IF ( ASSOCIATED( grid%em_mu_bxs ) ) THEN 
1256   DEALLOCATE(grid%em_mu_bxs,STAT=ierr)
1257  if (ierr.ne.0) then
1258  CALL wrf_error_fatal ( &
1259 'frame/module_domain.f: Failed to dallocate grid%em_mu_bxs. ')
1260  endif
1261   NULLIFY(grid%em_mu_bxs)
1262 ENDIF
1263 IF ( ASSOCIATED( grid%em_mu_bxe ) ) THEN 
1264   DEALLOCATE(grid%em_mu_bxe,STAT=ierr)
1265  if (ierr.ne.0) then
1266  CALL wrf_error_fatal ( &
1267 'frame/module_domain.f: Failed to dallocate grid%em_mu_bxe. ')
1268  endif
1269   NULLIFY(grid%em_mu_bxe)
1270 ENDIF
1271 IF ( ASSOCIATED( grid%em_mu_bys ) ) THEN 
1272   DEALLOCATE(grid%em_mu_bys,STAT=ierr)
1273  if (ierr.ne.0) then
1274  CALL wrf_error_fatal ( &
1275 'frame/module_domain.f: Failed to dallocate grid%em_mu_bys. ')
1276  endif
1277   NULLIFY(grid%em_mu_bys)
1278 ENDIF
1279 IF ( ASSOCIATED( grid%em_mu_bye ) ) THEN 
1280   DEALLOCATE(grid%em_mu_bye,STAT=ierr)
1281  if (ierr.ne.0) then
1282  CALL wrf_error_fatal ( &
1283 'frame/module_domain.f: Failed to dallocate grid%em_mu_bye. ')
1284  endif
1285   NULLIFY(grid%em_mu_bye)
1286 ENDIF
1287 IF ( ASSOCIATED( grid%em_mu_btxs ) ) THEN 
1288   DEALLOCATE(grid%em_mu_btxs,STAT=ierr)
1289  if (ierr.ne.0) then
1290  CALL wrf_error_fatal ( &
1291 'frame/module_domain.f: Failed to dallocate grid%em_mu_btxs. ')
1292  endif
1293   NULLIFY(grid%em_mu_btxs)
1294 ENDIF
1295 IF ( ASSOCIATED( grid%em_mu_btxe ) ) THEN 
1296   DEALLOCATE(grid%em_mu_btxe,STAT=ierr)
1297  if (ierr.ne.0) then
1298  CALL wrf_error_fatal ( &
1299 'frame/module_domain.f: Failed to dallocate grid%em_mu_btxe. ')
1300  endif
1301   NULLIFY(grid%em_mu_btxe)
1302 ENDIF
1303 IF ( ASSOCIATED( grid%em_mu_btys ) ) THEN 
1304   DEALLOCATE(grid%em_mu_btys,STAT=ierr)
1305  if (ierr.ne.0) then
1306  CALL wrf_error_fatal ( &
1307 'frame/module_domain.f: Failed to dallocate grid%em_mu_btys. ')
1308  endif
1309   NULLIFY(grid%em_mu_btys)
1310 ENDIF
1311 IF ( ASSOCIATED( grid%em_mu_btye ) ) THEN 
1312   DEALLOCATE(grid%em_mu_btye,STAT=ierr)
1313  if (ierr.ne.0) then
1314  CALL wrf_error_fatal ( &
1315 'frame/module_domain.f: Failed to dallocate grid%em_mu_btye. ')
1316  endif
1317   NULLIFY(grid%em_mu_btye)
1318 ENDIF
1319 IF ( ASSOCIATED( grid%a_mu_1 ) ) THEN 
1320   DEALLOCATE(grid%a_mu_1,STAT=ierr)
1321  if (ierr.ne.0) then
1322  CALL wrf_error_fatal ( &
1323 'frame/module_domain.f: Failed to dallocate grid%a_mu_1. ')
1324  endif
1325   NULLIFY(grid%a_mu_1)
1326 ENDIF
1327 IF ( ASSOCIATED( grid%a_mu_2 ) ) THEN 
1328   DEALLOCATE(grid%a_mu_2,STAT=ierr)
1329  if (ierr.ne.0) then
1330  CALL wrf_error_fatal ( &
1331 'frame/module_domain.f: Failed to dallocate grid%a_mu_2. ')
1332  endif
1333   NULLIFY(grid%a_mu_2)
1334 ENDIF
1335 IF ( ASSOCIATED( grid%a_mu_bxs ) ) THEN 
1336   DEALLOCATE(grid%a_mu_bxs,STAT=ierr)
1337  if (ierr.ne.0) then
1338  CALL wrf_error_fatal ( &
1339 'frame/module_domain.f: Failed to dallocate grid%a_mu_bxs. ')
1340  endif
1341   NULLIFY(grid%a_mu_bxs)
1342 ENDIF
1343 IF ( ASSOCIATED( grid%a_mu_bxe ) ) THEN 
1344   DEALLOCATE(grid%a_mu_bxe,STAT=ierr)
1345  if (ierr.ne.0) then
1346  CALL wrf_error_fatal ( &
1347 'frame/module_domain.f: Failed to dallocate grid%a_mu_bxe. ')
1348  endif
1349   NULLIFY(grid%a_mu_bxe)
1350 ENDIF
1351 IF ( ASSOCIATED( grid%a_mu_bys ) ) THEN 
1352   DEALLOCATE(grid%a_mu_bys,STAT=ierr)
1353  if (ierr.ne.0) then
1354  CALL wrf_error_fatal ( &
1355 'frame/module_domain.f: Failed to dallocate grid%a_mu_bys. ')
1356  endif
1357   NULLIFY(grid%a_mu_bys)
1358 ENDIF
1359 IF ( ASSOCIATED( grid%a_mu_bye ) ) THEN 
1360   DEALLOCATE(grid%a_mu_bye,STAT=ierr)
1361  if (ierr.ne.0) then
1362  CALL wrf_error_fatal ( &
1363 'frame/module_domain.f: Failed to dallocate grid%a_mu_bye. ')
1364  endif
1365   NULLIFY(grid%a_mu_bye)
1366 ENDIF
1367 IF ( ASSOCIATED( grid%a_mu_btxs ) ) THEN 
1368   DEALLOCATE(grid%a_mu_btxs,STAT=ierr)
1369  if (ierr.ne.0) then
1370  CALL wrf_error_fatal ( &
1371 'frame/module_domain.f: Failed to dallocate grid%a_mu_btxs. ')
1372  endif
1373   NULLIFY(grid%a_mu_btxs)
1374 ENDIF
1375 IF ( ASSOCIATED( grid%a_mu_btxe ) ) THEN 
1376   DEALLOCATE(grid%a_mu_btxe,STAT=ierr)
1377  if (ierr.ne.0) then
1378  CALL wrf_error_fatal ( &
1379 'frame/module_domain.f: Failed to dallocate grid%a_mu_btxe. ')
1380  endif
1381   NULLIFY(grid%a_mu_btxe)
1382 ENDIF
1383 IF ( ASSOCIATED( grid%a_mu_btys ) ) THEN 
1384   DEALLOCATE(grid%a_mu_btys,STAT=ierr)
1385  if (ierr.ne.0) then
1386  CALL wrf_error_fatal ( &
1387 'frame/module_domain.f: Failed to dallocate grid%a_mu_btys. ')
1388  endif
1389   NULLIFY(grid%a_mu_btys)
1390 ENDIF
1391 IF ( ASSOCIATED( grid%a_mu_btye ) ) THEN 
1392   DEALLOCATE(grid%a_mu_btye,STAT=ierr)
1393  if (ierr.ne.0) then
1394  CALL wrf_error_fatal ( &
1395 'frame/module_domain.f: Failed to dallocate grid%a_mu_btye. ')
1396  endif
1397   NULLIFY(grid%a_mu_btye)
1398 ENDIF
1399 IF ( ASSOCIATED( grid%g_mu_1 ) ) THEN 
1400   DEALLOCATE(grid%g_mu_1,STAT=ierr)
1401  if (ierr.ne.0) then
1402  CALL wrf_error_fatal ( &
1403 'frame/module_domain.f: Failed to dallocate grid%g_mu_1. ')
1404  endif
1405   NULLIFY(grid%g_mu_1)
1406 ENDIF
1407 IF ( ASSOCIATED( grid%g_mu_2 ) ) THEN 
1408   DEALLOCATE(grid%g_mu_2,STAT=ierr)
1409  if (ierr.ne.0) then
1410  CALL wrf_error_fatal ( &
1411 'frame/module_domain.f: Failed to dallocate grid%g_mu_2. ')
1412  endif
1413   NULLIFY(grid%g_mu_2)
1414 ENDIF
1415 IF ( ASSOCIATED( grid%g_mu_bxs ) ) THEN 
1416   DEALLOCATE(grid%g_mu_bxs,STAT=ierr)
1417  if (ierr.ne.0) then
1418  CALL wrf_error_fatal ( &
1419 'frame/module_domain.f: Failed to dallocate grid%g_mu_bxs. ')
1420  endif
1421   NULLIFY(grid%g_mu_bxs)
1422 ENDIF
1423 IF ( ASSOCIATED( grid%g_mu_bxe ) ) THEN 
1424   DEALLOCATE(grid%g_mu_bxe,STAT=ierr)
1425  if (ierr.ne.0) then
1426  CALL wrf_error_fatal ( &
1427 'frame/module_domain.f: Failed to dallocate grid%g_mu_bxe. ')
1428  endif
1429   NULLIFY(grid%g_mu_bxe)
1430 ENDIF
1431 IF ( ASSOCIATED( grid%g_mu_bys ) ) THEN 
1432   DEALLOCATE(grid%g_mu_bys,STAT=ierr)
1433  if (ierr.ne.0) then
1434  CALL wrf_error_fatal ( &
1435 'frame/module_domain.f: Failed to dallocate grid%g_mu_bys. ')
1436  endif
1437   NULLIFY(grid%g_mu_bys)
1438 ENDIF
1439 IF ( ASSOCIATED( grid%g_mu_bye ) ) THEN 
1440   DEALLOCATE(grid%g_mu_bye,STAT=ierr)
1441  if (ierr.ne.0) then
1442  CALL wrf_error_fatal ( &
1443 'frame/module_domain.f: Failed to dallocate grid%g_mu_bye. ')
1444  endif
1445   NULLIFY(grid%g_mu_bye)
1446 ENDIF
1447 IF ( ASSOCIATED( grid%g_mu_btxs ) ) THEN 
1448   DEALLOCATE(grid%g_mu_btxs,STAT=ierr)
1449  if (ierr.ne.0) then
1450  CALL wrf_error_fatal ( &
1451 'frame/module_domain.f: Failed to dallocate grid%g_mu_btxs. ')
1452  endif
1453   NULLIFY(grid%g_mu_btxs)
1454 ENDIF
1455 IF ( ASSOCIATED( grid%g_mu_btxe ) ) THEN 
1456   DEALLOCATE(grid%g_mu_btxe,STAT=ierr)
1457  if (ierr.ne.0) then
1458  CALL wrf_error_fatal ( &
1459 'frame/module_domain.f: Failed to dallocate grid%g_mu_btxe. ')
1460  endif
1461   NULLIFY(grid%g_mu_btxe)
1462 ENDIF
1463 IF ( ASSOCIATED( grid%g_mu_btys ) ) THEN 
1464   DEALLOCATE(grid%g_mu_btys,STAT=ierr)
1465  if (ierr.ne.0) then
1466  CALL wrf_error_fatal ( &
1467 'frame/module_domain.f: Failed to dallocate grid%g_mu_btys. ')
1468  endif
1469   NULLIFY(grid%g_mu_btys)
1470 ENDIF
1471 IF ( ASSOCIATED( grid%g_mu_btye ) ) THEN 
1472   DEALLOCATE(grid%g_mu_btye,STAT=ierr)
1473  if (ierr.ne.0) then
1474  CALL wrf_error_fatal ( &
1475 'frame/module_domain.f: Failed to dallocate grid%g_mu_btye. ')
1476  endif
1477   NULLIFY(grid%g_mu_btye)
1478 ENDIF
1479 IF ( ASSOCIATED( grid%em_mub ) ) THEN 
1480   DEALLOCATE(grid%em_mub,STAT=ierr)
1481  if (ierr.ne.0) then
1482  CALL wrf_error_fatal ( &
1483 'frame/module_domain.f: Failed to dallocate grid%em_mub. ')
1484  endif
1485   NULLIFY(grid%em_mub)
1486 ENDIF
1487 IF ( ASSOCIATED( grid%em_mu0 ) ) THEN 
1488   DEALLOCATE(grid%em_mu0,STAT=ierr)
1489  if (ierr.ne.0) then
1490  CALL wrf_error_fatal ( &
1491 'frame/module_domain.f: Failed to dallocate grid%em_mu0. ')
1492  endif
1493   NULLIFY(grid%em_mu0)
1494 ENDIF
1495 IF ( ASSOCIATED( grid%nest_pos ) ) THEN 
1496   DEALLOCATE(grid%nest_pos,STAT=ierr)
1497  if (ierr.ne.0) then
1498  CALL wrf_error_fatal ( &
1499 'frame/module_domain.f: Failed to dallocate grid%nest_pos. ')
1500  endif
1501   NULLIFY(grid%nest_pos)
1502 ENDIF
1503 IF ( ASSOCIATED( grid%nest_mask ) ) THEN 
1504   DEALLOCATE(grid%nest_mask,STAT=ierr)
1505  if (ierr.ne.0) then
1506  CALL wrf_error_fatal ( &
1507 'frame/module_domain.f: Failed to dallocate grid%nest_mask. ')
1508  endif
1509   NULLIFY(grid%nest_mask)
1510 ENDIF
1511 IF ( ASSOCIATED( grid%ht_coarse ) ) THEN 
1512   DEALLOCATE(grid%ht_coarse,STAT=ierr)
1513  if (ierr.ne.0) then
1514  CALL wrf_error_fatal ( &
1515 'frame/module_domain.f: Failed to dallocate grid%ht_coarse. ')
1516  endif
1517   NULLIFY(grid%ht_coarse)
1518 ENDIF
1519 IF ( ASSOCIATED( grid%em_p ) ) THEN 
1520   DEALLOCATE(grid%em_p,STAT=ierr)
1521  if (ierr.ne.0) then
1522  CALL wrf_error_fatal ( &
1523 'frame/module_domain.f: Failed to dallocate grid%em_p. ')
1524  endif
1525   NULLIFY(grid%em_p)
1526 ENDIF
1527 IF ( ASSOCIATED( grid%em_sr ) ) THEN 
1528   DEALLOCATE(grid%em_sr,STAT=ierr)
1529  if (ierr.ne.0) then
1530  CALL wrf_error_fatal ( &
1531 'frame/module_domain.f: Failed to dallocate grid%em_sr. ')
1532  endif
1533   NULLIFY(grid%em_sr)
1534 ENDIF
1535 IF ( ASSOCIATED( grid%em_fnm ) ) THEN 
1536   DEALLOCATE(grid%em_fnm,STAT=ierr)
1537  if (ierr.ne.0) then
1538  CALL wrf_error_fatal ( &
1539 'frame/module_domain.f: Failed to dallocate grid%em_fnm. ')
1540  endif
1541   NULLIFY(grid%em_fnm)
1542 ENDIF
1543 IF ( ASSOCIATED( grid%em_fnp ) ) THEN 
1544   DEALLOCATE(grid%em_fnp,STAT=ierr)
1545  if (ierr.ne.0) then
1546  CALL wrf_error_fatal ( &
1547 'frame/module_domain.f: Failed to dallocate grid%em_fnp. ')
1548  endif
1549   NULLIFY(grid%em_fnp)
1550 ENDIF
1551 IF ( ASSOCIATED( grid%em_rdnw ) ) THEN 
1552   DEALLOCATE(grid%em_rdnw,STAT=ierr)
1553  if (ierr.ne.0) then
1554  CALL wrf_error_fatal ( &
1555 'frame/module_domain.f: Failed to dallocate grid%em_rdnw. ')
1556  endif
1557   NULLIFY(grid%em_rdnw)
1558 ENDIF
1559 IF ( ASSOCIATED( grid%em_rdn ) ) THEN 
1560   DEALLOCATE(grid%em_rdn,STAT=ierr)
1561  if (ierr.ne.0) then
1562  CALL wrf_error_fatal ( &
1563 'frame/module_domain.f: Failed to dallocate grid%em_rdn. ')
1564  endif
1565   NULLIFY(grid%em_rdn)
1566 ENDIF
1567 IF ( ASSOCIATED( grid%em_dnw ) ) THEN 
1568   DEALLOCATE(grid%em_dnw,STAT=ierr)
1569  if (ierr.ne.0) then
1570  CALL wrf_error_fatal ( &
1571 'frame/module_domain.f: Failed to dallocate grid%em_dnw. ')
1572  endif
1573   NULLIFY(grid%em_dnw)
1574 ENDIF
1575 IF ( ASSOCIATED( grid%em_dn ) ) THEN 
1576   DEALLOCATE(grid%em_dn,STAT=ierr)
1577  if (ierr.ne.0) then
1578  CALL wrf_error_fatal ( &
1579 'frame/module_domain.f: Failed to dallocate grid%em_dn. ')
1580  endif
1581   NULLIFY(grid%em_dn)
1582 ENDIF
1583 IF ( ASSOCIATED( grid%em_znu ) ) THEN 
1584   DEALLOCATE(grid%em_znu,STAT=ierr)
1585  if (ierr.ne.0) then
1586  CALL wrf_error_fatal ( &
1587 'frame/module_domain.f: Failed to dallocate grid%em_znu. ')
1588  endif
1589   NULLIFY(grid%em_znu)
1590 ENDIF
1591 IF ( ASSOCIATED( grid%em_znw ) ) THEN 
1592   DEALLOCATE(grid%em_znw,STAT=ierr)
1593  if (ierr.ne.0) then
1594  CALL wrf_error_fatal ( &
1595 'frame/module_domain.f: Failed to dallocate grid%em_znw. ')
1596  endif
1597   NULLIFY(grid%em_znw)
1598 ENDIF
1599 IF ( ASSOCIATED( grid%em_t_base ) ) THEN 
1600   DEALLOCATE(grid%em_t_base,STAT=ierr)
1601  if (ierr.ne.0) then
1602  CALL wrf_error_fatal ( &
1603 'frame/module_domain.f: Failed to dallocate grid%em_t_base. ')
1604  endif
1605   NULLIFY(grid%em_t_base)
1606 ENDIF
1607 IF ( ASSOCIATED( grid%em_z ) ) THEN 
1608   DEALLOCATE(grid%em_z,STAT=ierr)
1609  if (ierr.ne.0) then
1610  CALL wrf_error_fatal ( &
1611 'frame/module_domain.f: Failed to dallocate grid%em_z. ')
1612  endif
1613   NULLIFY(grid%em_z)
1614 ENDIF
1615 IF ( ASSOCIATED( grid%a_z ) ) THEN 
1616   DEALLOCATE(grid%a_z,STAT=ierr)
1617  if (ierr.ne.0) then
1618  CALL wrf_error_fatal ( &
1619 'frame/module_domain.f: Failed to dallocate grid%a_z. ')
1620  endif
1621   NULLIFY(grid%a_z)
1622 ENDIF
1623 IF ( ASSOCIATED( grid%g_z ) ) THEN 
1624   DEALLOCATE(grid%g_z,STAT=ierr)
1625  if (ierr.ne.0) then
1626  CALL wrf_error_fatal ( &
1627 'frame/module_domain.f: Failed to dallocate grid%g_z. ')
1628  endif
1629   NULLIFY(grid%g_z)
1630 ENDIF
1631 IF ( ASSOCIATED( grid%kma_a ) ) THEN 
1632   DEALLOCATE(grid%kma_a,STAT=ierr)
1633  if (ierr.ne.0) then
1634  CALL wrf_error_fatal ( &
1635 'frame/module_domain.f: Failed to dallocate grid%kma_a. ')
1636  endif
1637   NULLIFY(grid%kma_a)
1638 ENDIF
1639 IF ( ASSOCIATED( grid%kma_b ) ) THEN 
1640   DEALLOCATE(grid%kma_b,STAT=ierr)
1641  if (ierr.ne.0) then
1642  CALL wrf_error_fatal ( &
1643 'frame/module_domain.f: Failed to dallocate grid%kma_b. ')
1644  endif
1645   NULLIFY(grid%kma_b)
1646 ENDIF
1647 IF ( ASSOCIATED( grid%q2 ) ) THEN 
1648   DEALLOCATE(grid%q2,STAT=ierr)
1649  if (ierr.ne.0) then
1650  CALL wrf_error_fatal ( &
1651 'frame/module_domain.f: Failed to dallocate grid%q2. ')
1652  endif
1653   NULLIFY(grid%q2)
1654 ENDIF
1655 IF ( ASSOCIATED( grid%t2 ) ) THEN 
1656   DEALLOCATE(grid%t2,STAT=ierr)
1657  if (ierr.ne.0) then
1658  CALL wrf_error_fatal ( &
1659 'frame/module_domain.f: Failed to dallocate grid%t2. ')
1660  endif
1661   NULLIFY(grid%t2)
1662 ENDIF
1663 IF ( ASSOCIATED( grid%th2 ) ) THEN 
1664   DEALLOCATE(grid%th2,STAT=ierr)
1665  if (ierr.ne.0) then
1666  CALL wrf_error_fatal ( &
1667 'frame/module_domain.f: Failed to dallocate grid%th2. ')
1668  endif
1669   NULLIFY(grid%th2)
1670 ENDIF
1671 IF ( ASSOCIATED( grid%psfc ) ) THEN 
1672   DEALLOCATE(grid%psfc,STAT=ierr)
1673  if (ierr.ne.0) then
1674  CALL wrf_error_fatal ( &
1675 'frame/module_domain.f: Failed to dallocate grid%psfc. ')
1676  endif
1677   NULLIFY(grid%psfc)
1678 ENDIF
1679 IF ( ASSOCIATED( grid%u10 ) ) THEN 
1680   DEALLOCATE(grid%u10,STAT=ierr)
1681  if (ierr.ne.0) then
1682  CALL wrf_error_fatal ( &
1683 'frame/module_domain.f: Failed to dallocate grid%u10. ')
1684  endif
1685   NULLIFY(grid%u10)
1686 ENDIF
1687 IF ( ASSOCIATED( grid%v10 ) ) THEN 
1688   DEALLOCATE(grid%v10,STAT=ierr)
1689  if (ierr.ne.0) then
1690  CALL wrf_error_fatal ( &
1691 'frame/module_domain.f: Failed to dallocate grid%v10. ')
1692  endif
1693   NULLIFY(grid%v10)
1694 ENDIF
1695 IF ( ASSOCIATED( grid%uratx ) ) THEN 
1696   DEALLOCATE(grid%uratx,STAT=ierr)
1697  if (ierr.ne.0) then
1698  CALL wrf_error_fatal ( &
1699 'frame/module_domain.f: Failed to dallocate grid%uratx. ')
1700  endif
1701   NULLIFY(grid%uratx)
1702 ENDIF
1703 IF ( ASSOCIATED( grid%vratx ) ) THEN 
1704   DEALLOCATE(grid%vratx,STAT=ierr)
1705  if (ierr.ne.0) then
1706  CALL wrf_error_fatal ( &
1707 'frame/module_domain.f: Failed to dallocate grid%vratx. ')
1708  endif
1709   NULLIFY(grid%vratx)
1710 ENDIF
1711 IF ( ASSOCIATED( grid%tratx ) ) THEN 
1712   DEALLOCATE(grid%tratx,STAT=ierr)
1713  if (ierr.ne.0) then
1714  CALL wrf_error_fatal ( &
1715 'frame/module_domain.f: Failed to dallocate grid%tratx. ')
1716  endif
1717   NULLIFY(grid%tratx)
1718 ENDIF
1719 IF ( ASSOCIATED( grid%imask_nostag ) ) THEN 
1720   DEALLOCATE(grid%imask_nostag,STAT=ierr)
1721  if (ierr.ne.0) then
1722  CALL wrf_error_fatal ( &
1723 'frame/module_domain.f: Failed to dallocate grid%imask_nostag. ')
1724  endif
1725   NULLIFY(grid%imask_nostag)
1726 ENDIF
1727 IF ( ASSOCIATED( grid%imask_xstag ) ) THEN 
1728   DEALLOCATE(grid%imask_xstag,STAT=ierr)
1729  if (ierr.ne.0) then
1730  CALL wrf_error_fatal ( &
1731 'frame/module_domain.f: Failed to dallocate grid%imask_xstag. ')
1732  endif
1733   NULLIFY(grid%imask_xstag)
1734 ENDIF
1735 IF ( ASSOCIATED( grid%imask_ystag ) ) THEN 
1736   DEALLOCATE(grid%imask_ystag,STAT=ierr)
1737  if (ierr.ne.0) then
1738  CALL wrf_error_fatal ( &
1739 'frame/module_domain.f: Failed to dallocate grid%imask_ystag. ')
1740  endif
1741   NULLIFY(grid%imask_ystag)
1742 ENDIF
1743 IF ( ASSOCIATED( grid%imask_xystag ) ) THEN 
1744   DEALLOCATE(grid%imask_xystag,STAT=ierr)
1745  if (ierr.ne.0) then
1746  CALL wrf_error_fatal ( &
1747 'frame/module_domain.f: Failed to dallocate grid%imask_xystag. ')
1748  endif
1749   NULLIFY(grid%imask_xystag)
1750 ENDIF
1751 IF ( ASSOCIATED( grid%moist ) ) THEN 
1752   DEALLOCATE(grid%moist,STAT=ierr)
1753  if (ierr.ne.0) then
1754  CALL wrf_error_fatal ( &
1755 'frame/module_domain.f: Failed to dallocate grid%moist. ')
1756  endif
1757   NULLIFY(grid%moist)
1758 ENDIF
1759 IF ( ASSOCIATED( grid%a_moist ) ) THEN 
1760   DEALLOCATE(grid%a_moist,STAT=ierr)
1761  if (ierr.ne.0) then
1762  CALL wrf_error_fatal ( &
1763 'frame/module_domain.f: Failed to dallocate grid%a_moist. ')
1764  endif
1765   NULLIFY(grid%a_moist)
1766 ENDIF
1767 IF ( ASSOCIATED( grid%g_moist ) ) THEN 
1768   DEALLOCATE(grid%g_moist,STAT=ierr)
1769  if (ierr.ne.0) then
1770  CALL wrf_error_fatal ( &
1771 'frame/module_domain.f: Failed to dallocate grid%g_moist. ')
1772  endif
1773   NULLIFY(grid%g_moist)
1774 ENDIF
1775 IF ( ASSOCIATED( grid%moist_bxs ) ) THEN 
1776   DEALLOCATE(grid%moist_bxs,STAT=ierr)
1777  if (ierr.ne.0) then
1778  CALL wrf_error_fatal ( &
1779 'frame/module_domain.f: Failed to dallocate grid%moist_bxs. ')
1780  endif
1781   NULLIFY(grid%moist_bxs)
1782 ENDIF
1783 IF ( ASSOCIATED( grid%moist_bxe ) ) THEN 
1784   DEALLOCATE(grid%moist_bxe,STAT=ierr)
1785  if (ierr.ne.0) then
1786  CALL wrf_error_fatal ( &
1787 'frame/module_domain.f: Failed to dallocate grid%moist_bxe. ')
1788  endif
1789   NULLIFY(grid%moist_bxe)
1790 ENDIF
1791 IF ( ASSOCIATED( grid%moist_bys ) ) THEN 
1792   DEALLOCATE(grid%moist_bys,STAT=ierr)
1793  if (ierr.ne.0) then
1794  CALL wrf_error_fatal ( &
1795 'frame/module_domain.f: Failed to dallocate grid%moist_bys. ')
1796  endif
1797   NULLIFY(grid%moist_bys)
1798 ENDIF
1799 IF ( ASSOCIATED( grid%moist_bye ) ) THEN 
1800   DEALLOCATE(grid%moist_bye,STAT=ierr)
1801  if (ierr.ne.0) then
1802  CALL wrf_error_fatal ( &
1803 'frame/module_domain.f: Failed to dallocate grid%moist_bye. ')
1804  endif
1805   NULLIFY(grid%moist_bye)
1806 ENDIF
1807 IF ( ASSOCIATED( grid%moist_btxs ) ) THEN 
1808   DEALLOCATE(grid%moist_btxs,STAT=ierr)
1809  if (ierr.ne.0) then
1810  CALL wrf_error_fatal ( &
1811 'frame/module_domain.f: Failed to dallocate grid%moist_btxs. ')
1812  endif
1813   NULLIFY(grid%moist_btxs)
1814 ENDIF
1815 IF ( ASSOCIATED( grid%moist_btxe ) ) THEN 
1816   DEALLOCATE(grid%moist_btxe,STAT=ierr)
1817  if (ierr.ne.0) then
1818  CALL wrf_error_fatal ( &
1819 'frame/module_domain.f: Failed to dallocate grid%moist_btxe. ')
1820  endif
1821   NULLIFY(grid%moist_btxe)
1822 ENDIF
1823 IF ( ASSOCIATED( grid%moist_btys ) ) THEN 
1824   DEALLOCATE(grid%moist_btys,STAT=ierr)
1825  if (ierr.ne.0) then
1826  CALL wrf_error_fatal ( &
1827 'frame/module_domain.f: Failed to dallocate grid%moist_btys. ')
1828  endif
1829   NULLIFY(grid%moist_btys)
1830 ENDIF
1831 IF ( ASSOCIATED( grid%moist_btye ) ) THEN 
1832   DEALLOCATE(grid%moist_btye,STAT=ierr)
1833  if (ierr.ne.0) then
1834  CALL wrf_error_fatal ( &
1835 'frame/module_domain.f: Failed to dallocate grid%moist_btye. ')
1836  endif
1837   NULLIFY(grid%moist_btye)
1838 ENDIF
1839 IF ( ASSOCIATED( grid%a_moist_bxs ) ) THEN 
1840   DEALLOCATE(grid%a_moist_bxs,STAT=ierr)
1841  if (ierr.ne.0) then
1842  CALL wrf_error_fatal ( &
1843 'frame/module_domain.f: Failed to dallocate grid%a_moist_bxs. ')
1844  endif
1845   NULLIFY(grid%a_moist_bxs)
1846 ENDIF
1847 IF ( ASSOCIATED( grid%a_moist_bxe ) ) THEN 
1848   DEALLOCATE(grid%a_moist_bxe,STAT=ierr)
1849  if (ierr.ne.0) then
1850  CALL wrf_error_fatal ( &
1851 'frame/module_domain.f: Failed to dallocate grid%a_moist_bxe. ')
1852  endif
1853   NULLIFY(grid%a_moist_bxe)
1854 ENDIF
1855 IF ( ASSOCIATED( grid%a_moist_bys ) ) THEN 
1856   DEALLOCATE(grid%a_moist_bys,STAT=ierr)
1857  if (ierr.ne.0) then
1858  CALL wrf_error_fatal ( &
1859 'frame/module_domain.f: Failed to dallocate grid%a_moist_bys. ')
1860  endif
1861   NULLIFY(grid%a_moist_bys)
1862 ENDIF
1863 IF ( ASSOCIATED( grid%a_moist_bye ) ) THEN 
1864   DEALLOCATE(grid%a_moist_bye,STAT=ierr)
1865  if (ierr.ne.0) then
1866  CALL wrf_error_fatal ( &
1867 'frame/module_domain.f: Failed to dallocate grid%a_moist_bye. ')
1868  endif
1869   NULLIFY(grid%a_moist_bye)
1870 ENDIF
1871 IF ( ASSOCIATED( grid%a_moist_btxs ) ) THEN 
1872   DEALLOCATE(grid%a_moist_btxs,STAT=ierr)
1873  if (ierr.ne.0) then
1874  CALL wrf_error_fatal ( &
1875 'frame/module_domain.f: Failed to dallocate grid%a_moist_btxs. ')
1876  endif
1877   NULLIFY(grid%a_moist_btxs)
1878 ENDIF
1879 IF ( ASSOCIATED( grid%a_moist_btxe ) ) THEN 
1880   DEALLOCATE(grid%a_moist_btxe,STAT=ierr)
1881  if (ierr.ne.0) then
1882  CALL wrf_error_fatal ( &
1883 'frame/module_domain.f: Failed to dallocate grid%a_moist_btxe. ')
1884  endif
1885   NULLIFY(grid%a_moist_btxe)
1886 ENDIF
1887 IF ( ASSOCIATED( grid%a_moist_btys ) ) THEN 
1888   DEALLOCATE(grid%a_moist_btys,STAT=ierr)
1889  if (ierr.ne.0) then
1890  CALL wrf_error_fatal ( &
1891 'frame/module_domain.f: Failed to dallocate grid%a_moist_btys. ')
1892  endif
1893   NULLIFY(grid%a_moist_btys)
1894 ENDIF
1895 IF ( ASSOCIATED( grid%a_moist_btye ) ) THEN 
1896   DEALLOCATE(grid%a_moist_btye,STAT=ierr)
1897  if (ierr.ne.0) then
1898  CALL wrf_error_fatal ( &
1899 'frame/module_domain.f: Failed to dallocate grid%a_moist_btye. ')
1900  endif
1901   NULLIFY(grid%a_moist_btye)
1902 ENDIF
1903 IF ( ASSOCIATED( grid%g_moist_bxs ) ) THEN 
1904   DEALLOCATE(grid%g_moist_bxs,STAT=ierr)
1905  if (ierr.ne.0) then
1906  CALL wrf_error_fatal ( &
1907 'frame/module_domain.f: Failed to dallocate grid%g_moist_bxs. ')
1908  endif
1909   NULLIFY(grid%g_moist_bxs)
1910 ENDIF
1911 IF ( ASSOCIATED( grid%g_moist_bxe ) ) THEN 
1912   DEALLOCATE(grid%g_moist_bxe,STAT=ierr)
1913  if (ierr.ne.0) then
1914  CALL wrf_error_fatal ( &
1915 'frame/module_domain.f: Failed to dallocate grid%g_moist_bxe. ')
1916  endif
1917   NULLIFY(grid%g_moist_bxe)
1918 ENDIF
1919 IF ( ASSOCIATED( grid%g_moist_bys ) ) THEN 
1920   DEALLOCATE(grid%g_moist_bys,STAT=ierr)
1921  if (ierr.ne.0) then
1922  CALL wrf_error_fatal ( &
1923 'frame/module_domain.f: Failed to dallocate grid%g_moist_bys. ')
1924  endif
1925   NULLIFY(grid%g_moist_bys)
1926 ENDIF
1927 IF ( ASSOCIATED( grid%g_moist_bye ) ) THEN 
1928   DEALLOCATE(grid%g_moist_bye,STAT=ierr)
1929  if (ierr.ne.0) then
1930  CALL wrf_error_fatal ( &
1931 'frame/module_domain.f: Failed to dallocate grid%g_moist_bye. ')
1932  endif
1933   NULLIFY(grid%g_moist_bye)
1934 ENDIF
1935 IF ( ASSOCIATED( grid%g_moist_btxs ) ) THEN 
1936   DEALLOCATE(grid%g_moist_btxs,STAT=ierr)
1937  if (ierr.ne.0) then
1938  CALL wrf_error_fatal ( &
1939 'frame/module_domain.f: Failed to dallocate grid%g_moist_btxs. ')
1940  endif
1941   NULLIFY(grid%g_moist_btxs)
1942 ENDIF
1943 IF ( ASSOCIATED( grid%g_moist_btxe ) ) THEN 
1944   DEALLOCATE(grid%g_moist_btxe,STAT=ierr)
1945  if (ierr.ne.0) then
1946  CALL wrf_error_fatal ( &
1947 'frame/module_domain.f: Failed to dallocate grid%g_moist_btxe. ')
1948  endif
1949   NULLIFY(grid%g_moist_btxe)
1950 ENDIF
1951 IF ( ASSOCIATED( grid%g_moist_btys ) ) THEN 
1952   DEALLOCATE(grid%g_moist_btys,STAT=ierr)
1953  if (ierr.ne.0) then
1954  CALL wrf_error_fatal ( &
1955 'frame/module_domain.f: Failed to dallocate grid%g_moist_btys. ')
1956  endif
1957   NULLIFY(grid%g_moist_btys)
1958 ENDIF
1959 IF ( ASSOCIATED( grid%g_moist_btye ) ) THEN 
1960   DEALLOCATE(grid%g_moist_btye,STAT=ierr)
1961  if (ierr.ne.0) then
1962  CALL wrf_error_fatal ( &
1963 'frame/module_domain.f: Failed to dallocate grid%g_moist_btye. ')
1964  endif
1965   NULLIFY(grid%g_moist_btye)
1966 ENDIF
1967 IF ( ASSOCIATED( grid%scalar ) ) THEN 
1968   DEALLOCATE(grid%scalar,STAT=ierr)
1969  if (ierr.ne.0) then
1970  CALL wrf_error_fatal ( &
1971 'frame/module_domain.f: Failed to dallocate grid%scalar. ')
1972  endif
1973   NULLIFY(grid%scalar)
1974 ENDIF
1975 IF ( ASSOCIATED( grid%a_scalar ) ) THEN 
1976   DEALLOCATE(grid%a_scalar,STAT=ierr)
1977  if (ierr.ne.0) then
1978  CALL wrf_error_fatal ( &
1979 'frame/module_domain.f: Failed to dallocate grid%a_scalar. ')
1980  endif
1981   NULLIFY(grid%a_scalar)
1982 ENDIF
1983 IF ( ASSOCIATED( grid%g_scalar ) ) THEN 
1984   DEALLOCATE(grid%g_scalar,STAT=ierr)
1985  if (ierr.ne.0) then
1986  CALL wrf_error_fatal ( &
1987 'frame/module_domain.f: Failed to dallocate grid%g_scalar. ')
1988  endif
1989   NULLIFY(grid%g_scalar)
1990 ENDIF
1991 IF ( ASSOCIATED( grid%scalar_bxs ) ) THEN 
1992   DEALLOCATE(grid%scalar_bxs,STAT=ierr)
1993  if (ierr.ne.0) then
1994  CALL wrf_error_fatal ( &
1995 'frame/module_domain.f: Failed to dallocate grid%scalar_bxs. ')
1996  endif
1997   NULLIFY(grid%scalar_bxs)
1998 ENDIF
1999 IF ( ASSOCIATED( grid%scalar_bxe ) ) THEN 
2000   DEALLOCATE(grid%scalar_bxe,STAT=ierr)
2001  if (ierr.ne.0) then
2002  CALL wrf_error_fatal ( &
2003 'frame/module_domain.f: Failed to dallocate grid%scalar_bxe. ')
2004  endif
2005   NULLIFY(grid%scalar_bxe)
2006 ENDIF
2007 IF ( ASSOCIATED( grid%scalar_bys ) ) THEN 
2008   DEALLOCATE(grid%scalar_bys,STAT=ierr)
2009  if (ierr.ne.0) then
2010  CALL wrf_error_fatal ( &
2011 'frame/module_domain.f: Failed to dallocate grid%scalar_bys. ')
2012  endif
2013   NULLIFY(grid%scalar_bys)
2014 ENDIF
2015 IF ( ASSOCIATED( grid%scalar_bye ) ) THEN 
2016   DEALLOCATE(grid%scalar_bye,STAT=ierr)
2017  if (ierr.ne.0) then
2018  CALL wrf_error_fatal ( &
2019 'frame/module_domain.f: Failed to dallocate grid%scalar_bye. ')
2020  endif
2021   NULLIFY(grid%scalar_bye)
2022 ENDIF
2023 IF ( ASSOCIATED( grid%scalar_btxs ) ) THEN 
2024   DEALLOCATE(grid%scalar_btxs,STAT=ierr)
2025  if (ierr.ne.0) then
2026  CALL wrf_error_fatal ( &
2027 'frame/module_domain.f: Failed to dallocate grid%scalar_btxs. ')
2028  endif
2029   NULLIFY(grid%scalar_btxs)
2030 ENDIF
2031 IF ( ASSOCIATED( grid%scalar_btxe ) ) THEN 
2032   DEALLOCATE(grid%scalar_btxe,STAT=ierr)
2033  if (ierr.ne.0) then
2034  CALL wrf_error_fatal ( &
2035 'frame/module_domain.f: Failed to dallocate grid%scalar_btxe. ')
2036  endif
2037   NULLIFY(grid%scalar_btxe)
2038 ENDIF
2039 IF ( ASSOCIATED( grid%scalar_btys ) ) THEN 
2040   DEALLOCATE(grid%scalar_btys,STAT=ierr)
2041  if (ierr.ne.0) then
2042  CALL wrf_error_fatal ( &
2043 'frame/module_domain.f: Failed to dallocate grid%scalar_btys. ')
2044  endif
2045   NULLIFY(grid%scalar_btys)
2046 ENDIF
2047 IF ( ASSOCIATED( grid%scalar_btye ) ) THEN 
2048   DEALLOCATE(grid%scalar_btye,STAT=ierr)
2049  if (ierr.ne.0) then
2050  CALL wrf_error_fatal ( &
2051 'frame/module_domain.f: Failed to dallocate grid%scalar_btye. ')
2052  endif
2053   NULLIFY(grid%scalar_btye)
2054 ENDIF
2055 IF ( ASSOCIATED( grid%fcx ) ) THEN 
2056   DEALLOCATE(grid%fcx,STAT=ierr)
2057  if (ierr.ne.0) then
2058  CALL wrf_error_fatal ( &
2059 'frame/module_domain.f: Failed to dallocate grid%fcx. ')
2060  endif
2061   NULLIFY(grid%fcx)
2062 ENDIF
2063 IF ( ASSOCIATED( grid%gcx ) ) THEN 
2064   DEALLOCATE(grid%gcx,STAT=ierr)
2065  if (ierr.ne.0) then
2066  CALL wrf_error_fatal ( &
2067 'frame/module_domain.f: Failed to dallocate grid%gcx. ')
2068  endif
2069   NULLIFY(grid%gcx)
2070 ENDIF
2071 IF ( ASSOCIATED( grid%landmask ) ) THEN 
2072   DEALLOCATE(grid%landmask,STAT=ierr)
2073  if (ierr.ne.0) then
2074  CALL wrf_error_fatal ( &
2075 'frame/module_domain.f: Failed to dallocate grid%landmask. ')
2076  endif
2077   NULLIFY(grid%landmask)
2078 ENDIF
2079 IF ( ASSOCIATED( grid%shdmax ) ) THEN 
2080   DEALLOCATE(grid%shdmax,STAT=ierr)
2081  if (ierr.ne.0) then
2082  CALL wrf_error_fatal ( &
2083 'frame/module_domain.f: Failed to dallocate grid%shdmax. ')
2084  endif
2085   NULLIFY(grid%shdmax)
2086 ENDIF
2087 IF ( ASSOCIATED( grid%shdmin ) ) THEN 
2088   DEALLOCATE(grid%shdmin,STAT=ierr)
2089  if (ierr.ne.0) then
2090  CALL wrf_error_fatal ( &
2091 'frame/module_domain.f: Failed to dallocate grid%shdmin. ')
2092  endif
2093   NULLIFY(grid%shdmin)
2094 ENDIF
2095 IF ( ASSOCIATED( grid%snoalb ) ) THEN 
2096   DEALLOCATE(grid%snoalb,STAT=ierr)
2097  if (ierr.ne.0) then
2098  CALL wrf_error_fatal ( &
2099 'frame/module_domain.f: Failed to dallocate grid%snoalb. ')
2100  endif
2101   NULLIFY(grid%snoalb)
2102 ENDIF
2103 IF ( ASSOCIATED( grid%tslb ) ) THEN 
2104   DEALLOCATE(grid%tslb,STAT=ierr)
2105  if (ierr.ne.0) then
2106  CALL wrf_error_fatal ( &
2107 'frame/module_domain.f: Failed to dallocate grid%tslb. ')
2108  endif
2109   NULLIFY(grid%tslb)
2110 ENDIF
2111 IF ( ASSOCIATED( grid%zs ) ) THEN 
2112   DEALLOCATE(grid%zs,STAT=ierr)
2113  if (ierr.ne.0) then
2114  CALL wrf_error_fatal ( &
2115 'frame/module_domain.f: Failed to dallocate grid%zs. ')
2116  endif
2117   NULLIFY(grid%zs)
2118 ENDIF
2119 IF ( ASSOCIATED( grid%dzs ) ) THEN 
2120   DEALLOCATE(grid%dzs,STAT=ierr)
2121  if (ierr.ne.0) then
2122  CALL wrf_error_fatal ( &
2123 'frame/module_domain.f: Failed to dallocate grid%dzs. ')
2124  endif
2125   NULLIFY(grid%dzs)
2126 ENDIF
2127 IF ( ASSOCIATED( grid%smois ) ) THEN 
2128   DEALLOCATE(grid%smois,STAT=ierr)
2129  if (ierr.ne.0) then
2130  CALL wrf_error_fatal ( &
2131 'frame/module_domain.f: Failed to dallocate grid%smois. ')
2132  endif
2133   NULLIFY(grid%smois)
2134 ENDIF
2135 IF ( ASSOCIATED( grid%sh2o ) ) THEN 
2136   DEALLOCATE(grid%sh2o,STAT=ierr)
2137  if (ierr.ne.0) then
2138  CALL wrf_error_fatal ( &
2139 'frame/module_domain.f: Failed to dallocate grid%sh2o. ')
2140  endif
2141   NULLIFY(grid%sh2o)
2142 ENDIF
2143 IF ( ASSOCIATED( grid%xice ) ) THEN 
2144   DEALLOCATE(grid%xice,STAT=ierr)
2145  if (ierr.ne.0) then
2146  CALL wrf_error_fatal ( &
2147 'frame/module_domain.f: Failed to dallocate grid%xice. ')
2148  endif
2149   NULLIFY(grid%xice)
2150 ENDIF
2151 IF ( ASSOCIATED( grid%sfcrunoff ) ) THEN 
2152   DEALLOCATE(grid%sfcrunoff,STAT=ierr)
2153  if (ierr.ne.0) then
2154  CALL wrf_error_fatal ( &
2155 'frame/module_domain.f: Failed to dallocate grid%sfcrunoff. ')
2156  endif
2157   NULLIFY(grid%sfcrunoff)
2158 ENDIF
2159 IF ( ASSOCIATED( grid%udrunoff ) ) THEN 
2160   DEALLOCATE(grid%udrunoff,STAT=ierr)
2161  if (ierr.ne.0) then
2162  CALL wrf_error_fatal ( &
2163 'frame/module_domain.f: Failed to dallocate grid%udrunoff. ')
2164  endif
2165   NULLIFY(grid%udrunoff)
2166 ENDIF
2167 IF ( ASSOCIATED( grid%ivgtyp ) ) THEN 
2168   DEALLOCATE(grid%ivgtyp,STAT=ierr)
2169  if (ierr.ne.0) then
2170  CALL wrf_error_fatal ( &
2171 'frame/module_domain.f: Failed to dallocate grid%ivgtyp. ')
2172  endif
2173   NULLIFY(grid%ivgtyp)
2174 ENDIF
2175 IF ( ASSOCIATED( grid%isltyp ) ) THEN 
2176   DEALLOCATE(grid%isltyp,STAT=ierr)
2177  if (ierr.ne.0) then
2178  CALL wrf_error_fatal ( &
2179 'frame/module_domain.f: Failed to dallocate grid%isltyp. ')
2180  endif
2181   NULLIFY(grid%isltyp)
2182 ENDIF
2183 IF ( ASSOCIATED( grid%vegfra ) ) THEN 
2184   DEALLOCATE(grid%vegfra,STAT=ierr)
2185  if (ierr.ne.0) then
2186  CALL wrf_error_fatal ( &
2187 'frame/module_domain.f: Failed to dallocate grid%vegfra. ')
2188  endif
2189   NULLIFY(grid%vegfra)
2190 ENDIF
2191 IF ( ASSOCIATED( grid%sfcevp ) ) THEN 
2192   DEALLOCATE(grid%sfcevp,STAT=ierr)
2193  if (ierr.ne.0) then
2194  CALL wrf_error_fatal ( &
2195 'frame/module_domain.f: Failed to dallocate grid%sfcevp. ')
2196  endif
2197   NULLIFY(grid%sfcevp)
2198 ENDIF
2199 IF ( ASSOCIATED( grid%acsnow ) ) THEN 
2200   DEALLOCATE(grid%acsnow,STAT=ierr)
2201  if (ierr.ne.0) then
2202  CALL wrf_error_fatal ( &
2203 'frame/module_domain.f: Failed to dallocate grid%acsnow. ')
2204  endif
2205   NULLIFY(grid%acsnow)
2206 ENDIF
2207 IF ( ASSOCIATED( grid%acsnom ) ) THEN 
2208   DEALLOCATE(grid%acsnom,STAT=ierr)
2209  if (ierr.ne.0) then
2210  CALL wrf_error_fatal ( &
2211 'frame/module_domain.f: Failed to dallocate grid%acsnom. ')
2212  endif
2213   NULLIFY(grid%acsnom)
2214 ENDIF
2215 IF ( ASSOCIATED( grid%snow ) ) THEN 
2216   DEALLOCATE(grid%snow,STAT=ierr)
2217  if (ierr.ne.0) then
2218  CALL wrf_error_fatal ( &
2219 'frame/module_domain.f: Failed to dallocate grid%snow. ')
2220  endif
2221   NULLIFY(grid%snow)
2222 ENDIF
2223 IF ( ASSOCIATED( grid%snowh ) ) THEN 
2224   DEALLOCATE(grid%snowh,STAT=ierr)
2225  if (ierr.ne.0) then
2226  CALL wrf_error_fatal ( &
2227 'frame/module_domain.f: Failed to dallocate grid%snowh. ')
2228  endif
2229   NULLIFY(grid%snowh)
2230 ENDIF
2231 IF ( ASSOCIATED( grid%rhosn ) ) THEN 
2232   DEALLOCATE(grid%rhosn,STAT=ierr)
2233  if (ierr.ne.0) then
2234  CALL wrf_error_fatal ( &
2235 'frame/module_domain.f: Failed to dallocate grid%rhosn. ')
2236  endif
2237   NULLIFY(grid%rhosn)
2238 ENDIF
2239 IF ( ASSOCIATED( grid%canwat ) ) THEN 
2240   DEALLOCATE(grid%canwat,STAT=ierr)
2241  if (ierr.ne.0) then
2242  CALL wrf_error_fatal ( &
2243 'frame/module_domain.f: Failed to dallocate grid%canwat. ')
2244  endif
2245   NULLIFY(grid%canwat)
2246 ENDIF
2247 IF ( ASSOCIATED( grid%sst ) ) THEN 
2248   DEALLOCATE(grid%sst,STAT=ierr)
2249  if (ierr.ne.0) then
2250  CALL wrf_error_fatal ( &
2251 'frame/module_domain.f: Failed to dallocate grid%sst. ')
2252  endif
2253   NULLIFY(grid%sst)
2254 ENDIF
2255 IF ( ASSOCIATED( grid%htop ) ) THEN 
2256   DEALLOCATE(grid%htop,STAT=ierr)
2257  if (ierr.ne.0) then
2258  CALL wrf_error_fatal ( &
2259 'frame/module_domain.f: Failed to dallocate grid%htop. ')
2260  endif
2261   NULLIFY(grid%htop)
2262 ENDIF
2263 IF ( ASSOCIATED( grid%hbot ) ) THEN 
2264   DEALLOCATE(grid%hbot,STAT=ierr)
2265  if (ierr.ne.0) then
2266  CALL wrf_error_fatal ( &
2267 'frame/module_domain.f: Failed to dallocate grid%hbot. ')
2268  endif
2269   NULLIFY(grid%hbot)
2270 ENDIF
2271 IF ( ASSOCIATED( grid%cuppt ) ) THEN 
2272   DEALLOCATE(grid%cuppt,STAT=ierr)
2273  if (ierr.ne.0) then
2274  CALL wrf_error_fatal ( &
2275 'frame/module_domain.f: Failed to dallocate grid%cuppt. ')
2276  endif
2277   NULLIFY(grid%cuppt)
2278 ENDIF
2279 IF ( ASSOCIATED( grid%rswtoa ) ) THEN 
2280   DEALLOCATE(grid%rswtoa,STAT=ierr)
2281  if (ierr.ne.0) then
2282  CALL wrf_error_fatal ( &
2283 'frame/module_domain.f: Failed to dallocate grid%rswtoa. ')
2284  endif
2285   NULLIFY(grid%rswtoa)
2286 ENDIF
2287 IF ( ASSOCIATED( grid%rlwtoa ) ) THEN 
2288   DEALLOCATE(grid%rlwtoa,STAT=ierr)
2289  if (ierr.ne.0) then
2290  CALL wrf_error_fatal ( &
2291 'frame/module_domain.f: Failed to dallocate grid%rlwtoa. ')
2292  endif
2293   NULLIFY(grid%rlwtoa)
2294 ENDIF
2295 IF ( ASSOCIATED( grid%czmean ) ) THEN 
2296   DEALLOCATE(grid%czmean,STAT=ierr)
2297  if (ierr.ne.0) then
2298  CALL wrf_error_fatal ( &
2299 'frame/module_domain.f: Failed to dallocate grid%czmean. ')
2300  endif
2301   NULLIFY(grid%czmean)
2302 ENDIF
2303 IF ( ASSOCIATED( grid%cfracl ) ) THEN 
2304   DEALLOCATE(grid%cfracl,STAT=ierr)
2305  if (ierr.ne.0) then
2306  CALL wrf_error_fatal ( &
2307 'frame/module_domain.f: Failed to dallocate grid%cfracl. ')
2308  endif
2309   NULLIFY(grid%cfracl)
2310 ENDIF
2311 IF ( ASSOCIATED( grid%cfracm ) ) THEN 
2312   DEALLOCATE(grid%cfracm,STAT=ierr)
2313  if (ierr.ne.0) then
2314  CALL wrf_error_fatal ( &
2315 'frame/module_domain.f: Failed to dallocate grid%cfracm. ')
2316  endif
2317   NULLIFY(grid%cfracm)
2318 ENDIF
2319 IF ( ASSOCIATED( grid%cfrach ) ) THEN 
2320   DEALLOCATE(grid%cfrach,STAT=ierr)
2321  if (ierr.ne.0) then
2322  CALL wrf_error_fatal ( &
2323 'frame/module_domain.f: Failed to dallocate grid%cfrach. ')
2324  endif
2325   NULLIFY(grid%cfrach)
2326 ENDIF
2327 IF ( ASSOCIATED( grid%acfrst ) ) THEN 
2328   DEALLOCATE(grid%acfrst,STAT=ierr)
2329  if (ierr.ne.0) then
2330  CALL wrf_error_fatal ( &
2331 'frame/module_domain.f: Failed to dallocate grid%acfrst. ')
2332  endif
2333   NULLIFY(grid%acfrst)
2334 ENDIF
2335 IF ( ASSOCIATED( grid%ncfrst ) ) THEN 
2336   DEALLOCATE(grid%ncfrst,STAT=ierr)
2337  if (ierr.ne.0) then
2338  CALL wrf_error_fatal ( &
2339 'frame/module_domain.f: Failed to dallocate grid%ncfrst. ')
2340  endif
2341   NULLIFY(grid%ncfrst)
2342 ENDIF
2343 IF ( ASSOCIATED( grid%acfrcv ) ) THEN 
2344   DEALLOCATE(grid%acfrcv,STAT=ierr)
2345  if (ierr.ne.0) then
2346  CALL wrf_error_fatal ( &
2347 'frame/module_domain.f: Failed to dallocate grid%acfrcv. ')
2348  endif
2349   NULLIFY(grid%acfrcv)
2350 ENDIF
2351 IF ( ASSOCIATED( grid%ncfrcv ) ) THEN 
2352   DEALLOCATE(grid%ncfrcv,STAT=ierr)
2353  if (ierr.ne.0) then
2354  CALL wrf_error_fatal ( &
2355 'frame/module_domain.f: Failed to dallocate grid%ncfrcv. ')
2356  endif
2357   NULLIFY(grid%ncfrcv)
2358 ENDIF
2359 IF ( ASSOCIATED( grid%h_diabatic ) ) THEN 
2360   DEALLOCATE(grid%h_diabatic,STAT=ierr)
2361  if (ierr.ne.0) then
2362  CALL wrf_error_fatal ( &
2363 'frame/module_domain.f: Failed to dallocate grid%h_diabatic. ')
2364  endif
2365   NULLIFY(grid%h_diabatic)
2366 ENDIF
2367 IF ( ASSOCIATED( grid%msft ) ) THEN 
2368   DEALLOCATE(grid%msft,STAT=ierr)
2369  if (ierr.ne.0) then
2370  CALL wrf_error_fatal ( &
2371 'frame/module_domain.f: Failed to dallocate grid%msft. ')
2372  endif
2373   NULLIFY(grid%msft)
2374 ENDIF
2375 IF ( ASSOCIATED( grid%msfu ) ) THEN 
2376   DEALLOCATE(grid%msfu,STAT=ierr)
2377  if (ierr.ne.0) then
2378  CALL wrf_error_fatal ( &
2379 'frame/module_domain.f: Failed to dallocate grid%msfu. ')
2380  endif
2381   NULLIFY(grid%msfu)
2382 ENDIF
2383 IF ( ASSOCIATED( grid%msfv ) ) THEN 
2384   DEALLOCATE(grid%msfv,STAT=ierr)
2385  if (ierr.ne.0) then
2386  CALL wrf_error_fatal ( &
2387 'frame/module_domain.f: Failed to dallocate grid%msfv. ')
2388  endif
2389   NULLIFY(grid%msfv)
2390 ENDIF
2391 IF ( ASSOCIATED( grid%f ) ) THEN 
2392   DEALLOCATE(grid%f,STAT=ierr)
2393  if (ierr.ne.0) then
2394  CALL wrf_error_fatal ( &
2395 'frame/module_domain.f: Failed to dallocate grid%f. ')
2396  endif
2397   NULLIFY(grid%f)
2398 ENDIF
2399 IF ( ASSOCIATED( grid%e ) ) THEN 
2400   DEALLOCATE(grid%e,STAT=ierr)
2401  if (ierr.ne.0) then
2402  CALL wrf_error_fatal ( &
2403 'frame/module_domain.f: Failed to dallocate grid%e. ')
2404  endif
2405   NULLIFY(grid%e)
2406 ENDIF
2407 IF ( ASSOCIATED( grid%sina ) ) THEN 
2408   DEALLOCATE(grid%sina,STAT=ierr)
2409  if (ierr.ne.0) then
2410  CALL wrf_error_fatal ( &
2411 'frame/module_domain.f: Failed to dallocate grid%sina. ')
2412  endif
2413   NULLIFY(grid%sina)
2414 ENDIF
2415 IF ( ASSOCIATED( grid%cosa ) ) THEN 
2416   DEALLOCATE(grid%cosa,STAT=ierr)
2417  if (ierr.ne.0) then
2418  CALL wrf_error_fatal ( &
2419 'frame/module_domain.f: Failed to dallocate grid%cosa. ')
2420  endif
2421   NULLIFY(grid%cosa)
2422 ENDIF
2423 IF ( ASSOCIATED( grid%ht ) ) THEN 
2424   DEALLOCATE(grid%ht,STAT=ierr)
2425  if (ierr.ne.0) then
2426  CALL wrf_error_fatal ( &
2427 'frame/module_domain.f: Failed to dallocate grid%ht. ')
2428  endif
2429   NULLIFY(grid%ht)
2430 ENDIF
2431 IF ( ASSOCIATED( grid%ht_fine ) ) THEN 
2432   DEALLOCATE(grid%ht_fine,STAT=ierr)
2433  if (ierr.ne.0) then
2434  CALL wrf_error_fatal ( &
2435 'frame/module_domain.f: Failed to dallocate grid%ht_fine. ')
2436  endif
2437   NULLIFY(grid%ht_fine)
2438 ENDIF
2439 IF ( ASSOCIATED( grid%ht_int ) ) THEN 
2440   DEALLOCATE(grid%ht_int,STAT=ierr)
2441  if (ierr.ne.0) then
2442  CALL wrf_error_fatal ( &
2443 'frame/module_domain.f: Failed to dallocate grid%ht_int. ')
2444  endif
2445   NULLIFY(grid%ht_int)
2446 ENDIF
2447 IF ( ASSOCIATED( grid%ht_input ) ) THEN 
2448   DEALLOCATE(grid%ht_input,STAT=ierr)
2449  if (ierr.ne.0) then
2450  CALL wrf_error_fatal ( &
2451 'frame/module_domain.f: Failed to dallocate grid%ht_input. ')
2452  endif
2453   NULLIFY(grid%ht_input)
2454 ENDIF
2455 IF ( ASSOCIATED( grid%tsk ) ) THEN 
2456   DEALLOCATE(grid%tsk,STAT=ierr)
2457  if (ierr.ne.0) then
2458  CALL wrf_error_fatal ( &
2459 'frame/module_domain.f: Failed to dallocate grid%tsk. ')
2460  endif
2461   NULLIFY(grid%tsk)
2462 ENDIF
2463 IF ( ASSOCIATED( grid%tsk_save ) ) THEN 
2464   DEALLOCATE(grid%tsk_save,STAT=ierr)
2465  if (ierr.ne.0) then
2466  CALL wrf_error_fatal ( &
2467 'frame/module_domain.f: Failed to dallocate grid%tsk_save. ')
2468  endif
2469   NULLIFY(grid%tsk_save)
2470 ENDIF
2471 IF ( ASSOCIATED( grid%u_base ) ) THEN 
2472   DEALLOCATE(grid%u_base,STAT=ierr)
2473  if (ierr.ne.0) then
2474  CALL wrf_error_fatal ( &
2475 'frame/module_domain.f: Failed to dallocate grid%u_base. ')
2476  endif
2477   NULLIFY(grid%u_base)
2478 ENDIF
2479 IF ( ASSOCIATED( grid%v_base ) ) THEN 
2480   DEALLOCATE(grid%v_base,STAT=ierr)
2481  if (ierr.ne.0) then
2482  CALL wrf_error_fatal ( &
2483 'frame/module_domain.f: Failed to dallocate grid%v_base. ')
2484  endif
2485   NULLIFY(grid%v_base)
2486 ENDIF
2487 IF ( ASSOCIATED( grid%qv_base ) ) THEN 
2488   DEALLOCATE(grid%qv_base,STAT=ierr)
2489  if (ierr.ne.0) then
2490  CALL wrf_error_fatal ( &
2491 'frame/module_domain.f: Failed to dallocate grid%qv_base. ')
2492  endif
2493   NULLIFY(grid%qv_base)
2494 ENDIF
2495 IF ( ASSOCIATED( grid%z_base ) ) THEN 
2496   DEALLOCATE(grid%z_base,STAT=ierr)
2497  if (ierr.ne.0) then
2498  CALL wrf_error_fatal ( &
2499 'frame/module_domain.f: Failed to dallocate grid%z_base. ')
2500  endif
2501   NULLIFY(grid%z_base)
2502 ENDIF
2503 IF ( ASSOCIATED( grid%rainc ) ) THEN 
2504   DEALLOCATE(grid%rainc,STAT=ierr)
2505  if (ierr.ne.0) then
2506  CALL wrf_error_fatal ( &
2507 'frame/module_domain.f: Failed to dallocate grid%rainc. ')
2508  endif
2509   NULLIFY(grid%rainc)
2510 ENDIF
2511 IF ( ASSOCIATED( grid%rainnc ) ) THEN 
2512   DEALLOCATE(grid%rainnc,STAT=ierr)
2513  if (ierr.ne.0) then
2514  CALL wrf_error_fatal ( &
2515 'frame/module_domain.f: Failed to dallocate grid%rainnc. ')
2516  endif
2517   NULLIFY(grid%rainnc)
2518 ENDIF
2519 IF ( ASSOCIATED( grid%xlat ) ) THEN 
2520   DEALLOCATE(grid%xlat,STAT=ierr)
2521  if (ierr.ne.0) then
2522  CALL wrf_error_fatal ( &
2523 'frame/module_domain.f: Failed to dallocate grid%xlat. ')
2524  endif
2525   NULLIFY(grid%xlat)
2526 ENDIF
2527 IF ( ASSOCIATED( grid%xlong ) ) THEN 
2528   DEALLOCATE(grid%xlong,STAT=ierr)
2529  if (ierr.ne.0) then
2530  CALL wrf_error_fatal ( &
2531 'frame/module_domain.f: Failed to dallocate grid%xlong. ')
2532  endif
2533   NULLIFY(grid%xlong)
2534 ENDIF
2535 IF ( ASSOCIATED( grid%em_xlat_u ) ) THEN 
2536   DEALLOCATE(grid%em_xlat_u,STAT=ierr)
2537  if (ierr.ne.0) then
2538  CALL wrf_error_fatal ( &
2539 'frame/module_domain.f: Failed to dallocate grid%em_xlat_u. ')
2540  endif
2541   NULLIFY(grid%em_xlat_u)
2542 ENDIF
2543 IF ( ASSOCIATED( grid%em_xlong_u ) ) THEN 
2544   DEALLOCATE(grid%em_xlong_u,STAT=ierr)
2545  if (ierr.ne.0) then
2546  CALL wrf_error_fatal ( &
2547 'frame/module_domain.f: Failed to dallocate grid%em_xlong_u. ')
2548  endif
2549   NULLIFY(grid%em_xlong_u)
2550 ENDIF
2551 IF ( ASSOCIATED( grid%em_xlat_v ) ) THEN 
2552   DEALLOCATE(grid%em_xlat_v,STAT=ierr)
2553  if (ierr.ne.0) then
2554  CALL wrf_error_fatal ( &
2555 'frame/module_domain.f: Failed to dallocate grid%em_xlat_v. ')
2556  endif
2557   NULLIFY(grid%em_xlat_v)
2558 ENDIF
2559 IF ( ASSOCIATED( grid%em_xlong_v ) ) THEN 
2560   DEALLOCATE(grid%em_xlong_v,STAT=ierr)
2561  if (ierr.ne.0) then
2562  CALL wrf_error_fatal ( &
2563 'frame/module_domain.f: Failed to dallocate grid%em_xlong_v. ')
2564  endif
2565   NULLIFY(grid%em_xlong_v)
2566 ENDIF
2567 IF ( ASSOCIATED( grid%albbck ) ) THEN 
2568   DEALLOCATE(grid%albbck,STAT=ierr)
2569  if (ierr.ne.0) then
2570  CALL wrf_error_fatal ( &
2571 'frame/module_domain.f: Failed to dallocate grid%albbck. ')
2572  endif
2573   NULLIFY(grid%albbck)
2574 ENDIF
2575 IF ( ASSOCIATED( grid%mp_restart_state ) ) THEN 
2576   DEALLOCATE(grid%mp_restart_state,STAT=ierr)
2577  if (ierr.ne.0) then
2578  CALL wrf_error_fatal ( &
2579 'frame/module_domain.f: Failed to dallocate grid%mp_restart_state. ')
2580  endif
2581   NULLIFY(grid%mp_restart_state)
2582 ENDIF
2583 IF ( ASSOCIATED( grid%tbpvs_state ) ) THEN 
2584   DEALLOCATE(grid%tbpvs_state,STAT=ierr)
2585  if (ierr.ne.0) then
2586  CALL wrf_error_fatal ( &
2587 'frame/module_domain.f: Failed to dallocate grid%tbpvs_state. ')
2588  endif
2589   NULLIFY(grid%tbpvs_state)
2590 ENDIF
2591 IF ( ASSOCIATED( grid%tbpvs0_state ) ) THEN 
2592   DEALLOCATE(grid%tbpvs0_state,STAT=ierr)
2593  if (ierr.ne.0) then
2594  CALL wrf_error_fatal ( &
2595 'frame/module_domain.f: Failed to dallocate grid%tbpvs0_state. ')
2596  endif
2597   NULLIFY(grid%tbpvs0_state)
2598 ENDIF
2599 IF ( ASSOCIATED( grid%tmn ) ) THEN 
2600   DEALLOCATE(grid%tmn,STAT=ierr)
2601  if (ierr.ne.0) then
2602  CALL wrf_error_fatal ( &
2603 'frame/module_domain.f: Failed to dallocate grid%tmn. ')
2604  endif
2605   NULLIFY(grid%tmn)
2606 ENDIF
2607 IF ( ASSOCIATED( grid%xland ) ) THEN 
2608   DEALLOCATE(grid%xland,STAT=ierr)
2609  if (ierr.ne.0) then
2610  CALL wrf_error_fatal ( &
2611 'frame/module_domain.f: Failed to dallocate grid%xland. ')
2612  endif
2613   NULLIFY(grid%xland)
2614 ENDIF
2615 IF ( ASSOCIATED( grid%znt ) ) THEN 
2616   DEALLOCATE(grid%znt,STAT=ierr)
2617  if (ierr.ne.0) then
2618  CALL wrf_error_fatal ( &
2619 'frame/module_domain.f: Failed to dallocate grid%znt. ')
2620  endif
2621   NULLIFY(grid%znt)
2622 ENDIF
2623 IF ( ASSOCIATED( grid%snowc ) ) THEN 
2624   DEALLOCATE(grid%snowc,STAT=ierr)
2625  if (ierr.ne.0) then
2626  CALL wrf_error_fatal ( &
2627 'frame/module_domain.f: Failed to dallocate grid%snowc. ')
2628  endif
2629   NULLIFY(grid%snowc)
2630 ENDIF
2631 IF ( ASSOCIATED( grid%xkmv ) ) THEN 
2632   DEALLOCATE(grid%xkmv,STAT=ierr)
2633  if (ierr.ne.0) then
2634  CALL wrf_error_fatal ( &
2635 'frame/module_domain.f: Failed to dallocate grid%xkmv. ')
2636  endif
2637   NULLIFY(grid%xkmv)
2638 ENDIF
2639 IF ( ASSOCIATED( grid%xkmh ) ) THEN 
2640   DEALLOCATE(grid%xkmh,STAT=ierr)
2641  if (ierr.ne.0) then
2642  CALL wrf_error_fatal ( &
2643 'frame/module_domain.f: Failed to dallocate grid%xkmh. ')
2644  endif
2645   NULLIFY(grid%xkmh)
2646 ENDIF
2647 IF ( ASSOCIATED( grid%xkmhd ) ) THEN 
2648   DEALLOCATE(grid%xkmhd,STAT=ierr)
2649  if (ierr.ne.0) then
2650  CALL wrf_error_fatal ( &
2651 'frame/module_domain.f: Failed to dallocate grid%xkmhd. ')
2652  endif
2653   NULLIFY(grid%xkmhd)
2654 ENDIF
2655 IF ( ASSOCIATED( grid%a_xkmhd ) ) THEN 
2656   DEALLOCATE(grid%a_xkmhd,STAT=ierr)
2657  if (ierr.ne.0) then
2658  CALL wrf_error_fatal ( &
2659 'frame/module_domain.f: Failed to dallocate grid%a_xkmhd. ')
2660  endif
2661   NULLIFY(grid%a_xkmhd)
2662 ENDIF
2663 IF ( ASSOCIATED( grid%g_xkmhd ) ) THEN 
2664   DEALLOCATE(grid%g_xkmhd,STAT=ierr)
2665  if (ierr.ne.0) then
2666  CALL wrf_error_fatal ( &
2667 'frame/module_domain.f: Failed to dallocate grid%g_xkmhd. ')
2668  endif
2669   NULLIFY(grid%g_xkmhd)
2670 ENDIF
2671 IF ( ASSOCIATED( grid%xkhv ) ) THEN 
2672   DEALLOCATE(grid%xkhv,STAT=ierr)
2673  if (ierr.ne.0) then
2674  CALL wrf_error_fatal ( &
2675 'frame/module_domain.f: Failed to dallocate grid%xkhv. ')
2676  endif
2677   NULLIFY(grid%xkhv)
2678 ENDIF
2679 IF ( ASSOCIATED( grid%xkhh ) ) THEN 
2680   DEALLOCATE(grid%xkhh,STAT=ierr)
2681  if (ierr.ne.0) then
2682  CALL wrf_error_fatal ( &
2683 'frame/module_domain.f: Failed to dallocate grid%xkhh. ')
2684  endif
2685   NULLIFY(grid%xkhh)
2686 ENDIF
2687 IF ( ASSOCIATED( grid%em_dummy ) ) THEN 
2688   DEALLOCATE(grid%em_dummy,STAT=ierr)
2689  if (ierr.ne.0) then
2690  CALL wrf_error_fatal ( &
2691 'frame/module_domain.f: Failed to dallocate grid%em_dummy. ')
2692  endif
2693   NULLIFY(grid%em_dummy)
2694 ENDIF
2695 IF ( ASSOCIATED( grid%vv%v1 ) ) THEN 
2696   DEALLOCATE(grid%vv%v1,STAT=ierr)
2697  if (ierr.ne.0) then
2698  CALL wrf_error_fatal ( &
2699 'frame/module_domain.f: Failed to dallocate grid%vv%v1. ')
2700  endif
2701   NULLIFY(grid%vv%v1)
2702 ENDIF
2703 IF ( ASSOCIATED( grid%vv%v2 ) ) THEN 
2704   DEALLOCATE(grid%vv%v2,STAT=ierr)
2705  if (ierr.ne.0) then
2706  CALL wrf_error_fatal ( &
2707 'frame/module_domain.f: Failed to dallocate grid%vv%v2. ')
2708  endif
2709   NULLIFY(grid%vv%v2)
2710 ENDIF
2711 IF ( ASSOCIATED( grid%vv%v3 ) ) THEN 
2712   DEALLOCATE(grid%vv%v3,STAT=ierr)
2713  if (ierr.ne.0) then
2714  CALL wrf_error_fatal ( &
2715 'frame/module_domain.f: Failed to dallocate grid%vv%v3. ')
2716  endif
2717   NULLIFY(grid%vv%v3)
2718 ENDIF
2719 IF ( ASSOCIATED( grid%vv%v4 ) ) THEN 
2720   DEALLOCATE(grid%vv%v4,STAT=ierr)
2721  if (ierr.ne.0) then
2722  CALL wrf_error_fatal ( &
2723 'frame/module_domain.f: Failed to dallocate grid%vv%v4. ')
2724  endif
2725   NULLIFY(grid%vv%v4)
2726 ENDIF
2727 IF ( ASSOCIATED( grid%vv%v5 ) ) THEN 
2728   DEALLOCATE(grid%vv%v5,STAT=ierr)
2729  if (ierr.ne.0) then
2730  CALL wrf_error_fatal ( &
2731 'frame/module_domain.f: Failed to dallocate grid%vv%v5. ')
2732  endif
2733   NULLIFY(grid%vv%v5)
2734 ENDIF
2735 IF ( ASSOCIATED( grid%vv%alpha ) ) THEN 
2736   DEALLOCATE(grid%vv%alpha,STAT=ierr)
2737  if (ierr.ne.0) then
2738  CALL wrf_error_fatal ( &
2739 'frame/module_domain.f: Failed to dallocate grid%vv%alpha. ')
2740  endif
2741   NULLIFY(grid%vv%alpha)
2742 ENDIF
2743 IF ( ASSOCIATED( grid%vp%v1 ) ) THEN 
2744   DEALLOCATE(grid%vp%v1,STAT=ierr)
2745  if (ierr.ne.0) then
2746  CALL wrf_error_fatal ( &
2747 'frame/module_domain.f: Failed to dallocate grid%vp%v1. ')
2748  endif
2749   NULLIFY(grid%vp%v1)
2750 ENDIF
2751 IF ( ASSOCIATED( grid%vp%v2 ) ) THEN 
2752   DEALLOCATE(grid%vp%v2,STAT=ierr)
2753  if (ierr.ne.0) then
2754  CALL wrf_error_fatal ( &
2755 'frame/module_domain.f: Failed to dallocate grid%vp%v2. ')
2756  endif
2757   NULLIFY(grid%vp%v2)
2758 ENDIF
2759 IF ( ASSOCIATED( grid%vp%v3 ) ) THEN 
2760   DEALLOCATE(grid%vp%v3,STAT=ierr)
2761  if (ierr.ne.0) then
2762  CALL wrf_error_fatal ( &
2763 'frame/module_domain.f: Failed to dallocate grid%vp%v3. ')
2764  endif
2765   NULLIFY(grid%vp%v3)
2766 ENDIF
2767 IF ( ASSOCIATED( grid%vp%v4 ) ) THEN 
2768   DEALLOCATE(grid%vp%v4,STAT=ierr)
2769  if (ierr.ne.0) then
2770  CALL wrf_error_fatal ( &
2771 'frame/module_domain.f: Failed to dallocate grid%vp%v4. ')
2772  endif
2773   NULLIFY(grid%vp%v4)
2774 ENDIF
2775 IF ( ASSOCIATED( grid%vp%v5 ) ) THEN 
2776   DEALLOCATE(grid%vp%v5,STAT=ierr)
2777  if (ierr.ne.0) then
2778  CALL wrf_error_fatal ( &
2779 'frame/module_domain.f: Failed to dallocate grid%vp%v5. ')
2780  endif
2781   NULLIFY(grid%vp%v5)
2782 ENDIF
2783 IF ( ASSOCIATED( grid%vp%alpha ) ) THEN 
2784   DEALLOCATE(grid%vp%alpha,STAT=ierr)
2785  if (ierr.ne.0) then
2786  CALL wrf_error_fatal ( &
2787 'frame/module_domain.f: Failed to dallocate grid%vp%alpha. ')
2788  endif
2789   NULLIFY(grid%vp%alpha)
2790 ENDIF
2791 IF ( ASSOCIATED( grid%ep%v1 ) ) THEN 
2792   DEALLOCATE(grid%ep%v1,STAT=ierr)
2793  if (ierr.ne.0) then
2794  CALL wrf_error_fatal ( &
2795 'frame/module_domain.f: Failed to dallocate grid%ep%v1. ')
2796  endif
2797   NULLIFY(grid%ep%v1)
2798 ENDIF
2799 IF ( ASSOCIATED( grid%ep%v2 ) ) THEN 
2800   DEALLOCATE(grid%ep%v2,STAT=ierr)
2801  if (ierr.ne.0) then
2802  CALL wrf_error_fatal ( &
2803 'frame/module_domain.f: Failed to dallocate grid%ep%v2. ')
2804  endif
2805   NULLIFY(grid%ep%v2)
2806 ENDIF
2807 IF ( ASSOCIATED( grid%ep%v3 ) ) THEN 
2808   DEALLOCATE(grid%ep%v3,STAT=ierr)
2809  if (ierr.ne.0) then
2810  CALL wrf_error_fatal ( &
2811 'frame/module_domain.f: Failed to dallocate grid%ep%v3. ')
2812  endif
2813   NULLIFY(grid%ep%v3)
2814 ENDIF
2815 IF ( ASSOCIATED( grid%ep%v4 ) ) THEN 
2816   DEALLOCATE(grid%ep%v4,STAT=ierr)
2817  if (ierr.ne.0) then
2818  CALL wrf_error_fatal ( &
2819 'frame/module_domain.f: Failed to dallocate grid%ep%v4. ')
2820  endif
2821   NULLIFY(grid%ep%v4)
2822 ENDIF
2823 IF ( ASSOCIATED( grid%ep%v5 ) ) THEN 
2824   DEALLOCATE(grid%ep%v5,STAT=ierr)
2825  if (ierr.ne.0) then
2826  CALL wrf_error_fatal ( &
2827 'frame/module_domain.f: Failed to dallocate grid%ep%v5. ')
2828  endif
2829   NULLIFY(grid%ep%v5)
2830 ENDIF
2831 IF ( ASSOCIATED( grid%xb%grid_box_area ) ) THEN 
2832   DEALLOCATE(grid%xb%grid_box_area,STAT=ierr)
2833  if (ierr.ne.0) then
2834  CALL wrf_error_fatal ( &
2835 'frame/module_domain.f: Failed to dallocate grid%xb%grid_box_area. ')
2836  endif
2837   NULLIFY(grid%xb%grid_box_area)
2838 ENDIF
2839 IF ( ASSOCIATED( grid%xb%map_factor ) ) THEN 
2840   DEALLOCATE(grid%xb%map_factor,STAT=ierr)
2841  if (ierr.ne.0) then
2842  CALL wrf_error_fatal ( &
2843 'frame/module_domain.f: Failed to dallocate grid%xb%map_factor. ')
2844  endif
2845   NULLIFY(grid%xb%map_factor)
2846 ENDIF
2847 IF ( ASSOCIATED( grid%xb%u ) ) THEN 
2848   DEALLOCATE(grid%xb%u,STAT=ierr)
2849  if (ierr.ne.0) then
2850  CALL wrf_error_fatal ( &
2851 'frame/module_domain.f: Failed to dallocate grid%xb%u. ')
2852  endif
2853   NULLIFY(grid%xb%u)
2854 ENDIF
2855 IF ( ASSOCIATED( grid%xb%v ) ) THEN 
2856   DEALLOCATE(grid%xb%v,STAT=ierr)
2857  if (ierr.ne.0) then
2858  CALL wrf_error_fatal ( &
2859 'frame/module_domain.f: Failed to dallocate grid%xb%v. ')
2860  endif
2861   NULLIFY(grid%xb%v)
2862 ENDIF
2863 IF ( ASSOCIATED( grid%xb%w ) ) THEN 
2864   DEALLOCATE(grid%xb%w,STAT=ierr)
2865  if (ierr.ne.0) then
2866  CALL wrf_error_fatal ( &
2867 'frame/module_domain.f: Failed to dallocate grid%xb%w. ')
2868  endif
2869   NULLIFY(grid%xb%w)
2870 ENDIF
2871 IF ( ASSOCIATED( grid%xb%t ) ) THEN 
2872   DEALLOCATE(grid%xb%t,STAT=ierr)
2873  if (ierr.ne.0) then
2874  CALL wrf_error_fatal ( &
2875 'frame/module_domain.f: Failed to dallocate grid%xb%t. ')
2876  endif
2877   NULLIFY(grid%xb%t)
2878 ENDIF
2879 IF ( ASSOCIATED( grid%xb%p ) ) THEN 
2880   DEALLOCATE(grid%xb%p,STAT=ierr)
2881  if (ierr.ne.0) then
2882  CALL wrf_error_fatal ( &
2883 'frame/module_domain.f: Failed to dallocate grid%xb%p. ')
2884  endif
2885   NULLIFY(grid%xb%p)
2886 ENDIF
2887 IF ( ASSOCIATED( grid%xb%q ) ) THEN 
2888   DEALLOCATE(grid%xb%q,STAT=ierr)
2889  if (ierr.ne.0) then
2890  CALL wrf_error_fatal ( &
2891 'frame/module_domain.f: Failed to dallocate grid%xb%q. ')
2892  endif
2893   NULLIFY(grid%xb%q)
2894 ENDIF
2895 IF ( ASSOCIATED( grid%xb%qrn ) ) THEN 
2896   DEALLOCATE(grid%xb%qrn,STAT=ierr)
2897  if (ierr.ne.0) then
2898  CALL wrf_error_fatal ( &
2899 'frame/module_domain.f: Failed to dallocate grid%xb%qrn. ')
2900  endif
2901   NULLIFY(grid%xb%qrn)
2902 ENDIF
2903 IF ( ASSOCIATED( grid%xb%qcw ) ) THEN 
2904   DEALLOCATE(grid%xb%qcw,STAT=ierr)
2905  if (ierr.ne.0) then
2906  CALL wrf_error_fatal ( &
2907 'frame/module_domain.f: Failed to dallocate grid%xb%qcw. ')
2908  endif
2909   NULLIFY(grid%xb%qcw)
2910 ENDIF
2911 IF ( ASSOCIATED( grid%xb%qci ) ) THEN 
2912   DEALLOCATE(grid%xb%qci,STAT=ierr)
2913  if (ierr.ne.0) then
2914  CALL wrf_error_fatal ( &
2915 'frame/module_domain.f: Failed to dallocate grid%xb%qci. ')
2916  endif
2917   NULLIFY(grid%xb%qci)
2918 ENDIF
2919 IF ( ASSOCIATED( grid%xb%qsn ) ) THEN 
2920   DEALLOCATE(grid%xb%qsn,STAT=ierr)
2921  if (ierr.ne.0) then
2922  CALL wrf_error_fatal ( &
2923 'frame/module_domain.f: Failed to dallocate grid%xb%qsn. ')
2924  endif
2925   NULLIFY(grid%xb%qsn)
2926 ENDIF
2927 IF ( ASSOCIATED( grid%xb%qgr ) ) THEN 
2928   DEALLOCATE(grid%xb%qgr,STAT=ierr)
2929  if (ierr.ne.0) then
2930  CALL wrf_error_fatal ( &
2931 'frame/module_domain.f: Failed to dallocate grid%xb%qgr. ')
2932  endif
2933   NULLIFY(grid%xb%qgr)
2934 ENDIF
2935 IF ( ASSOCIATED( grid%xb%qt ) ) THEN 
2936   DEALLOCATE(grid%xb%qt,STAT=ierr)
2937  if (ierr.ne.0) then
2938  CALL wrf_error_fatal ( &
2939 'frame/module_domain.f: Failed to dallocate grid%xb%qt. ')
2940  endif
2941   NULLIFY(grid%xb%qt)
2942 ENDIF
2943 IF ( ASSOCIATED( grid%xb%delt ) ) THEN 
2944   DEALLOCATE(grid%xb%delt,STAT=ierr)
2945  if (ierr.ne.0) then
2946  CALL wrf_error_fatal ( &
2947 'frame/module_domain.f: Failed to dallocate grid%xb%delt. ')
2948  endif
2949   NULLIFY(grid%xb%delt)
2950 ENDIF
2951 IF ( ASSOCIATED( grid%xb%h ) ) THEN 
2952   DEALLOCATE(grid%xb%h,STAT=ierr)
2953  if (ierr.ne.0) then
2954  CALL wrf_error_fatal ( &
2955 'frame/module_domain.f: Failed to dallocate grid%xb%h. ')
2956  endif
2957   NULLIFY(grid%xb%h)
2958 ENDIF
2959 IF ( ASSOCIATED( grid%xb%hf ) ) THEN 
2960   DEALLOCATE(grid%xb%hf,STAT=ierr)
2961  if (ierr.ne.0) then
2962  CALL wrf_error_fatal ( &
2963 'frame/module_domain.f: Failed to dallocate grid%xb%hf. ')
2964  endif
2965   NULLIFY(grid%xb%hf)
2966 ENDIF
2967 IF ( ASSOCIATED( grid%xb%wh ) ) THEN 
2968   DEALLOCATE(grid%xb%wh,STAT=ierr)
2969  if (ierr.ne.0) then
2970  CALL wrf_error_fatal ( &
2971 'frame/module_domain.f: Failed to dallocate grid%xb%wh. ')
2972  endif
2973   NULLIFY(grid%xb%wh)
2974 ENDIF
2975 IF ( ASSOCIATED( grid%xb%rho ) ) THEN 
2976   DEALLOCATE(grid%xb%rho,STAT=ierr)
2977  if (ierr.ne.0) then
2978  CALL wrf_error_fatal ( &
2979 'frame/module_domain.f: Failed to dallocate grid%xb%rho. ')
2980  endif
2981   NULLIFY(grid%xb%rho)
2982 ENDIF
2983 IF ( ASSOCIATED( grid%xb%rh ) ) THEN 
2984   DEALLOCATE(grid%xb%rh,STAT=ierr)
2985  if (ierr.ne.0) then
2986  CALL wrf_error_fatal ( &
2987 'frame/module_domain.f: Failed to dallocate grid%xb%rh. ')
2988  endif
2989   NULLIFY(grid%xb%rh)
2990 ENDIF
2991 IF ( ASSOCIATED( grid%xb%es ) ) THEN 
2992   DEALLOCATE(grid%xb%es,STAT=ierr)
2993  if (ierr.ne.0) then
2994  CALL wrf_error_fatal ( &
2995 'frame/module_domain.f: Failed to dallocate grid%xb%es. ')
2996  endif
2997   NULLIFY(grid%xb%es)
2998 ENDIF
2999 IF ( ASSOCIATED( grid%xb%qs ) ) THEN 
3000   DEALLOCATE(grid%xb%qs,STAT=ierr)
3001  if (ierr.ne.0) then
3002  CALL wrf_error_fatal ( &
3003 'frame/module_domain.f: Failed to dallocate grid%xb%qs. ')
3004  endif
3005   NULLIFY(grid%xb%qs)
3006 ENDIF
3007 IF ( ASSOCIATED( grid%xb%td ) ) THEN 
3008   DEALLOCATE(grid%xb%td,STAT=ierr)
3009  if (ierr.ne.0) then
3010  CALL wrf_error_fatal ( &
3011 'frame/module_domain.f: Failed to dallocate grid%xb%td. ')
3012  endif
3013   NULLIFY(grid%xb%td)
3014 ENDIF
3015 IF ( ASSOCIATED( grid%xb%vertical_inner_product ) ) THEN 
3016   DEALLOCATE(grid%xb%vertical_inner_product,STAT=ierr)
3017  if (ierr.ne.0) then
3018  CALL wrf_error_fatal ( &
3019 'frame/module_domain.f: Failed to dallocate grid%xb%vertical_inner_product. ')
3020  endif
3021   NULLIFY(grid%xb%vertical_inner_product)
3022 ENDIF
3023 IF ( ASSOCIATED( grid%xb%ref ) ) THEN 
3024   DEALLOCATE(grid%xb%ref,STAT=ierr)
3025  if (ierr.ne.0) then
3026  CALL wrf_error_fatal ( &
3027 'frame/module_domain.f: Failed to dallocate grid%xb%ref. ')
3028  endif
3029   NULLIFY(grid%xb%ref)
3030 ENDIF
3031 IF ( ASSOCIATED( grid%xb%rough ) ) THEN 
3032   DEALLOCATE(grid%xb%rough,STAT=ierr)
3033  if (ierr.ne.0) then
3034  CALL wrf_error_fatal ( &
3035 'frame/module_domain.f: Failed to dallocate grid%xb%rough. ')
3036  endif
3037   NULLIFY(grid%xb%rough)
3038 ENDIF
3039 IF ( ASSOCIATED( grid%xb%tpw ) ) THEN 
3040   DEALLOCATE(grid%xb%tpw,STAT=ierr)
3041  if (ierr.ne.0) then
3042  CALL wrf_error_fatal ( &
3043 'frame/module_domain.f: Failed to dallocate grid%xb%tpw. ')
3044  endif
3045   NULLIFY(grid%xb%tpw)
3046 ENDIF
3047 IF ( ASSOCIATED( grid%xb%slp ) ) THEN 
3048   DEALLOCATE(grid%xb%slp,STAT=ierr)
3049  if (ierr.ne.0) then
3050  CALL wrf_error_fatal ( &
3051 'frame/module_domain.f: Failed to dallocate grid%xb%slp. ')
3052  endif
3053   NULLIFY(grid%xb%slp)
3054 ENDIF
3055 IF ( ASSOCIATED( grid%xb%speed ) ) THEN 
3056   DEALLOCATE(grid%xb%speed,STAT=ierr)
3057  if (ierr.ne.0) then
3058  CALL wrf_error_fatal ( &
3059 'frame/module_domain.f: Failed to dallocate grid%xb%speed. ')
3060  endif
3061   NULLIFY(grid%xb%speed)
3062 ENDIF
3063 IF ( ASSOCIATED( grid%xb%tb19v ) ) THEN 
3064   DEALLOCATE(grid%xb%tb19v,STAT=ierr)
3065  if (ierr.ne.0) then
3066  CALL wrf_error_fatal ( &
3067 'frame/module_domain.f: Failed to dallocate grid%xb%tb19v. ')
3068  endif
3069   NULLIFY(grid%xb%tb19v)
3070 ENDIF
3071 IF ( ASSOCIATED( grid%xb%tb19h ) ) THEN 
3072   DEALLOCATE(grid%xb%tb19h,STAT=ierr)
3073  if (ierr.ne.0) then
3074  CALL wrf_error_fatal ( &
3075 'frame/module_domain.f: Failed to dallocate grid%xb%tb19h. ')
3076  endif
3077   NULLIFY(grid%xb%tb19h)
3078 ENDIF
3079 IF ( ASSOCIATED( grid%xb%tb22v ) ) THEN 
3080   DEALLOCATE(grid%xb%tb22v,STAT=ierr)
3081  if (ierr.ne.0) then
3082  CALL wrf_error_fatal ( &
3083 'frame/module_domain.f: Failed to dallocate grid%xb%tb22v. ')
3084  endif
3085   NULLIFY(grid%xb%tb22v)
3086 ENDIF
3087 IF ( ASSOCIATED( grid%xb%tb37v ) ) THEN 
3088   DEALLOCATE(grid%xb%tb37v,STAT=ierr)
3089  if (ierr.ne.0) then
3090  CALL wrf_error_fatal ( &
3091 'frame/module_domain.f: Failed to dallocate grid%xb%tb37v. ')
3092  endif
3093   NULLIFY(grid%xb%tb37v)
3094 ENDIF
3095 IF ( ASSOCIATED( grid%xb%tb37h ) ) THEN 
3096   DEALLOCATE(grid%xb%tb37h,STAT=ierr)
3097  if (ierr.ne.0) then
3098  CALL wrf_error_fatal ( &
3099 'frame/module_domain.f: Failed to dallocate grid%xb%tb37h. ')
3100  endif
3101   NULLIFY(grid%xb%tb37h)
3102 ENDIF
3103 IF ( ASSOCIATED( grid%xb%tb85v ) ) THEN 
3104   DEALLOCATE(grid%xb%tb85v,STAT=ierr)
3105  if (ierr.ne.0) then
3106  CALL wrf_error_fatal ( &
3107 'frame/module_domain.f: Failed to dallocate grid%xb%tb85v. ')
3108  endif
3109   NULLIFY(grid%xb%tb85v)
3110 ENDIF
3111 IF ( ASSOCIATED( grid%xb%tb85h ) ) THEN 
3112   DEALLOCATE(grid%xb%tb85h,STAT=ierr)
3113  if (ierr.ne.0) then
3114  CALL wrf_error_fatal ( &
3115 'frame/module_domain.f: Failed to dallocate grid%xb%tb85h. ')
3116  endif
3117   NULLIFY(grid%xb%tb85h)
3118 ENDIF
3119 IF ( ASSOCIATED( grid%xb%cori ) ) THEN 
3120   DEALLOCATE(grid%xb%cori,STAT=ierr)
3121  if (ierr.ne.0) then
3122  CALL wrf_error_fatal ( &
3123 'frame/module_domain.f: Failed to dallocate grid%xb%cori. ')
3124  endif
3125   NULLIFY(grid%xb%cori)
3126 ENDIF
3127 IF ( ASSOCIATED( grid%xb%tgrn ) ) THEN 
3128   DEALLOCATE(grid%xb%tgrn,STAT=ierr)
3129  if (ierr.ne.0) then
3130  CALL wrf_error_fatal ( &
3131 'frame/module_domain.f: Failed to dallocate grid%xb%tgrn. ')
3132  endif
3133   NULLIFY(grid%xb%tgrn)
3134 ENDIF
3135 IF ( ASSOCIATED( grid%xb%lat ) ) THEN 
3136   DEALLOCATE(grid%xb%lat,STAT=ierr)
3137  if (ierr.ne.0) then
3138  CALL wrf_error_fatal ( &
3139 'frame/module_domain.f: Failed to dallocate grid%xb%lat. ')
3140  endif
3141   NULLIFY(grid%xb%lat)
3142 ENDIF
3143 IF ( ASSOCIATED( grid%xb%lon ) ) THEN 
3144   DEALLOCATE(grid%xb%lon,STAT=ierr)
3145  if (ierr.ne.0) then
3146  CALL wrf_error_fatal ( &
3147 'frame/module_domain.f: Failed to dallocate grid%xb%lon. ')
3148  endif
3149   NULLIFY(grid%xb%lon)
3150 ENDIF
3151 IF ( ASSOCIATED( grid%xb%terr ) ) THEN 
3152   DEALLOCATE(grid%xb%terr,STAT=ierr)
3153  if (ierr.ne.0) then
3154  CALL wrf_error_fatal ( &
3155 'frame/module_domain.f: Failed to dallocate grid%xb%terr. ')
3156  endif
3157   NULLIFY(grid%xb%terr)
3158 ENDIF
3159 IF ( ASSOCIATED( grid%xb%psac ) ) THEN 
3160   DEALLOCATE(grid%xb%psac,STAT=ierr)
3161  if (ierr.ne.0) then
3162  CALL wrf_error_fatal ( &
3163 'frame/module_domain.f: Failed to dallocate grid%xb%psac. ')
3164  endif
3165   NULLIFY(grid%xb%psac)
3166 ENDIF
3167 IF ( ASSOCIATED( grid%xb%lanu ) ) THEN 
3168   DEALLOCATE(grid%xb%lanu,STAT=ierr)
3169  if (ierr.ne.0) then
3170  CALL wrf_error_fatal ( &
3171 'frame/module_domain.f: Failed to dallocate grid%xb%lanu. ')
3172  endif
3173   NULLIFY(grid%xb%lanu)
3174 ENDIF
3175 IF ( ASSOCIATED( grid%xb%snow ) ) THEN 
3176   DEALLOCATE(grid%xb%snow,STAT=ierr)
3177  if (ierr.ne.0) then
3178  CALL wrf_error_fatal ( &
3179 'frame/module_domain.f: Failed to dallocate grid%xb%snow. ')
3180  endif
3181   NULLIFY(grid%xb%snow)
3182 ENDIF
3183 IF ( ASSOCIATED( grid%xb%xland ) ) THEN 
3184   DEALLOCATE(grid%xb%xland,STAT=ierr)
3185  if (ierr.ne.0) then
3186  CALL wrf_error_fatal ( &
3187 'frame/module_domain.f: Failed to dallocate grid%xb%xland. ')
3188  endif
3189   NULLIFY(grid%xb%xland)
3190 ENDIF
3191 IF ( ASSOCIATED( grid%xb%landmask ) ) THEN 
3192   DEALLOCATE(grid%xb%landmask,STAT=ierr)
3193  if (ierr.ne.0) then
3194  CALL wrf_error_fatal ( &
3195 'frame/module_domain.f: Failed to dallocate grid%xb%landmask. ')
3196  endif
3197   NULLIFY(grid%xb%landmask)
3198 ENDIF
3199 IF ( ASSOCIATED( grid%xb%u10 ) ) THEN 
3200   DEALLOCATE(grid%xb%u10,STAT=ierr)
3201  if (ierr.ne.0) then
3202  CALL wrf_error_fatal ( &
3203 'frame/module_domain.f: Failed to dallocate grid%xb%u10. ')
3204  endif
3205   NULLIFY(grid%xb%u10)
3206 ENDIF
3207 IF ( ASSOCIATED( grid%xb%v10 ) ) THEN 
3208   DEALLOCATE(grid%xb%v10,STAT=ierr)
3209  if (ierr.ne.0) then
3210  CALL wrf_error_fatal ( &
3211 'frame/module_domain.f: Failed to dallocate grid%xb%v10. ')
3212  endif
3213   NULLIFY(grid%xb%v10)
3214 ENDIF
3215 IF ( ASSOCIATED( grid%xb%t2 ) ) THEN 
3216   DEALLOCATE(grid%xb%t2,STAT=ierr)
3217  if (ierr.ne.0) then
3218  CALL wrf_error_fatal ( &
3219 'frame/module_domain.f: Failed to dallocate grid%xb%t2. ')
3220  endif
3221   NULLIFY(grid%xb%t2)
3222 ENDIF
3223 IF ( ASSOCIATED( grid%xb%q2 ) ) THEN 
3224   DEALLOCATE(grid%xb%q2,STAT=ierr)
3225  if (ierr.ne.0) then
3226  CALL wrf_error_fatal ( &
3227 'frame/module_domain.f: Failed to dallocate grid%xb%q2. ')
3228  endif
3229   NULLIFY(grid%xb%q2)
3230 ENDIF
3231 IF ( ASSOCIATED( grid%xb%psfc ) ) THEN 
3232   DEALLOCATE(grid%xb%psfc,STAT=ierr)
3233  if (ierr.ne.0) then
3234  CALL wrf_error_fatal ( &
3235 'frame/module_domain.f: Failed to dallocate grid%xb%psfc. ')
3236  endif
3237   NULLIFY(grid%xb%psfc)
3238 ENDIF
3239 IF ( ASSOCIATED( grid%xb%tsk ) ) THEN 
3240   DEALLOCATE(grid%xb%tsk,STAT=ierr)
3241  if (ierr.ne.0) then
3242  CALL wrf_error_fatal ( &
3243 'frame/module_domain.f: Failed to dallocate grid%xb%tsk. ')
3244  endif
3245   NULLIFY(grid%xb%tsk)
3246 ENDIF
3247 IF ( ASSOCIATED( grid%xb%smois ) ) THEN 
3248   DEALLOCATE(grid%xb%smois,STAT=ierr)
3249  if (ierr.ne.0) then
3250  CALL wrf_error_fatal ( &
3251 'frame/module_domain.f: Failed to dallocate grid%xb%smois. ')
3252  endif
3253   NULLIFY(grid%xb%smois)
3254 ENDIF
3255 IF ( ASSOCIATED( grid%xb%tslb ) ) THEN 
3256   DEALLOCATE(grid%xb%tslb,STAT=ierr)
3257  if (ierr.ne.0) then
3258  CALL wrf_error_fatal ( &
3259 'frame/module_domain.f: Failed to dallocate grid%xb%tslb. ')
3260  endif
3261   NULLIFY(grid%xb%tslb)
3262 ENDIF
3263 IF ( ASSOCIATED( grid%xb%xice ) ) THEN 
3264   DEALLOCATE(grid%xb%xice,STAT=ierr)
3265  if (ierr.ne.0) then
3266  CALL wrf_error_fatal ( &
3267 'frame/module_domain.f: Failed to dallocate grid%xb%xice. ')
3268  endif
3269   NULLIFY(grid%xb%xice)
3270 ENDIF
3271 IF ( ASSOCIATED( grid%xb%ivgtyp ) ) THEN 
3272   DEALLOCATE(grid%xb%ivgtyp,STAT=ierr)
3273  if (ierr.ne.0) then
3274  CALL wrf_error_fatal ( &
3275 'frame/module_domain.f: Failed to dallocate grid%xb%ivgtyp. ')
3276  endif
3277   NULLIFY(grid%xb%ivgtyp)
3278 ENDIF
3279 IF ( ASSOCIATED( grid%xb%isltyp ) ) THEN 
3280   DEALLOCATE(grid%xb%isltyp,STAT=ierr)
3281  if (ierr.ne.0) then
3282  CALL wrf_error_fatal ( &
3283 'frame/module_domain.f: Failed to dallocate grid%xb%isltyp. ')
3284  endif
3285   NULLIFY(grid%xb%isltyp)
3286 ENDIF
3287 IF ( ASSOCIATED( grid%xb%vegfra ) ) THEN 
3288   DEALLOCATE(grid%xb%vegfra,STAT=ierr)
3289  if (ierr.ne.0) then
3290  CALL wrf_error_fatal ( &
3291 'frame/module_domain.f: Failed to dallocate grid%xb%vegfra. ')
3292  endif
3293   NULLIFY(grid%xb%vegfra)
3294 ENDIF
3295 IF ( ASSOCIATED( grid%xb%snowh ) ) THEN 
3296   DEALLOCATE(grid%xb%snowh,STAT=ierr)
3297  if (ierr.ne.0) then
3298  CALL wrf_error_fatal ( &
3299 'frame/module_domain.f: Failed to dallocate grid%xb%snowh. ')
3300  endif
3301   NULLIFY(grid%xb%snowh)
3302 ENDIF
3303 IF ( ASSOCIATED( grid%xb%regime ) ) THEN 
3304   DEALLOCATE(grid%xb%regime,STAT=ierr)
3305  if (ierr.ne.0) then
3306  CALL wrf_error_fatal ( &
3307 'frame/module_domain.f: Failed to dallocate grid%xb%regime. ')
3308  endif
3309   NULLIFY(grid%xb%regime)
3310 ENDIF
3311 IF ( ASSOCIATED( grid%xb%znu ) ) THEN 
3312   DEALLOCATE(grid%xb%znu,STAT=ierr)
3313  if (ierr.ne.0) then
3314  CALL wrf_error_fatal ( &
3315 'frame/module_domain.f: Failed to dallocate grid%xb%znu. ')
3316  endif
3317   NULLIFY(grid%xb%znu)
3318 ENDIF
3319 IF ( ASSOCIATED( grid%xb%znw ) ) THEN 
3320   DEALLOCATE(grid%xb%znw,STAT=ierr)
3321  if (ierr.ne.0) then
3322  CALL wrf_error_fatal ( &
3323 'frame/module_domain.f: Failed to dallocate grid%xb%znw. ')
3324  endif
3325   NULLIFY(grid%xb%znw)
3326 ENDIF
3327 IF ( ASSOCIATED( grid%xb%dn ) ) THEN 
3328   DEALLOCATE(grid%xb%dn,STAT=ierr)
3329  if (ierr.ne.0) then
3330  CALL wrf_error_fatal ( &
3331 'frame/module_domain.f: Failed to dallocate grid%xb%dn. ')
3332  endif
3333   NULLIFY(grid%xb%dn)
3334 ENDIF
3335 IF ( ASSOCIATED( grid%xb%dnw ) ) THEN 
3336   DEALLOCATE(grid%xb%dnw,STAT=ierr)
3337  if (ierr.ne.0) then
3338  CALL wrf_error_fatal ( &
3339 'frame/module_domain.f: Failed to dallocate grid%xb%dnw. ')
3340  endif
3341   NULLIFY(grid%xb%dnw)
3342 ENDIF
3343 IF ( ASSOCIATED( grid%xb%sigmah ) ) THEN 
3344   DEALLOCATE(grid%xb%sigmah,STAT=ierr)
3345  if (ierr.ne.0) then
3346  CALL wrf_error_fatal ( &
3347 'frame/module_domain.f: Failed to dallocate grid%xb%sigmah. ')
3348  endif
3349   NULLIFY(grid%xb%sigmah)
3350 ENDIF
3351 IF ( ASSOCIATED( grid%xb%sigmaf ) ) THEN 
3352   DEALLOCATE(grid%xb%sigmaf,STAT=ierr)
3353  if (ierr.ne.0) then
3354  CALL wrf_error_fatal ( &
3355 'frame/module_domain.f: Failed to dallocate grid%xb%sigmaf. ')
3356  endif
3357   NULLIFY(grid%xb%sigmaf)
3358 ENDIF
3359 IF ( ASSOCIATED( grid%xb%coefx ) ) THEN 
3360   DEALLOCATE(grid%xb%coefx,STAT=ierr)
3361  if (ierr.ne.0) then
3362  CALL wrf_error_fatal ( &
3363 'frame/module_domain.f: Failed to dallocate grid%xb%coefx. ')
3364  endif
3365   NULLIFY(grid%xb%coefx)
3366 ENDIF
3367 IF ( ASSOCIATED( grid%xb%coefy ) ) THEN 
3368   DEALLOCATE(grid%xb%coefy,STAT=ierr)
3369  if (ierr.ne.0) then
3370  CALL wrf_error_fatal ( &
3371 'frame/module_domain.f: Failed to dallocate grid%xb%coefy. ')
3372  endif
3373   NULLIFY(grid%xb%coefy)
3374 ENDIF
3375 IF ( ASSOCIATED( grid%xb%coefz ) ) THEN 
3376   DEALLOCATE(grid%xb%coefz,STAT=ierr)
3377  if (ierr.ne.0) then
3378  CALL wrf_error_fatal ( &
3379 'frame/module_domain.f: Failed to dallocate grid%xb%coefz. ')
3380  endif
3381   NULLIFY(grid%xb%coefz)
3382 ENDIF
3383 IF ( ASSOCIATED( grid%xb%kma_a ) ) THEN 
3384   DEALLOCATE(grid%xb%kma_a,STAT=ierr)
3385  if (ierr.ne.0) then
3386  CALL wrf_error_fatal ( &
3387 'frame/module_domain.f: Failed to dallocate grid%xb%kma_a. ')
3388  endif
3389   NULLIFY(grid%xb%kma_a)
3390 ENDIF
3391 IF ( ASSOCIATED( grid%xb%kma_b ) ) THEN 
3392   DEALLOCATE(grid%xb%kma_b,STAT=ierr)
3393  if (ierr.ne.0) then
3394  CALL wrf_error_fatal ( &
3395 'frame/module_domain.f: Failed to dallocate grid%xb%kma_b. ')
3396  endif
3397   NULLIFY(grid%xb%kma_b)
3398 ENDIF
3399 IF ( ASSOCIATED( grid%xa%u ) ) THEN 
3400   DEALLOCATE(grid%xa%u,STAT=ierr)
3401  if (ierr.ne.0) then
3402  CALL wrf_error_fatal ( &
3403 'frame/module_domain.f: Failed to dallocate grid%xa%u. ')
3404  endif
3405   NULLIFY(grid%xa%u)
3406 ENDIF
3407 IF ( ASSOCIATED( grid%xa%v ) ) THEN 
3408   DEALLOCATE(grid%xa%v,STAT=ierr)
3409  if (ierr.ne.0) then
3410  CALL wrf_error_fatal ( &
3411 'frame/module_domain.f: Failed to dallocate grid%xa%v. ')
3412  endif
3413   NULLIFY(grid%xa%v)
3414 ENDIF
3415 IF ( ASSOCIATED( grid%xa%w ) ) THEN 
3416   DEALLOCATE(grid%xa%w,STAT=ierr)
3417  if (ierr.ne.0) then
3418  CALL wrf_error_fatal ( &
3419 'frame/module_domain.f: Failed to dallocate grid%xa%w. ')
3420  endif
3421   NULLIFY(grid%xa%w)
3422 ENDIF
3423 IF ( ASSOCIATED( grid%xa%t ) ) THEN 
3424   DEALLOCATE(grid%xa%t,STAT=ierr)
3425  if (ierr.ne.0) then
3426  CALL wrf_error_fatal ( &
3427 'frame/module_domain.f: Failed to dallocate grid%xa%t. ')
3428  endif
3429   NULLIFY(grid%xa%t)
3430 ENDIF
3431 IF ( ASSOCIATED( grid%xa%q ) ) THEN 
3432   DEALLOCATE(grid%xa%q,STAT=ierr)
3433  if (ierr.ne.0) then
3434  CALL wrf_error_fatal ( &
3435 'frame/module_domain.f: Failed to dallocate grid%xa%q. ')
3436  endif
3437   NULLIFY(grid%xa%q)
3438 ENDIF
3439 IF ( ASSOCIATED( grid%xa%p ) ) THEN 
3440   DEALLOCATE(grid%xa%p,STAT=ierr)
3441  if (ierr.ne.0) then
3442  CALL wrf_error_fatal ( &
3443 'frame/module_domain.f: Failed to dallocate grid%xa%p. ')
3444  endif
3445   NULLIFY(grid%xa%p)
3446 ENDIF
3447 IF ( ASSOCIATED( grid%xa%rh ) ) THEN 
3448   DEALLOCATE(grid%xa%rh,STAT=ierr)
3449  if (ierr.ne.0) then
3450  CALL wrf_error_fatal ( &
3451 'frame/module_domain.f: Failed to dallocate grid%xa%rh. ')
3452  endif
3453   NULLIFY(grid%xa%rh)
3454 ENDIF
3455 IF ( ASSOCIATED( grid%xa%rho ) ) THEN 
3456   DEALLOCATE(grid%xa%rho,STAT=ierr)
3457  if (ierr.ne.0) then
3458  CALL wrf_error_fatal ( &
3459 'frame/module_domain.f: Failed to dallocate grid%xa%rho. ')
3460  endif
3461   NULLIFY(grid%xa%rho)
3462 ENDIF
3463 IF ( ASSOCIATED( grid%xa%wh ) ) THEN 
3464   DEALLOCATE(grid%xa%wh,STAT=ierr)
3465  if (ierr.ne.0) then
3466  CALL wrf_error_fatal ( &
3467 'frame/module_domain.f: Failed to dallocate grid%xa%wh. ')
3468  endif
3469   NULLIFY(grid%xa%wh)
3470 ENDIF
3471 IF ( ASSOCIATED( grid%xa%qrn ) ) THEN 
3472   DEALLOCATE(grid%xa%qrn,STAT=ierr)
3473  if (ierr.ne.0) then
3474  CALL wrf_error_fatal ( &
3475 'frame/module_domain.f: Failed to dallocate grid%xa%qrn. ')
3476  endif
3477   NULLIFY(grid%xa%qrn)
3478 ENDIF
3479 IF ( ASSOCIATED( grid%xa%qcw ) ) THEN 
3480   DEALLOCATE(grid%xa%qcw,STAT=ierr)
3481  if (ierr.ne.0) then
3482  CALL wrf_error_fatal ( &
3483 'frame/module_domain.f: Failed to dallocate grid%xa%qcw. ')
3484  endif
3485   NULLIFY(grid%xa%qcw)
3486 ENDIF
3487 IF ( ASSOCIATED( grid%xa%qci ) ) THEN 
3488   DEALLOCATE(grid%xa%qci,STAT=ierr)
3489  if (ierr.ne.0) then
3490  CALL wrf_error_fatal ( &
3491 'frame/module_domain.f: Failed to dallocate grid%xa%qci. ')
3492  endif
3493   NULLIFY(grid%xa%qci)
3494 ENDIF
3495 IF ( ASSOCIATED( grid%xa%qsn ) ) THEN 
3496   DEALLOCATE(grid%xa%qsn,STAT=ierr)
3497  if (ierr.ne.0) then
3498  CALL wrf_error_fatal ( &
3499 'frame/module_domain.f: Failed to dallocate grid%xa%qsn. ')
3500  endif
3501   NULLIFY(grid%xa%qsn)
3502 ENDIF
3503 IF ( ASSOCIATED( grid%xa%qgr ) ) THEN 
3504   DEALLOCATE(grid%xa%qgr,STAT=ierr)
3505  if (ierr.ne.0) then
3506  CALL wrf_error_fatal ( &
3507 'frame/module_domain.f: Failed to dallocate grid%xa%qgr. ')
3508  endif
3509   NULLIFY(grid%xa%qgr)
3510 ENDIF
3511 IF ( ASSOCIATED( grid%xa%qt ) ) THEN 
3512   DEALLOCATE(grid%xa%qt,STAT=ierr)
3513  if (ierr.ne.0) then
3514  CALL wrf_error_fatal ( &
3515 'frame/module_domain.f: Failed to dallocate grid%xa%qt. ')
3516  endif
3517   NULLIFY(grid%xa%qt)
3518 ENDIF
3519 IF ( ASSOCIATED( grid%xa%tgrn ) ) THEN 
3520   DEALLOCATE(grid%xa%tgrn,STAT=ierr)
3521  if (ierr.ne.0) then
3522  CALL wrf_error_fatal ( &
3523 'frame/module_domain.f: Failed to dallocate grid%xa%tgrn. ')
3524  endif
3525   NULLIFY(grid%xa%tgrn)
3526 ENDIF
3527 IF ( ASSOCIATED( grid%xa%psfc ) ) THEN 
3528   DEALLOCATE(grid%xa%psfc,STAT=ierr)
3529  if (ierr.ne.0) then
3530  CALL wrf_error_fatal ( &
3531 'frame/module_domain.f: Failed to dallocate grid%xa%psfc. ')
3532  endif
3533   NULLIFY(grid%xa%psfc)
3534 ENDIF
3535 IF ( ASSOCIATED( grid%xa%u10 ) ) THEN 
3536   DEALLOCATE(grid%xa%u10,STAT=ierr)
3537  if (ierr.ne.0) then
3538  CALL wrf_error_fatal ( &
3539 'frame/module_domain.f: Failed to dallocate grid%xa%u10. ')
3540  endif
3541   NULLIFY(grid%xa%u10)
3542 ENDIF
3543 IF ( ASSOCIATED( grid%xa%v10 ) ) THEN 
3544   DEALLOCATE(grid%xa%v10,STAT=ierr)
3545  if (ierr.ne.0) then
3546  CALL wrf_error_fatal ( &
3547 'frame/module_domain.f: Failed to dallocate grid%xa%v10. ')
3548  endif
3549   NULLIFY(grid%xa%v10)
3550 ENDIF
3551 IF ( ASSOCIATED( grid%xa%t2 ) ) THEN 
3552   DEALLOCATE(grid%xa%t2,STAT=ierr)
3553  if (ierr.ne.0) then
3554  CALL wrf_error_fatal ( &
3555 'frame/module_domain.f: Failed to dallocate grid%xa%t2. ')
3556  endif
3557   NULLIFY(grid%xa%t2)
3558 ENDIF
3559 IF ( ASSOCIATED( grid%xa%q2 ) ) THEN 
3560   DEALLOCATE(grid%xa%q2,STAT=ierr)
3561  if (ierr.ne.0) then
3562  CALL wrf_error_fatal ( &
3563 'frame/module_domain.f: Failed to dallocate grid%xa%q2. ')
3564  endif
3565   NULLIFY(grid%xa%q2)
3566 ENDIF
3567 IF ( ASSOCIATED( grid%xa%ref ) ) THEN 
3568   DEALLOCATE(grid%xa%ref,STAT=ierr)
3569  if (ierr.ne.0) then
3570  CALL wrf_error_fatal ( &
3571 'frame/module_domain.f: Failed to dallocate grid%xa%ref. ')
3572  endif
3573   NULLIFY(grid%xa%ref)
3574 ENDIF
3575 IF ( ASSOCIATED( grid%xa%tpw ) ) THEN 
3576   DEALLOCATE(grid%xa%tpw,STAT=ierr)
3577  if (ierr.ne.0) then
3578  CALL wrf_error_fatal ( &
3579 'frame/module_domain.f: Failed to dallocate grid%xa%tpw. ')
3580  endif
3581   NULLIFY(grid%xa%tpw)
3582 ENDIF
3583 IF ( ASSOCIATED( grid%xa%speed ) ) THEN 
3584   DEALLOCATE(grid%xa%speed,STAT=ierr)
3585  if (ierr.ne.0) then
3586  CALL wrf_error_fatal ( &
3587 'frame/module_domain.f: Failed to dallocate grid%xa%speed. ')
3588  endif
3589   NULLIFY(grid%xa%speed)
3590 ENDIF
3591 IF ( ASSOCIATED( grid%xa%tb19v ) ) THEN 
3592   DEALLOCATE(grid%xa%tb19v,STAT=ierr)
3593  if (ierr.ne.0) then
3594  CALL wrf_error_fatal ( &
3595 'frame/module_domain.f: Failed to dallocate grid%xa%tb19v. ')
3596  endif
3597   NULLIFY(grid%xa%tb19v)
3598 ENDIF
3599 IF ( ASSOCIATED( grid%xa%tb19h ) ) THEN 
3600   DEALLOCATE(grid%xa%tb19h,STAT=ierr)
3601  if (ierr.ne.0) then
3602  CALL wrf_error_fatal ( &
3603 'frame/module_domain.f: Failed to dallocate grid%xa%tb19h. ')
3604  endif
3605   NULLIFY(grid%xa%tb19h)
3606 ENDIF
3607 IF ( ASSOCIATED( grid%xa%tb22v ) ) THEN 
3608   DEALLOCATE(grid%xa%tb22v,STAT=ierr)
3609  if (ierr.ne.0) then
3610  CALL wrf_error_fatal ( &
3611 'frame/module_domain.f: Failed to dallocate grid%xa%tb22v. ')
3612  endif
3613   NULLIFY(grid%xa%tb22v)
3614 ENDIF
3615 IF ( ASSOCIATED( grid%xa%tb37v ) ) THEN 
3616   DEALLOCATE(grid%xa%tb37v,STAT=ierr)
3617  if (ierr.ne.0) then
3618  CALL wrf_error_fatal ( &
3619 'frame/module_domain.f: Failed to dallocate grid%xa%tb37v. ')
3620  endif
3621   NULLIFY(grid%xa%tb37v)
3622 ENDIF
3623 IF ( ASSOCIATED( grid%xa%tb37h ) ) THEN 
3624   DEALLOCATE(grid%xa%tb37h,STAT=ierr)
3625  if (ierr.ne.0) then
3626  CALL wrf_error_fatal ( &
3627 'frame/module_domain.f: Failed to dallocate grid%xa%tb37h. ')
3628  endif
3629   NULLIFY(grid%xa%tb37h)
3630 ENDIF
3631 IF ( ASSOCIATED( grid%xa%tb85v ) ) THEN 
3632   DEALLOCATE(grid%xa%tb85v,STAT=ierr)
3633  if (ierr.ne.0) then
3634  CALL wrf_error_fatal ( &
3635 'frame/module_domain.f: Failed to dallocate grid%xa%tb85v. ')
3636  endif
3637   NULLIFY(grid%xa%tb85v)
3638 ENDIF
3639 IF ( ASSOCIATED( grid%xa%tb85h ) ) THEN 
3640   DEALLOCATE(grid%xa%tb85h,STAT=ierr)
3641  if (ierr.ne.0) then
3642  CALL wrf_error_fatal ( &
3643 'frame/module_domain.f: Failed to dallocate grid%xa%tb85h. ')
3644  endif
3645   NULLIFY(grid%xa%tb85h)
3646 ENDIF
3647 IF ( ASSOCIATED( grid%xp%vxy ) ) THEN 
3648   DEALLOCATE(grid%xp%vxy,STAT=ierr)
3649  if (ierr.ne.0) then
3650  CALL wrf_error_fatal ( &
3651 'frame/module_domain.f: Failed to dallocate grid%xp%vxy. ')
3652  endif
3653   NULLIFY(grid%xp%vxy)
3654 ENDIF
3655 IF ( ASSOCIATED( grid%xp%v1z ) ) THEN 
3656   DEALLOCATE(grid%xp%v1z,STAT=ierr)
3657  if (ierr.ne.0) then
3658  CALL wrf_error_fatal ( &
3659 'frame/module_domain.f: Failed to dallocate grid%xp%v1z. ')
3660  endif
3661   NULLIFY(grid%xp%v1z)
3662 ENDIF
3663 IF ( ASSOCIATED( grid%xp%v1x ) ) THEN 
3664   DEALLOCATE(grid%xp%v1x,STAT=ierr)
3665  if (ierr.ne.0) then
3666  CALL wrf_error_fatal ( &
3667 'frame/module_domain.f: Failed to dallocate grid%xp%v1x. ')
3668  endif
3669   NULLIFY(grid%xp%v1x)
3670 ENDIF
3671 IF ( ASSOCIATED( grid%xp%v1y ) ) THEN 
3672   DEALLOCATE(grid%xp%v1y,STAT=ierr)
3673  if (ierr.ne.0) then
3674  CALL wrf_error_fatal ( &
3675 'frame/module_domain.f: Failed to dallocate grid%xp%v1y. ')
3676  endif
3677   NULLIFY(grid%xp%v1y)
3678 ENDIF
3679 IF ( ASSOCIATED( grid%xp%v2z ) ) THEN 
3680   DEALLOCATE(grid%xp%v2z,STAT=ierr)
3681  if (ierr.ne.0) then
3682  CALL wrf_error_fatal ( &
3683 'frame/module_domain.f: Failed to dallocate grid%xp%v2z. ')
3684  endif
3685   NULLIFY(grid%xp%v2z)
3686 ENDIF
3687 IF ( ASSOCIATED( grid%xp%v2x ) ) THEN 
3688   DEALLOCATE(grid%xp%v2x,STAT=ierr)
3689  if (ierr.ne.0) then
3690  CALL wrf_error_fatal ( &
3691 'frame/module_domain.f: Failed to dallocate grid%xp%v2x. ')
3692  endif
3693   NULLIFY(grid%xp%v2x)
3694 ENDIF
3695 IF ( ASSOCIATED( grid%xp%v2y ) ) THEN 
3696   DEALLOCATE(grid%xp%v2y,STAT=ierr)
3697  if (ierr.ne.0) then
3698  CALL wrf_error_fatal ( &
3699 'frame/module_domain.f: Failed to dallocate grid%xp%v2y. ')
3700  endif
3701   NULLIFY(grid%xp%v2y)
3702 ENDIF
3703 IF ( ASSOCIATED( grid%fdob%varobs ) ) THEN 
3704   DEALLOCATE(grid%fdob%varobs,STAT=ierr)
3705  if (ierr.ne.0) then
3706  CALL wrf_error_fatal ( &
3707 'frame/module_domain.f: Failed to dallocate grid%fdob%varobs. ')
3708  endif
3709   NULLIFY(grid%fdob%varobs)
3710 ENDIF
3711 IF ( ASSOCIATED( grid%fdob%errf ) ) THEN 
3712   DEALLOCATE(grid%fdob%errf,STAT=ierr)
3713  if (ierr.ne.0) then
3714  CALL wrf_error_fatal ( &
3715 'frame/module_domain.f: Failed to dallocate grid%fdob%errf. ')
3716  endif
3717   NULLIFY(grid%fdob%errf)
3718 ENDIF
3719 IF ( ASSOCIATED( grid%fdob%timeob ) ) THEN 
3720   DEALLOCATE(grid%fdob%timeob,STAT=ierr)
3721  if (ierr.ne.0) then
3722  CALL wrf_error_fatal ( &
3723 'frame/module_domain.f: Failed to dallocate grid%fdob%timeob. ')
3724  endif
3725   NULLIFY(grid%fdob%timeob)
3726 ENDIF
3727 IF ( ASSOCIATED( grid%fdob%nlevs_ob ) ) THEN 
3728   DEALLOCATE(grid%fdob%nlevs_ob,STAT=ierr)
3729  if (ierr.ne.0) then
3730  CALL wrf_error_fatal ( &
3731 'frame/module_domain.f: Failed to dallocate grid%fdob%nlevs_ob. ')
3732  endif
3733   NULLIFY(grid%fdob%nlevs_ob)
3734 ENDIF
3735 IF ( ASSOCIATED( grid%fdob%lev_in_ob ) ) THEN 
3736   DEALLOCATE(grid%fdob%lev_in_ob,STAT=ierr)
3737  if (ierr.ne.0) then
3738  CALL wrf_error_fatal ( &
3739 'frame/module_domain.f: Failed to dallocate grid%fdob%lev_in_ob. ')
3740  endif
3741   NULLIFY(grid%fdob%lev_in_ob)
3742 ENDIF
3743 IF ( ASSOCIATED( grid%fdob%plfo ) ) THEN 
3744   DEALLOCATE(grid%fdob%plfo,STAT=ierr)
3745  if (ierr.ne.0) then
3746  CALL wrf_error_fatal ( &
3747 'frame/module_domain.f: Failed to dallocate grid%fdob%plfo. ')
3748  endif
3749   NULLIFY(grid%fdob%plfo)
3750 ENDIF
3751 IF ( ASSOCIATED( grid%fdob%elevob ) ) THEN 
3752   DEALLOCATE(grid%fdob%elevob,STAT=ierr)
3753  if (ierr.ne.0) then
3754  CALL wrf_error_fatal ( &
3755 'frame/module_domain.f: Failed to dallocate grid%fdob%elevob. ')
3756  endif
3757   NULLIFY(grid%fdob%elevob)
3758 ENDIF
3759 IF ( ASSOCIATED( grid%fdob%rio ) ) THEN 
3760   DEALLOCATE(grid%fdob%rio,STAT=ierr)
3761  if (ierr.ne.0) then
3762  CALL wrf_error_fatal ( &
3763 'frame/module_domain.f: Failed to dallocate grid%fdob%rio. ')
3764  endif
3765   NULLIFY(grid%fdob%rio)
3766 ENDIF
3767 IF ( ASSOCIATED( grid%fdob%rjo ) ) THEN 
3768   DEALLOCATE(grid%fdob%rjo,STAT=ierr)
3769  if (ierr.ne.0) then
3770  CALL wrf_error_fatal ( &
3771 'frame/module_domain.f: Failed to dallocate grid%fdob%rjo. ')
3772  endif
3773   NULLIFY(grid%fdob%rjo)
3774 ENDIF
3775 IF ( ASSOCIATED( grid%fdob%rko ) ) THEN 
3776   DEALLOCATE(grid%fdob%rko,STAT=ierr)
3777  if (ierr.ne.0) then
3778  CALL wrf_error_fatal ( &
3779 'frame/module_domain.f: Failed to dallocate grid%fdob%rko. ')
3780  endif
3781   NULLIFY(grid%fdob%rko)
3782 ENDIF
3783 !ENDOFREGISTRYGENERATEDINCLUDE