md_calls.inc

References to this file elsewhere.
1 !
2 ! WRF io macro file
3 !
4 ! This file is used to generate the series of 40 meta-data get and 
5 ! put calls in the WRF I/O API.  It contains an M4 macro and then
6 ! a series of invocations of the macro to generate the subroutine
7 ! definitions, which are then included by the file module_io.F
8 !
9 
10 ! $1 = get|put $2=dom|var $3=type $4=[char] $5=td|ti
11 
12 
13 
14 
15 
16 
17 
18 INTERFACE wrf_get_dom_ti_real
19   MODULE PROCEDURE wrf_get_dom_ti_real_arr, wrf_get_dom_ti_real_sca
20 END INTERFACE
21 
22 
23 INTERFACE wrf_put_dom_ti_real
24   MODULE PROCEDURE wrf_put_dom_ti_real_arr, wrf_put_dom_ti_real_sca
25 END INTERFACE
26 
27 
28 INTERFACE wrf_get_dom_ti_double
29   MODULE PROCEDURE wrf_get_dom_ti_double_arr, wrf_get_dom_ti_double_sca
30 END INTERFACE
31 
32 
33 INTERFACE wrf_put_dom_ti_double
34   MODULE PROCEDURE wrf_put_dom_ti_double_arr, wrf_put_dom_ti_double_sca
35 END INTERFACE
36 
37 
38 INTERFACE wrf_get_dom_ti_integer
39   MODULE PROCEDURE wrf_get_dom_ti_integer_arr, wrf_get_dom_ti_integer_sca
40 END INTERFACE
41 
42 
43 INTERFACE wrf_put_dom_ti_integer
44   MODULE PROCEDURE wrf_put_dom_ti_integer_arr, wrf_put_dom_ti_integer_sca
45 END INTERFACE
46 
47 
48 INTERFACE wrf_get_dom_ti_logical
49   MODULE PROCEDURE wrf_get_dom_ti_logical_arr, wrf_get_dom_ti_logical_sca
50 END INTERFACE
51 
52 
53 INTERFACE wrf_put_dom_ti_logical
54   MODULE PROCEDURE wrf_put_dom_ti_logical_arr, wrf_put_dom_ti_logical_sca
55 END INTERFACE
56 
57 
58 INTERFACE wrf_get_dom_ti_char
59   MODULE PROCEDURE wrf_get_dom_ti_char_arr
60 END INTERFACE
61 
62 
63 INTERFACE wrf_put_dom_ti_char
64   MODULE PROCEDURE wrf_put_dom_ti_char_arr
65 END INTERFACE
66 
67 
68 
69 INTERFACE wrf_get_dom_td_real
70   MODULE PROCEDURE wrf_get_dom_td_real_arr, wrf_get_dom_td_real_sca
71 END INTERFACE
72 
73 
74 INTERFACE wrf_put_dom_td_real
75   MODULE PROCEDURE wrf_put_dom_td_real_arr, wrf_put_dom_td_real_sca
76 END INTERFACE
77 
78 
79 INTERFACE wrf_get_dom_td_double
80   MODULE PROCEDURE wrf_get_dom_td_double_arr, wrf_get_dom_td_double_sca
81 END INTERFACE
82 
83 
84 INTERFACE wrf_put_dom_td_double
85   MODULE PROCEDURE wrf_put_dom_td_double_arr, wrf_put_dom_td_double_sca
86 END INTERFACE
87 
88 
89 INTERFACE wrf_get_dom_td_integer
90   MODULE PROCEDURE wrf_get_dom_td_integer_arr, wrf_get_dom_td_integer_sca
91 END INTERFACE
92 
93 
94 INTERFACE wrf_put_dom_td_integer
95   MODULE PROCEDURE wrf_put_dom_td_integer_arr, wrf_put_dom_td_integer_sca
96 END INTERFACE
97 
98 
99 INTERFACE wrf_get_dom_td_logical
100   MODULE PROCEDURE wrf_get_dom_td_logical_arr, wrf_get_dom_td_logical_sca
101 END INTERFACE
102 
103 
104 INTERFACE wrf_put_dom_td_logical
105   MODULE PROCEDURE wrf_put_dom_td_logical_arr, wrf_put_dom_td_logical_sca
106 END INTERFACE
107 
108 
109 INTERFACE wrf_get_dom_td_char
110   MODULE PROCEDURE wrf_get_dom_td_char_arr
111 END INTERFACE
112 
113 
114 INTERFACE wrf_put_dom_td_char
115   MODULE PROCEDURE wrf_put_dom_td_char_arr
116 END INTERFACE
117 
118 
119 
120 INTERFACE wrf_get_var_ti_real
121   MODULE PROCEDURE wrf_get_var_ti_real_arr, wrf_get_var_ti_real_sca
122 END INTERFACE
123 
124 
125 INTERFACE wrf_put_var_ti_real
126   MODULE PROCEDURE wrf_put_var_ti_real_arr, wrf_put_var_ti_real_sca
127 END INTERFACE
128 
129 
130 INTERFACE wrf_get_var_ti_double
131   MODULE PROCEDURE wrf_get_var_ti_double_arr, wrf_get_var_ti_double_sca
132 END INTERFACE
133 
134 
135 INTERFACE wrf_put_var_ti_double
136   MODULE PROCEDURE wrf_put_var_ti_double_arr, wrf_put_var_ti_double_sca
137 END INTERFACE
138 
139 
140 INTERFACE wrf_get_var_ti_integer
141   MODULE PROCEDURE wrf_get_var_ti_integer_arr, wrf_get_var_ti_integer_sca
142 END INTERFACE
143 
144 
145 INTERFACE wrf_put_var_ti_integer
146   MODULE PROCEDURE wrf_put_var_ti_integer_arr, wrf_put_var_ti_integer_sca
147 END INTERFACE
148 
149 
150 INTERFACE wrf_get_var_ti_logical
151   MODULE PROCEDURE wrf_get_var_ti_logical_arr, wrf_get_var_ti_logical_sca
152 END INTERFACE
153 
154 
155 INTERFACE wrf_put_var_ti_logical
156   MODULE PROCEDURE wrf_put_var_ti_logical_arr, wrf_put_var_ti_logical_sca
157 END INTERFACE
158 
159 
160 INTERFACE wrf_get_var_ti_char
161   MODULE PROCEDURE wrf_get_var_ti_char_arr
162 END INTERFACE
163 
164 
165 INTERFACE wrf_put_var_ti_char
166   MODULE PROCEDURE wrf_put_var_ti_char_arr
167 END INTERFACE
168 
169 
170 
171 INTERFACE wrf_get_var_td_real
172   MODULE PROCEDURE wrf_get_var_td_real_arr, wrf_get_var_td_real_sca
173 END INTERFACE
174 
175 
176 INTERFACE wrf_put_var_td_real
177   MODULE PROCEDURE wrf_put_var_td_real_arr, wrf_put_var_td_real_sca
178 END INTERFACE
179 
180 
181 INTERFACE wrf_get_var_td_double
182   MODULE PROCEDURE wrf_get_var_td_double_arr, wrf_get_var_td_double_sca
183 END INTERFACE
184 
185 
186 INTERFACE wrf_put_var_td_double
187   MODULE PROCEDURE wrf_put_var_td_double_arr, wrf_put_var_td_double_sca
188 END INTERFACE
189 
190 
191 INTERFACE wrf_get_var_td_integer
192   MODULE PROCEDURE wrf_get_var_td_integer_arr, wrf_get_var_td_integer_sca
193 END INTERFACE
194 
195 
196 INTERFACE wrf_put_var_td_integer
197   MODULE PROCEDURE wrf_put_var_td_integer_arr, wrf_put_var_td_integer_sca
198 END INTERFACE
199 
200 
201 INTERFACE wrf_get_var_td_logical
202   MODULE PROCEDURE wrf_get_var_td_logical_arr, wrf_get_var_td_logical_sca
203 END INTERFACE
204 
205 
206 INTERFACE wrf_put_var_td_logical
207   MODULE PROCEDURE wrf_put_var_td_logical_arr, wrf_put_var_td_logical_sca
208 END INTERFACE
209 
210 
211 INTERFACE wrf_get_var_td_char
212   MODULE PROCEDURE wrf_get_var_td_char_arr
213 END INTERFACE
214 
215 
216 INTERFACE wrf_put_var_td_char
217   MODULE PROCEDURE wrf_put_var_td_char_arr
218 END INTERFACE
219 
220 
221 
222 CONTAINS
223 
224 !--- get_dom_ti_real
225 
226 SUBROUTINE wrf_get_dom_ti_real_arr ( DataHandle,Element,   Data, Count, Outcount, Status )
227 !<DESCRIPTION>
228 !<PRE>
229 !
230 ! Attempt to read Count words of time independent
231 ! domain metadata named "Element"  
232 ! from the open dataset described by DataHandle.  
233 ! Metadata of type real are
234 ! stored in array Data.
235 ! Actual number of words read is returned in OutCount.
236 !
237 !</PRE>
238 !</DESCRIPTION>
239 USE module_state_description
240 IMPLICIT NONE
241 INTEGER ,       INTENT(IN)  :: DataHandle
242 CHARACTER*(*) , INTENT(IN)  :: Element
243 
244  
245 
246  real  :: Data (*)
247 
248 INTEGER ,       INTENT(IN)  :: Count
249 INTEGER ,       INTENT(OUT)  :: OutCount
250 INTEGER ,       INTENT(OUT) :: Status
251 
252 #include <wrf_status_codes.h>
253 INTEGER                     :: len_of_str
254 LOGICAL                     :: for_out
255 INTEGER, EXTERNAL           :: use_package
256 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
257 INTEGER                     :: locCount
258 
259 INTEGER io_form , Hndl
260 
261 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_real_arr " )
262 
263 
264 locCount = Count
265 
266 
267 Status = 0
268 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
269 IF ( Hndl .GT. -1 ) THEN
270   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
271     SELECT CASE ( use_package( io_form ) )
272 #ifdef NETCDF
273       CASE ( IO_NETCDF   )
274         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
275 #  if ( RWORDSIZE == DWORDSIZE )
276            CALL ext_ncd_get_dom_ti_double ( Hndl, Element,   Data, &
277                                  locCount, Outcount, Status )
278 #  else
279            CALL ext_ncd_get_dom_ti_real ( Hndl, Element,   Data, &
280                                  locCount, Outcount, Status )
281 #  endif
282         ENDIF
283         IF ( .NOT. multi_files(io_form) ) THEN
284           
285           
286           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
287           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
288           
289           
290           
291           
292           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
293         ENDIF
294 #endif
295 #ifdef PNETCDF
296       CASE ( IO_PNETCDF   )
297 #  if ( RWORDSIZE == DWORDSIZE )
298         CALL ext_pnc_get_dom_ti_double ( Hndl, Element,   Data, &
299                               locCount, Outcount, Status )
300 #  else
301         CALL ext_pnc_get_dom_ti_real ( Hndl, Element,   Data, &
302                               locCount, Outcount, Status )
303 #  endif
304 #endif
305 #ifdef PHDF5
306       CASE ( IO_PHDF5   )
307 #  if ( RWORDSIZE == DWORDSIZE )
308         CALL ext_phdf5_get_dom_ti_double ( Hndl, Element,   Data, &
309                               locCount, Outcount, Status )
310 #  else
311         CALL ext_phdf5_get_dom_ti_real ( Hndl, Element,   Data, &
312                               locCount, Outcount, Status )
313 #  endif
314 #endif
315 #ifdef ESMFIO
316       CASE ( IO_ESMF )
317 #  if ( RWORDSIZE == DWORDSIZE )
318         CALL ext_esmf_get_dom_ti_double ( Hndl, Element,   Data, &
319                               locCount, Outcount, Status )
320 #  else
321         CALL ext_esmf_get_dom_ti_real ( Hndl, Element,   Data, &
322                               locCount, Outcount, Status )
323 #  endif
324 #endif
325 #ifdef XXX
326       CASE ( IO_XXX   )
327 #  if ( RWORDSIZE == DWORDSIZE )
328         CALL ext_xxx_get_dom_ti_double ( Hndl, Element,   Data, &
329                               locCount, Outcount, Status )
330 #  else
331         CALL ext_xxx_get_dom_ti_real ( Hndl, Element,   Data, &
332                               locCount, Outcount, Status )
333 #  endif
334 #endif
335 #ifdef YYY
336       CASE ( IO_YYY   )
337 #  if ( RWORDSIZE == DWORDSIZE )
338         CALL ext_yyy_get_dom_ti_double ( Hndl, Element,   Data, &
339                               locCount, Outcount, Status )
340 #  else
341         CALL ext_yyy_get_dom_ti_real ( Hndl, Element,   Data, &
342                               locCount, Outcount, Status )
343 #  endif
344 #endif
345 #ifdef GRIB1
346       CASE ( IO_GRIB1   )
347         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
348 #  if ( RWORDSIZE == DWORDSIZE )
349            CALL ext_gr1_get_dom_ti_double ( Hndl, Element,   Data, &
350                                  locCount, Outcount, Status )
351 #  else
352            CALL ext_gr1_get_dom_ti_real ( Hndl, Element,   Data, &
353                                  locCount, Outcount, Status )
354 #  endif
355         ENDIF
356         IF ( .NOT. multi_files(io_form) ) THEN
357           
358           
359           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
360           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
361           
362           
363           
364           
365           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
366         ENDIF
367 #endif
368 #ifdef GRIB2
369       CASE ( IO_GRIB2   )
370         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
371 #  if ( RWORDSIZE == DWORDSIZE )
372            CALL ext_gr2_get_dom_ti_double ( Hndl, Element,   Data, &
373                                  locCount, Outcount, Status )
374 #  else
375            CALL ext_gr2_get_dom_ti_real ( Hndl, Element,   Data, &
376                                  locCount, Outcount, Status )
377 #  endif
378         ENDIF
379         IF ( .NOT. multi_files(io_form) ) THEN
380           
381           
382           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
383           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
384           
385           
386           
387           
388           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
389         ENDIF
390 #endif
391 #ifdef INTIO
392       CASE ( IO_INTIO   )
393         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
394 #  if ( RWORDSIZE == DWORDSIZE )
395            CALL ext_int_get_dom_ti_double ( Hndl, Element,   Data, &
396                                  locCount, Outcount, Status )
397 #  else
398            CALL ext_int_get_dom_ti_real ( Hndl, Element,   Data, &
399                                  locCount, Outcount, Status )
400 #  endif
401         ENDIF
402         IF ( .NOT. multi_files(io_form) ) THEN
403            
404            
405            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
406            CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
407            
408            
409            
410            
411            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
412         ENDIF
413 #endif
414       CASE DEFAULT
415     END SELECT
416   ELSE IF ( for_out .AND. use_output_servers() ) THEN
417     CALL wrf_quilt_get_dom_ti_real ( Hndl, Element,   Data, &
418                           locCount, Outcount, Status )
419   ELSE
420     Status = 0
421 ENDIF
422 ELSE
423   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
424 ENDIF
425 RETURN
426 END SUBROUTINE wrf_get_dom_ti_real_arr 
427 !--- get_dom_ti_real
428 
429 SUBROUTINE wrf_get_dom_ti_real_sca ( DataHandle,Element,   Data, Count, Outcount, Status )
430 !<DESCRIPTION>
431 !<PRE>
432 !
433 ! Attempt to read time independent
434 ! domain metadata named "Element"  
435 ! from the open dataset described by DataHandle.  
436 ! Metadata of type real are
437 ! stored in scalar Data.
438 ! 
439 !
440 !</PRE>
441 !</DESCRIPTION>
442 USE module_state_description
443 IMPLICIT NONE
444 INTEGER ,       INTENT(IN)  :: DataHandle
445 CHARACTER*(*) , INTENT(IN)  :: Element
446 
447  
448 
449  real  :: Data 
450 
451 INTEGER ,       INTENT(IN)  :: Count
452 INTEGER ,       INTENT(OUT)  :: OutCount
453 INTEGER ,       INTENT(OUT) :: Status
454 
455 #include <wrf_status_codes.h>
456 INTEGER                     :: len_of_str
457 LOGICAL                     :: for_out
458 INTEGER, EXTERNAL           :: use_package
459 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
460 INTEGER                     :: locCount
461 
462 INTEGER io_form , Hndl
463 
464 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_real_sca " )
465 
466 
467 locCount = Count
468 
469 
470 Status = 0
471 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
472 IF ( Hndl .GT. -1 ) THEN
473   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
474     SELECT CASE ( use_package( io_form ) )
475 #ifdef NETCDF
476       CASE ( IO_NETCDF   )
477         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
478 #  if ( RWORDSIZE == DWORDSIZE )
479            CALL ext_ncd_get_dom_ti_double ( Hndl, Element,   Data, &
480                                  locCount, Outcount, Status )
481 #  else
482            CALL ext_ncd_get_dom_ti_real ( Hndl, Element,   Data, &
483                                  locCount, Outcount, Status )
484 #  endif
485         ENDIF
486         IF ( .NOT. multi_files(io_form) ) THEN
487           
488           
489           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
490           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
491           
492           
493           
494           
495           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
496         ENDIF
497 #endif
498 #ifdef PNETCDF
499       CASE ( IO_PNETCDF   )
500 #  if ( RWORDSIZE == DWORDSIZE )
501         CALL ext_pnc_get_dom_ti_double ( Hndl, Element,   Data, &
502                               locCount, Outcount, Status )
503 #  else
504         CALL ext_pnc_get_dom_ti_real ( Hndl, Element,   Data, &
505                               locCount, Outcount, Status )
506 #  endif
507 #endif
508 #ifdef PHDF5
509       CASE ( IO_PHDF5   )
510 #  if ( RWORDSIZE == DWORDSIZE )
511         CALL ext_phdf5_get_dom_ti_double ( Hndl, Element,   Data, &
512                               locCount, Outcount, Status )
513 #  else
514         CALL ext_phdf5_get_dom_ti_real ( Hndl, Element,   Data, &
515                               locCount, Outcount, Status )
516 #  endif
517 #endif
518 #ifdef ESMFIO
519       CASE ( IO_ESMF )
520 #  if ( RWORDSIZE == DWORDSIZE )
521         CALL ext_esmf_get_dom_ti_double ( Hndl, Element,   Data, &
522                               locCount, Outcount, Status )
523 #  else
524         CALL ext_esmf_get_dom_ti_real ( Hndl, Element,   Data, &
525                               locCount, Outcount, Status )
526 #  endif
527 #endif
528 #ifdef XXX
529       CASE ( IO_XXX   )
530 #  if ( RWORDSIZE == DWORDSIZE )
531         CALL ext_xxx_get_dom_ti_double ( Hndl, Element,   Data, &
532                               locCount, Outcount, Status )
533 #  else
534         CALL ext_xxx_get_dom_ti_real ( Hndl, Element,   Data, &
535                               locCount, Outcount, Status )
536 #  endif
537 #endif
538 #ifdef YYY
539       CASE ( IO_YYY   )
540 #  if ( RWORDSIZE == DWORDSIZE )
541         CALL ext_yyy_get_dom_ti_double ( Hndl, Element,   Data, &
542                               locCount, Outcount, Status )
543 #  else
544         CALL ext_yyy_get_dom_ti_real ( Hndl, Element,   Data, &
545                               locCount, Outcount, Status )
546 #  endif
547 #endif
548 #ifdef GRIB1
549       CASE ( IO_GRIB1   )
550         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
551 #  if ( RWORDSIZE == DWORDSIZE )
552            CALL ext_gr1_get_dom_ti_double ( Hndl, Element,   Data, &
553                                  locCount, Outcount, Status )
554 #  else
555            CALL ext_gr1_get_dom_ti_real ( Hndl, Element,   Data, &
556                                  locCount, Outcount, Status )
557 #  endif
558         ENDIF
559         IF ( .NOT. multi_files(io_form) ) THEN
560           
561           
562           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
563           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
564           
565           
566           
567           
568           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
569         ENDIF
570 #endif
571 #ifdef GRIB2
572       CASE ( IO_GRIB2   )
573         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
574 #  if ( RWORDSIZE == DWORDSIZE )
575            CALL ext_gr2_get_dom_ti_double ( Hndl, Element,   Data, &
576                                  locCount, Outcount, Status )
577 #  else
578            CALL ext_gr2_get_dom_ti_real ( Hndl, Element,   Data, &
579                                  locCount, Outcount, Status )
580 #  endif
581         ENDIF
582         IF ( .NOT. multi_files(io_form) ) THEN
583           
584           
585           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
586           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
587           
588           
589           
590           
591           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
592         ENDIF
593 #endif
594 #ifdef INTIO
595       CASE ( IO_INTIO   )
596         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
597 #  if ( RWORDSIZE == DWORDSIZE )
598            CALL ext_int_get_dom_ti_double ( Hndl, Element,   Data, &
599                                  locCount, Outcount, Status )
600 #  else
601            CALL ext_int_get_dom_ti_real ( Hndl, Element,   Data, &
602                                  locCount, Outcount, Status )
603 #  endif
604         ENDIF
605         IF ( .NOT. multi_files(io_form) ) THEN
606            
607            
608            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
609            CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
610            
611            
612            
613            
614            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
615         ENDIF
616 #endif
617       CASE DEFAULT
618     END SELECT
619   ELSE IF ( for_out .AND. use_output_servers() ) THEN
620     CALL wrf_quilt_get_dom_ti_real ( Hndl, Element,   Data, &
621                           locCount, Outcount, Status )
622   ELSE
623     Status = 0
624 ENDIF
625 ELSE
626   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
627 ENDIF
628 RETURN
629 END SUBROUTINE wrf_get_dom_ti_real_sca 
630 
631 
632 !--- put_dom_ti_real
633 
634 SUBROUTINE wrf_put_dom_ti_real_arr ( DataHandle,Element,   Data, Count,  Status )
635 !<DESCRIPTION>
636 !<PRE>
637 !
638 ! Write Count words of time independent
639 ! domain metadata named "Element"  
640 ! to the open dataset described by DataHandle.  
641 ! Metadata of type real are
642 ! copied from array Data.
643 ! 
644 !
645 !</PRE>
646 !</DESCRIPTION>
647 USE module_state_description
648 IMPLICIT NONE
649 INTEGER ,       INTENT(IN)  :: DataHandle
650 CHARACTER*(*) , INTENT(IN)  :: Element
651 
652  
653 
654  real  :: Data (*)
655 
656 INTEGER ,       INTENT(IN)  :: Count
657 
658 INTEGER ,       INTENT(OUT) :: Status
659 
660 #include <wrf_status_codes.h>
661 INTEGER                     :: len_of_str
662 LOGICAL                     :: for_out
663 INTEGER, EXTERNAL           :: use_package
664 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
665 INTEGER                     :: locCount
666 
667 INTEGER io_form , Hndl
668 
669 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_real_arr " )
670 
671 
672 locCount = Count
673 
674 
675 Status = 0
676 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
677 IF ( Hndl .GT. -1 ) THEN
678   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
679     SELECT CASE ( use_package( io_form ) )
680 #ifdef NETCDF
681       CASE ( IO_NETCDF   )
682         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
683 #  if ( RWORDSIZE == DWORDSIZE )
684            CALL ext_ncd_put_dom_ti_double ( Hndl, Element,   Data, &
685                                  locCount,  Status )
686 #  else
687            CALL ext_ncd_put_dom_ti_real ( Hndl, Element,   Data, &
688                                  locCount,  Status )
689 #  endif
690         ENDIF
691         IF ( .NOT. multi_files(io_form) ) THEN
692           
693           
694           
695           
696           
697           
698           
699           
700           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
701         ENDIF
702 #endif
703 #ifdef PNETCDF
704       CASE ( IO_PNETCDF   )
705 #  if ( RWORDSIZE == DWORDSIZE )
706         CALL ext_pnc_put_dom_ti_double ( Hndl, Element,   Data, &
707                               locCount,  Status )
708 #  else
709         CALL ext_pnc_put_dom_ti_real ( Hndl, Element,   Data, &
710                               locCount,  Status )
711 #  endif
712 #endif
713 #ifdef PHDF5
714       CASE ( IO_PHDF5   )
715 #  if ( RWORDSIZE == DWORDSIZE )
716         CALL ext_phdf5_put_dom_ti_double ( Hndl, Element,   Data, &
717                               locCount,  Status )
718 #  else
719         CALL ext_phdf5_put_dom_ti_real ( Hndl, Element,   Data, &
720                               locCount,  Status )
721 #  endif
722 #endif
723 #ifdef ESMFIO
724       CASE ( IO_ESMF )
725 #  if ( RWORDSIZE == DWORDSIZE )
726         CALL ext_esmf_put_dom_ti_double ( Hndl, Element,   Data, &
727                               locCount,  Status )
728 #  else
729         CALL ext_esmf_put_dom_ti_real ( Hndl, Element,   Data, &
730                               locCount,  Status )
731 #  endif
732 #endif
733 #ifdef XXX
734       CASE ( IO_XXX   )
735 #  if ( RWORDSIZE == DWORDSIZE )
736         CALL ext_xxx_put_dom_ti_double ( Hndl, Element,   Data, &
737                               locCount,  Status )
738 #  else
739         CALL ext_xxx_put_dom_ti_real ( Hndl, Element,   Data, &
740                               locCount,  Status )
741 #  endif
742 #endif
743 #ifdef YYY
744       CASE ( IO_YYY   )
745 #  if ( RWORDSIZE == DWORDSIZE )
746         CALL ext_yyy_put_dom_ti_double ( Hndl, Element,   Data, &
747                               locCount,  Status )
748 #  else
749         CALL ext_yyy_put_dom_ti_real ( Hndl, Element,   Data, &
750                               locCount,  Status )
751 #  endif
752 #endif
753 #ifdef GRIB1
754       CASE ( IO_GRIB1   )
755         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
756 #  if ( RWORDSIZE == DWORDSIZE )
757            CALL ext_gr1_put_dom_ti_double ( Hndl, Element,   Data, &
758                                  locCount,  Status )
759 #  else
760            CALL ext_gr1_put_dom_ti_real ( Hndl, Element,   Data, &
761                                  locCount,  Status )
762 #  endif
763         ENDIF
764         IF ( .NOT. multi_files(io_form) ) THEN
765           
766           
767           
768           
769           
770           
771           
772           
773           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
774         ENDIF
775 #endif
776 #ifdef GRIB2
777       CASE ( IO_GRIB2   )
778         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
779 #  if ( RWORDSIZE == DWORDSIZE )
780            CALL ext_gr2_put_dom_ti_double ( Hndl, Element,   Data, &
781                                  locCount,  Status )
782 #  else
783            CALL ext_gr2_put_dom_ti_real ( Hndl, Element,   Data, &
784                                  locCount,  Status )
785 #  endif
786         ENDIF
787         IF ( .NOT. multi_files(io_form) ) THEN
788           
789           
790           
791           
792           
793           
794           
795           
796           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
797         ENDIF
798 #endif
799 #ifdef INTIO
800       CASE ( IO_INTIO   )
801         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
802 #  if ( RWORDSIZE == DWORDSIZE )
803            CALL ext_int_put_dom_ti_double ( Hndl, Element,   Data, &
804                                  locCount,  Status )
805 #  else
806            CALL ext_int_put_dom_ti_real ( Hndl, Element,   Data, &
807                                  locCount,  Status )
808 #  endif
809         ENDIF
810         IF ( .NOT. multi_files(io_form) ) THEN
811            
812            
813            
814            
815            
816            
817            
818            
819            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
820         ENDIF
821 #endif
822       CASE DEFAULT
823     END SELECT
824   ELSE IF ( for_out .AND. use_output_servers() ) THEN
825     CALL wrf_quilt_put_dom_ti_real ( Hndl, Element,   Data, &
826                           locCount,  Status )
827   ELSE
828     Status = 0
829 ENDIF
830 ELSE
831   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
832 ENDIF
833 RETURN
834 END SUBROUTINE wrf_put_dom_ti_real_arr 
835 !--- put_dom_ti_real
836 
837 SUBROUTINE wrf_put_dom_ti_real_sca ( DataHandle,Element,   Data, Count,  Status )
838 !<DESCRIPTION>
839 !<PRE>
840 !
841 ! Write time independent
842 ! domain metadata named "Element"  
843 ! to the open dataset described by DataHandle.  
844 ! Metadata of type real are
845 ! copied from scalar Data.
846 ! 
847 !
848 !</PRE>
849 !</DESCRIPTION>
850 USE module_state_description
851 IMPLICIT NONE
852 INTEGER ,       INTENT(IN)  :: DataHandle
853 CHARACTER*(*) , INTENT(IN)  :: Element
854 
855  
856 
857  real  :: Data 
858 
859 INTEGER ,       INTENT(IN)  :: Count
860 
861 INTEGER ,       INTENT(OUT) :: Status
862 
863 #include <wrf_status_codes.h>
864 INTEGER                     :: len_of_str
865 LOGICAL                     :: for_out
866 INTEGER, EXTERNAL           :: use_package
867 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
868 INTEGER                     :: locCount
869 
870 INTEGER io_form , Hndl
871 
872 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_real_sca " )
873 
874 
875 locCount = Count
876 
877 
878 Status = 0
879 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
880 IF ( Hndl .GT. -1 ) THEN
881   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
882     SELECT CASE ( use_package( io_form ) )
883 #ifdef NETCDF
884       CASE ( IO_NETCDF   )
885         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
886 #  if ( RWORDSIZE == DWORDSIZE )
887            CALL ext_ncd_put_dom_ti_double ( Hndl, Element,   Data, &
888                                  locCount,  Status )
889 #  else
890            CALL ext_ncd_put_dom_ti_real ( Hndl, Element,   Data, &
891                                  locCount,  Status )
892 #  endif
893         ENDIF
894         IF ( .NOT. multi_files(io_form) ) THEN
895           
896           
897           
898           
899           
900           
901           
902           
903           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
904         ENDIF
905 #endif
906 #ifdef PNETCDF
907       CASE ( IO_PNETCDF   )
908 #  if ( RWORDSIZE == DWORDSIZE )
909         CALL ext_pnc_put_dom_ti_double ( Hndl, Element,   Data, &
910                               locCount,  Status )
911 #  else
912         CALL ext_pnc_put_dom_ti_real ( Hndl, Element,   Data, &
913                               locCount,  Status )
914 #  endif
915 #endif
916 #ifdef PHDF5
917       CASE ( IO_PHDF5   )
918 #  if ( RWORDSIZE == DWORDSIZE )
919         CALL ext_phdf5_put_dom_ti_double ( Hndl, Element,   Data, &
920                               locCount,  Status )
921 #  else
922         CALL ext_phdf5_put_dom_ti_real ( Hndl, Element,   Data, &
923                               locCount,  Status )
924 #  endif
925 #endif
926 #ifdef ESMFIO
927       CASE ( IO_ESMF )
928 #  if ( RWORDSIZE == DWORDSIZE )
929         CALL ext_esmf_put_dom_ti_double ( Hndl, Element,   Data, &
930                               locCount,  Status )
931 #  else
932         CALL ext_esmf_put_dom_ti_real ( Hndl, Element,   Data, &
933                               locCount,  Status )
934 #  endif
935 #endif
936 #ifdef XXX
937       CASE ( IO_XXX   )
938 #  if ( RWORDSIZE == DWORDSIZE )
939         CALL ext_xxx_put_dom_ti_double ( Hndl, Element,   Data, &
940                               locCount,  Status )
941 #  else
942         CALL ext_xxx_put_dom_ti_real ( Hndl, Element,   Data, &
943                               locCount,  Status )
944 #  endif
945 #endif
946 #ifdef YYY
947       CASE ( IO_YYY   )
948 #  if ( RWORDSIZE == DWORDSIZE )
949         CALL ext_yyy_put_dom_ti_double ( Hndl, Element,   Data, &
950                               locCount,  Status )
951 #  else
952         CALL ext_yyy_put_dom_ti_real ( Hndl, Element,   Data, &
953                               locCount,  Status )
954 #  endif
955 #endif
956 #ifdef GRIB1
957       CASE ( IO_GRIB1   )
958         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
959 #  if ( RWORDSIZE == DWORDSIZE )
960            CALL ext_gr1_put_dom_ti_double ( Hndl, Element,   Data, &
961                                  locCount,  Status )
962 #  else
963            CALL ext_gr1_put_dom_ti_real ( Hndl, Element,   Data, &
964                                  locCount,  Status )
965 #  endif
966         ENDIF
967         IF ( .NOT. multi_files(io_form) ) THEN
968           
969           
970           
971           
972           
973           
974           
975           
976           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
977         ENDIF
978 #endif
979 #ifdef GRIB2
980       CASE ( IO_GRIB2   )
981         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
982 #  if ( RWORDSIZE == DWORDSIZE )
983            CALL ext_gr2_put_dom_ti_double ( Hndl, Element,   Data, &
984                                  locCount,  Status )
985 #  else
986            CALL ext_gr2_put_dom_ti_real ( Hndl, Element,   Data, &
987                                  locCount,  Status )
988 #  endif
989         ENDIF
990         IF ( .NOT. multi_files(io_form) ) THEN
991           
992           
993           
994           
995           
996           
997           
998           
999           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1000         ENDIF
1001 #endif
1002 #ifdef INTIO
1003       CASE ( IO_INTIO   )
1004         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1005 #  if ( RWORDSIZE == DWORDSIZE )
1006            CALL ext_int_put_dom_ti_double ( Hndl, Element,   Data, &
1007                                  locCount,  Status )
1008 #  else
1009            CALL ext_int_put_dom_ti_real ( Hndl, Element,   Data, &
1010                                  locCount,  Status )
1011 #  endif
1012         ENDIF
1013         IF ( .NOT. multi_files(io_form) ) THEN
1014            
1015            
1016            
1017            
1018            
1019            
1020            
1021            
1022            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1023         ENDIF
1024 #endif
1025       CASE DEFAULT
1026     END SELECT
1027   ELSE IF ( for_out .AND. use_output_servers() ) THEN
1028     CALL wrf_quilt_put_dom_ti_real ( Hndl, Element,   Data, &
1029                           locCount,  Status )
1030   ELSE
1031     Status = 0
1032 ENDIF
1033 ELSE
1034   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
1035 ENDIF
1036 RETURN
1037 END SUBROUTINE wrf_put_dom_ti_real_sca 
1038 
1039 
1040 !--- get_dom_ti_double
1041 
1042 SUBROUTINE wrf_get_dom_ti_double_arr ( DataHandle,Element,   Data, Count, Outcount, Status )
1043 !<DESCRIPTION>
1044 !<PRE>
1045 !
1046 ! Attempt to read Count words of time independent
1047 ! domain metadata named "Element"  
1048 ! from the open dataset described by DataHandle.  
1049 ! Metadata of type double are
1050 ! stored in array Data.
1051 ! Actual number of words read is returned in OutCount.
1052 !
1053 !</PRE>
1054 !</DESCRIPTION>
1055 USE module_state_description
1056 IMPLICIT NONE
1057 INTEGER ,       INTENT(IN)  :: DataHandle
1058 CHARACTER*(*) , INTENT(IN)  :: Element
1059 
1060  
1061 
1062  real*8  :: Data (*)
1063 
1064 INTEGER ,       INTENT(IN)  :: Count
1065 INTEGER ,       INTENT(OUT)  :: OutCount
1066 INTEGER ,       INTENT(OUT) :: Status
1067 
1068 #include <wrf_status_codes.h>
1069 INTEGER                     :: len_of_str
1070 LOGICAL                     :: for_out
1071 INTEGER, EXTERNAL           :: use_package
1072 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
1073 INTEGER                     :: locCount
1074 
1075 INTEGER io_form , Hndl
1076 
1077 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_double_arr " )
1078 
1079 
1080 
1081 
1082 
1083 Status = 0
1084 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
1085 IF ( Hndl .GT. -1 ) THEN
1086   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
1087     SELECT CASE ( use_package( io_form ) )
1088 #ifdef NETCDF
1089       CASE ( IO_NETCDF   )
1090         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1091            CALL ext_ncd_get_dom_ti_double ( Hndl, Element,   Data, &
1092                                  locCount, Outcount, Status ) 
1093         ENDIF
1094         IF ( .NOT. multi_files(io_form) ) THEN
1095           
1096           
1097           
1098           
1099           
1100           
1101           
1102           
1103           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1104         ENDIF
1105 #endif
1106 #ifdef PNETCDF
1107       CASE ( IO_PNETCDF   )
1108         CALL ext_pnc_get_dom_ti_double ( Hndl, Element,   Data, &
1109                               locCount, Outcount, Status ) 
1110 #endif
1111 #ifdef PHDF5
1112       CASE ( IO_PHDF5   )
1113         CALL ext_phdf5_get_dom_ti_double ( Hndl, Element,   Data, &
1114                               locCount, Outcount, Status ) 
1115 #endif
1116 #ifdef ESMFIO
1117       CASE ( IO_ESMF )
1118         CALL ext_esmf_get_dom_ti_double ( Hndl, Element,   Data, &
1119                               locCount, Outcount, Status ) 
1120 #endif
1121 #ifdef XXX
1122       CASE ( IO_XXX   )
1123         CALL ext_xxx_get_dom_ti_double ( Hndl, Element,   Data, &
1124                               locCount, Outcount, Status ) 
1125 #endif
1126 #ifdef YYY
1127       CASE ( IO_YYY   )
1128         CALL ext_yyy_get_dom_ti_double ( Hndl, Element,   Data, &
1129                               locCount, Outcount, Status ) 
1130 #endif
1131 #ifdef GRIB1
1132       CASE ( IO_GRIB1   )
1133         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1134            CALL ext_gr1_get_dom_ti_double ( Hndl, Element,   Data, &
1135                                  locCount, Outcount, Status ) 
1136         ENDIF
1137         IF ( .NOT. multi_files(io_form) ) THEN
1138           
1139           
1140           
1141           
1142           
1143           
1144           
1145           
1146           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1147         ENDIF
1148 #endif
1149 #ifdef GRIB2
1150       CASE ( IO_GRIB2   )
1151         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1152            CALL ext_gr2_get_dom_ti_double ( Hndl, Element,   Data, &
1153                                  locCount, Outcount, Status ) 
1154         ENDIF
1155         IF ( .NOT. multi_files(io_form) ) THEN
1156           
1157           
1158           
1159           
1160           
1161           
1162           
1163           
1164           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1165         ENDIF
1166 #endif
1167 #ifdef INTIO
1168       CASE ( IO_INTIO   )
1169         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1170            CALL ext_int_get_dom_ti_double ( Hndl, Element,   Data, &
1171                                  locCount, Outcount, Status ) 
1172         ENDIF
1173         IF ( .NOT. multi_files(io_form) ) THEN
1174            
1175            
1176            
1177            
1178            
1179            
1180            
1181            
1182            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1183         ENDIF
1184 #endif
1185       CASE DEFAULT
1186     END SELECT
1187   ELSE IF ( for_out .AND. use_output_servers() ) THEN
1188     CALL wrf_quilt_get_dom_ti_double ( Hndl, Element,   Data, &
1189                           locCount, Outcount, Status )
1190   ELSE
1191     Status = 0
1192 ENDIF
1193 ELSE
1194   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
1195 ENDIF
1196 RETURN
1197 END SUBROUTINE wrf_get_dom_ti_double_arr 
1198 !--- get_dom_ti_double
1199 
1200 SUBROUTINE wrf_get_dom_ti_double_sca ( DataHandle,Element,   Data, Count, Outcount, Status )
1201 !<DESCRIPTION>
1202 !<PRE>
1203 !
1204 ! Attempt to read time independent
1205 ! domain metadata named "Element"  
1206 ! from the open dataset described by DataHandle.  
1207 ! Metadata of type double are
1208 ! stored in scalar Data.
1209 ! 
1210 !
1211 !</PRE>
1212 !</DESCRIPTION>
1213 USE module_state_description
1214 IMPLICIT NONE
1215 INTEGER ,       INTENT(IN)  :: DataHandle
1216 CHARACTER*(*) , INTENT(IN)  :: Element
1217 
1218  
1219 
1220  real*8  :: Data 
1221 
1222 INTEGER ,       INTENT(IN)  :: Count
1223 INTEGER ,       INTENT(OUT)  :: OutCount
1224 INTEGER ,       INTENT(OUT) :: Status
1225 
1226 #include <wrf_status_codes.h>
1227 INTEGER                     :: len_of_str
1228 LOGICAL                     :: for_out
1229 INTEGER, EXTERNAL           :: use_package
1230 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
1231 INTEGER                     :: locCount
1232 
1233 INTEGER io_form , Hndl
1234 
1235 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_double_sca " )
1236 
1237 
1238 
1239 
1240 
1241 Status = 0
1242 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
1243 IF ( Hndl .GT. -1 ) THEN
1244   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
1245     SELECT CASE ( use_package( io_form ) )
1246 #ifdef NETCDF
1247       CASE ( IO_NETCDF   )
1248         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1249            CALL ext_ncd_get_dom_ti_double ( Hndl, Element,   Data, &
1250                                  locCount, Outcount, Status ) 
1251         ENDIF
1252         IF ( .NOT. multi_files(io_form) ) THEN
1253           
1254           
1255           
1256           
1257           
1258           
1259           
1260           
1261           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1262         ENDIF
1263 #endif
1264 #ifdef PNETCDF
1265       CASE ( IO_PNETCDF   )
1266         CALL ext_pnc_get_dom_ti_double ( Hndl, Element,   Data, &
1267                               locCount, Outcount, Status ) 
1268 #endif
1269 #ifdef PHDF5
1270       CASE ( IO_PHDF5   )
1271         CALL ext_phdf5_get_dom_ti_double ( Hndl, Element,   Data, &
1272                               locCount, Outcount, Status ) 
1273 #endif
1274 #ifdef ESMFIO
1275       CASE ( IO_ESMF )
1276         CALL ext_esmf_get_dom_ti_double ( Hndl, Element,   Data, &
1277                               locCount, Outcount, Status ) 
1278 #endif
1279 #ifdef XXX
1280       CASE ( IO_XXX   )
1281         CALL ext_xxx_get_dom_ti_double ( Hndl, Element,   Data, &
1282                               locCount, Outcount, Status ) 
1283 #endif
1284 #ifdef YYY
1285       CASE ( IO_YYY   )
1286         CALL ext_yyy_get_dom_ti_double ( Hndl, Element,   Data, &
1287                               locCount, Outcount, Status ) 
1288 #endif
1289 #ifdef GRIB1
1290       CASE ( IO_GRIB1   )
1291         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1292            CALL ext_gr1_get_dom_ti_double ( Hndl, Element,   Data, &
1293                                  locCount, Outcount, Status ) 
1294         ENDIF
1295         IF ( .NOT. multi_files(io_form) ) THEN
1296           
1297           
1298           
1299           
1300           
1301           
1302           
1303           
1304           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1305         ENDIF
1306 #endif
1307 #ifdef GRIB2
1308       CASE ( IO_GRIB2   )
1309         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1310            CALL ext_gr2_get_dom_ti_double ( Hndl, Element,   Data, &
1311                                  locCount, Outcount, Status ) 
1312         ENDIF
1313         IF ( .NOT. multi_files(io_form) ) THEN
1314           
1315           
1316           
1317           
1318           
1319           
1320           
1321           
1322           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1323         ENDIF
1324 #endif
1325 #ifdef INTIO
1326       CASE ( IO_INTIO   )
1327         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1328            CALL ext_int_get_dom_ti_double ( Hndl, Element,   Data, &
1329                                  locCount, Outcount, Status ) 
1330         ENDIF
1331         IF ( .NOT. multi_files(io_form) ) THEN
1332            
1333            
1334            
1335            
1336            
1337            
1338            
1339            
1340            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1341         ENDIF
1342 #endif
1343       CASE DEFAULT
1344     END SELECT
1345   ELSE IF ( for_out .AND. use_output_servers() ) THEN
1346     CALL wrf_quilt_get_dom_ti_double ( Hndl, Element,   Data, &
1347                           locCount, Outcount, Status )
1348   ELSE
1349     Status = 0
1350 ENDIF
1351 ELSE
1352   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
1353 ENDIF
1354 RETURN
1355 END SUBROUTINE wrf_get_dom_ti_double_sca 
1356 
1357 
1358 !--- put_dom_ti_double
1359 
1360 SUBROUTINE wrf_put_dom_ti_double_arr ( DataHandle,Element,   Data, Count,  Status )
1361 !<DESCRIPTION>
1362 !<PRE>
1363 !
1364 ! Write Count words of time independent
1365 ! domain metadata named "Element"  
1366 ! to the open dataset described by DataHandle.  
1367 ! Metadata of type double are
1368 ! copied from array Data.
1369 ! 
1370 !
1371 !</PRE>
1372 !</DESCRIPTION>
1373 USE module_state_description
1374 IMPLICIT NONE
1375 INTEGER ,       INTENT(IN)  :: DataHandle
1376 CHARACTER*(*) , INTENT(IN)  :: Element
1377 
1378  
1379 
1380  real*8  :: Data (*)
1381 
1382 INTEGER ,       INTENT(IN)  :: Count
1383 
1384 INTEGER ,       INTENT(OUT) :: Status
1385 
1386 #include <wrf_status_codes.h>
1387 INTEGER                     :: len_of_str
1388 LOGICAL                     :: for_out
1389 INTEGER, EXTERNAL           :: use_package
1390 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
1391 INTEGER                     :: locCount
1392 
1393 INTEGER io_form , Hndl
1394 
1395 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_double_arr " )
1396 
1397 
1398 
1399 
1400 
1401 Status = 0
1402 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
1403 IF ( Hndl .GT. -1 ) THEN
1404   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
1405     SELECT CASE ( use_package( io_form ) )
1406 #ifdef NETCDF
1407       CASE ( IO_NETCDF   )
1408         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1409            CALL ext_ncd_put_dom_ti_double ( Hndl, Element,   Data, &
1410                                  locCount,  Status ) 
1411         ENDIF
1412         IF ( .NOT. multi_files(io_form) ) THEN
1413           
1414           
1415           
1416           
1417           
1418           
1419           
1420           
1421           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1422         ENDIF
1423 #endif
1424 #ifdef PNETCDF
1425       CASE ( IO_PNETCDF   )
1426         CALL ext_pnc_put_dom_ti_double ( Hndl, Element,   Data, &
1427                               locCount,  Status ) 
1428 #endif
1429 #ifdef PHDF5
1430       CASE ( IO_PHDF5   )
1431         CALL ext_phdf5_put_dom_ti_double ( Hndl, Element,   Data, &
1432                               locCount,  Status ) 
1433 #endif
1434 #ifdef ESMFIO
1435       CASE ( IO_ESMF )
1436         CALL ext_esmf_put_dom_ti_double ( Hndl, Element,   Data, &
1437                               locCount,  Status ) 
1438 #endif
1439 #ifdef XXX
1440       CASE ( IO_XXX   )
1441         CALL ext_xxx_put_dom_ti_double ( Hndl, Element,   Data, &
1442                               locCount,  Status ) 
1443 #endif
1444 #ifdef YYY
1445       CASE ( IO_YYY   )
1446         CALL ext_yyy_put_dom_ti_double ( Hndl, Element,   Data, &
1447                               locCount,  Status ) 
1448 #endif
1449 #ifdef GRIB1
1450       CASE ( IO_GRIB1   )
1451         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1452            CALL ext_gr1_put_dom_ti_double ( Hndl, Element,   Data, &
1453                                  locCount,  Status ) 
1454         ENDIF
1455         IF ( .NOT. multi_files(io_form) ) THEN
1456           
1457           
1458           
1459           
1460           
1461           
1462           
1463           
1464           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1465         ENDIF
1466 #endif
1467 #ifdef GRIB2
1468       CASE ( IO_GRIB2   )
1469         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1470            CALL ext_gr2_put_dom_ti_double ( Hndl, Element,   Data, &
1471                                  locCount,  Status ) 
1472         ENDIF
1473         IF ( .NOT. multi_files(io_form) ) THEN
1474           
1475           
1476           
1477           
1478           
1479           
1480           
1481           
1482           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1483         ENDIF
1484 #endif
1485 #ifdef INTIO
1486       CASE ( IO_INTIO   )
1487         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1488            CALL ext_int_put_dom_ti_double ( Hndl, Element,   Data, &
1489                                  locCount,  Status ) 
1490         ENDIF
1491         IF ( .NOT. multi_files(io_form) ) THEN
1492            
1493            
1494            
1495            
1496            
1497            
1498            
1499            
1500            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1501         ENDIF
1502 #endif
1503       CASE DEFAULT
1504     END SELECT
1505   ELSE IF ( for_out .AND. use_output_servers() ) THEN
1506     CALL wrf_quilt_put_dom_ti_double ( Hndl, Element,   Data, &
1507                           locCount,  Status )
1508   ELSE
1509     Status = 0
1510 ENDIF
1511 ELSE
1512   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
1513 ENDIF
1514 RETURN
1515 END SUBROUTINE wrf_put_dom_ti_double_arr 
1516 !--- put_dom_ti_double
1517 
1518 SUBROUTINE wrf_put_dom_ti_double_sca ( DataHandle,Element,   Data, Count,  Status )
1519 !<DESCRIPTION>
1520 !<PRE>
1521 !
1522 ! Write time independent
1523 ! domain metadata named "Element"  
1524 ! to the open dataset described by DataHandle.  
1525 ! Metadata of type double are
1526 ! copied from scalar Data.
1527 ! 
1528 !
1529 !</PRE>
1530 !</DESCRIPTION>
1531 USE module_state_description
1532 IMPLICIT NONE
1533 INTEGER ,       INTENT(IN)  :: DataHandle
1534 CHARACTER*(*) , INTENT(IN)  :: Element
1535 
1536  
1537 
1538  real*8  :: Data 
1539 
1540 INTEGER ,       INTENT(IN)  :: Count
1541 
1542 INTEGER ,       INTENT(OUT) :: Status
1543 
1544 #include <wrf_status_codes.h>
1545 INTEGER                     :: len_of_str
1546 LOGICAL                     :: for_out
1547 INTEGER, EXTERNAL           :: use_package
1548 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
1549 INTEGER                     :: locCount
1550 
1551 INTEGER io_form , Hndl
1552 
1553 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_double_sca " )
1554 
1555 
1556 
1557 
1558 
1559 Status = 0
1560 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
1561 IF ( Hndl .GT. -1 ) THEN
1562   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
1563     SELECT CASE ( use_package( io_form ) )
1564 #ifdef NETCDF
1565       CASE ( IO_NETCDF   )
1566         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1567            CALL ext_ncd_put_dom_ti_double ( Hndl, Element,   Data, &
1568                                  locCount,  Status ) 
1569         ENDIF
1570         IF ( .NOT. multi_files(io_form) ) THEN
1571           
1572           
1573           
1574           
1575           
1576           
1577           
1578           
1579           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1580         ENDIF
1581 #endif
1582 #ifdef PNETCDF
1583       CASE ( IO_PNETCDF   )
1584         CALL ext_pnc_put_dom_ti_double ( Hndl, Element,   Data, &
1585                               locCount,  Status ) 
1586 #endif
1587 #ifdef PHDF5
1588       CASE ( IO_PHDF5   )
1589         CALL ext_phdf5_put_dom_ti_double ( Hndl, Element,   Data, &
1590                               locCount,  Status ) 
1591 #endif
1592 #ifdef ESMFIO
1593       CASE ( IO_ESMF )
1594         CALL ext_esmf_put_dom_ti_double ( Hndl, Element,   Data, &
1595                               locCount,  Status ) 
1596 #endif
1597 #ifdef XXX
1598       CASE ( IO_XXX   )
1599         CALL ext_xxx_put_dom_ti_double ( Hndl, Element,   Data, &
1600                               locCount,  Status ) 
1601 #endif
1602 #ifdef YYY
1603       CASE ( IO_YYY   )
1604         CALL ext_yyy_put_dom_ti_double ( Hndl, Element,   Data, &
1605                               locCount,  Status ) 
1606 #endif
1607 #ifdef GRIB1
1608       CASE ( IO_GRIB1   )
1609         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1610            CALL ext_gr1_put_dom_ti_double ( Hndl, Element,   Data, &
1611                                  locCount,  Status ) 
1612         ENDIF
1613         IF ( .NOT. multi_files(io_form) ) THEN
1614           
1615           
1616           
1617           
1618           
1619           
1620           
1621           
1622           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1623         ENDIF
1624 #endif
1625 #ifdef GRIB2
1626       CASE ( IO_GRIB2   )
1627         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1628            CALL ext_gr2_put_dom_ti_double ( Hndl, Element,   Data, &
1629                                  locCount,  Status ) 
1630         ENDIF
1631         IF ( .NOT. multi_files(io_form) ) THEN
1632           
1633           
1634           
1635           
1636           
1637           
1638           
1639           
1640           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1641         ENDIF
1642 #endif
1643 #ifdef INTIO
1644       CASE ( IO_INTIO   )
1645         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1646            CALL ext_int_put_dom_ti_double ( Hndl, Element,   Data, &
1647                                  locCount,  Status ) 
1648         ENDIF
1649         IF ( .NOT. multi_files(io_form) ) THEN
1650            
1651            
1652            
1653            
1654            
1655            
1656            
1657            
1658            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1659         ENDIF
1660 #endif
1661       CASE DEFAULT
1662     END SELECT
1663   ELSE IF ( for_out .AND. use_output_servers() ) THEN
1664     CALL wrf_quilt_put_dom_ti_double ( Hndl, Element,   Data, &
1665                           locCount,  Status )
1666   ELSE
1667     Status = 0
1668 ENDIF
1669 ELSE
1670   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
1671 ENDIF
1672 RETURN
1673 END SUBROUTINE wrf_put_dom_ti_double_sca 
1674 
1675 
1676 !--- get_dom_ti_integer
1677 
1678 SUBROUTINE wrf_get_dom_ti_integer_arr ( DataHandle,Element,   Data, Count, Outcount, Status )
1679 !<DESCRIPTION>
1680 !<PRE>
1681 !
1682 ! Attempt to read Count words of time independent
1683 ! domain metadata named "Element"  
1684 ! from the open dataset described by DataHandle.  
1685 ! Metadata of type integer are
1686 ! stored in array Data.
1687 ! Actual number of words read is returned in OutCount.
1688 !
1689 !</PRE>
1690 !</DESCRIPTION>
1691 USE module_state_description
1692 IMPLICIT NONE
1693 INTEGER ,       INTENT(IN)  :: DataHandle
1694 CHARACTER*(*) , INTENT(IN)  :: Element
1695 
1696  
1697 
1698  integer  :: Data (*)
1699 
1700 INTEGER ,       INTENT(IN)  :: Count
1701 INTEGER ,       INTENT(OUT)  :: OutCount
1702 INTEGER ,       INTENT(OUT) :: Status
1703 
1704 #include <wrf_status_codes.h>
1705 INTEGER                     :: len_of_str
1706 LOGICAL                     :: for_out
1707 INTEGER, EXTERNAL           :: use_package
1708 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
1709 INTEGER                     :: locCount
1710 
1711 INTEGER io_form , Hndl
1712 
1713 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_integer_arr " )
1714 
1715 locCount = Count
1716 
1717 
1718 
1719 Status = 0
1720 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
1721 IF ( Hndl .GT. -1 ) THEN
1722   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
1723     SELECT CASE ( use_package( io_form ) )
1724 #ifdef NETCDF
1725       CASE ( IO_NETCDF   )
1726         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1727            CALL ext_ncd_get_dom_ti_integer ( Hndl, Element,   Data, &
1728                                  locCount, Outcount, Status ) 
1729         ENDIF
1730         IF ( .NOT. multi_files(io_form) ) THEN
1731           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
1732           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
1733           
1734           
1735           
1736           
1737           
1738           
1739           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1740         ENDIF
1741 #endif
1742 #ifdef PNETCDF
1743       CASE ( IO_PNETCDF   )
1744         CALL ext_pnc_get_dom_ti_integer ( Hndl, Element,   Data, &
1745                               locCount, Outcount, Status ) 
1746 #endif
1747 #ifdef PHDF5
1748       CASE ( IO_PHDF5   )
1749         CALL ext_phdf5_get_dom_ti_integer ( Hndl, Element,   Data, &
1750                               locCount, Outcount, Status ) 
1751 #endif
1752 #ifdef ESMFIO
1753       CASE ( IO_ESMF )
1754         CALL ext_esmf_get_dom_ti_integer ( Hndl, Element,   Data, &
1755                               locCount, Outcount, Status ) 
1756 #endif
1757 #ifdef XXX
1758       CASE ( IO_XXX   )
1759         CALL ext_xxx_get_dom_ti_integer ( Hndl, Element,   Data, &
1760                               locCount, Outcount, Status ) 
1761 #endif
1762 #ifdef YYY
1763       CASE ( IO_YYY   )
1764         CALL ext_yyy_get_dom_ti_integer ( Hndl, Element,   Data, &
1765                               locCount, Outcount, Status ) 
1766 #endif
1767 #ifdef GRIB1
1768       CASE ( IO_GRIB1   )
1769         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1770            CALL ext_gr1_get_dom_ti_integer ( Hndl, Element,   Data, &
1771                                  locCount, Outcount, Status ) 
1772         ENDIF
1773         IF ( .NOT. multi_files(io_form) ) THEN
1774           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
1775           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
1776           
1777           
1778           
1779           
1780           
1781           
1782           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1783         ENDIF
1784 #endif
1785 #ifdef GRIB2
1786       CASE ( IO_GRIB2   )
1787         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1788            CALL ext_gr2_get_dom_ti_integer ( Hndl, Element,   Data, &
1789                                  locCount, Outcount, Status ) 
1790         ENDIF
1791         IF ( .NOT. multi_files(io_form) ) THEN
1792           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
1793           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
1794           
1795           
1796           
1797           
1798           
1799           
1800           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1801         ENDIF
1802 #endif
1803 #ifdef INTIO
1804       CASE ( IO_INTIO   )
1805         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1806            CALL ext_int_get_dom_ti_integer ( Hndl, Element,   Data, &
1807                                  locCount, Outcount, Status ) 
1808         ENDIF
1809         IF ( .NOT. multi_files(io_form) ) THEN
1810            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
1811            CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
1812            
1813            
1814            
1815            
1816            
1817            
1818            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1819         ENDIF
1820 #endif
1821       CASE DEFAULT
1822     END SELECT
1823   ELSE IF ( for_out .AND. use_output_servers() ) THEN
1824     CALL wrf_quilt_get_dom_ti_integer ( Hndl, Element,   Data, &
1825                           locCount, Outcount, Status )
1826   ELSE
1827     Status = 0
1828 ENDIF
1829 ELSE
1830   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
1831 ENDIF
1832 RETURN
1833 END SUBROUTINE wrf_get_dom_ti_integer_arr 
1834 !--- get_dom_ti_integer
1835 
1836 SUBROUTINE wrf_get_dom_ti_integer_sca ( DataHandle,Element,   Data, Count, Outcount, Status )
1837 !<DESCRIPTION>
1838 !<PRE>
1839 !
1840 ! Attempt to read time independent
1841 ! domain metadata named "Element"  
1842 ! from the open dataset described by DataHandle.  
1843 ! Metadata of type integer are
1844 ! stored in scalar Data.
1845 ! 
1846 !
1847 !</PRE>
1848 !</DESCRIPTION>
1849 USE module_state_description
1850 IMPLICIT NONE
1851 INTEGER ,       INTENT(IN)  :: DataHandle
1852 CHARACTER*(*) , INTENT(IN)  :: Element
1853 
1854  
1855 
1856  integer  :: Data 
1857 
1858 INTEGER ,       INTENT(IN)  :: Count
1859 INTEGER ,       INTENT(OUT)  :: OutCount
1860 INTEGER ,       INTENT(OUT) :: Status
1861 
1862 #include <wrf_status_codes.h>
1863 INTEGER                     :: len_of_str
1864 LOGICAL                     :: for_out
1865 INTEGER, EXTERNAL           :: use_package
1866 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
1867 INTEGER                     :: locCount
1868 
1869 INTEGER io_form , Hndl
1870 
1871 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_integer_sca " )
1872 
1873 locCount = Count
1874 
1875 
1876 
1877 Status = 0
1878 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
1879 IF ( Hndl .GT. -1 ) THEN
1880   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
1881     SELECT CASE ( use_package( io_form ) )
1882 #ifdef NETCDF
1883       CASE ( IO_NETCDF   )
1884         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1885            CALL ext_ncd_get_dom_ti_integer ( Hndl, Element,   Data, &
1886                                  locCount, Outcount, Status ) 
1887         ENDIF
1888         IF ( .NOT. multi_files(io_form) ) THEN
1889           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
1890           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
1891           
1892           
1893           
1894           
1895           
1896           
1897           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1898         ENDIF
1899 #endif
1900 #ifdef PNETCDF
1901       CASE ( IO_PNETCDF   )
1902         CALL ext_pnc_get_dom_ti_integer ( Hndl, Element,   Data, &
1903                               locCount, Outcount, Status ) 
1904 #endif
1905 #ifdef PHDF5
1906       CASE ( IO_PHDF5   )
1907         CALL ext_phdf5_get_dom_ti_integer ( Hndl, Element,   Data, &
1908                               locCount, Outcount, Status ) 
1909 #endif
1910 #ifdef ESMFIO
1911       CASE ( IO_ESMF )
1912         CALL ext_esmf_get_dom_ti_integer ( Hndl, Element,   Data, &
1913                               locCount, Outcount, Status ) 
1914 #endif
1915 #ifdef XXX
1916       CASE ( IO_XXX   )
1917         CALL ext_xxx_get_dom_ti_integer ( Hndl, Element,   Data, &
1918                               locCount, Outcount, Status ) 
1919 #endif
1920 #ifdef YYY
1921       CASE ( IO_YYY   )
1922         CALL ext_yyy_get_dom_ti_integer ( Hndl, Element,   Data, &
1923                               locCount, Outcount, Status ) 
1924 #endif
1925 #ifdef GRIB1
1926       CASE ( IO_GRIB1   )
1927         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1928            CALL ext_gr1_get_dom_ti_integer ( Hndl, Element,   Data, &
1929                                  locCount, Outcount, Status ) 
1930         ENDIF
1931         IF ( .NOT. multi_files(io_form) ) THEN
1932           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
1933           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
1934           
1935           
1936           
1937           
1938           
1939           
1940           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1941         ENDIF
1942 #endif
1943 #ifdef GRIB2
1944       CASE ( IO_GRIB2   )
1945         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1946            CALL ext_gr2_get_dom_ti_integer ( Hndl, Element,   Data, &
1947                                  locCount, Outcount, Status ) 
1948         ENDIF
1949         IF ( .NOT. multi_files(io_form) ) THEN
1950           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
1951           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
1952           
1953           
1954           
1955           
1956           
1957           
1958           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1959         ENDIF
1960 #endif
1961 #ifdef INTIO
1962       CASE ( IO_INTIO   )
1963         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
1964            CALL ext_int_get_dom_ti_integer ( Hndl, Element,   Data, &
1965                                  locCount, Outcount, Status ) 
1966         ENDIF
1967         IF ( .NOT. multi_files(io_form) ) THEN
1968            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
1969            CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
1970            
1971            
1972            
1973            
1974            
1975            
1976            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
1977         ENDIF
1978 #endif
1979       CASE DEFAULT
1980     END SELECT
1981   ELSE IF ( for_out .AND. use_output_servers() ) THEN
1982     CALL wrf_quilt_get_dom_ti_integer ( Hndl, Element,   Data, &
1983                           locCount, Outcount, Status )
1984   ELSE
1985     Status = 0
1986 ENDIF
1987 ELSE
1988   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
1989 ENDIF
1990 RETURN
1991 END SUBROUTINE wrf_get_dom_ti_integer_sca 
1992 
1993 
1994 !--- put_dom_ti_integer
1995 
1996 SUBROUTINE wrf_put_dom_ti_integer_arr ( DataHandle,Element,   Data, Count,  Status )
1997 !<DESCRIPTION>
1998 !<PRE>
1999 !
2000 ! Write Count words of time independent
2001 ! domain metadata named "Element"  
2002 ! to the open dataset described by DataHandle.  
2003 ! Metadata of type integer are
2004 ! copied from array Data.
2005 ! 
2006 !
2007 !</PRE>
2008 !</DESCRIPTION>
2009 USE module_state_description
2010 IMPLICIT NONE
2011 INTEGER ,       INTENT(IN)  :: DataHandle
2012 CHARACTER*(*) , INTENT(IN)  :: Element
2013 
2014  
2015 
2016  integer  :: Data (*)
2017 
2018 INTEGER ,       INTENT(IN)  :: Count
2019 
2020 INTEGER ,       INTENT(OUT) :: Status
2021 
2022 #include <wrf_status_codes.h>
2023 INTEGER                     :: len_of_str
2024 LOGICAL                     :: for_out
2025 INTEGER, EXTERNAL           :: use_package
2026 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
2027 INTEGER                     :: locCount
2028 
2029 INTEGER io_form , Hndl
2030 
2031 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_integer_arr " )
2032 
2033 locCount = Count
2034 
2035 
2036 
2037 Status = 0
2038 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
2039 IF ( Hndl .GT. -1 ) THEN
2040   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
2041     SELECT CASE ( use_package( io_form ) )
2042 #ifdef NETCDF
2043       CASE ( IO_NETCDF   )
2044         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2045            CALL ext_ncd_put_dom_ti_integer ( Hndl, Element,   Data, &
2046                                  locCount,  Status ) 
2047         ENDIF
2048         IF ( .NOT. multi_files(io_form) ) THEN
2049           
2050           
2051           
2052           
2053           
2054           
2055           
2056           
2057           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2058         ENDIF
2059 #endif
2060 #ifdef PNETCDF
2061       CASE ( IO_PNETCDF   )
2062         CALL ext_pnc_put_dom_ti_integer ( Hndl, Element,   Data, &
2063                               locCount,  Status ) 
2064 #endif
2065 #ifdef PHDF5
2066       CASE ( IO_PHDF5   )
2067         CALL ext_phdf5_put_dom_ti_integer ( Hndl, Element,   Data, &
2068                               locCount,  Status ) 
2069 #endif
2070 #ifdef ESMFIO
2071       CASE ( IO_ESMF )
2072         CALL ext_esmf_put_dom_ti_integer ( Hndl, Element,   Data, &
2073                               locCount,  Status ) 
2074 #endif
2075 #ifdef XXX
2076       CASE ( IO_XXX   )
2077         CALL ext_xxx_put_dom_ti_integer ( Hndl, Element,   Data, &
2078                               locCount,  Status ) 
2079 #endif
2080 #ifdef YYY
2081       CASE ( IO_YYY   )
2082         CALL ext_yyy_put_dom_ti_integer ( Hndl, Element,   Data, &
2083                               locCount,  Status ) 
2084 #endif
2085 #ifdef GRIB1
2086       CASE ( IO_GRIB1   )
2087         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2088            CALL ext_gr1_put_dom_ti_integer ( Hndl, Element,   Data, &
2089                                  locCount,  Status ) 
2090         ENDIF
2091         IF ( .NOT. multi_files(io_form) ) THEN
2092           
2093           
2094           
2095           
2096           
2097           
2098           
2099           
2100           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2101         ENDIF
2102 #endif
2103 #ifdef GRIB2
2104       CASE ( IO_GRIB2   )
2105         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2106            CALL ext_gr2_put_dom_ti_integer ( Hndl, Element,   Data, &
2107                                  locCount,  Status ) 
2108         ENDIF
2109         IF ( .NOT. multi_files(io_form) ) THEN
2110           
2111           
2112           
2113           
2114           
2115           
2116           
2117           
2118           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2119         ENDIF
2120 #endif
2121 #ifdef INTIO
2122       CASE ( IO_INTIO   )
2123         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2124            CALL ext_int_put_dom_ti_integer ( Hndl, Element,   Data, &
2125                                  locCount,  Status ) 
2126         ENDIF
2127         IF ( .NOT. multi_files(io_form) ) THEN
2128            
2129            
2130            
2131            
2132            
2133            
2134            
2135            
2136            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2137         ENDIF
2138 #endif
2139       CASE DEFAULT
2140     END SELECT
2141   ELSE IF ( for_out .AND. use_output_servers() ) THEN
2142     CALL wrf_quilt_put_dom_ti_integer ( Hndl, Element,   Data, &
2143                           locCount,  Status )
2144   ELSE
2145     Status = 0
2146 ENDIF
2147 ELSE
2148   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
2149 ENDIF
2150 RETURN
2151 END SUBROUTINE wrf_put_dom_ti_integer_arr 
2152 !--- put_dom_ti_integer
2153 
2154 SUBROUTINE wrf_put_dom_ti_integer_sca ( DataHandle,Element,   Data, Count,  Status )
2155 !<DESCRIPTION>
2156 !<PRE>
2157 !
2158 ! Write time independent
2159 ! domain metadata named "Element"  
2160 ! to the open dataset described by DataHandle.  
2161 ! Metadata of type integer are
2162 ! copied from scalar Data.
2163 ! 
2164 !
2165 !</PRE>
2166 !</DESCRIPTION>
2167 USE module_state_description
2168 IMPLICIT NONE
2169 INTEGER ,       INTENT(IN)  :: DataHandle
2170 CHARACTER*(*) , INTENT(IN)  :: Element
2171 
2172  
2173 
2174  integer  :: Data 
2175 
2176 INTEGER ,       INTENT(IN)  :: Count
2177 
2178 INTEGER ,       INTENT(OUT) :: Status
2179 
2180 #include <wrf_status_codes.h>
2181 INTEGER                     :: len_of_str
2182 LOGICAL                     :: for_out
2183 INTEGER, EXTERNAL           :: use_package
2184 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
2185 INTEGER                     :: locCount
2186 
2187 INTEGER io_form , Hndl
2188 
2189 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_integer_sca " )
2190 
2191 locCount = Count
2192 
2193 
2194 
2195 Status = 0
2196 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
2197 IF ( Hndl .GT. -1 ) THEN
2198   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
2199     SELECT CASE ( use_package( io_form ) )
2200 #ifdef NETCDF
2201       CASE ( IO_NETCDF   )
2202         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2203            CALL ext_ncd_put_dom_ti_integer ( Hndl, Element,   Data, &
2204                                  locCount,  Status ) 
2205         ENDIF
2206         IF ( .NOT. multi_files(io_form) ) THEN
2207           
2208           
2209           
2210           
2211           
2212           
2213           
2214           
2215           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2216         ENDIF
2217 #endif
2218 #ifdef PNETCDF
2219       CASE ( IO_PNETCDF   )
2220         CALL ext_pnc_put_dom_ti_integer ( Hndl, Element,   Data, &
2221                               locCount,  Status ) 
2222 #endif
2223 #ifdef PHDF5
2224       CASE ( IO_PHDF5   )
2225         CALL ext_phdf5_put_dom_ti_integer ( Hndl, Element,   Data, &
2226                               locCount,  Status ) 
2227 #endif
2228 #ifdef ESMFIO
2229       CASE ( IO_ESMF )
2230         CALL ext_esmf_put_dom_ti_integer ( Hndl, Element,   Data, &
2231                               locCount,  Status ) 
2232 #endif
2233 #ifdef XXX
2234       CASE ( IO_XXX   )
2235         CALL ext_xxx_put_dom_ti_integer ( Hndl, Element,   Data, &
2236                               locCount,  Status ) 
2237 #endif
2238 #ifdef YYY
2239       CASE ( IO_YYY   )
2240         CALL ext_yyy_put_dom_ti_integer ( Hndl, Element,   Data, &
2241                               locCount,  Status ) 
2242 #endif
2243 #ifdef GRIB1
2244       CASE ( IO_GRIB1   )
2245         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2246            CALL ext_gr1_put_dom_ti_integer ( Hndl, Element,   Data, &
2247                                  locCount,  Status ) 
2248         ENDIF
2249         IF ( .NOT. multi_files(io_form) ) THEN
2250           
2251           
2252           
2253           
2254           
2255           
2256           
2257           
2258           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2259         ENDIF
2260 #endif
2261 #ifdef GRIB2
2262       CASE ( IO_GRIB2   )
2263         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2264            CALL ext_gr2_put_dom_ti_integer ( Hndl, Element,   Data, &
2265                                  locCount,  Status ) 
2266         ENDIF
2267         IF ( .NOT. multi_files(io_form) ) THEN
2268           
2269           
2270           
2271           
2272           
2273           
2274           
2275           
2276           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2277         ENDIF
2278 #endif
2279 #ifdef INTIO
2280       CASE ( IO_INTIO   )
2281         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2282            CALL ext_int_put_dom_ti_integer ( Hndl, Element,   Data, &
2283                                  locCount,  Status ) 
2284         ENDIF
2285         IF ( .NOT. multi_files(io_form) ) THEN
2286            
2287            
2288            
2289            
2290            
2291            
2292            
2293            
2294            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2295         ENDIF
2296 #endif
2297       CASE DEFAULT
2298     END SELECT
2299   ELSE IF ( for_out .AND. use_output_servers() ) THEN
2300     CALL wrf_quilt_put_dom_ti_integer ( Hndl, Element,   Data, &
2301                           locCount,  Status )
2302   ELSE
2303     Status = 0
2304 ENDIF
2305 ELSE
2306   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
2307 ENDIF
2308 RETURN
2309 END SUBROUTINE wrf_put_dom_ti_integer_sca 
2310 
2311 
2312 !--- get_dom_ti_logical
2313 
2314 SUBROUTINE wrf_get_dom_ti_logical_arr ( DataHandle,Element,   Data, Count, Outcount, Status )
2315 !<DESCRIPTION>
2316 !<PRE>
2317 !
2318 ! Attempt to read Count words of time independent
2319 ! domain metadata named "Element"  
2320 ! from the open dataset described by DataHandle.  
2321 ! Metadata of type logical are
2322 ! stored in array Data.
2323 ! Actual number of words read is returned in OutCount.
2324 !
2325 !</PRE>
2326 !</DESCRIPTION>
2327 USE module_state_description
2328 IMPLICIT NONE
2329 INTEGER ,       INTENT(IN)  :: DataHandle
2330 CHARACTER*(*) , INTENT(IN)  :: Element
2331 
2332  
2333 
2334  logical  :: Data (*)
2335 
2336 INTEGER ,       INTENT(IN)  :: Count
2337 INTEGER ,       INTENT(OUT)  :: OutCount
2338 INTEGER ,       INTENT(OUT) :: Status
2339 
2340 #include <wrf_status_codes.h>
2341 INTEGER                     :: len_of_str
2342 LOGICAL                     :: for_out
2343 INTEGER, EXTERNAL           :: use_package
2344 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
2345 INTEGER                     :: locCount
2346 
2347 INTEGER io_form , Hndl
2348 
2349 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_logical_arr " )
2350 
2351 
2352 
2353 locCount = Count
2354 
2355 Status = 0
2356 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
2357 IF ( Hndl .GT. -1 ) THEN
2358   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
2359     SELECT CASE ( use_package( io_form ) )
2360 #ifdef NETCDF
2361       CASE ( IO_NETCDF   )
2362         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2363            CALL ext_ncd_get_dom_ti_logical ( Hndl, Element,   Data, &
2364                                  locCount, Outcount, Status ) 
2365         ENDIF
2366         IF ( .NOT. multi_files(io_form) ) THEN
2367           
2368           
2369           
2370           
2371           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
2372           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
2373           
2374           
2375           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2376         ENDIF
2377 #endif
2378 #ifdef PNETCDF
2379       CASE ( IO_PNETCDF   )
2380         CALL ext_pnc_get_dom_ti_logical ( Hndl, Element,   Data, &
2381                               locCount, Outcount, Status ) 
2382 #endif
2383 #ifdef PHDF5
2384       CASE ( IO_PHDF5   )
2385         CALL ext_phdf5_get_dom_ti_logical ( Hndl, Element,   Data, &
2386                               locCount, Outcount, Status ) 
2387 #endif
2388 #ifdef ESMFIO
2389       CASE ( IO_ESMF )
2390         CALL ext_esmf_get_dom_ti_logical ( Hndl, Element,   Data, &
2391                               locCount, Outcount, Status ) 
2392 #endif
2393 #ifdef XXX
2394       CASE ( IO_XXX   )
2395         CALL ext_xxx_get_dom_ti_logical ( Hndl, Element,   Data, &
2396                               locCount, Outcount, Status ) 
2397 #endif
2398 #ifdef YYY
2399       CASE ( IO_YYY   )
2400         CALL ext_yyy_get_dom_ti_logical ( Hndl, Element,   Data, &
2401                               locCount, Outcount, Status ) 
2402 #endif
2403 #ifdef GRIB1
2404       CASE ( IO_GRIB1   )
2405         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2406            CALL ext_gr1_get_dom_ti_logical ( Hndl, Element,   Data, &
2407                                  locCount, Outcount, Status ) 
2408         ENDIF
2409         IF ( .NOT. multi_files(io_form) ) THEN
2410           
2411           
2412           
2413           
2414           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
2415           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
2416           
2417           
2418           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2419         ENDIF
2420 #endif
2421 #ifdef GRIB2
2422       CASE ( IO_GRIB2   )
2423         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2424            CALL ext_gr2_get_dom_ti_logical ( Hndl, Element,   Data, &
2425                                  locCount, Outcount, Status ) 
2426         ENDIF
2427         IF ( .NOT. multi_files(io_form) ) THEN
2428           
2429           
2430           
2431           
2432           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
2433           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
2434           
2435           
2436           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2437         ENDIF
2438 #endif
2439 #ifdef INTIO
2440       CASE ( IO_INTIO   )
2441         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2442            CALL ext_int_get_dom_ti_logical ( Hndl, Element,   Data, &
2443                                  locCount, Outcount, Status ) 
2444         ENDIF
2445         IF ( .NOT. multi_files(io_form) ) THEN
2446            
2447            
2448            
2449            
2450            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
2451            CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
2452            
2453            
2454            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2455         ENDIF
2456 #endif
2457       CASE DEFAULT
2458     END SELECT
2459   ELSE IF ( for_out .AND. use_output_servers() ) THEN
2460     CALL wrf_quilt_get_dom_ti_logical ( Hndl, Element,   Data, &
2461                           locCount, Outcount, Status )
2462   ELSE
2463     Status = 0
2464 ENDIF
2465 ELSE
2466   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
2467 ENDIF
2468 RETURN
2469 END SUBROUTINE wrf_get_dom_ti_logical_arr 
2470 !--- get_dom_ti_logical
2471 
2472 SUBROUTINE wrf_get_dom_ti_logical_sca ( DataHandle,Element,   Data, Count, Outcount, Status )
2473 !<DESCRIPTION>
2474 !<PRE>
2475 !
2476 ! Attempt to read time independent
2477 ! domain metadata named "Element"  
2478 ! from the open dataset described by DataHandle.  
2479 ! Metadata of type logical are
2480 ! stored in scalar Data.
2481 ! 
2482 !
2483 !</PRE>
2484 !</DESCRIPTION>
2485 USE module_state_description
2486 IMPLICIT NONE
2487 INTEGER ,       INTENT(IN)  :: DataHandle
2488 CHARACTER*(*) , INTENT(IN)  :: Element
2489 
2490  
2491 
2492  logical  :: Data 
2493 
2494 INTEGER ,       INTENT(IN)  :: Count
2495 INTEGER ,       INTENT(OUT)  :: OutCount
2496 INTEGER ,       INTENT(OUT) :: Status
2497 
2498 #include <wrf_status_codes.h>
2499 INTEGER                     :: len_of_str
2500 LOGICAL                     :: for_out
2501 INTEGER, EXTERNAL           :: use_package
2502 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
2503 INTEGER                     :: locCount
2504 
2505 INTEGER io_form , Hndl
2506 
2507 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_logical_sca " )
2508 
2509 
2510 
2511 locCount = Count
2512 
2513 Status = 0
2514 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
2515 IF ( Hndl .GT. -1 ) THEN
2516   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
2517     SELECT CASE ( use_package( io_form ) )
2518 #ifdef NETCDF
2519       CASE ( IO_NETCDF   )
2520         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2521            CALL ext_ncd_get_dom_ti_logical ( Hndl, Element,   Data, &
2522                                  locCount, Outcount, Status ) 
2523         ENDIF
2524         IF ( .NOT. multi_files(io_form) ) THEN
2525           
2526           
2527           
2528           
2529           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
2530           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
2531           
2532           
2533           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2534         ENDIF
2535 #endif
2536 #ifdef PNETCDF
2537       CASE ( IO_PNETCDF   )
2538         CALL ext_pnc_get_dom_ti_logical ( Hndl, Element,   Data, &
2539                               locCount, Outcount, Status ) 
2540 #endif
2541 #ifdef PHDF5
2542       CASE ( IO_PHDF5   )
2543         CALL ext_phdf5_get_dom_ti_logical ( Hndl, Element,   Data, &
2544                               locCount, Outcount, Status ) 
2545 #endif
2546 #ifdef ESMFIO
2547       CASE ( IO_ESMF )
2548         CALL ext_esmf_get_dom_ti_logical ( Hndl, Element,   Data, &
2549                               locCount, Outcount, Status ) 
2550 #endif
2551 #ifdef XXX
2552       CASE ( IO_XXX   )
2553         CALL ext_xxx_get_dom_ti_logical ( Hndl, Element,   Data, &
2554                               locCount, Outcount, Status ) 
2555 #endif
2556 #ifdef YYY
2557       CASE ( IO_YYY   )
2558         CALL ext_yyy_get_dom_ti_logical ( Hndl, Element,   Data, &
2559                               locCount, Outcount, Status ) 
2560 #endif
2561 #ifdef GRIB1
2562       CASE ( IO_GRIB1   )
2563         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2564            CALL ext_gr1_get_dom_ti_logical ( Hndl, Element,   Data, &
2565                                  locCount, Outcount, Status ) 
2566         ENDIF
2567         IF ( .NOT. multi_files(io_form) ) THEN
2568           
2569           
2570           
2571           
2572           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
2573           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
2574           
2575           
2576           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2577         ENDIF
2578 #endif
2579 #ifdef GRIB2
2580       CASE ( IO_GRIB2   )
2581         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2582            CALL ext_gr2_get_dom_ti_logical ( Hndl, Element,   Data, &
2583                                  locCount, Outcount, Status ) 
2584         ENDIF
2585         IF ( .NOT. multi_files(io_form) ) THEN
2586           
2587           
2588           
2589           
2590           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
2591           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
2592           
2593           
2594           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2595         ENDIF
2596 #endif
2597 #ifdef INTIO
2598       CASE ( IO_INTIO   )
2599         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2600            CALL ext_int_get_dom_ti_logical ( Hndl, Element,   Data, &
2601                                  locCount, Outcount, Status ) 
2602         ENDIF
2603         IF ( .NOT. multi_files(io_form) ) THEN
2604            
2605            
2606            
2607            
2608            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
2609            CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
2610            
2611            
2612            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2613         ENDIF
2614 #endif
2615       CASE DEFAULT
2616     END SELECT
2617   ELSE IF ( for_out .AND. use_output_servers() ) THEN
2618     CALL wrf_quilt_get_dom_ti_logical ( Hndl, Element,   Data, &
2619                           locCount, Outcount, Status )
2620   ELSE
2621     Status = 0
2622 ENDIF
2623 ELSE
2624   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
2625 ENDIF
2626 RETURN
2627 END SUBROUTINE wrf_get_dom_ti_logical_sca 
2628 
2629 
2630 !--- put_dom_ti_logical
2631 
2632 SUBROUTINE wrf_put_dom_ti_logical_arr ( DataHandle,Element,   Data, Count,  Status )
2633 !<DESCRIPTION>
2634 !<PRE>
2635 !
2636 ! Write Count words of time independent
2637 ! domain metadata named "Element"  
2638 ! to the open dataset described by DataHandle.  
2639 ! Metadata of type logical are
2640 ! copied from array Data.
2641 ! 
2642 !
2643 !</PRE>
2644 !</DESCRIPTION>
2645 USE module_state_description
2646 IMPLICIT NONE
2647 INTEGER ,       INTENT(IN)  :: DataHandle
2648 CHARACTER*(*) , INTENT(IN)  :: Element
2649 
2650  
2651 
2652  logical  :: Data (*)
2653 
2654 INTEGER ,       INTENT(IN)  :: Count
2655 
2656 INTEGER ,       INTENT(OUT) :: Status
2657 
2658 #include <wrf_status_codes.h>
2659 INTEGER                     :: len_of_str
2660 LOGICAL                     :: for_out
2661 INTEGER, EXTERNAL           :: use_package
2662 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
2663 INTEGER                     :: locCount
2664 
2665 INTEGER io_form , Hndl
2666 
2667 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_logical_arr " )
2668 
2669 
2670 
2671 locCount = Count
2672 
2673 Status = 0
2674 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
2675 IF ( Hndl .GT. -1 ) THEN
2676   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
2677     SELECT CASE ( use_package( io_form ) )
2678 #ifdef NETCDF
2679       CASE ( IO_NETCDF   )
2680         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2681            CALL ext_ncd_put_dom_ti_logical ( Hndl, Element,   Data, &
2682                                  locCount,  Status ) 
2683         ENDIF
2684         IF ( .NOT. multi_files(io_form) ) THEN
2685           
2686           
2687           
2688           
2689           
2690           
2691           
2692           
2693           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2694         ENDIF
2695 #endif
2696 #ifdef PNETCDF
2697       CASE ( IO_PNETCDF   )
2698         CALL ext_pnc_put_dom_ti_logical ( Hndl, Element,   Data, &
2699                               locCount,  Status ) 
2700 #endif
2701 #ifdef PHDF5
2702       CASE ( IO_PHDF5   )
2703         CALL ext_phdf5_put_dom_ti_logical ( Hndl, Element,   Data, &
2704                               locCount,  Status ) 
2705 #endif
2706 #ifdef ESMFIO
2707       CASE ( IO_ESMF )
2708         CALL ext_esmf_put_dom_ti_logical ( Hndl, Element,   Data, &
2709                               locCount,  Status ) 
2710 #endif
2711 #ifdef XXX
2712       CASE ( IO_XXX   )
2713         CALL ext_xxx_put_dom_ti_logical ( Hndl, Element,   Data, &
2714                               locCount,  Status ) 
2715 #endif
2716 #ifdef YYY
2717       CASE ( IO_YYY   )
2718         CALL ext_yyy_put_dom_ti_logical ( Hndl, Element,   Data, &
2719                               locCount,  Status ) 
2720 #endif
2721 #ifdef GRIB1
2722       CASE ( IO_GRIB1   )
2723         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2724            CALL ext_gr1_put_dom_ti_logical ( Hndl, Element,   Data, &
2725                                  locCount,  Status ) 
2726         ENDIF
2727         IF ( .NOT. multi_files(io_form) ) THEN
2728           
2729           
2730           
2731           
2732           
2733           
2734           
2735           
2736           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2737         ENDIF
2738 #endif
2739 #ifdef GRIB2
2740       CASE ( IO_GRIB2   )
2741         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2742            CALL ext_gr2_put_dom_ti_logical ( Hndl, Element,   Data, &
2743                                  locCount,  Status ) 
2744         ENDIF
2745         IF ( .NOT. multi_files(io_form) ) THEN
2746           
2747           
2748           
2749           
2750           
2751           
2752           
2753           
2754           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2755         ENDIF
2756 #endif
2757 #ifdef INTIO
2758       CASE ( IO_INTIO   )
2759         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2760            CALL ext_int_put_dom_ti_logical ( Hndl, Element,   Data, &
2761                                  locCount,  Status ) 
2762         ENDIF
2763         IF ( .NOT. multi_files(io_form) ) THEN
2764            
2765            
2766            
2767            
2768            
2769            
2770            
2771            
2772            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2773         ENDIF
2774 #endif
2775       CASE DEFAULT
2776     END SELECT
2777   ELSE IF ( for_out .AND. use_output_servers() ) THEN
2778     CALL wrf_quilt_put_dom_ti_logical ( Hndl, Element,   Data, &
2779                           locCount,  Status )
2780   ELSE
2781     Status = 0
2782 ENDIF
2783 ELSE
2784   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
2785 ENDIF
2786 RETURN
2787 END SUBROUTINE wrf_put_dom_ti_logical_arr 
2788 !--- put_dom_ti_logical
2789 
2790 SUBROUTINE wrf_put_dom_ti_logical_sca ( DataHandle,Element,   Data, Count,  Status )
2791 !<DESCRIPTION>
2792 !<PRE>
2793 !
2794 ! Write time independent
2795 ! domain metadata named "Element"  
2796 ! to the open dataset described by DataHandle.  
2797 ! Metadata of type logical are
2798 ! copied from scalar Data.
2799 ! 
2800 !
2801 !</PRE>
2802 !</DESCRIPTION>
2803 USE module_state_description
2804 IMPLICIT NONE
2805 INTEGER ,       INTENT(IN)  :: DataHandle
2806 CHARACTER*(*) , INTENT(IN)  :: Element
2807 
2808  
2809 
2810  logical  :: Data 
2811 
2812 INTEGER ,       INTENT(IN)  :: Count
2813 
2814 INTEGER ,       INTENT(OUT) :: Status
2815 
2816 #include <wrf_status_codes.h>
2817 INTEGER                     :: len_of_str
2818 LOGICAL                     :: for_out
2819 INTEGER, EXTERNAL           :: use_package
2820 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
2821 INTEGER                     :: locCount
2822 
2823 INTEGER io_form , Hndl
2824 
2825 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_logical_sca " )
2826 
2827 
2828 
2829 locCount = Count
2830 
2831 Status = 0
2832 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
2833 IF ( Hndl .GT. -1 ) THEN
2834   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
2835     SELECT CASE ( use_package( io_form ) )
2836 #ifdef NETCDF
2837       CASE ( IO_NETCDF   )
2838         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2839            CALL ext_ncd_put_dom_ti_logical ( Hndl, Element,   Data, &
2840                                  locCount,  Status ) 
2841         ENDIF
2842         IF ( .NOT. multi_files(io_form) ) THEN
2843           
2844           
2845           
2846           
2847           
2848           
2849           
2850           
2851           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2852         ENDIF
2853 #endif
2854 #ifdef PNETCDF
2855       CASE ( IO_PNETCDF   )
2856         CALL ext_pnc_put_dom_ti_logical ( Hndl, Element,   Data, &
2857                               locCount,  Status ) 
2858 #endif
2859 #ifdef PHDF5
2860       CASE ( IO_PHDF5   )
2861         CALL ext_phdf5_put_dom_ti_logical ( Hndl, Element,   Data, &
2862                               locCount,  Status ) 
2863 #endif
2864 #ifdef ESMFIO
2865       CASE ( IO_ESMF )
2866         CALL ext_esmf_put_dom_ti_logical ( Hndl, Element,   Data, &
2867                               locCount,  Status ) 
2868 #endif
2869 #ifdef XXX
2870       CASE ( IO_XXX   )
2871         CALL ext_xxx_put_dom_ti_logical ( Hndl, Element,   Data, &
2872                               locCount,  Status ) 
2873 #endif
2874 #ifdef YYY
2875       CASE ( IO_YYY   )
2876         CALL ext_yyy_put_dom_ti_logical ( Hndl, Element,   Data, &
2877                               locCount,  Status ) 
2878 #endif
2879 #ifdef GRIB1
2880       CASE ( IO_GRIB1   )
2881         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2882            CALL ext_gr1_put_dom_ti_logical ( Hndl, Element,   Data, &
2883                                  locCount,  Status ) 
2884         ENDIF
2885         IF ( .NOT. multi_files(io_form) ) THEN
2886           
2887           
2888           
2889           
2890           
2891           
2892           
2893           
2894           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2895         ENDIF
2896 #endif
2897 #ifdef GRIB2
2898       CASE ( IO_GRIB2   )
2899         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2900            CALL ext_gr2_put_dom_ti_logical ( Hndl, Element,   Data, &
2901                                  locCount,  Status ) 
2902         ENDIF
2903         IF ( .NOT. multi_files(io_form) ) THEN
2904           
2905           
2906           
2907           
2908           
2909           
2910           
2911           
2912           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2913         ENDIF
2914 #endif
2915 #ifdef INTIO
2916       CASE ( IO_INTIO   )
2917         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2918            CALL ext_int_put_dom_ti_logical ( Hndl, Element,   Data, &
2919                                  locCount,  Status ) 
2920         ENDIF
2921         IF ( .NOT. multi_files(io_form) ) THEN
2922            
2923            
2924            
2925            
2926            
2927            
2928            
2929            
2930            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
2931         ENDIF
2932 #endif
2933       CASE DEFAULT
2934     END SELECT
2935   ELSE IF ( for_out .AND. use_output_servers() ) THEN
2936     CALL wrf_quilt_put_dom_ti_logical ( Hndl, Element,   Data, &
2937                           locCount,  Status )
2938   ELSE
2939     Status = 0
2940 ENDIF
2941 ELSE
2942   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
2943 ENDIF
2944 RETURN
2945 END SUBROUTINE wrf_put_dom_ti_logical_sca 
2946 
2947 
2948 !--- get_dom_ti_char
2949 
2950 SUBROUTINE wrf_get_dom_ti_char_arr ( DataHandle,Element,   Data,  Status )
2951 !<DESCRIPTION>
2952 !<PRE>
2953 !
2954 ! Attempt to read time independent
2955 ! domain metadata named "Element"  
2956 ! from the open dataset described by DataHandle.  
2957 ! Metadata of type char are
2958 ! stored in string Data.
2959 ! 
2960 !
2961 !</PRE>
2962 !</DESCRIPTION>
2963 USE module_state_description
2964 IMPLICIT NONE
2965 INTEGER ,       INTENT(IN)  :: DataHandle
2966 CHARACTER*(*) , INTENT(IN)  :: Element
2967 
2968  
2969 
2970  CHARACTER*(*)  :: Data
2971 
2972 
2973 
2974 INTEGER ,       INTENT(OUT) :: Status
2975 
2976 #include <wrf_status_codes.h>
2977 INTEGER                     :: len_of_str
2978 LOGICAL                     :: for_out
2979 INTEGER, EXTERNAL           :: use_package
2980 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
2981 INTEGER                     :: locCount
2982 
2983 INTEGER io_form , Hndl
2984 
2985 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_ti_char_arr " )
2986 
2987 
2988 
2989 
2990 
2991 Status = 0
2992 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
2993 IF ( Hndl .GT. -1 ) THEN
2994   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
2995     SELECT CASE ( use_package( io_form ) )
2996 #ifdef NETCDF
2997       CASE ( IO_NETCDF   )
2998         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
2999            CALL ext_ncd_get_dom_ti_char ( Hndl, Element,   Data, &
3000                                   Status ) 
3001         ENDIF
3002         IF ( .NOT. multi_files(io_form) ) THEN
3003           
3004           
3005           
3006           
3007           
3008           
3009           len_of_str = LEN(Data)
3010           CALL wrf_dm_bcast_string( Data, len_of_str )
3011           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3012         ENDIF
3013 #endif
3014 #ifdef PNETCDF
3015       CASE ( IO_PNETCDF   )
3016         CALL ext_pnc_get_dom_ti_char ( Hndl, Element,   Data, &
3017                                Status ) 
3018 #endif
3019 #ifdef PHDF5
3020       CASE ( IO_PHDF5   )
3021         CALL ext_phdf5_get_dom_ti_char ( Hndl, Element,   Data, &
3022                                Status ) 
3023 #endif
3024 #ifdef ESMFIO
3025       CASE ( IO_ESMF )
3026         CALL ext_esmf_get_dom_ti_char ( Hndl, Element,   Data, &
3027                                Status ) 
3028 #endif
3029 #ifdef XXX
3030       CASE ( IO_XXX   )
3031         CALL ext_xxx_get_dom_ti_char ( Hndl, Element,   Data, &
3032                                Status ) 
3033 #endif
3034 #ifdef YYY
3035       CASE ( IO_YYY   )
3036         CALL ext_yyy_get_dom_ti_char ( Hndl, Element,   Data, &
3037                                Status ) 
3038 #endif
3039 #ifdef GRIB1
3040       CASE ( IO_GRIB1   )
3041         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3042            CALL ext_gr1_get_dom_ti_char ( Hndl, Element,   Data, &
3043                                   Status ) 
3044         ENDIF
3045         IF ( .NOT. multi_files(io_form) ) THEN
3046           
3047           
3048           
3049           
3050           
3051           
3052           len_of_str = LEN(Data)
3053           CALL wrf_dm_bcast_string( Data, len_of_str )
3054           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3055         ENDIF
3056 #endif
3057 #ifdef GRIB2
3058       CASE ( IO_GRIB2   )
3059         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3060            CALL ext_gr2_get_dom_ti_char ( Hndl, Element,   Data, &
3061                                   Status ) 
3062         ENDIF
3063         IF ( .NOT. multi_files(io_form) ) THEN
3064           
3065           
3066           
3067           
3068           
3069           
3070           len_of_str = LEN(Data)
3071           CALL wrf_dm_bcast_string( Data, len_of_str )
3072           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3073         ENDIF
3074 #endif
3075 #ifdef INTIO
3076       CASE ( IO_INTIO   )
3077         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3078            CALL ext_int_get_dom_ti_char ( Hndl, Element,   Data, &
3079                                   Status ) 
3080         ENDIF
3081         IF ( .NOT. multi_files(io_form) ) THEN
3082            
3083            
3084            
3085            
3086            
3087            
3088            len_of_str = LEN(Data)
3089            CALL wrf_dm_bcast_string( Data, len_of_str )
3090            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3091         ENDIF
3092 #endif
3093       CASE DEFAULT
3094     END SELECT
3095   ELSE IF ( for_out .AND. use_output_servers() ) THEN
3096     CALL wrf_quilt_get_dom_ti_char ( Hndl, Element,   Data, &
3097                            Status )
3098   ELSE
3099     Status = 0
3100 ENDIF
3101 ELSE
3102   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
3103 ENDIF
3104 RETURN
3105 END SUBROUTINE wrf_get_dom_ti_char_arr 
3106 
3107 
3108 !--- put_dom_ti_char
3109 
3110 SUBROUTINE wrf_put_dom_ti_char_arr ( DataHandle,Element,   Data,  Status )
3111 !<DESCRIPTION>
3112 !<PRE>
3113 !
3114 ! Write time independent
3115 ! domain metadata named "Element"  
3116 ! to the open dataset described by DataHandle.  
3117 ! Metadata of type char are
3118 ! copied from string Data.
3119 ! 
3120 !
3121 !</PRE>
3122 !</DESCRIPTION>
3123 USE module_state_description
3124 IMPLICIT NONE
3125 INTEGER ,       INTENT(IN)  :: DataHandle
3126 CHARACTER*(*) , INTENT(IN)  :: Element
3127 
3128  
3129 
3130  CHARACTER*(*)  :: Data
3131 
3132 
3133 
3134 INTEGER ,       INTENT(OUT) :: Status
3135 
3136 #include <wrf_status_codes.h>
3137 INTEGER                     :: len_of_str
3138 LOGICAL                     :: for_out
3139 INTEGER, EXTERNAL           :: use_package
3140 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
3141 INTEGER                     :: locCount
3142 
3143 INTEGER io_form , Hndl
3144 
3145 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_ti_char_arr " )
3146 
3147 
3148 
3149 
3150 
3151 Status = 0
3152 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
3153 IF ( Hndl .GT. -1 ) THEN
3154   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
3155     SELECT CASE ( use_package( io_form ) )
3156 #ifdef NETCDF
3157       CASE ( IO_NETCDF   )
3158         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3159            CALL ext_ncd_put_dom_ti_char ( Hndl, Element,   Data, &
3160                                   Status ) 
3161         ENDIF
3162         IF ( .NOT. multi_files(io_form) ) THEN
3163           
3164           
3165           
3166           
3167           
3168           
3169           
3170           
3171           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3172         ENDIF
3173 #endif
3174 #ifdef PNETCDF
3175       CASE ( IO_PNETCDF   )
3176         CALL ext_pnc_put_dom_ti_char ( Hndl, Element,   Data, &
3177                                Status ) 
3178 #endif
3179 #ifdef PHDF5
3180       CASE ( IO_PHDF5   )
3181         CALL ext_phdf5_put_dom_ti_char ( Hndl, Element,   Data, &
3182                                Status ) 
3183 #endif
3184 #ifdef ESMFIO
3185       CASE ( IO_ESMF )
3186         CALL ext_esmf_put_dom_ti_char ( Hndl, Element,   Data, &
3187                                Status ) 
3188 #endif
3189 #ifdef XXX
3190       CASE ( IO_XXX   )
3191         CALL ext_xxx_put_dom_ti_char ( Hndl, Element,   Data, &
3192                                Status ) 
3193 #endif
3194 #ifdef YYY
3195       CASE ( IO_YYY   )
3196         CALL ext_yyy_put_dom_ti_char ( Hndl, Element,   Data, &
3197                                Status ) 
3198 #endif
3199 #ifdef GRIB1
3200       CASE ( IO_GRIB1   )
3201         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3202            CALL ext_gr1_put_dom_ti_char ( Hndl, Element,   Data, &
3203                                   Status ) 
3204         ENDIF
3205         IF ( .NOT. multi_files(io_form) ) THEN
3206           
3207           
3208           
3209           
3210           
3211           
3212           
3213           
3214           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3215         ENDIF
3216 #endif
3217 #ifdef GRIB2
3218       CASE ( IO_GRIB2   )
3219         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3220            CALL ext_gr2_put_dom_ti_char ( Hndl, Element,   Data, &
3221                                   Status ) 
3222         ENDIF
3223         IF ( .NOT. multi_files(io_form) ) THEN
3224           
3225           
3226           
3227           
3228           
3229           
3230           
3231           
3232           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3233         ENDIF
3234 #endif
3235 #ifdef INTIO
3236       CASE ( IO_INTIO   )
3237         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3238            CALL ext_int_put_dom_ti_char ( Hndl, Element,   Data, &
3239                                   Status ) 
3240         ENDIF
3241         IF ( .NOT. multi_files(io_form) ) THEN
3242            
3243            
3244            
3245            
3246            
3247            
3248            
3249            
3250            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3251         ENDIF
3252 #endif
3253       CASE DEFAULT
3254     END SELECT
3255   ELSE IF ( for_out .AND. use_output_servers() ) THEN
3256     CALL wrf_quilt_put_dom_ti_char ( Hndl, Element,   Data, &
3257                            Status )
3258   ELSE
3259     Status = 0
3260 ENDIF
3261 ELSE
3262   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
3263 ENDIF
3264 RETURN
3265 END SUBROUTINE wrf_put_dom_ti_char_arr 
3266 
3267 
3268 
3269 !--- get_dom_td_real
3270 
3271 SUBROUTINE wrf_get_dom_td_real_arr ( DataHandle,Element, DateStr,  Data, Count, Outcount, Status )
3272 !<DESCRIPTION>
3273 !<PRE>
3274 !
3275 ! Attempt to read Count words of time dependent
3276 ! domain metadata named "Element" valid at time DateStr 
3277 ! from the open dataset described by DataHandle.  
3278 ! Metadata of type real are
3279 ! stored in array Data.
3280 ! Actual number of words read is returned in OutCount.
3281 !
3282 !</PRE>
3283 !</DESCRIPTION>
3284 USE module_state_description
3285 IMPLICIT NONE
3286 INTEGER ,       INTENT(IN)  :: DataHandle
3287 CHARACTER*(*) , INTENT(IN)  :: Element
3288 CHARACTER*(*) , INTENT(IN)  :: DateStr
3289  
3290 
3291  real  :: Data (*)
3292 
3293 INTEGER ,       INTENT(IN)  :: Count
3294 INTEGER ,       INTENT(OUT)  :: OutCount
3295 INTEGER ,       INTENT(OUT) :: Status
3296 
3297 #include <wrf_status_codes.h>
3298 INTEGER                     :: len_of_str
3299 LOGICAL                     :: for_out
3300 INTEGER, EXTERNAL           :: use_package
3301 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
3302 INTEGER                     :: locCount
3303 
3304 INTEGER io_form , Hndl
3305 
3306 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_real_arr " )
3307 
3308 
3309 locCount = Count
3310 
3311 
3312 Status = 0
3313 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
3314 IF ( Hndl .GT. -1 ) THEN
3315   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
3316     SELECT CASE ( use_package( io_form ) )
3317 #ifdef NETCDF
3318       CASE ( IO_NETCDF   )
3319         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3320 #  if ( RWORDSIZE == DWORDSIZE )
3321            CALL ext_ncd_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3322                                  locCount, Outcount, Status )
3323 #  else
3324            CALL ext_ncd_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3325                                  locCount, Outcount, Status )
3326 #  endif
3327         ENDIF
3328         IF ( .NOT. multi_files(io_form) ) THEN
3329           
3330           
3331           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
3332           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
3333           
3334           
3335           
3336           
3337           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3338         ENDIF
3339 #endif
3340 #ifdef PNETCDF
3341       CASE ( IO_PNETCDF   )
3342 #  if ( RWORDSIZE == DWORDSIZE )
3343         CALL ext_pnc_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3344                               locCount, Outcount, Status )
3345 #  else
3346         CALL ext_pnc_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3347                               locCount, Outcount, Status )
3348 #  endif
3349 #endif
3350 #ifdef PHDF5
3351       CASE ( IO_PHDF5   )
3352 #  if ( RWORDSIZE == DWORDSIZE )
3353         CALL ext_phdf5_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3354                               locCount, Outcount, Status )
3355 #  else
3356         CALL ext_phdf5_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3357                               locCount, Outcount, Status )
3358 #  endif
3359 #endif
3360 #ifdef ESMFIO
3361       CASE ( IO_ESMF )
3362 #  if ( RWORDSIZE == DWORDSIZE )
3363         CALL ext_esmf_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3364                               locCount, Outcount, Status )
3365 #  else
3366         CALL ext_esmf_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3367                               locCount, Outcount, Status )
3368 #  endif
3369 #endif
3370 #ifdef XXX
3371       CASE ( IO_XXX   )
3372 #  if ( RWORDSIZE == DWORDSIZE )
3373         CALL ext_xxx_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3374                               locCount, Outcount, Status )
3375 #  else
3376         CALL ext_xxx_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3377                               locCount, Outcount, Status )
3378 #  endif
3379 #endif
3380 #ifdef YYY
3381       CASE ( IO_YYY   )
3382 #  if ( RWORDSIZE == DWORDSIZE )
3383         CALL ext_yyy_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3384                               locCount, Outcount, Status )
3385 #  else
3386         CALL ext_yyy_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3387                               locCount, Outcount, Status )
3388 #  endif
3389 #endif
3390 #ifdef GRIB1
3391       CASE ( IO_GRIB1   )
3392         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3393 #  if ( RWORDSIZE == DWORDSIZE )
3394            CALL ext_gr1_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3395                                  locCount, Outcount, Status )
3396 #  else
3397            CALL ext_gr1_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3398                                  locCount, Outcount, Status )
3399 #  endif
3400         ENDIF
3401         IF ( .NOT. multi_files(io_form) ) THEN
3402           
3403           
3404           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
3405           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
3406           
3407           
3408           
3409           
3410           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3411         ENDIF
3412 #endif
3413 #ifdef GRIB2
3414       CASE ( IO_GRIB2   )
3415         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3416 #  if ( RWORDSIZE == DWORDSIZE )
3417            CALL ext_gr2_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3418                                  locCount, Outcount, Status )
3419 #  else
3420            CALL ext_gr2_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3421                                  locCount, Outcount, Status )
3422 #  endif
3423         ENDIF
3424         IF ( .NOT. multi_files(io_form) ) THEN
3425           
3426           
3427           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
3428           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
3429           
3430           
3431           
3432           
3433           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3434         ENDIF
3435 #endif
3436 #ifdef INTIO
3437       CASE ( IO_INTIO   )
3438         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3439 #  if ( RWORDSIZE == DWORDSIZE )
3440            CALL ext_int_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3441                                  locCount, Outcount, Status )
3442 #  else
3443            CALL ext_int_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3444                                  locCount, Outcount, Status )
3445 #  endif
3446         ENDIF
3447         IF ( .NOT. multi_files(io_form) ) THEN
3448            
3449            
3450            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
3451            CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
3452            
3453            
3454            
3455            
3456            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3457         ENDIF
3458 #endif
3459       CASE DEFAULT
3460     END SELECT
3461   ELSE IF ( for_out .AND. use_output_servers() ) THEN
3462     CALL wrf_quilt_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3463                           locCount, Outcount, Status )
3464   ELSE
3465     Status = 0
3466 ENDIF
3467 ELSE
3468   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
3469 ENDIF
3470 RETURN
3471 END SUBROUTINE wrf_get_dom_td_real_arr 
3472 !--- get_dom_td_real
3473 
3474 SUBROUTINE wrf_get_dom_td_real_sca ( DataHandle,Element, DateStr,  Data, Count, Outcount, Status )
3475 !<DESCRIPTION>
3476 !<PRE>
3477 !
3478 ! Attempt to read time dependent
3479 ! domain metadata named "Element" valid at time DateStr 
3480 ! from the open dataset described by DataHandle.  
3481 ! Metadata of type real are
3482 ! stored in scalar Data.
3483 ! 
3484 !
3485 !</PRE>
3486 !</DESCRIPTION>
3487 USE module_state_description
3488 IMPLICIT NONE
3489 INTEGER ,       INTENT(IN)  :: DataHandle
3490 CHARACTER*(*) , INTENT(IN)  :: Element
3491 CHARACTER*(*) , INTENT(IN)  :: DateStr
3492  
3493 
3494  real  :: Data 
3495 
3496 INTEGER ,       INTENT(IN)  :: Count
3497 INTEGER ,       INTENT(OUT)  :: OutCount
3498 INTEGER ,       INTENT(OUT) :: Status
3499 
3500 #include <wrf_status_codes.h>
3501 INTEGER                     :: len_of_str
3502 LOGICAL                     :: for_out
3503 INTEGER, EXTERNAL           :: use_package
3504 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
3505 INTEGER                     :: locCount
3506 
3507 INTEGER io_form , Hndl
3508 
3509 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_real_sca " )
3510 
3511 
3512 locCount = Count
3513 
3514 
3515 Status = 0
3516 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
3517 IF ( Hndl .GT. -1 ) THEN
3518   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
3519     SELECT CASE ( use_package( io_form ) )
3520 #ifdef NETCDF
3521       CASE ( IO_NETCDF   )
3522         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3523 #  if ( RWORDSIZE == DWORDSIZE )
3524            CALL ext_ncd_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3525                                  locCount, Outcount, Status )
3526 #  else
3527            CALL ext_ncd_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3528                                  locCount, Outcount, Status )
3529 #  endif
3530         ENDIF
3531         IF ( .NOT. multi_files(io_form) ) THEN
3532           
3533           
3534           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
3535           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
3536           
3537           
3538           
3539           
3540           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3541         ENDIF
3542 #endif
3543 #ifdef PNETCDF
3544       CASE ( IO_PNETCDF   )
3545 #  if ( RWORDSIZE == DWORDSIZE )
3546         CALL ext_pnc_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3547                               locCount, Outcount, Status )
3548 #  else
3549         CALL ext_pnc_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3550                               locCount, Outcount, Status )
3551 #  endif
3552 #endif
3553 #ifdef PHDF5
3554       CASE ( IO_PHDF5   )
3555 #  if ( RWORDSIZE == DWORDSIZE )
3556         CALL ext_phdf5_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3557                               locCount, Outcount, Status )
3558 #  else
3559         CALL ext_phdf5_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3560                               locCount, Outcount, Status )
3561 #  endif
3562 #endif
3563 #ifdef ESMFIO
3564       CASE ( IO_ESMF )
3565 #  if ( RWORDSIZE == DWORDSIZE )
3566         CALL ext_esmf_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3567                               locCount, Outcount, Status )
3568 #  else
3569         CALL ext_esmf_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3570                               locCount, Outcount, Status )
3571 #  endif
3572 #endif
3573 #ifdef XXX
3574       CASE ( IO_XXX   )
3575 #  if ( RWORDSIZE == DWORDSIZE )
3576         CALL ext_xxx_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3577                               locCount, Outcount, Status )
3578 #  else
3579         CALL ext_xxx_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3580                               locCount, Outcount, Status )
3581 #  endif
3582 #endif
3583 #ifdef YYY
3584       CASE ( IO_YYY   )
3585 #  if ( RWORDSIZE == DWORDSIZE )
3586         CALL ext_yyy_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3587                               locCount, Outcount, Status )
3588 #  else
3589         CALL ext_yyy_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3590                               locCount, Outcount, Status )
3591 #  endif
3592 #endif
3593 #ifdef GRIB1
3594       CASE ( IO_GRIB1   )
3595         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3596 #  if ( RWORDSIZE == DWORDSIZE )
3597            CALL ext_gr1_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3598                                  locCount, Outcount, Status )
3599 #  else
3600            CALL ext_gr1_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3601                                  locCount, Outcount, Status )
3602 #  endif
3603         ENDIF
3604         IF ( .NOT. multi_files(io_form) ) THEN
3605           
3606           
3607           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
3608           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
3609           
3610           
3611           
3612           
3613           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3614         ENDIF
3615 #endif
3616 #ifdef GRIB2
3617       CASE ( IO_GRIB2   )
3618         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3619 #  if ( RWORDSIZE == DWORDSIZE )
3620            CALL ext_gr2_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3621                                  locCount, Outcount, Status )
3622 #  else
3623            CALL ext_gr2_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3624                                  locCount, Outcount, Status )
3625 #  endif
3626         ENDIF
3627         IF ( .NOT. multi_files(io_form) ) THEN
3628           
3629           
3630           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
3631           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
3632           
3633           
3634           
3635           
3636           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3637         ENDIF
3638 #endif
3639 #ifdef INTIO
3640       CASE ( IO_INTIO   )
3641         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3642 #  if ( RWORDSIZE == DWORDSIZE )
3643            CALL ext_int_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
3644                                  locCount, Outcount, Status )
3645 #  else
3646            CALL ext_int_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3647                                  locCount, Outcount, Status )
3648 #  endif
3649         ENDIF
3650         IF ( .NOT. multi_files(io_form) ) THEN
3651            
3652            
3653            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
3654            CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
3655            
3656            
3657            
3658            
3659            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3660         ENDIF
3661 #endif
3662       CASE DEFAULT
3663     END SELECT
3664   ELSE IF ( for_out .AND. use_output_servers() ) THEN
3665     CALL wrf_quilt_get_dom_td_real ( Hndl, Element, DateStr,  Data, &
3666                           locCount, Outcount, Status )
3667   ELSE
3668     Status = 0
3669 ENDIF
3670 ELSE
3671   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
3672 ENDIF
3673 RETURN
3674 END SUBROUTINE wrf_get_dom_td_real_sca 
3675 
3676 
3677 !--- put_dom_td_real
3678 
3679 SUBROUTINE wrf_put_dom_td_real_arr ( DataHandle,Element, DateStr,  Data, Count,  Status )
3680 !<DESCRIPTION>
3681 !<PRE>
3682 !
3683 ! Write Count words of time dependent
3684 ! domain metadata named "Element" valid at time DateStr 
3685 ! to the open dataset described by DataHandle.  
3686 ! Metadata of type real are
3687 ! copied from array Data.
3688 ! 
3689 !
3690 !</PRE>
3691 !</DESCRIPTION>
3692 USE module_state_description
3693 IMPLICIT NONE
3694 INTEGER ,       INTENT(IN)  :: DataHandle
3695 CHARACTER*(*) , INTENT(IN)  :: Element
3696 CHARACTER*(*) , INTENT(IN)  :: DateStr
3697  
3698 
3699  real  :: Data (*)
3700 
3701 INTEGER ,       INTENT(IN)  :: Count
3702 
3703 INTEGER ,       INTENT(OUT) :: Status
3704 
3705 #include <wrf_status_codes.h>
3706 INTEGER                     :: len_of_str
3707 LOGICAL                     :: for_out
3708 INTEGER, EXTERNAL           :: use_package
3709 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
3710 INTEGER                     :: locCount
3711 
3712 INTEGER io_form , Hndl
3713 
3714 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_real_arr " )
3715 
3716 
3717 locCount = Count
3718 
3719 
3720 Status = 0
3721 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
3722 IF ( Hndl .GT. -1 ) THEN
3723   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
3724     SELECT CASE ( use_package( io_form ) )
3725 #ifdef NETCDF
3726       CASE ( IO_NETCDF   )
3727         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3728 #  if ( RWORDSIZE == DWORDSIZE )
3729            CALL ext_ncd_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3730                                  locCount,  Status )
3731 #  else
3732            CALL ext_ncd_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3733                                  locCount,  Status )
3734 #  endif
3735         ENDIF
3736         IF ( .NOT. multi_files(io_form) ) THEN
3737           
3738           
3739           
3740           
3741           
3742           
3743           
3744           
3745           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3746         ENDIF
3747 #endif
3748 #ifdef PNETCDF
3749       CASE ( IO_PNETCDF   )
3750 #  if ( RWORDSIZE == DWORDSIZE )
3751         CALL ext_pnc_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3752                               locCount,  Status )
3753 #  else
3754         CALL ext_pnc_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3755                               locCount,  Status )
3756 #  endif
3757 #endif
3758 #ifdef PHDF5
3759       CASE ( IO_PHDF5   )
3760 #  if ( RWORDSIZE == DWORDSIZE )
3761         CALL ext_phdf5_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3762                               locCount,  Status )
3763 #  else
3764         CALL ext_phdf5_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3765                               locCount,  Status )
3766 #  endif
3767 #endif
3768 #ifdef ESMFIO
3769       CASE ( IO_ESMF )
3770 #  if ( RWORDSIZE == DWORDSIZE )
3771         CALL ext_esmf_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3772                               locCount,  Status )
3773 #  else
3774         CALL ext_esmf_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3775                               locCount,  Status )
3776 #  endif
3777 #endif
3778 #ifdef XXX
3779       CASE ( IO_XXX   )
3780 #  if ( RWORDSIZE == DWORDSIZE )
3781         CALL ext_xxx_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3782                               locCount,  Status )
3783 #  else
3784         CALL ext_xxx_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3785                               locCount,  Status )
3786 #  endif
3787 #endif
3788 #ifdef YYY
3789       CASE ( IO_YYY   )
3790 #  if ( RWORDSIZE == DWORDSIZE )
3791         CALL ext_yyy_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3792                               locCount,  Status )
3793 #  else
3794         CALL ext_yyy_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3795                               locCount,  Status )
3796 #  endif
3797 #endif
3798 #ifdef GRIB1
3799       CASE ( IO_GRIB1   )
3800         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3801 #  if ( RWORDSIZE == DWORDSIZE )
3802            CALL ext_gr1_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3803                                  locCount,  Status )
3804 #  else
3805            CALL ext_gr1_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3806                                  locCount,  Status )
3807 #  endif
3808         ENDIF
3809         IF ( .NOT. multi_files(io_form) ) THEN
3810           
3811           
3812           
3813           
3814           
3815           
3816           
3817           
3818           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3819         ENDIF
3820 #endif
3821 #ifdef GRIB2
3822       CASE ( IO_GRIB2   )
3823         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3824 #  if ( RWORDSIZE == DWORDSIZE )
3825            CALL ext_gr2_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3826                                  locCount,  Status )
3827 #  else
3828            CALL ext_gr2_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3829                                  locCount,  Status )
3830 #  endif
3831         ENDIF
3832         IF ( .NOT. multi_files(io_form) ) THEN
3833           
3834           
3835           
3836           
3837           
3838           
3839           
3840           
3841           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3842         ENDIF
3843 #endif
3844 #ifdef INTIO
3845       CASE ( IO_INTIO   )
3846         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3847 #  if ( RWORDSIZE == DWORDSIZE )
3848            CALL ext_int_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3849                                  locCount,  Status )
3850 #  else
3851            CALL ext_int_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3852                                  locCount,  Status )
3853 #  endif
3854         ENDIF
3855         IF ( .NOT. multi_files(io_form) ) THEN
3856            
3857            
3858            
3859            
3860            
3861            
3862            
3863            
3864            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3865         ENDIF
3866 #endif
3867       CASE DEFAULT
3868     END SELECT
3869   ELSE IF ( for_out .AND. use_output_servers() ) THEN
3870     CALL wrf_quilt_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3871                           locCount,  Status )
3872   ELSE
3873     Status = 0
3874 ENDIF
3875 ELSE
3876   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
3877 ENDIF
3878 RETURN
3879 END SUBROUTINE wrf_put_dom_td_real_arr 
3880 !--- put_dom_td_real
3881 
3882 SUBROUTINE wrf_put_dom_td_real_sca ( DataHandle,Element, DateStr,  Data, Count,  Status )
3883 !<DESCRIPTION>
3884 !<PRE>
3885 !
3886 ! Write time dependent
3887 ! domain metadata named "Element" valid at time DateStr 
3888 ! to the open dataset described by DataHandle.  
3889 ! Metadata of type real are
3890 ! copied from scalar Data.
3891 ! 
3892 !
3893 !</PRE>
3894 !</DESCRIPTION>
3895 USE module_state_description
3896 IMPLICIT NONE
3897 INTEGER ,       INTENT(IN)  :: DataHandle
3898 CHARACTER*(*) , INTENT(IN)  :: Element
3899 CHARACTER*(*) , INTENT(IN)  :: DateStr
3900  
3901 
3902  real  :: Data 
3903 
3904 INTEGER ,       INTENT(IN)  :: Count
3905 
3906 INTEGER ,       INTENT(OUT) :: Status
3907 
3908 #include <wrf_status_codes.h>
3909 INTEGER                     :: len_of_str
3910 LOGICAL                     :: for_out
3911 INTEGER, EXTERNAL           :: use_package
3912 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
3913 INTEGER                     :: locCount
3914 
3915 INTEGER io_form , Hndl
3916 
3917 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_real_sca " )
3918 
3919 
3920 locCount = Count
3921 
3922 
3923 Status = 0
3924 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
3925 IF ( Hndl .GT. -1 ) THEN
3926   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
3927     SELECT CASE ( use_package( io_form ) )
3928 #ifdef NETCDF
3929       CASE ( IO_NETCDF   )
3930         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
3931 #  if ( RWORDSIZE == DWORDSIZE )
3932            CALL ext_ncd_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3933                                  locCount,  Status )
3934 #  else
3935            CALL ext_ncd_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3936                                  locCount,  Status )
3937 #  endif
3938         ENDIF
3939         IF ( .NOT. multi_files(io_form) ) THEN
3940           
3941           
3942           
3943           
3944           
3945           
3946           
3947           
3948           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
3949         ENDIF
3950 #endif
3951 #ifdef PNETCDF
3952       CASE ( IO_PNETCDF   )
3953 #  if ( RWORDSIZE == DWORDSIZE )
3954         CALL ext_pnc_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3955                               locCount,  Status )
3956 #  else
3957         CALL ext_pnc_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3958                               locCount,  Status )
3959 #  endif
3960 #endif
3961 #ifdef PHDF5
3962       CASE ( IO_PHDF5   )
3963 #  if ( RWORDSIZE == DWORDSIZE )
3964         CALL ext_phdf5_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3965                               locCount,  Status )
3966 #  else
3967         CALL ext_phdf5_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3968                               locCount,  Status )
3969 #  endif
3970 #endif
3971 #ifdef ESMFIO
3972       CASE ( IO_ESMF )
3973 #  if ( RWORDSIZE == DWORDSIZE )
3974         CALL ext_esmf_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3975                               locCount,  Status )
3976 #  else
3977         CALL ext_esmf_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3978                               locCount,  Status )
3979 #  endif
3980 #endif
3981 #ifdef XXX
3982       CASE ( IO_XXX   )
3983 #  if ( RWORDSIZE == DWORDSIZE )
3984         CALL ext_xxx_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3985                               locCount,  Status )
3986 #  else
3987         CALL ext_xxx_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3988                               locCount,  Status )
3989 #  endif
3990 #endif
3991 #ifdef YYY
3992       CASE ( IO_YYY   )
3993 #  if ( RWORDSIZE == DWORDSIZE )
3994         CALL ext_yyy_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
3995                               locCount,  Status )
3996 #  else
3997         CALL ext_yyy_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
3998                               locCount,  Status )
3999 #  endif
4000 #endif
4001 #ifdef GRIB1
4002       CASE ( IO_GRIB1   )
4003         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4004 #  if ( RWORDSIZE == DWORDSIZE )
4005            CALL ext_gr1_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4006                                  locCount,  Status )
4007 #  else
4008            CALL ext_gr1_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
4009                                  locCount,  Status )
4010 #  endif
4011         ENDIF
4012         IF ( .NOT. multi_files(io_form) ) THEN
4013           
4014           
4015           
4016           
4017           
4018           
4019           
4020           
4021           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4022         ENDIF
4023 #endif
4024 #ifdef GRIB2
4025       CASE ( IO_GRIB2   )
4026         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4027 #  if ( RWORDSIZE == DWORDSIZE )
4028            CALL ext_gr2_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4029                                  locCount,  Status )
4030 #  else
4031            CALL ext_gr2_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
4032                                  locCount,  Status )
4033 #  endif
4034         ENDIF
4035         IF ( .NOT. multi_files(io_form) ) THEN
4036           
4037           
4038           
4039           
4040           
4041           
4042           
4043           
4044           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4045         ENDIF
4046 #endif
4047 #ifdef INTIO
4048       CASE ( IO_INTIO   )
4049         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4050 #  if ( RWORDSIZE == DWORDSIZE )
4051            CALL ext_int_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4052                                  locCount,  Status )
4053 #  else
4054            CALL ext_int_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
4055                                  locCount,  Status )
4056 #  endif
4057         ENDIF
4058         IF ( .NOT. multi_files(io_form) ) THEN
4059            
4060            
4061            
4062            
4063            
4064            
4065            
4066            
4067            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4068         ENDIF
4069 #endif
4070       CASE DEFAULT
4071     END SELECT
4072   ELSE IF ( for_out .AND. use_output_servers() ) THEN
4073     CALL wrf_quilt_put_dom_td_real ( Hndl, Element, DateStr,  Data, &
4074                           locCount,  Status )
4075   ELSE
4076     Status = 0
4077 ENDIF
4078 ELSE
4079   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
4080 ENDIF
4081 RETURN
4082 END SUBROUTINE wrf_put_dom_td_real_sca 
4083 
4084 
4085 !--- get_dom_td_double
4086 
4087 SUBROUTINE wrf_get_dom_td_double_arr ( DataHandle,Element, DateStr,  Data, Count, Outcount, Status )
4088 !<DESCRIPTION>
4089 !<PRE>
4090 !
4091 ! Attempt to read Count words of time dependent
4092 ! domain metadata named "Element" valid at time DateStr 
4093 ! from the open dataset described by DataHandle.  
4094 ! Metadata of type double are
4095 ! stored in array Data.
4096 ! Actual number of words read is returned in OutCount.
4097 !
4098 !</PRE>
4099 !</DESCRIPTION>
4100 USE module_state_description
4101 IMPLICIT NONE
4102 INTEGER ,       INTENT(IN)  :: DataHandle
4103 CHARACTER*(*) , INTENT(IN)  :: Element
4104 CHARACTER*(*) , INTENT(IN)  :: DateStr
4105  
4106 
4107  real*8  :: Data (*)
4108 
4109 INTEGER ,       INTENT(IN)  :: Count
4110 INTEGER ,       INTENT(OUT)  :: OutCount
4111 INTEGER ,       INTENT(OUT) :: Status
4112 
4113 #include <wrf_status_codes.h>
4114 INTEGER                     :: len_of_str
4115 LOGICAL                     :: for_out
4116 INTEGER, EXTERNAL           :: use_package
4117 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
4118 INTEGER                     :: locCount
4119 
4120 INTEGER io_form , Hndl
4121 
4122 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_double_arr " )
4123 
4124 
4125 
4126 
4127 
4128 Status = 0
4129 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
4130 IF ( Hndl .GT. -1 ) THEN
4131   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
4132     SELECT CASE ( use_package( io_form ) )
4133 #ifdef NETCDF
4134       CASE ( IO_NETCDF   )
4135         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4136            CALL ext_ncd_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4137                                  locCount, Outcount, Status ) 
4138         ENDIF
4139         IF ( .NOT. multi_files(io_form) ) THEN
4140           
4141           
4142           
4143           
4144           
4145           
4146           
4147           
4148           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4149         ENDIF
4150 #endif
4151 #ifdef PNETCDF
4152       CASE ( IO_PNETCDF   )
4153         CALL ext_pnc_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4154                               locCount, Outcount, Status ) 
4155 #endif
4156 #ifdef PHDF5
4157       CASE ( IO_PHDF5   )
4158         CALL ext_phdf5_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4159                               locCount, Outcount, Status ) 
4160 #endif
4161 #ifdef ESMFIO
4162       CASE ( IO_ESMF )
4163         CALL ext_esmf_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4164                               locCount, Outcount, Status ) 
4165 #endif
4166 #ifdef XXX
4167       CASE ( IO_XXX   )
4168         CALL ext_xxx_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4169                               locCount, Outcount, Status ) 
4170 #endif
4171 #ifdef YYY
4172       CASE ( IO_YYY   )
4173         CALL ext_yyy_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4174                               locCount, Outcount, Status ) 
4175 #endif
4176 #ifdef GRIB1
4177       CASE ( IO_GRIB1   )
4178         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4179            CALL ext_gr1_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4180                                  locCount, Outcount, Status ) 
4181         ENDIF
4182         IF ( .NOT. multi_files(io_form) ) THEN
4183           
4184           
4185           
4186           
4187           
4188           
4189           
4190           
4191           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4192         ENDIF
4193 #endif
4194 #ifdef GRIB2
4195       CASE ( IO_GRIB2   )
4196         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4197            CALL ext_gr2_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4198                                  locCount, Outcount, Status ) 
4199         ENDIF
4200         IF ( .NOT. multi_files(io_form) ) THEN
4201           
4202           
4203           
4204           
4205           
4206           
4207           
4208           
4209           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4210         ENDIF
4211 #endif
4212 #ifdef INTIO
4213       CASE ( IO_INTIO   )
4214         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4215            CALL ext_int_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4216                                  locCount, Outcount, Status ) 
4217         ENDIF
4218         IF ( .NOT. multi_files(io_form) ) THEN
4219            
4220            
4221            
4222            
4223            
4224            
4225            
4226            
4227            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4228         ENDIF
4229 #endif
4230       CASE DEFAULT
4231     END SELECT
4232   ELSE IF ( for_out .AND. use_output_servers() ) THEN
4233     CALL wrf_quilt_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4234                           locCount, Outcount, Status )
4235   ELSE
4236     Status = 0
4237 ENDIF
4238 ELSE
4239   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
4240 ENDIF
4241 RETURN
4242 END SUBROUTINE wrf_get_dom_td_double_arr 
4243 !--- get_dom_td_double
4244 
4245 SUBROUTINE wrf_get_dom_td_double_sca ( DataHandle,Element, DateStr,  Data, Count, Outcount, Status )
4246 !<DESCRIPTION>
4247 !<PRE>
4248 !
4249 ! Attempt to read time dependent
4250 ! domain metadata named "Element" valid at time DateStr 
4251 ! from the open dataset described by DataHandle.  
4252 ! Metadata of type double are
4253 ! stored in scalar Data.
4254 ! 
4255 !
4256 !</PRE>
4257 !</DESCRIPTION>
4258 USE module_state_description
4259 IMPLICIT NONE
4260 INTEGER ,       INTENT(IN)  :: DataHandle
4261 CHARACTER*(*) , INTENT(IN)  :: Element
4262 CHARACTER*(*) , INTENT(IN)  :: DateStr
4263  
4264 
4265  real*8  :: Data 
4266 
4267 INTEGER ,       INTENT(IN)  :: Count
4268 INTEGER ,       INTENT(OUT)  :: OutCount
4269 INTEGER ,       INTENT(OUT) :: Status
4270 
4271 #include <wrf_status_codes.h>
4272 INTEGER                     :: len_of_str
4273 LOGICAL                     :: for_out
4274 INTEGER, EXTERNAL           :: use_package
4275 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
4276 INTEGER                     :: locCount
4277 
4278 INTEGER io_form , Hndl
4279 
4280 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_double_sca " )
4281 
4282 
4283 
4284 
4285 
4286 Status = 0
4287 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
4288 IF ( Hndl .GT. -1 ) THEN
4289   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
4290     SELECT CASE ( use_package( io_form ) )
4291 #ifdef NETCDF
4292       CASE ( IO_NETCDF   )
4293         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4294            CALL ext_ncd_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4295                                  locCount, Outcount, Status ) 
4296         ENDIF
4297         IF ( .NOT. multi_files(io_form) ) THEN
4298           
4299           
4300           
4301           
4302           
4303           
4304           
4305           
4306           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4307         ENDIF
4308 #endif
4309 #ifdef PNETCDF
4310       CASE ( IO_PNETCDF   )
4311         CALL ext_pnc_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4312                               locCount, Outcount, Status ) 
4313 #endif
4314 #ifdef PHDF5
4315       CASE ( IO_PHDF5   )
4316         CALL ext_phdf5_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4317                               locCount, Outcount, Status ) 
4318 #endif
4319 #ifdef ESMFIO
4320       CASE ( IO_ESMF )
4321         CALL ext_esmf_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4322                               locCount, Outcount, Status ) 
4323 #endif
4324 #ifdef XXX
4325       CASE ( IO_XXX   )
4326         CALL ext_xxx_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4327                               locCount, Outcount, Status ) 
4328 #endif
4329 #ifdef YYY
4330       CASE ( IO_YYY   )
4331         CALL ext_yyy_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4332                               locCount, Outcount, Status ) 
4333 #endif
4334 #ifdef GRIB1
4335       CASE ( IO_GRIB1   )
4336         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4337            CALL ext_gr1_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4338                                  locCount, Outcount, Status ) 
4339         ENDIF
4340         IF ( .NOT. multi_files(io_form) ) THEN
4341           
4342           
4343           
4344           
4345           
4346           
4347           
4348           
4349           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4350         ENDIF
4351 #endif
4352 #ifdef GRIB2
4353       CASE ( IO_GRIB2   )
4354         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4355            CALL ext_gr2_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4356                                  locCount, Outcount, Status ) 
4357         ENDIF
4358         IF ( .NOT. multi_files(io_form) ) THEN
4359           
4360           
4361           
4362           
4363           
4364           
4365           
4366           
4367           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4368         ENDIF
4369 #endif
4370 #ifdef INTIO
4371       CASE ( IO_INTIO   )
4372         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4373            CALL ext_int_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4374                                  locCount, Outcount, Status ) 
4375         ENDIF
4376         IF ( .NOT. multi_files(io_form) ) THEN
4377            
4378            
4379            
4380            
4381            
4382            
4383            
4384            
4385            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4386         ENDIF
4387 #endif
4388       CASE DEFAULT
4389     END SELECT
4390   ELSE IF ( for_out .AND. use_output_servers() ) THEN
4391     CALL wrf_quilt_get_dom_td_double ( Hndl, Element, DateStr,  Data, &
4392                           locCount, Outcount, Status )
4393   ELSE
4394     Status = 0
4395 ENDIF
4396 ELSE
4397   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
4398 ENDIF
4399 RETURN
4400 END SUBROUTINE wrf_get_dom_td_double_sca 
4401 
4402 
4403 !--- put_dom_td_double
4404 
4405 SUBROUTINE wrf_put_dom_td_double_arr ( DataHandle,Element, DateStr,  Data, Count,  Status )
4406 !<DESCRIPTION>
4407 !<PRE>
4408 !
4409 ! Write Count words of time dependent
4410 ! domain metadata named "Element" valid at time DateStr 
4411 ! to the open dataset described by DataHandle.  
4412 ! Metadata of type double are
4413 ! copied from array Data.
4414 ! 
4415 !
4416 !</PRE>
4417 !</DESCRIPTION>
4418 USE module_state_description
4419 IMPLICIT NONE
4420 INTEGER ,       INTENT(IN)  :: DataHandle
4421 CHARACTER*(*) , INTENT(IN)  :: Element
4422 CHARACTER*(*) , INTENT(IN)  :: DateStr
4423  
4424 
4425  real*8  :: Data (*)
4426 
4427 INTEGER ,       INTENT(IN)  :: Count
4428 
4429 INTEGER ,       INTENT(OUT) :: Status
4430 
4431 #include <wrf_status_codes.h>
4432 INTEGER                     :: len_of_str
4433 LOGICAL                     :: for_out
4434 INTEGER, EXTERNAL           :: use_package
4435 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
4436 INTEGER                     :: locCount
4437 
4438 INTEGER io_form , Hndl
4439 
4440 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_double_arr " )
4441 
4442 
4443 
4444 
4445 
4446 Status = 0
4447 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
4448 IF ( Hndl .GT. -1 ) THEN
4449   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
4450     SELECT CASE ( use_package( io_form ) )
4451 #ifdef NETCDF
4452       CASE ( IO_NETCDF   )
4453         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4454            CALL ext_ncd_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4455                                  locCount,  Status ) 
4456         ENDIF
4457         IF ( .NOT. multi_files(io_form) ) THEN
4458           
4459           
4460           
4461           
4462           
4463           
4464           
4465           
4466           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4467         ENDIF
4468 #endif
4469 #ifdef PNETCDF
4470       CASE ( IO_PNETCDF   )
4471         CALL ext_pnc_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4472                               locCount,  Status ) 
4473 #endif
4474 #ifdef PHDF5
4475       CASE ( IO_PHDF5   )
4476         CALL ext_phdf5_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4477                               locCount,  Status ) 
4478 #endif
4479 #ifdef ESMFIO
4480       CASE ( IO_ESMF )
4481         CALL ext_esmf_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4482                               locCount,  Status ) 
4483 #endif
4484 #ifdef XXX
4485       CASE ( IO_XXX   )
4486         CALL ext_xxx_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4487                               locCount,  Status ) 
4488 #endif
4489 #ifdef YYY
4490       CASE ( IO_YYY   )
4491         CALL ext_yyy_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4492                               locCount,  Status ) 
4493 #endif
4494 #ifdef GRIB1
4495       CASE ( IO_GRIB1   )
4496         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4497            CALL ext_gr1_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4498                                  locCount,  Status ) 
4499         ENDIF
4500         IF ( .NOT. multi_files(io_form) ) THEN
4501           
4502           
4503           
4504           
4505           
4506           
4507           
4508           
4509           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4510         ENDIF
4511 #endif
4512 #ifdef GRIB2
4513       CASE ( IO_GRIB2   )
4514         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4515            CALL ext_gr2_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4516                                  locCount,  Status ) 
4517         ENDIF
4518         IF ( .NOT. multi_files(io_form) ) THEN
4519           
4520           
4521           
4522           
4523           
4524           
4525           
4526           
4527           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4528         ENDIF
4529 #endif
4530 #ifdef INTIO
4531       CASE ( IO_INTIO   )
4532         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4533            CALL ext_int_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4534                                  locCount,  Status ) 
4535         ENDIF
4536         IF ( .NOT. multi_files(io_form) ) THEN
4537            
4538            
4539            
4540            
4541            
4542            
4543            
4544            
4545            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4546         ENDIF
4547 #endif
4548       CASE DEFAULT
4549     END SELECT
4550   ELSE IF ( for_out .AND. use_output_servers() ) THEN
4551     CALL wrf_quilt_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4552                           locCount,  Status )
4553   ELSE
4554     Status = 0
4555 ENDIF
4556 ELSE
4557   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
4558 ENDIF
4559 RETURN
4560 END SUBROUTINE wrf_put_dom_td_double_arr 
4561 !--- put_dom_td_double
4562 
4563 SUBROUTINE wrf_put_dom_td_double_sca ( DataHandle,Element, DateStr,  Data, Count,  Status )
4564 !<DESCRIPTION>
4565 !<PRE>
4566 !
4567 ! Write time dependent
4568 ! domain metadata named "Element" valid at time DateStr 
4569 ! to the open dataset described by DataHandle.  
4570 ! Metadata of type double are
4571 ! copied from scalar Data.
4572 ! 
4573 !
4574 !</PRE>
4575 !</DESCRIPTION>
4576 USE module_state_description
4577 IMPLICIT NONE
4578 INTEGER ,       INTENT(IN)  :: DataHandle
4579 CHARACTER*(*) , INTENT(IN)  :: Element
4580 CHARACTER*(*) , INTENT(IN)  :: DateStr
4581  
4582 
4583  real*8  :: Data 
4584 
4585 INTEGER ,       INTENT(IN)  :: Count
4586 
4587 INTEGER ,       INTENT(OUT) :: Status
4588 
4589 #include <wrf_status_codes.h>
4590 INTEGER                     :: len_of_str
4591 LOGICAL                     :: for_out
4592 INTEGER, EXTERNAL           :: use_package
4593 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
4594 INTEGER                     :: locCount
4595 
4596 INTEGER io_form , Hndl
4597 
4598 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_double_sca " )
4599 
4600 
4601 
4602 
4603 
4604 Status = 0
4605 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
4606 IF ( Hndl .GT. -1 ) THEN
4607   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
4608     SELECT CASE ( use_package( io_form ) )
4609 #ifdef NETCDF
4610       CASE ( IO_NETCDF   )
4611         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4612            CALL ext_ncd_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4613                                  locCount,  Status ) 
4614         ENDIF
4615         IF ( .NOT. multi_files(io_form) ) THEN
4616           
4617           
4618           
4619           
4620           
4621           
4622           
4623           
4624           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4625         ENDIF
4626 #endif
4627 #ifdef PNETCDF
4628       CASE ( IO_PNETCDF   )
4629         CALL ext_pnc_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4630                               locCount,  Status ) 
4631 #endif
4632 #ifdef PHDF5
4633       CASE ( IO_PHDF5   )
4634         CALL ext_phdf5_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4635                               locCount,  Status ) 
4636 #endif
4637 #ifdef ESMFIO
4638       CASE ( IO_ESMF )
4639         CALL ext_esmf_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4640                               locCount,  Status ) 
4641 #endif
4642 #ifdef XXX
4643       CASE ( IO_XXX   )
4644         CALL ext_xxx_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4645                               locCount,  Status ) 
4646 #endif
4647 #ifdef YYY
4648       CASE ( IO_YYY   )
4649         CALL ext_yyy_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4650                               locCount,  Status ) 
4651 #endif
4652 #ifdef GRIB1
4653       CASE ( IO_GRIB1   )
4654         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4655            CALL ext_gr1_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4656                                  locCount,  Status ) 
4657         ENDIF
4658         IF ( .NOT. multi_files(io_form) ) THEN
4659           
4660           
4661           
4662           
4663           
4664           
4665           
4666           
4667           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4668         ENDIF
4669 #endif
4670 #ifdef GRIB2
4671       CASE ( IO_GRIB2   )
4672         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4673            CALL ext_gr2_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4674                                  locCount,  Status ) 
4675         ENDIF
4676         IF ( .NOT. multi_files(io_form) ) THEN
4677           
4678           
4679           
4680           
4681           
4682           
4683           
4684           
4685           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4686         ENDIF
4687 #endif
4688 #ifdef INTIO
4689       CASE ( IO_INTIO   )
4690         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4691            CALL ext_int_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4692                                  locCount,  Status ) 
4693         ENDIF
4694         IF ( .NOT. multi_files(io_form) ) THEN
4695            
4696            
4697            
4698            
4699            
4700            
4701            
4702            
4703            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4704         ENDIF
4705 #endif
4706       CASE DEFAULT
4707     END SELECT
4708   ELSE IF ( for_out .AND. use_output_servers() ) THEN
4709     CALL wrf_quilt_put_dom_td_double ( Hndl, Element, DateStr,  Data, &
4710                           locCount,  Status )
4711   ELSE
4712     Status = 0
4713 ENDIF
4714 ELSE
4715   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
4716 ENDIF
4717 RETURN
4718 END SUBROUTINE wrf_put_dom_td_double_sca 
4719 
4720 
4721 !--- get_dom_td_integer
4722 
4723 SUBROUTINE wrf_get_dom_td_integer_arr ( DataHandle,Element, DateStr,  Data, Count, Outcount, Status )
4724 !<DESCRIPTION>
4725 !<PRE>
4726 !
4727 ! Attempt to read Count words of time dependent
4728 ! domain metadata named "Element" valid at time DateStr 
4729 ! from the open dataset described by DataHandle.  
4730 ! Metadata of type integer are
4731 ! stored in array Data.
4732 ! Actual number of words read is returned in OutCount.
4733 !
4734 !</PRE>
4735 !</DESCRIPTION>
4736 USE module_state_description
4737 IMPLICIT NONE
4738 INTEGER ,       INTENT(IN)  :: DataHandle
4739 CHARACTER*(*) , INTENT(IN)  :: Element
4740 CHARACTER*(*) , INTENT(IN)  :: DateStr
4741  
4742 
4743  integer  :: Data (*)
4744 
4745 INTEGER ,       INTENT(IN)  :: Count
4746 INTEGER ,       INTENT(OUT)  :: OutCount
4747 INTEGER ,       INTENT(OUT) :: Status
4748 
4749 #include <wrf_status_codes.h>
4750 INTEGER                     :: len_of_str
4751 LOGICAL                     :: for_out
4752 INTEGER, EXTERNAL           :: use_package
4753 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
4754 INTEGER                     :: locCount
4755 
4756 INTEGER io_form , Hndl
4757 
4758 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_integer_arr " )
4759 
4760 locCount = Count
4761 
4762 
4763 
4764 Status = 0
4765 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
4766 IF ( Hndl .GT. -1 ) THEN
4767   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
4768     SELECT CASE ( use_package( io_form ) )
4769 #ifdef NETCDF
4770       CASE ( IO_NETCDF   )
4771         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4772            CALL ext_ncd_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4773                                  locCount, Outcount, Status ) 
4774         ENDIF
4775         IF ( .NOT. multi_files(io_form) ) THEN
4776           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
4777           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
4778           
4779           
4780           
4781           
4782           
4783           
4784           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4785         ENDIF
4786 #endif
4787 #ifdef PNETCDF
4788       CASE ( IO_PNETCDF   )
4789         CALL ext_pnc_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4790                               locCount, Outcount, Status ) 
4791 #endif
4792 #ifdef PHDF5
4793       CASE ( IO_PHDF5   )
4794         CALL ext_phdf5_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4795                               locCount, Outcount, Status ) 
4796 #endif
4797 #ifdef ESMFIO
4798       CASE ( IO_ESMF )
4799         CALL ext_esmf_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4800                               locCount, Outcount, Status ) 
4801 #endif
4802 #ifdef XXX
4803       CASE ( IO_XXX   )
4804         CALL ext_xxx_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4805                               locCount, Outcount, Status ) 
4806 #endif
4807 #ifdef YYY
4808       CASE ( IO_YYY   )
4809         CALL ext_yyy_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4810                               locCount, Outcount, Status ) 
4811 #endif
4812 #ifdef GRIB1
4813       CASE ( IO_GRIB1   )
4814         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4815            CALL ext_gr1_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4816                                  locCount, Outcount, Status ) 
4817         ENDIF
4818         IF ( .NOT. multi_files(io_form) ) THEN
4819           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
4820           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
4821           
4822           
4823           
4824           
4825           
4826           
4827           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4828         ENDIF
4829 #endif
4830 #ifdef GRIB2
4831       CASE ( IO_GRIB2   )
4832         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4833            CALL ext_gr2_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4834                                  locCount, Outcount, Status ) 
4835         ENDIF
4836         IF ( .NOT. multi_files(io_form) ) THEN
4837           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
4838           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
4839           
4840           
4841           
4842           
4843           
4844           
4845           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4846         ENDIF
4847 #endif
4848 #ifdef INTIO
4849       CASE ( IO_INTIO   )
4850         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4851            CALL ext_int_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4852                                  locCount, Outcount, Status ) 
4853         ENDIF
4854         IF ( .NOT. multi_files(io_form) ) THEN
4855            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
4856            CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
4857            
4858            
4859            
4860            
4861            
4862            
4863            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4864         ENDIF
4865 #endif
4866       CASE DEFAULT
4867     END SELECT
4868   ELSE IF ( for_out .AND. use_output_servers() ) THEN
4869     CALL wrf_quilt_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4870                           locCount, Outcount, Status )
4871   ELSE
4872     Status = 0
4873 ENDIF
4874 ELSE
4875   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
4876 ENDIF
4877 RETURN
4878 END SUBROUTINE wrf_get_dom_td_integer_arr 
4879 !--- get_dom_td_integer
4880 
4881 SUBROUTINE wrf_get_dom_td_integer_sca ( DataHandle,Element, DateStr,  Data, Count, Outcount, Status )
4882 !<DESCRIPTION>
4883 !<PRE>
4884 !
4885 ! Attempt to read time dependent
4886 ! domain metadata named "Element" valid at time DateStr 
4887 ! from the open dataset described by DataHandle.  
4888 ! Metadata of type integer are
4889 ! stored in scalar Data.
4890 ! 
4891 !
4892 !</PRE>
4893 !</DESCRIPTION>
4894 USE module_state_description
4895 IMPLICIT NONE
4896 INTEGER ,       INTENT(IN)  :: DataHandle
4897 CHARACTER*(*) , INTENT(IN)  :: Element
4898 CHARACTER*(*) , INTENT(IN)  :: DateStr
4899  
4900 
4901  integer  :: Data 
4902 
4903 INTEGER ,       INTENT(IN)  :: Count
4904 INTEGER ,       INTENT(OUT)  :: OutCount
4905 INTEGER ,       INTENT(OUT) :: Status
4906 
4907 #include <wrf_status_codes.h>
4908 INTEGER                     :: len_of_str
4909 LOGICAL                     :: for_out
4910 INTEGER, EXTERNAL           :: use_package
4911 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
4912 INTEGER                     :: locCount
4913 
4914 INTEGER io_form , Hndl
4915 
4916 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_integer_sca " )
4917 
4918 locCount = Count
4919 
4920 
4921 
4922 Status = 0
4923 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
4924 IF ( Hndl .GT. -1 ) THEN
4925   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
4926     SELECT CASE ( use_package( io_form ) )
4927 #ifdef NETCDF
4928       CASE ( IO_NETCDF   )
4929         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4930            CALL ext_ncd_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4931                                  locCount, Outcount, Status ) 
4932         ENDIF
4933         IF ( .NOT. multi_files(io_form) ) THEN
4934           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
4935           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
4936           
4937           
4938           
4939           
4940           
4941           
4942           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4943         ENDIF
4944 #endif
4945 #ifdef PNETCDF
4946       CASE ( IO_PNETCDF   )
4947         CALL ext_pnc_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4948                               locCount, Outcount, Status ) 
4949 #endif
4950 #ifdef PHDF5
4951       CASE ( IO_PHDF5   )
4952         CALL ext_phdf5_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4953                               locCount, Outcount, Status ) 
4954 #endif
4955 #ifdef ESMFIO
4956       CASE ( IO_ESMF )
4957         CALL ext_esmf_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4958                               locCount, Outcount, Status ) 
4959 #endif
4960 #ifdef XXX
4961       CASE ( IO_XXX   )
4962         CALL ext_xxx_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4963                               locCount, Outcount, Status ) 
4964 #endif
4965 #ifdef YYY
4966       CASE ( IO_YYY   )
4967         CALL ext_yyy_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4968                               locCount, Outcount, Status ) 
4969 #endif
4970 #ifdef GRIB1
4971       CASE ( IO_GRIB1   )
4972         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4973            CALL ext_gr1_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4974                                  locCount, Outcount, Status ) 
4975         ENDIF
4976         IF ( .NOT. multi_files(io_form) ) THEN
4977           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
4978           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
4979           
4980           
4981           
4982           
4983           
4984           
4985           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
4986         ENDIF
4987 #endif
4988 #ifdef GRIB2
4989       CASE ( IO_GRIB2   )
4990         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
4991            CALL ext_gr2_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
4992                                  locCount, Outcount, Status ) 
4993         ENDIF
4994         IF ( .NOT. multi_files(io_form) ) THEN
4995           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
4996           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
4997           
4998           
4999           
5000           
5001           
5002           
5003           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5004         ENDIF
5005 #endif
5006 #ifdef INTIO
5007       CASE ( IO_INTIO   )
5008         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5009            CALL ext_int_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5010                                  locCount, Outcount, Status ) 
5011         ENDIF
5012         IF ( .NOT. multi_files(io_form) ) THEN
5013            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5014            CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
5015            
5016            
5017            
5018            
5019            
5020            
5021            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5022         ENDIF
5023 #endif
5024       CASE DEFAULT
5025     END SELECT
5026   ELSE IF ( for_out .AND. use_output_servers() ) THEN
5027     CALL wrf_quilt_get_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5028                           locCount, Outcount, Status )
5029   ELSE
5030     Status = 0
5031 ENDIF
5032 ELSE
5033   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
5034 ENDIF
5035 RETURN
5036 END SUBROUTINE wrf_get_dom_td_integer_sca 
5037 
5038 
5039 !--- put_dom_td_integer
5040 
5041 SUBROUTINE wrf_put_dom_td_integer_arr ( DataHandle,Element, DateStr,  Data, Count,  Status )
5042 !<DESCRIPTION>
5043 !<PRE>
5044 !
5045 ! Write Count words of time dependent
5046 ! domain metadata named "Element" valid at time DateStr 
5047 ! to the open dataset described by DataHandle.  
5048 ! Metadata of type integer are
5049 ! copied from array Data.
5050 ! 
5051 !
5052 !</PRE>
5053 !</DESCRIPTION>
5054 USE module_state_description
5055 IMPLICIT NONE
5056 INTEGER ,       INTENT(IN)  :: DataHandle
5057 CHARACTER*(*) , INTENT(IN)  :: Element
5058 CHARACTER*(*) , INTENT(IN)  :: DateStr
5059  
5060 
5061  integer  :: Data (*)
5062 
5063 INTEGER ,       INTENT(IN)  :: Count
5064 
5065 INTEGER ,       INTENT(OUT) :: Status
5066 
5067 #include <wrf_status_codes.h>
5068 INTEGER                     :: len_of_str
5069 LOGICAL                     :: for_out
5070 INTEGER, EXTERNAL           :: use_package
5071 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
5072 INTEGER                     :: locCount
5073 
5074 INTEGER io_form , Hndl
5075 
5076 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_integer_arr " )
5077 
5078 locCount = Count
5079 
5080 
5081 
5082 Status = 0
5083 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
5084 IF ( Hndl .GT. -1 ) THEN
5085   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
5086     SELECT CASE ( use_package( io_form ) )
5087 #ifdef NETCDF
5088       CASE ( IO_NETCDF   )
5089         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5090            CALL ext_ncd_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5091                                  locCount,  Status ) 
5092         ENDIF
5093         IF ( .NOT. multi_files(io_form) ) THEN
5094           
5095           
5096           
5097           
5098           
5099           
5100           
5101           
5102           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5103         ENDIF
5104 #endif
5105 #ifdef PNETCDF
5106       CASE ( IO_PNETCDF   )
5107         CALL ext_pnc_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5108                               locCount,  Status ) 
5109 #endif
5110 #ifdef PHDF5
5111       CASE ( IO_PHDF5   )
5112         CALL ext_phdf5_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5113                               locCount,  Status ) 
5114 #endif
5115 #ifdef ESMFIO
5116       CASE ( IO_ESMF )
5117         CALL ext_esmf_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5118                               locCount,  Status ) 
5119 #endif
5120 #ifdef XXX
5121       CASE ( IO_XXX   )
5122         CALL ext_xxx_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5123                               locCount,  Status ) 
5124 #endif
5125 #ifdef YYY
5126       CASE ( IO_YYY   )
5127         CALL ext_yyy_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5128                               locCount,  Status ) 
5129 #endif
5130 #ifdef GRIB1
5131       CASE ( IO_GRIB1   )
5132         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5133            CALL ext_gr1_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5134                                  locCount,  Status ) 
5135         ENDIF
5136         IF ( .NOT. multi_files(io_form) ) THEN
5137           
5138           
5139           
5140           
5141           
5142           
5143           
5144           
5145           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5146         ENDIF
5147 #endif
5148 #ifdef GRIB2
5149       CASE ( IO_GRIB2   )
5150         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5151            CALL ext_gr2_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5152                                  locCount,  Status ) 
5153         ENDIF
5154         IF ( .NOT. multi_files(io_form) ) THEN
5155           
5156           
5157           
5158           
5159           
5160           
5161           
5162           
5163           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5164         ENDIF
5165 #endif
5166 #ifdef INTIO
5167       CASE ( IO_INTIO   )
5168         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5169            CALL ext_int_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5170                                  locCount,  Status ) 
5171         ENDIF
5172         IF ( .NOT. multi_files(io_form) ) THEN
5173            
5174            
5175            
5176            
5177            
5178            
5179            
5180            
5181            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5182         ENDIF
5183 #endif
5184       CASE DEFAULT
5185     END SELECT
5186   ELSE IF ( for_out .AND. use_output_servers() ) THEN
5187     CALL wrf_quilt_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5188                           locCount,  Status )
5189   ELSE
5190     Status = 0
5191 ENDIF
5192 ELSE
5193   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
5194 ENDIF
5195 RETURN
5196 END SUBROUTINE wrf_put_dom_td_integer_arr 
5197 !--- put_dom_td_integer
5198 
5199 SUBROUTINE wrf_put_dom_td_integer_sca ( DataHandle,Element, DateStr,  Data, Count,  Status )
5200 !<DESCRIPTION>
5201 !<PRE>
5202 !
5203 ! Write time dependent
5204 ! domain metadata named "Element" valid at time DateStr 
5205 ! to the open dataset described by DataHandle.  
5206 ! Metadata of type integer are
5207 ! copied from scalar Data.
5208 ! 
5209 !
5210 !</PRE>
5211 !</DESCRIPTION>
5212 USE module_state_description
5213 IMPLICIT NONE
5214 INTEGER ,       INTENT(IN)  :: DataHandle
5215 CHARACTER*(*) , INTENT(IN)  :: Element
5216 CHARACTER*(*) , INTENT(IN)  :: DateStr
5217  
5218 
5219  integer  :: Data 
5220 
5221 INTEGER ,       INTENT(IN)  :: Count
5222 
5223 INTEGER ,       INTENT(OUT) :: Status
5224 
5225 #include <wrf_status_codes.h>
5226 INTEGER                     :: len_of_str
5227 LOGICAL                     :: for_out
5228 INTEGER, EXTERNAL           :: use_package
5229 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
5230 INTEGER                     :: locCount
5231 
5232 INTEGER io_form , Hndl
5233 
5234 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_integer_sca " )
5235 
5236 locCount = Count
5237 
5238 
5239 
5240 Status = 0
5241 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
5242 IF ( Hndl .GT. -1 ) THEN
5243   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
5244     SELECT CASE ( use_package( io_form ) )
5245 #ifdef NETCDF
5246       CASE ( IO_NETCDF   )
5247         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5248            CALL ext_ncd_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5249                                  locCount,  Status ) 
5250         ENDIF
5251         IF ( .NOT. multi_files(io_form) ) THEN
5252           
5253           
5254           
5255           
5256           
5257           
5258           
5259           
5260           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5261         ENDIF
5262 #endif
5263 #ifdef PNETCDF
5264       CASE ( IO_PNETCDF   )
5265         CALL ext_pnc_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5266                               locCount,  Status ) 
5267 #endif
5268 #ifdef PHDF5
5269       CASE ( IO_PHDF5   )
5270         CALL ext_phdf5_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5271                               locCount,  Status ) 
5272 #endif
5273 #ifdef ESMFIO
5274       CASE ( IO_ESMF )
5275         CALL ext_esmf_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5276                               locCount,  Status ) 
5277 #endif
5278 #ifdef XXX
5279       CASE ( IO_XXX   )
5280         CALL ext_xxx_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5281                               locCount,  Status ) 
5282 #endif
5283 #ifdef YYY
5284       CASE ( IO_YYY   )
5285         CALL ext_yyy_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5286                               locCount,  Status ) 
5287 #endif
5288 #ifdef GRIB1
5289       CASE ( IO_GRIB1   )
5290         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5291            CALL ext_gr1_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5292                                  locCount,  Status ) 
5293         ENDIF
5294         IF ( .NOT. multi_files(io_form) ) THEN
5295           
5296           
5297           
5298           
5299           
5300           
5301           
5302           
5303           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5304         ENDIF
5305 #endif
5306 #ifdef GRIB2
5307       CASE ( IO_GRIB2   )
5308         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5309            CALL ext_gr2_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5310                                  locCount,  Status ) 
5311         ENDIF
5312         IF ( .NOT. multi_files(io_form) ) THEN
5313           
5314           
5315           
5316           
5317           
5318           
5319           
5320           
5321           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5322         ENDIF
5323 #endif
5324 #ifdef INTIO
5325       CASE ( IO_INTIO   )
5326         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5327            CALL ext_int_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5328                                  locCount,  Status ) 
5329         ENDIF
5330         IF ( .NOT. multi_files(io_form) ) THEN
5331            
5332            
5333            
5334            
5335            
5336            
5337            
5338            
5339            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5340         ENDIF
5341 #endif
5342       CASE DEFAULT
5343     END SELECT
5344   ELSE IF ( for_out .AND. use_output_servers() ) THEN
5345     CALL wrf_quilt_put_dom_td_integer ( Hndl, Element, DateStr,  Data, &
5346                           locCount,  Status )
5347   ELSE
5348     Status = 0
5349 ENDIF
5350 ELSE
5351   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
5352 ENDIF
5353 RETURN
5354 END SUBROUTINE wrf_put_dom_td_integer_sca 
5355 
5356 
5357 !--- get_dom_td_logical
5358 
5359 SUBROUTINE wrf_get_dom_td_logical_arr ( DataHandle,Element, DateStr,  Data, Count, Outcount, Status )
5360 !<DESCRIPTION>
5361 !<PRE>
5362 !
5363 ! Attempt to read Count words of time dependent
5364 ! domain metadata named "Element" valid at time DateStr 
5365 ! from the open dataset described by DataHandle.  
5366 ! Metadata of type logical are
5367 ! stored in array Data.
5368 ! Actual number of words read is returned in OutCount.
5369 !
5370 !</PRE>
5371 !</DESCRIPTION>
5372 USE module_state_description
5373 IMPLICIT NONE
5374 INTEGER ,       INTENT(IN)  :: DataHandle
5375 CHARACTER*(*) , INTENT(IN)  :: Element
5376 CHARACTER*(*) , INTENT(IN)  :: DateStr
5377  
5378 
5379  logical  :: Data (*)
5380 
5381 INTEGER ,       INTENT(IN)  :: Count
5382 INTEGER ,       INTENT(OUT)  :: OutCount
5383 INTEGER ,       INTENT(OUT) :: Status
5384 
5385 #include <wrf_status_codes.h>
5386 INTEGER                     :: len_of_str
5387 LOGICAL                     :: for_out
5388 INTEGER, EXTERNAL           :: use_package
5389 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
5390 INTEGER                     :: locCount
5391 
5392 INTEGER io_form , Hndl
5393 
5394 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_logical_arr " )
5395 
5396 
5397 
5398 locCount = Count
5399 
5400 Status = 0
5401 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
5402 IF ( Hndl .GT. -1 ) THEN
5403   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
5404     SELECT CASE ( use_package( io_form ) )
5405 #ifdef NETCDF
5406       CASE ( IO_NETCDF   )
5407         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5408            CALL ext_ncd_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5409                                  locCount, Outcount, Status ) 
5410         ENDIF
5411         IF ( .NOT. multi_files(io_form) ) THEN
5412           
5413           
5414           
5415           
5416           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5417           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
5418           
5419           
5420           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5421         ENDIF
5422 #endif
5423 #ifdef PNETCDF
5424       CASE ( IO_PNETCDF   )
5425         CALL ext_pnc_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5426                               locCount, Outcount, Status ) 
5427 #endif
5428 #ifdef PHDF5
5429       CASE ( IO_PHDF5   )
5430         CALL ext_phdf5_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5431                               locCount, Outcount, Status ) 
5432 #endif
5433 #ifdef ESMFIO
5434       CASE ( IO_ESMF )
5435         CALL ext_esmf_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5436                               locCount, Outcount, Status ) 
5437 #endif
5438 #ifdef XXX
5439       CASE ( IO_XXX   )
5440         CALL ext_xxx_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5441                               locCount, Outcount, Status ) 
5442 #endif
5443 #ifdef YYY
5444       CASE ( IO_YYY   )
5445         CALL ext_yyy_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5446                               locCount, Outcount, Status ) 
5447 #endif
5448 #ifdef GRIB1
5449       CASE ( IO_GRIB1   )
5450         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5451            CALL ext_gr1_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5452                                  locCount, Outcount, Status ) 
5453         ENDIF
5454         IF ( .NOT. multi_files(io_form) ) THEN
5455           
5456           
5457           
5458           
5459           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5460           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
5461           
5462           
5463           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5464         ENDIF
5465 #endif
5466 #ifdef GRIB2
5467       CASE ( IO_GRIB2   )
5468         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5469            CALL ext_gr2_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5470                                  locCount, Outcount, Status ) 
5471         ENDIF
5472         IF ( .NOT. multi_files(io_form) ) THEN
5473           
5474           
5475           
5476           
5477           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5478           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
5479           
5480           
5481           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5482         ENDIF
5483 #endif
5484 #ifdef INTIO
5485       CASE ( IO_INTIO   )
5486         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5487            CALL ext_int_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5488                                  locCount, Outcount, Status ) 
5489         ENDIF
5490         IF ( .NOT. multi_files(io_form) ) THEN
5491            
5492            
5493            
5494            
5495            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5496            CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
5497            
5498            
5499            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5500         ENDIF
5501 #endif
5502       CASE DEFAULT
5503     END SELECT
5504   ELSE IF ( for_out .AND. use_output_servers() ) THEN
5505     CALL wrf_quilt_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5506                           locCount, Outcount, Status )
5507   ELSE
5508     Status = 0
5509 ENDIF
5510 ELSE
5511   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
5512 ENDIF
5513 RETURN
5514 END SUBROUTINE wrf_get_dom_td_logical_arr 
5515 !--- get_dom_td_logical
5516 
5517 SUBROUTINE wrf_get_dom_td_logical_sca ( DataHandle,Element, DateStr,  Data, Count, Outcount, Status )
5518 !<DESCRIPTION>
5519 !<PRE>
5520 !
5521 ! Attempt to read time dependent
5522 ! domain metadata named "Element" valid at time DateStr 
5523 ! from the open dataset described by DataHandle.  
5524 ! Metadata of type logical are
5525 ! stored in scalar Data.
5526 ! 
5527 !
5528 !</PRE>
5529 !</DESCRIPTION>
5530 USE module_state_description
5531 IMPLICIT NONE
5532 INTEGER ,       INTENT(IN)  :: DataHandle
5533 CHARACTER*(*) , INTENT(IN)  :: Element
5534 CHARACTER*(*) , INTENT(IN)  :: DateStr
5535  
5536 
5537  logical  :: Data 
5538 
5539 INTEGER ,       INTENT(IN)  :: Count
5540 INTEGER ,       INTENT(OUT)  :: OutCount
5541 INTEGER ,       INTENT(OUT) :: Status
5542 
5543 #include <wrf_status_codes.h>
5544 INTEGER                     :: len_of_str
5545 LOGICAL                     :: for_out
5546 INTEGER, EXTERNAL           :: use_package
5547 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
5548 INTEGER                     :: locCount
5549 
5550 INTEGER io_form , Hndl
5551 
5552 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_logical_sca " )
5553 
5554 
5555 
5556 locCount = Count
5557 
5558 Status = 0
5559 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
5560 IF ( Hndl .GT. -1 ) THEN
5561   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
5562     SELECT CASE ( use_package( io_form ) )
5563 #ifdef NETCDF
5564       CASE ( IO_NETCDF   )
5565         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5566            CALL ext_ncd_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5567                                  locCount, Outcount, Status ) 
5568         ENDIF
5569         IF ( .NOT. multi_files(io_form) ) THEN
5570           
5571           
5572           
5573           
5574           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5575           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
5576           
5577           
5578           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5579         ENDIF
5580 #endif
5581 #ifdef PNETCDF
5582       CASE ( IO_PNETCDF   )
5583         CALL ext_pnc_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5584                               locCount, Outcount, Status ) 
5585 #endif
5586 #ifdef PHDF5
5587       CASE ( IO_PHDF5   )
5588         CALL ext_phdf5_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5589                               locCount, Outcount, Status ) 
5590 #endif
5591 #ifdef ESMFIO
5592       CASE ( IO_ESMF )
5593         CALL ext_esmf_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5594                               locCount, Outcount, Status ) 
5595 #endif
5596 #ifdef XXX
5597       CASE ( IO_XXX   )
5598         CALL ext_xxx_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5599                               locCount, Outcount, Status ) 
5600 #endif
5601 #ifdef YYY
5602       CASE ( IO_YYY   )
5603         CALL ext_yyy_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5604                               locCount, Outcount, Status ) 
5605 #endif
5606 #ifdef GRIB1
5607       CASE ( IO_GRIB1   )
5608         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5609            CALL ext_gr1_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5610                                  locCount, Outcount, Status ) 
5611         ENDIF
5612         IF ( .NOT. multi_files(io_form) ) THEN
5613           
5614           
5615           
5616           
5617           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5618           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
5619           
5620           
5621           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5622         ENDIF
5623 #endif
5624 #ifdef GRIB2
5625       CASE ( IO_GRIB2   )
5626         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5627            CALL ext_gr2_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5628                                  locCount, Outcount, Status ) 
5629         ENDIF
5630         IF ( .NOT. multi_files(io_form) ) THEN
5631           
5632           
5633           
5634           
5635           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5636           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
5637           
5638           
5639           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5640         ENDIF
5641 #endif
5642 #ifdef INTIO
5643       CASE ( IO_INTIO   )
5644         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5645            CALL ext_int_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5646                                  locCount, Outcount, Status ) 
5647         ENDIF
5648         IF ( .NOT. multi_files(io_form) ) THEN
5649            
5650            
5651            
5652            
5653            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
5654            CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
5655            
5656            
5657            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5658         ENDIF
5659 #endif
5660       CASE DEFAULT
5661     END SELECT
5662   ELSE IF ( for_out .AND. use_output_servers() ) THEN
5663     CALL wrf_quilt_get_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5664                           locCount, Outcount, Status )
5665   ELSE
5666     Status = 0
5667 ENDIF
5668 ELSE
5669   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
5670 ENDIF
5671 RETURN
5672 END SUBROUTINE wrf_get_dom_td_logical_sca 
5673 
5674 
5675 !--- put_dom_td_logical
5676 
5677 SUBROUTINE wrf_put_dom_td_logical_arr ( DataHandle,Element, DateStr,  Data, Count,  Status )
5678 !<DESCRIPTION>
5679 !<PRE>
5680 !
5681 ! Write Count words of time dependent
5682 ! domain metadata named "Element" valid at time DateStr 
5683 ! to the open dataset described by DataHandle.  
5684 ! Metadata of type logical are
5685 ! copied from array Data.
5686 ! 
5687 !
5688 !</PRE>
5689 !</DESCRIPTION>
5690 USE module_state_description
5691 IMPLICIT NONE
5692 INTEGER ,       INTENT(IN)  :: DataHandle
5693 CHARACTER*(*) , INTENT(IN)  :: Element
5694 CHARACTER*(*) , INTENT(IN)  :: DateStr
5695  
5696 
5697  logical  :: Data (*)
5698 
5699 INTEGER ,       INTENT(IN)  :: Count
5700 
5701 INTEGER ,       INTENT(OUT) :: Status
5702 
5703 #include <wrf_status_codes.h>
5704 INTEGER                     :: len_of_str
5705 LOGICAL                     :: for_out
5706 INTEGER, EXTERNAL           :: use_package
5707 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
5708 INTEGER                     :: locCount
5709 
5710 INTEGER io_form , Hndl
5711 
5712 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_logical_arr " )
5713 
5714 
5715 
5716 locCount = Count
5717 
5718 Status = 0
5719 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
5720 IF ( Hndl .GT. -1 ) THEN
5721   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
5722     SELECT CASE ( use_package( io_form ) )
5723 #ifdef NETCDF
5724       CASE ( IO_NETCDF   )
5725         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5726            CALL ext_ncd_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5727                                  locCount,  Status ) 
5728         ENDIF
5729         IF ( .NOT. multi_files(io_form) ) THEN
5730           
5731           
5732           
5733           
5734           
5735           
5736           
5737           
5738           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5739         ENDIF
5740 #endif
5741 #ifdef PNETCDF
5742       CASE ( IO_PNETCDF   )
5743         CALL ext_pnc_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5744                               locCount,  Status ) 
5745 #endif
5746 #ifdef PHDF5
5747       CASE ( IO_PHDF5   )
5748         CALL ext_phdf5_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5749                               locCount,  Status ) 
5750 #endif
5751 #ifdef ESMFIO
5752       CASE ( IO_ESMF )
5753         CALL ext_esmf_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5754                               locCount,  Status ) 
5755 #endif
5756 #ifdef XXX
5757       CASE ( IO_XXX   )
5758         CALL ext_xxx_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5759                               locCount,  Status ) 
5760 #endif
5761 #ifdef YYY
5762       CASE ( IO_YYY   )
5763         CALL ext_yyy_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5764                               locCount,  Status ) 
5765 #endif
5766 #ifdef GRIB1
5767       CASE ( IO_GRIB1   )
5768         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5769            CALL ext_gr1_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5770                                  locCount,  Status ) 
5771         ENDIF
5772         IF ( .NOT. multi_files(io_form) ) THEN
5773           
5774           
5775           
5776           
5777           
5778           
5779           
5780           
5781           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5782         ENDIF
5783 #endif
5784 #ifdef GRIB2
5785       CASE ( IO_GRIB2   )
5786         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5787            CALL ext_gr2_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5788                                  locCount,  Status ) 
5789         ENDIF
5790         IF ( .NOT. multi_files(io_form) ) THEN
5791           
5792           
5793           
5794           
5795           
5796           
5797           
5798           
5799           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5800         ENDIF
5801 #endif
5802 #ifdef INTIO
5803       CASE ( IO_INTIO   )
5804         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5805            CALL ext_int_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5806                                  locCount,  Status ) 
5807         ENDIF
5808         IF ( .NOT. multi_files(io_form) ) THEN
5809            
5810            
5811            
5812            
5813            
5814            
5815            
5816            
5817            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5818         ENDIF
5819 #endif
5820       CASE DEFAULT
5821     END SELECT
5822   ELSE IF ( for_out .AND. use_output_servers() ) THEN
5823     CALL wrf_quilt_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5824                           locCount,  Status )
5825   ELSE
5826     Status = 0
5827 ENDIF
5828 ELSE
5829   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
5830 ENDIF
5831 RETURN
5832 END SUBROUTINE wrf_put_dom_td_logical_arr 
5833 !--- put_dom_td_logical
5834 
5835 SUBROUTINE wrf_put_dom_td_logical_sca ( DataHandle,Element, DateStr,  Data, Count,  Status )
5836 !<DESCRIPTION>
5837 !<PRE>
5838 !
5839 ! Write time dependent
5840 ! domain metadata named "Element" valid at time DateStr 
5841 ! to the open dataset described by DataHandle.  
5842 ! Metadata of type logical are
5843 ! copied from scalar Data.
5844 ! 
5845 !
5846 !</PRE>
5847 !</DESCRIPTION>
5848 USE module_state_description
5849 IMPLICIT NONE
5850 INTEGER ,       INTENT(IN)  :: DataHandle
5851 CHARACTER*(*) , INTENT(IN)  :: Element
5852 CHARACTER*(*) , INTENT(IN)  :: DateStr
5853  
5854 
5855  logical  :: Data 
5856 
5857 INTEGER ,       INTENT(IN)  :: Count
5858 
5859 INTEGER ,       INTENT(OUT) :: Status
5860 
5861 #include <wrf_status_codes.h>
5862 INTEGER                     :: len_of_str
5863 LOGICAL                     :: for_out
5864 INTEGER, EXTERNAL           :: use_package
5865 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
5866 INTEGER                     :: locCount
5867 
5868 INTEGER io_form , Hndl
5869 
5870 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_logical_sca " )
5871 
5872 
5873 
5874 locCount = Count
5875 
5876 Status = 0
5877 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
5878 IF ( Hndl .GT. -1 ) THEN
5879   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
5880     SELECT CASE ( use_package( io_form ) )
5881 #ifdef NETCDF
5882       CASE ( IO_NETCDF   )
5883         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5884            CALL ext_ncd_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5885                                  locCount,  Status ) 
5886         ENDIF
5887         IF ( .NOT. multi_files(io_form) ) THEN
5888           
5889           
5890           
5891           
5892           
5893           
5894           
5895           
5896           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5897         ENDIF
5898 #endif
5899 #ifdef PNETCDF
5900       CASE ( IO_PNETCDF   )
5901         CALL ext_pnc_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5902                               locCount,  Status ) 
5903 #endif
5904 #ifdef PHDF5
5905       CASE ( IO_PHDF5   )
5906         CALL ext_phdf5_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5907                               locCount,  Status ) 
5908 #endif
5909 #ifdef ESMFIO
5910       CASE ( IO_ESMF )
5911         CALL ext_esmf_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5912                               locCount,  Status ) 
5913 #endif
5914 #ifdef XXX
5915       CASE ( IO_XXX   )
5916         CALL ext_xxx_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5917                               locCount,  Status ) 
5918 #endif
5919 #ifdef YYY
5920       CASE ( IO_YYY   )
5921         CALL ext_yyy_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5922                               locCount,  Status ) 
5923 #endif
5924 #ifdef GRIB1
5925       CASE ( IO_GRIB1   )
5926         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5927            CALL ext_gr1_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5928                                  locCount,  Status ) 
5929         ENDIF
5930         IF ( .NOT. multi_files(io_form) ) THEN
5931           
5932           
5933           
5934           
5935           
5936           
5937           
5938           
5939           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5940         ENDIF
5941 #endif
5942 #ifdef GRIB2
5943       CASE ( IO_GRIB2   )
5944         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5945            CALL ext_gr2_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5946                                  locCount,  Status ) 
5947         ENDIF
5948         IF ( .NOT. multi_files(io_form) ) THEN
5949           
5950           
5951           
5952           
5953           
5954           
5955           
5956           
5957           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5958         ENDIF
5959 #endif
5960 #ifdef INTIO
5961       CASE ( IO_INTIO   )
5962         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
5963            CALL ext_int_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5964                                  locCount,  Status ) 
5965         ENDIF
5966         IF ( .NOT. multi_files(io_form) ) THEN
5967            
5968            
5969            
5970            
5971            
5972            
5973            
5974            
5975            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
5976         ENDIF
5977 #endif
5978       CASE DEFAULT
5979     END SELECT
5980   ELSE IF ( for_out .AND. use_output_servers() ) THEN
5981     CALL wrf_quilt_put_dom_td_logical ( Hndl, Element, DateStr,  Data, &
5982                           locCount,  Status )
5983   ELSE
5984     Status = 0
5985 ENDIF
5986 ELSE
5987   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
5988 ENDIF
5989 RETURN
5990 END SUBROUTINE wrf_put_dom_td_logical_sca 
5991 
5992 
5993 !--- get_dom_td_char
5994 
5995 SUBROUTINE wrf_get_dom_td_char_arr ( DataHandle,Element, DateStr,  Data,  Status )
5996 !<DESCRIPTION>
5997 !<PRE>
5998 !
5999 ! Attempt to read time dependent
6000 ! domain metadata named "Element" valid at time DateStr 
6001 ! from the open dataset described by DataHandle.  
6002 ! Metadata of type char are
6003 ! stored in string Data.
6004 ! 
6005 !
6006 !</PRE>
6007 !</DESCRIPTION>
6008 USE module_state_description
6009 IMPLICIT NONE
6010 INTEGER ,       INTENT(IN)  :: DataHandle
6011 CHARACTER*(*) , INTENT(IN)  :: Element
6012 CHARACTER*(*) , INTENT(IN)  :: DateStr
6013  
6014 
6015  CHARACTER*(*)  :: Data
6016 
6017 
6018 
6019 INTEGER ,       INTENT(OUT) :: Status
6020 
6021 #include <wrf_status_codes.h>
6022 INTEGER                     :: len_of_str
6023 LOGICAL                     :: for_out
6024 INTEGER, EXTERNAL           :: use_package
6025 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
6026 INTEGER                     :: locCount
6027 
6028 INTEGER io_form , Hndl
6029 
6030 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_dom_td_char_arr " )
6031 
6032 
6033 
6034 
6035 
6036 Status = 0
6037 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
6038 IF ( Hndl .GT. -1 ) THEN
6039   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
6040     SELECT CASE ( use_package( io_form ) )
6041 #ifdef NETCDF
6042       CASE ( IO_NETCDF   )
6043         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6044            CALL ext_ncd_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6045                                   Status ) 
6046         ENDIF
6047         IF ( .NOT. multi_files(io_form) ) THEN
6048           
6049           
6050           
6051           
6052           
6053           
6054           len_of_str = LEN(Data)
6055           CALL wrf_dm_bcast_string( Data, len_of_str )
6056           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6057         ENDIF
6058 #endif
6059 #ifdef PNETCDF
6060       CASE ( IO_PNETCDF   )
6061         CALL ext_pnc_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6062                                Status ) 
6063 #endif
6064 #ifdef PHDF5
6065       CASE ( IO_PHDF5   )
6066         CALL ext_phdf5_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6067                                Status ) 
6068 #endif
6069 #ifdef ESMFIO
6070       CASE ( IO_ESMF )
6071         CALL ext_esmf_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6072                                Status ) 
6073 #endif
6074 #ifdef XXX
6075       CASE ( IO_XXX   )
6076         CALL ext_xxx_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6077                                Status ) 
6078 #endif
6079 #ifdef YYY
6080       CASE ( IO_YYY   )
6081         CALL ext_yyy_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6082                                Status ) 
6083 #endif
6084 #ifdef GRIB1
6085       CASE ( IO_GRIB1   )
6086         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6087            CALL ext_gr1_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6088                                   Status ) 
6089         ENDIF
6090         IF ( .NOT. multi_files(io_form) ) THEN
6091           
6092           
6093           
6094           
6095           
6096           
6097           len_of_str = LEN(Data)
6098           CALL wrf_dm_bcast_string( Data, len_of_str )
6099           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6100         ENDIF
6101 #endif
6102 #ifdef GRIB2
6103       CASE ( IO_GRIB2   )
6104         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6105            CALL ext_gr2_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6106                                   Status ) 
6107         ENDIF
6108         IF ( .NOT. multi_files(io_form) ) THEN
6109           
6110           
6111           
6112           
6113           
6114           
6115           len_of_str = LEN(Data)
6116           CALL wrf_dm_bcast_string( Data, len_of_str )
6117           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6118         ENDIF
6119 #endif
6120 #ifdef INTIO
6121       CASE ( IO_INTIO   )
6122         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6123            CALL ext_int_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6124                                   Status ) 
6125         ENDIF
6126         IF ( .NOT. multi_files(io_form) ) THEN
6127            
6128            
6129            
6130            
6131            
6132            
6133            len_of_str = LEN(Data)
6134            CALL wrf_dm_bcast_string( Data, len_of_str )
6135            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6136         ENDIF
6137 #endif
6138       CASE DEFAULT
6139     END SELECT
6140   ELSE IF ( for_out .AND. use_output_servers() ) THEN
6141     CALL wrf_quilt_get_dom_td_char ( Hndl, Element, DateStr,  Data, &
6142                            Status )
6143   ELSE
6144     Status = 0
6145 ENDIF
6146 ELSE
6147   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
6148 ENDIF
6149 RETURN
6150 END SUBROUTINE wrf_get_dom_td_char_arr 
6151 
6152 
6153 !--- put_dom_td_char
6154 
6155 SUBROUTINE wrf_put_dom_td_char_arr ( DataHandle,Element, DateStr,  Data,  Status )
6156 !<DESCRIPTION>
6157 !<PRE>
6158 !
6159 ! Write time dependent
6160 ! domain metadata named "Element" valid at time DateStr 
6161 ! to the open dataset described by DataHandle.  
6162 ! Metadata of type char are
6163 ! copied from string Data.
6164 ! 
6165 !
6166 !</PRE>
6167 !</DESCRIPTION>
6168 USE module_state_description
6169 IMPLICIT NONE
6170 INTEGER ,       INTENT(IN)  :: DataHandle
6171 CHARACTER*(*) , INTENT(IN)  :: Element
6172 CHARACTER*(*) , INTENT(IN)  :: DateStr
6173  
6174 
6175  CHARACTER*(*)  :: Data
6176 
6177 
6178 
6179 INTEGER ,       INTENT(OUT) :: Status
6180 
6181 #include <wrf_status_codes.h>
6182 INTEGER                     :: len_of_str
6183 LOGICAL                     :: for_out
6184 INTEGER, EXTERNAL           :: use_package
6185 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
6186 INTEGER                     :: locCount
6187 
6188 INTEGER io_form , Hndl
6189 
6190 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_dom_td_char_arr " )
6191 
6192 
6193 
6194 
6195 
6196 Status = 0
6197 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
6198 IF ( Hndl .GT. -1 ) THEN
6199   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
6200     SELECT CASE ( use_package( io_form ) )
6201 #ifdef NETCDF
6202       CASE ( IO_NETCDF   )
6203         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6204            CALL ext_ncd_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6205                                   Status ) 
6206         ENDIF
6207         IF ( .NOT. multi_files(io_form) ) THEN
6208           
6209           
6210           
6211           
6212           
6213           
6214           
6215           
6216           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6217         ENDIF
6218 #endif
6219 #ifdef PNETCDF
6220       CASE ( IO_PNETCDF   )
6221         CALL ext_pnc_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6222                                Status ) 
6223 #endif
6224 #ifdef PHDF5
6225       CASE ( IO_PHDF5   )
6226         CALL ext_phdf5_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6227                                Status ) 
6228 #endif
6229 #ifdef ESMFIO
6230       CASE ( IO_ESMF )
6231         CALL ext_esmf_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6232                                Status ) 
6233 #endif
6234 #ifdef XXX
6235       CASE ( IO_XXX   )
6236         CALL ext_xxx_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6237                                Status ) 
6238 #endif
6239 #ifdef YYY
6240       CASE ( IO_YYY   )
6241         CALL ext_yyy_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6242                                Status ) 
6243 #endif
6244 #ifdef GRIB1
6245       CASE ( IO_GRIB1   )
6246         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6247            CALL ext_gr1_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6248                                   Status ) 
6249         ENDIF
6250         IF ( .NOT. multi_files(io_form) ) THEN
6251           
6252           
6253           
6254           
6255           
6256           
6257           
6258           
6259           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6260         ENDIF
6261 #endif
6262 #ifdef GRIB2
6263       CASE ( IO_GRIB2   )
6264         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6265            CALL ext_gr2_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6266                                   Status ) 
6267         ENDIF
6268         IF ( .NOT. multi_files(io_form) ) THEN
6269           
6270           
6271           
6272           
6273           
6274           
6275           
6276           
6277           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6278         ENDIF
6279 #endif
6280 #ifdef INTIO
6281       CASE ( IO_INTIO   )
6282         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6283            CALL ext_int_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6284                                   Status ) 
6285         ENDIF
6286         IF ( .NOT. multi_files(io_form) ) THEN
6287            
6288            
6289            
6290            
6291            
6292            
6293            
6294            
6295            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6296         ENDIF
6297 #endif
6298       CASE DEFAULT
6299     END SELECT
6300   ELSE IF ( for_out .AND. use_output_servers() ) THEN
6301     CALL wrf_quilt_put_dom_td_char ( Hndl, Element, DateStr,  Data, &
6302                            Status )
6303   ELSE
6304     Status = 0
6305 ENDIF
6306 ELSE
6307   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
6308 ENDIF
6309 RETURN
6310 END SUBROUTINE wrf_put_dom_td_char_arr 
6311 
6312 
6313 
6314 !--- get_var_ti_real
6315 
6316 SUBROUTINE wrf_get_var_ti_real_arr ( DataHandle,Element,  Varname, Data, Count, Outcount, Status )
6317 !<DESCRIPTION>
6318 !<PRE>
6319 !
6320 ! Attempt to read Count words of time independent
6321 ! attribute "Element" of variable "Varname"  
6322 ! from the open dataset described by DataHandle.  
6323 ! Attribute of type real is
6324 ! stored in array Data.
6325 ! Actual number of words read is returned in OutCount.
6326 !
6327 !</PRE>
6328 !</DESCRIPTION>
6329 USE module_state_description
6330 IMPLICIT NONE
6331 INTEGER ,       INTENT(IN)  :: DataHandle
6332 CHARACTER*(*) , INTENT(IN)  :: Element
6333 
6334 CHARACTER*(*) , INTENT(IN)  :: VarName 
6335 
6336  real  :: Data (*)
6337 
6338 INTEGER ,       INTENT(IN)  :: Count
6339 INTEGER ,       INTENT(OUT)  :: OutCount
6340 INTEGER ,       INTENT(OUT) :: Status
6341 
6342 #include <wrf_status_codes.h>
6343 INTEGER                     :: len_of_str
6344 LOGICAL                     :: for_out
6345 INTEGER, EXTERNAL           :: use_package
6346 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
6347 INTEGER                     :: locCount
6348 
6349 INTEGER io_form , Hndl
6350 
6351 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_real_arr " )
6352 
6353 
6354 locCount = Count
6355 
6356 
6357 Status = 0
6358 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
6359 IF ( Hndl .GT. -1 ) THEN
6360   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
6361     SELECT CASE ( use_package( io_form ) )
6362 #ifdef NETCDF
6363       CASE ( IO_NETCDF   )
6364         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6365 #  if ( RWORDSIZE == DWORDSIZE )
6366            CALL ext_ncd_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6367                                  locCount, Outcount, Status )
6368 #  else
6369            CALL ext_ncd_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6370                                  locCount, Outcount, Status )
6371 #  endif
6372         ENDIF
6373         IF ( .NOT. multi_files(io_form) ) THEN
6374           
6375           
6376           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
6377           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
6378           
6379           
6380           
6381           
6382           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6383         ENDIF
6384 #endif
6385 #ifdef PNETCDF
6386       CASE ( IO_PNETCDF   )
6387 #  if ( RWORDSIZE == DWORDSIZE )
6388         CALL ext_pnc_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6389                               locCount, Outcount, Status )
6390 #  else
6391         CALL ext_pnc_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6392                               locCount, Outcount, Status )
6393 #  endif
6394 #endif
6395 #ifdef PHDF5
6396       CASE ( IO_PHDF5   )
6397 #  if ( RWORDSIZE == DWORDSIZE )
6398         CALL ext_phdf5_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6399                               locCount, Outcount, Status )
6400 #  else
6401         CALL ext_phdf5_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6402                               locCount, Outcount, Status )
6403 #  endif
6404 #endif
6405 #ifdef ESMFIO
6406       CASE ( IO_ESMF )
6407 #  if ( RWORDSIZE == DWORDSIZE )
6408         CALL ext_esmf_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6409                               locCount, Outcount, Status )
6410 #  else
6411         CALL ext_esmf_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6412                               locCount, Outcount, Status )
6413 #  endif
6414 #endif
6415 #ifdef XXX
6416       CASE ( IO_XXX   )
6417 #  if ( RWORDSIZE == DWORDSIZE )
6418         CALL ext_xxx_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6419                               locCount, Outcount, Status )
6420 #  else
6421         CALL ext_xxx_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6422                               locCount, Outcount, Status )
6423 #  endif
6424 #endif
6425 #ifdef YYY
6426       CASE ( IO_YYY   )
6427 #  if ( RWORDSIZE == DWORDSIZE )
6428         CALL ext_yyy_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6429                               locCount, Outcount, Status )
6430 #  else
6431         CALL ext_yyy_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6432                               locCount, Outcount, Status )
6433 #  endif
6434 #endif
6435 #ifdef GRIB1
6436       CASE ( IO_GRIB1   )
6437         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6438 #  if ( RWORDSIZE == DWORDSIZE )
6439            CALL ext_gr1_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6440                                  locCount, Outcount, Status )
6441 #  else
6442            CALL ext_gr1_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6443                                  locCount, Outcount, Status )
6444 #  endif
6445         ENDIF
6446         IF ( .NOT. multi_files(io_form) ) THEN
6447           
6448           
6449           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
6450           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
6451           
6452           
6453           
6454           
6455           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6456         ENDIF
6457 #endif
6458 #ifdef GRIB2
6459       CASE ( IO_GRIB2   )
6460         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6461 #  if ( RWORDSIZE == DWORDSIZE )
6462            CALL ext_gr2_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6463                                  locCount, Outcount, Status )
6464 #  else
6465            CALL ext_gr2_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6466                                  locCount, Outcount, Status )
6467 #  endif
6468         ENDIF
6469         IF ( .NOT. multi_files(io_form) ) THEN
6470           
6471           
6472           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
6473           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
6474           
6475           
6476           
6477           
6478           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6479         ENDIF
6480 #endif
6481 #ifdef INTIO
6482       CASE ( IO_INTIO   )
6483         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6484 #  if ( RWORDSIZE == DWORDSIZE )
6485            CALL ext_int_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6486                                  locCount, Outcount, Status )
6487 #  else
6488            CALL ext_int_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6489                                  locCount, Outcount, Status )
6490 #  endif
6491         ENDIF
6492         IF ( .NOT. multi_files(io_form) ) THEN
6493            
6494            
6495            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
6496            CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
6497            
6498            
6499            
6500            
6501            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6502         ENDIF
6503 #endif
6504       CASE DEFAULT
6505     END SELECT
6506   ELSE IF ( for_out .AND. use_output_servers() ) THEN
6507     CALL wrf_quilt_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6508                           locCount, Outcount, Status )
6509   ELSE
6510     Status = 0
6511 ENDIF
6512 ELSE
6513   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
6514 ENDIF
6515 RETURN
6516 END SUBROUTINE wrf_get_var_ti_real_arr 
6517 !--- get_var_ti_real
6518 
6519 SUBROUTINE wrf_get_var_ti_real_sca ( DataHandle,Element,  Varname, Data, Count, Outcount, Status )
6520 !<DESCRIPTION>
6521 !<PRE>
6522 !
6523 ! Attempt to read time independent
6524 ! attribute "Element" of variable "Varname"  
6525 ! from the open dataset described by DataHandle.  
6526 ! Attribute of type real is
6527 ! stored in scalar Data.
6528 ! 
6529 !
6530 !</PRE>
6531 !</DESCRIPTION>
6532 USE module_state_description
6533 IMPLICIT NONE
6534 INTEGER ,       INTENT(IN)  :: DataHandle
6535 CHARACTER*(*) , INTENT(IN)  :: Element
6536 
6537 CHARACTER*(*) , INTENT(IN)  :: VarName 
6538 
6539  real  :: Data 
6540 
6541 INTEGER ,       INTENT(IN)  :: Count
6542 INTEGER ,       INTENT(OUT)  :: OutCount
6543 INTEGER ,       INTENT(OUT) :: Status
6544 
6545 #include <wrf_status_codes.h>
6546 INTEGER                     :: len_of_str
6547 LOGICAL                     :: for_out
6548 INTEGER, EXTERNAL           :: use_package
6549 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
6550 INTEGER                     :: locCount
6551 
6552 INTEGER io_form , Hndl
6553 
6554 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_real_sca " )
6555 
6556 
6557 locCount = Count
6558 
6559 
6560 Status = 0
6561 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
6562 IF ( Hndl .GT. -1 ) THEN
6563   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
6564     SELECT CASE ( use_package( io_form ) )
6565 #ifdef NETCDF
6566       CASE ( IO_NETCDF   )
6567         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6568 #  if ( RWORDSIZE == DWORDSIZE )
6569            CALL ext_ncd_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6570                                  locCount, Outcount, Status )
6571 #  else
6572            CALL ext_ncd_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6573                                  locCount, Outcount, Status )
6574 #  endif
6575         ENDIF
6576         IF ( .NOT. multi_files(io_form) ) THEN
6577           
6578           
6579           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
6580           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
6581           
6582           
6583           
6584           
6585           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6586         ENDIF
6587 #endif
6588 #ifdef PNETCDF
6589       CASE ( IO_PNETCDF   )
6590 #  if ( RWORDSIZE == DWORDSIZE )
6591         CALL ext_pnc_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6592                               locCount, Outcount, Status )
6593 #  else
6594         CALL ext_pnc_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6595                               locCount, Outcount, Status )
6596 #  endif
6597 #endif
6598 #ifdef PHDF5
6599       CASE ( IO_PHDF5   )
6600 #  if ( RWORDSIZE == DWORDSIZE )
6601         CALL ext_phdf5_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6602                               locCount, Outcount, Status )
6603 #  else
6604         CALL ext_phdf5_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6605                               locCount, Outcount, Status )
6606 #  endif
6607 #endif
6608 #ifdef ESMFIO
6609       CASE ( IO_ESMF )
6610 #  if ( RWORDSIZE == DWORDSIZE )
6611         CALL ext_esmf_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6612                               locCount, Outcount, Status )
6613 #  else
6614         CALL ext_esmf_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6615                               locCount, Outcount, Status )
6616 #  endif
6617 #endif
6618 #ifdef XXX
6619       CASE ( IO_XXX   )
6620 #  if ( RWORDSIZE == DWORDSIZE )
6621         CALL ext_xxx_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6622                               locCount, Outcount, Status )
6623 #  else
6624         CALL ext_xxx_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6625                               locCount, Outcount, Status )
6626 #  endif
6627 #endif
6628 #ifdef YYY
6629       CASE ( IO_YYY   )
6630 #  if ( RWORDSIZE == DWORDSIZE )
6631         CALL ext_yyy_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6632                               locCount, Outcount, Status )
6633 #  else
6634         CALL ext_yyy_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6635                               locCount, Outcount, Status )
6636 #  endif
6637 #endif
6638 #ifdef GRIB1
6639       CASE ( IO_GRIB1   )
6640         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6641 #  if ( RWORDSIZE == DWORDSIZE )
6642            CALL ext_gr1_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6643                                  locCount, Outcount, Status )
6644 #  else
6645            CALL ext_gr1_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6646                                  locCount, Outcount, Status )
6647 #  endif
6648         ENDIF
6649         IF ( .NOT. multi_files(io_form) ) THEN
6650           
6651           
6652           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
6653           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
6654           
6655           
6656           
6657           
6658           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6659         ENDIF
6660 #endif
6661 #ifdef GRIB2
6662       CASE ( IO_GRIB2   )
6663         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6664 #  if ( RWORDSIZE == DWORDSIZE )
6665            CALL ext_gr2_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6666                                  locCount, Outcount, Status )
6667 #  else
6668            CALL ext_gr2_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6669                                  locCount, Outcount, Status )
6670 #  endif
6671         ENDIF
6672         IF ( .NOT. multi_files(io_form) ) THEN
6673           
6674           
6675           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
6676           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
6677           
6678           
6679           
6680           
6681           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6682         ENDIF
6683 #endif
6684 #ifdef INTIO
6685       CASE ( IO_INTIO   )
6686         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6687 #  if ( RWORDSIZE == DWORDSIZE )
6688            CALL ext_int_get_var_ti_double ( Hndl, Element,  Varname, Data, &
6689                                  locCount, Outcount, Status )
6690 #  else
6691            CALL ext_int_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6692                                  locCount, Outcount, Status )
6693 #  endif
6694         ENDIF
6695         IF ( .NOT. multi_files(io_form) ) THEN
6696            
6697            
6698            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
6699            CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
6700            
6701            
6702            
6703            
6704            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6705         ENDIF
6706 #endif
6707       CASE DEFAULT
6708     END SELECT
6709   ELSE IF ( for_out .AND. use_output_servers() ) THEN
6710     CALL wrf_quilt_get_var_ti_real ( Hndl, Element,  Varname, Data, &
6711                           locCount, Outcount, Status )
6712   ELSE
6713     Status = 0
6714 ENDIF
6715 ELSE
6716   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
6717 ENDIF
6718 RETURN
6719 END SUBROUTINE wrf_get_var_ti_real_sca 
6720 
6721 
6722 !--- put_var_ti_real
6723 
6724 SUBROUTINE wrf_put_var_ti_real_arr ( DataHandle,Element,  Varname, Data, Count,  Status )
6725 !<DESCRIPTION>
6726 !<PRE>
6727 !
6728 ! Write Count words of time independent
6729 ! attribute "Element" of variable "Varname"  
6730 ! to the open dataset described by DataHandle.  
6731 ! Attribute of type real is
6732 ! copied from array Data.
6733 ! 
6734 !
6735 !</PRE>
6736 !</DESCRIPTION>
6737 USE module_state_description
6738 IMPLICIT NONE
6739 INTEGER ,       INTENT(IN)  :: DataHandle
6740 CHARACTER*(*) , INTENT(IN)  :: Element
6741 
6742 CHARACTER*(*) , INTENT(IN)  :: VarName 
6743 
6744  real  :: Data (*)
6745 
6746 INTEGER ,       INTENT(IN)  :: Count
6747 
6748 INTEGER ,       INTENT(OUT) :: Status
6749 
6750 #include <wrf_status_codes.h>
6751 INTEGER                     :: len_of_str
6752 LOGICAL                     :: for_out
6753 INTEGER, EXTERNAL           :: use_package
6754 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
6755 INTEGER                     :: locCount
6756 
6757 INTEGER io_form , Hndl
6758 
6759 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_real_arr " )
6760 
6761 
6762 locCount = Count
6763 
6764 
6765 Status = 0
6766 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
6767 IF ( Hndl .GT. -1 ) THEN
6768   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
6769     SELECT CASE ( use_package( io_form ) )
6770 #ifdef NETCDF
6771       CASE ( IO_NETCDF   )
6772         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6773 #  if ( RWORDSIZE == DWORDSIZE )
6774            CALL ext_ncd_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6775                                  locCount,  Status )
6776 #  else
6777            CALL ext_ncd_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6778                                  locCount,  Status )
6779 #  endif
6780         ENDIF
6781         IF ( .NOT. multi_files(io_form) ) THEN
6782           
6783           
6784           
6785           
6786           
6787           
6788           
6789           
6790           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6791         ENDIF
6792 #endif
6793 #ifdef PNETCDF
6794       CASE ( IO_PNETCDF   )
6795 #  if ( RWORDSIZE == DWORDSIZE )
6796         CALL ext_pnc_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6797                               locCount,  Status )
6798 #  else
6799         CALL ext_pnc_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6800                               locCount,  Status )
6801 #  endif
6802 #endif
6803 #ifdef PHDF5
6804       CASE ( IO_PHDF5   )
6805 #  if ( RWORDSIZE == DWORDSIZE )
6806         CALL ext_phdf5_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6807                               locCount,  Status )
6808 #  else
6809         CALL ext_phdf5_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6810                               locCount,  Status )
6811 #  endif
6812 #endif
6813 #ifdef ESMFIO
6814       CASE ( IO_ESMF )
6815 #  if ( RWORDSIZE == DWORDSIZE )
6816         CALL ext_esmf_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6817                               locCount,  Status )
6818 #  else
6819         CALL ext_esmf_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6820                               locCount,  Status )
6821 #  endif
6822 #endif
6823 #ifdef XXX
6824       CASE ( IO_XXX   )
6825 #  if ( RWORDSIZE == DWORDSIZE )
6826         CALL ext_xxx_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6827                               locCount,  Status )
6828 #  else
6829         CALL ext_xxx_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6830                               locCount,  Status )
6831 #  endif
6832 #endif
6833 #ifdef YYY
6834       CASE ( IO_YYY   )
6835 #  if ( RWORDSIZE == DWORDSIZE )
6836         CALL ext_yyy_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6837                               locCount,  Status )
6838 #  else
6839         CALL ext_yyy_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6840                               locCount,  Status )
6841 #  endif
6842 #endif
6843 #ifdef GRIB1
6844       CASE ( IO_GRIB1   )
6845         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6846 #  if ( RWORDSIZE == DWORDSIZE )
6847            CALL ext_gr1_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6848                                  locCount,  Status )
6849 #  else
6850            CALL ext_gr1_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6851                                  locCount,  Status )
6852 #  endif
6853         ENDIF
6854         IF ( .NOT. multi_files(io_form) ) THEN
6855           
6856           
6857           
6858           
6859           
6860           
6861           
6862           
6863           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6864         ENDIF
6865 #endif
6866 #ifdef GRIB2
6867       CASE ( IO_GRIB2   )
6868         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6869 #  if ( RWORDSIZE == DWORDSIZE )
6870            CALL ext_gr2_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6871                                  locCount,  Status )
6872 #  else
6873            CALL ext_gr2_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6874                                  locCount,  Status )
6875 #  endif
6876         ENDIF
6877         IF ( .NOT. multi_files(io_form) ) THEN
6878           
6879           
6880           
6881           
6882           
6883           
6884           
6885           
6886           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6887         ENDIF
6888 #endif
6889 #ifdef INTIO
6890       CASE ( IO_INTIO   )
6891         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6892 #  if ( RWORDSIZE == DWORDSIZE )
6893            CALL ext_int_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6894                                  locCount,  Status )
6895 #  else
6896            CALL ext_int_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6897                                  locCount,  Status )
6898 #  endif
6899         ENDIF
6900         IF ( .NOT. multi_files(io_form) ) THEN
6901            
6902            
6903            
6904            
6905            
6906            
6907            
6908            
6909            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6910         ENDIF
6911 #endif
6912       CASE DEFAULT
6913     END SELECT
6914   ELSE IF ( for_out .AND. use_output_servers() ) THEN
6915     CALL wrf_quilt_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6916                           locCount,  Status )
6917   ELSE
6918     Status = 0
6919 ENDIF
6920 ELSE
6921   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
6922 ENDIF
6923 RETURN
6924 END SUBROUTINE wrf_put_var_ti_real_arr 
6925 !--- put_var_ti_real
6926 
6927 SUBROUTINE wrf_put_var_ti_real_sca ( DataHandle,Element,  Varname, Data, Count,  Status )
6928 !<DESCRIPTION>
6929 !<PRE>
6930 !
6931 ! Write time independent
6932 ! attribute "Element" of variable "Varname"  
6933 ! to the open dataset described by DataHandle.  
6934 ! Attribute of type real is
6935 ! copied from scalar Data.
6936 ! 
6937 !
6938 !</PRE>
6939 !</DESCRIPTION>
6940 USE module_state_description
6941 IMPLICIT NONE
6942 INTEGER ,       INTENT(IN)  :: DataHandle
6943 CHARACTER*(*) , INTENT(IN)  :: Element
6944 
6945 CHARACTER*(*) , INTENT(IN)  :: VarName 
6946 
6947  real  :: Data 
6948 
6949 INTEGER ,       INTENT(IN)  :: Count
6950 
6951 INTEGER ,       INTENT(OUT) :: Status
6952 
6953 #include <wrf_status_codes.h>
6954 INTEGER                     :: len_of_str
6955 LOGICAL                     :: for_out
6956 INTEGER, EXTERNAL           :: use_package
6957 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
6958 INTEGER                     :: locCount
6959 
6960 INTEGER io_form , Hndl
6961 
6962 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_real_sca " )
6963 
6964 
6965 locCount = Count
6966 
6967 
6968 Status = 0
6969 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
6970 IF ( Hndl .GT. -1 ) THEN
6971   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
6972     SELECT CASE ( use_package( io_form ) )
6973 #ifdef NETCDF
6974       CASE ( IO_NETCDF   )
6975         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
6976 #  if ( RWORDSIZE == DWORDSIZE )
6977            CALL ext_ncd_put_var_ti_double ( Hndl, Element,  Varname, Data, &
6978                                  locCount,  Status )
6979 #  else
6980            CALL ext_ncd_put_var_ti_real ( Hndl, Element,  Varname, Data, &
6981                                  locCount,  Status )
6982 #  endif
6983         ENDIF
6984         IF ( .NOT. multi_files(io_form) ) THEN
6985           
6986           
6987           
6988           
6989           
6990           
6991           
6992           
6993           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
6994         ENDIF
6995 #endif
6996 #ifdef PNETCDF
6997       CASE ( IO_PNETCDF   )
6998 #  if ( RWORDSIZE == DWORDSIZE )
6999         CALL ext_pnc_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7000                               locCount,  Status )
7001 #  else
7002         CALL ext_pnc_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7003                               locCount,  Status )
7004 #  endif
7005 #endif
7006 #ifdef PHDF5
7007       CASE ( IO_PHDF5   )
7008 #  if ( RWORDSIZE == DWORDSIZE )
7009         CALL ext_phdf5_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7010                               locCount,  Status )
7011 #  else
7012         CALL ext_phdf5_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7013                               locCount,  Status )
7014 #  endif
7015 #endif
7016 #ifdef ESMFIO
7017       CASE ( IO_ESMF )
7018 #  if ( RWORDSIZE == DWORDSIZE )
7019         CALL ext_esmf_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7020                               locCount,  Status )
7021 #  else
7022         CALL ext_esmf_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7023                               locCount,  Status )
7024 #  endif
7025 #endif
7026 #ifdef XXX
7027       CASE ( IO_XXX   )
7028 #  if ( RWORDSIZE == DWORDSIZE )
7029         CALL ext_xxx_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7030                               locCount,  Status )
7031 #  else
7032         CALL ext_xxx_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7033                               locCount,  Status )
7034 #  endif
7035 #endif
7036 #ifdef YYY
7037       CASE ( IO_YYY   )
7038 #  if ( RWORDSIZE == DWORDSIZE )
7039         CALL ext_yyy_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7040                               locCount,  Status )
7041 #  else
7042         CALL ext_yyy_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7043                               locCount,  Status )
7044 #  endif
7045 #endif
7046 #ifdef GRIB1
7047       CASE ( IO_GRIB1   )
7048         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7049 #  if ( RWORDSIZE == DWORDSIZE )
7050            CALL ext_gr1_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7051                                  locCount,  Status )
7052 #  else
7053            CALL ext_gr1_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7054                                  locCount,  Status )
7055 #  endif
7056         ENDIF
7057         IF ( .NOT. multi_files(io_form) ) THEN
7058           
7059           
7060           
7061           
7062           
7063           
7064           
7065           
7066           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7067         ENDIF
7068 #endif
7069 #ifdef GRIB2
7070       CASE ( IO_GRIB2   )
7071         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7072 #  if ( RWORDSIZE == DWORDSIZE )
7073            CALL ext_gr2_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7074                                  locCount,  Status )
7075 #  else
7076            CALL ext_gr2_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7077                                  locCount,  Status )
7078 #  endif
7079         ENDIF
7080         IF ( .NOT. multi_files(io_form) ) THEN
7081           
7082           
7083           
7084           
7085           
7086           
7087           
7088           
7089           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7090         ENDIF
7091 #endif
7092 #ifdef INTIO
7093       CASE ( IO_INTIO   )
7094         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7095 #  if ( RWORDSIZE == DWORDSIZE )
7096            CALL ext_int_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7097                                  locCount,  Status )
7098 #  else
7099            CALL ext_int_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7100                                  locCount,  Status )
7101 #  endif
7102         ENDIF
7103         IF ( .NOT. multi_files(io_form) ) THEN
7104            
7105            
7106            
7107            
7108            
7109            
7110            
7111            
7112            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7113         ENDIF
7114 #endif
7115       CASE DEFAULT
7116     END SELECT
7117   ELSE IF ( for_out .AND. use_output_servers() ) THEN
7118     CALL wrf_quilt_put_var_ti_real ( Hndl, Element,  Varname, Data, &
7119                           locCount,  Status )
7120   ELSE
7121     Status = 0
7122 ENDIF
7123 ELSE
7124   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
7125 ENDIF
7126 RETURN
7127 END SUBROUTINE wrf_put_var_ti_real_sca 
7128 
7129 
7130 !--- get_var_ti_double
7131 
7132 SUBROUTINE wrf_get_var_ti_double_arr ( DataHandle,Element,  Varname, Data, Count, Outcount, Status )
7133 !<DESCRIPTION>
7134 !<PRE>
7135 !
7136 ! Attempt to read Count words of time independent
7137 ! attribute "Element" of variable "Varname"  
7138 ! from the open dataset described by DataHandle.  
7139 ! Attribute of type double is
7140 ! stored in array Data.
7141 ! Actual number of words read is returned in OutCount.
7142 !
7143 !</PRE>
7144 !</DESCRIPTION>
7145 USE module_state_description
7146 IMPLICIT NONE
7147 INTEGER ,       INTENT(IN)  :: DataHandle
7148 CHARACTER*(*) , INTENT(IN)  :: Element
7149 
7150 CHARACTER*(*) , INTENT(IN)  :: VarName 
7151 
7152  real*8  :: Data (*)
7153 
7154 INTEGER ,       INTENT(IN)  :: Count
7155 INTEGER ,       INTENT(OUT)  :: OutCount
7156 INTEGER ,       INTENT(OUT) :: Status
7157 
7158 #include <wrf_status_codes.h>
7159 INTEGER                     :: len_of_str
7160 LOGICAL                     :: for_out
7161 INTEGER, EXTERNAL           :: use_package
7162 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
7163 INTEGER                     :: locCount
7164 
7165 INTEGER io_form , Hndl
7166 
7167 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_double_arr " )
7168 
7169 
7170 
7171 
7172 
7173 Status = 0
7174 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
7175 IF ( Hndl .GT. -1 ) THEN
7176   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
7177     SELECT CASE ( use_package( io_form ) )
7178 #ifdef NETCDF
7179       CASE ( IO_NETCDF   )
7180         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7181            CALL ext_ncd_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7182                                  locCount, Outcount, Status ) 
7183         ENDIF
7184         IF ( .NOT. multi_files(io_form) ) THEN
7185           
7186           
7187           
7188           
7189           
7190           
7191           
7192           
7193           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7194         ENDIF
7195 #endif
7196 #ifdef PNETCDF
7197       CASE ( IO_PNETCDF   )
7198         CALL ext_pnc_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7199                               locCount, Outcount, Status ) 
7200 #endif
7201 #ifdef PHDF5
7202       CASE ( IO_PHDF5   )
7203         CALL ext_phdf5_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7204                               locCount, Outcount, Status ) 
7205 #endif
7206 #ifdef ESMFIO
7207       CASE ( IO_ESMF )
7208         CALL ext_esmf_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7209                               locCount, Outcount, Status ) 
7210 #endif
7211 #ifdef XXX
7212       CASE ( IO_XXX   )
7213         CALL ext_xxx_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7214                               locCount, Outcount, Status ) 
7215 #endif
7216 #ifdef YYY
7217       CASE ( IO_YYY   )
7218         CALL ext_yyy_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7219                               locCount, Outcount, Status ) 
7220 #endif
7221 #ifdef GRIB1
7222       CASE ( IO_GRIB1   )
7223         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7224            CALL ext_gr1_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7225                                  locCount, Outcount, Status ) 
7226         ENDIF
7227         IF ( .NOT. multi_files(io_form) ) THEN
7228           
7229           
7230           
7231           
7232           
7233           
7234           
7235           
7236           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7237         ENDIF
7238 #endif
7239 #ifdef GRIB2
7240       CASE ( IO_GRIB2   )
7241         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7242            CALL ext_gr2_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7243                                  locCount, Outcount, Status ) 
7244         ENDIF
7245         IF ( .NOT. multi_files(io_form) ) THEN
7246           
7247           
7248           
7249           
7250           
7251           
7252           
7253           
7254           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7255         ENDIF
7256 #endif
7257 #ifdef INTIO
7258       CASE ( IO_INTIO   )
7259         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7260            CALL ext_int_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7261                                  locCount, Outcount, Status ) 
7262         ENDIF
7263         IF ( .NOT. multi_files(io_form) ) THEN
7264            
7265            
7266            
7267            
7268            
7269            
7270            
7271            
7272            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7273         ENDIF
7274 #endif
7275       CASE DEFAULT
7276     END SELECT
7277   ELSE IF ( for_out .AND. use_output_servers() ) THEN
7278     CALL wrf_quilt_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7279                           locCount, Outcount, Status )
7280   ELSE
7281     Status = 0
7282 ENDIF
7283 ELSE
7284   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
7285 ENDIF
7286 RETURN
7287 END SUBROUTINE wrf_get_var_ti_double_arr 
7288 !--- get_var_ti_double
7289 
7290 SUBROUTINE wrf_get_var_ti_double_sca ( DataHandle,Element,  Varname, Data, Count, Outcount, Status )
7291 !<DESCRIPTION>
7292 !<PRE>
7293 !
7294 ! Attempt to read time independent
7295 ! attribute "Element" of variable "Varname"  
7296 ! from the open dataset described by DataHandle.  
7297 ! Attribute of type double is
7298 ! stored in scalar Data.
7299 ! 
7300 !
7301 !</PRE>
7302 !</DESCRIPTION>
7303 USE module_state_description
7304 IMPLICIT NONE
7305 INTEGER ,       INTENT(IN)  :: DataHandle
7306 CHARACTER*(*) , INTENT(IN)  :: Element
7307 
7308 CHARACTER*(*) , INTENT(IN)  :: VarName 
7309 
7310  real*8  :: Data 
7311 
7312 INTEGER ,       INTENT(IN)  :: Count
7313 INTEGER ,       INTENT(OUT)  :: OutCount
7314 INTEGER ,       INTENT(OUT) :: Status
7315 
7316 #include <wrf_status_codes.h>
7317 INTEGER                     :: len_of_str
7318 LOGICAL                     :: for_out
7319 INTEGER, EXTERNAL           :: use_package
7320 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
7321 INTEGER                     :: locCount
7322 
7323 INTEGER io_form , Hndl
7324 
7325 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_double_sca " )
7326 
7327 
7328 
7329 
7330 
7331 Status = 0
7332 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
7333 IF ( Hndl .GT. -1 ) THEN
7334   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
7335     SELECT CASE ( use_package( io_form ) )
7336 #ifdef NETCDF
7337       CASE ( IO_NETCDF   )
7338         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7339            CALL ext_ncd_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7340                                  locCount, Outcount, Status ) 
7341         ENDIF
7342         IF ( .NOT. multi_files(io_form) ) THEN
7343           
7344           
7345           
7346           
7347           
7348           
7349           
7350           
7351           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7352         ENDIF
7353 #endif
7354 #ifdef PNETCDF
7355       CASE ( IO_PNETCDF   )
7356         CALL ext_pnc_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7357                               locCount, Outcount, Status ) 
7358 #endif
7359 #ifdef PHDF5
7360       CASE ( IO_PHDF5   )
7361         CALL ext_phdf5_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7362                               locCount, Outcount, Status ) 
7363 #endif
7364 #ifdef ESMFIO
7365       CASE ( IO_ESMF )
7366         CALL ext_esmf_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7367                               locCount, Outcount, Status ) 
7368 #endif
7369 #ifdef XXX
7370       CASE ( IO_XXX   )
7371         CALL ext_xxx_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7372                               locCount, Outcount, Status ) 
7373 #endif
7374 #ifdef YYY
7375       CASE ( IO_YYY   )
7376         CALL ext_yyy_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7377                               locCount, Outcount, Status ) 
7378 #endif
7379 #ifdef GRIB1
7380       CASE ( IO_GRIB1   )
7381         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7382            CALL ext_gr1_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7383                                  locCount, Outcount, Status ) 
7384         ENDIF
7385         IF ( .NOT. multi_files(io_form) ) THEN
7386           
7387           
7388           
7389           
7390           
7391           
7392           
7393           
7394           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7395         ENDIF
7396 #endif
7397 #ifdef GRIB2
7398       CASE ( IO_GRIB2   )
7399         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7400            CALL ext_gr2_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7401                                  locCount, Outcount, Status ) 
7402         ENDIF
7403         IF ( .NOT. multi_files(io_form) ) THEN
7404           
7405           
7406           
7407           
7408           
7409           
7410           
7411           
7412           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7413         ENDIF
7414 #endif
7415 #ifdef INTIO
7416       CASE ( IO_INTIO   )
7417         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7418            CALL ext_int_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7419                                  locCount, Outcount, Status ) 
7420         ENDIF
7421         IF ( .NOT. multi_files(io_form) ) THEN
7422            
7423            
7424            
7425            
7426            
7427            
7428            
7429            
7430            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7431         ENDIF
7432 #endif
7433       CASE DEFAULT
7434     END SELECT
7435   ELSE IF ( for_out .AND. use_output_servers() ) THEN
7436     CALL wrf_quilt_get_var_ti_double ( Hndl, Element,  Varname, Data, &
7437                           locCount, Outcount, Status )
7438   ELSE
7439     Status = 0
7440 ENDIF
7441 ELSE
7442   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
7443 ENDIF
7444 RETURN
7445 END SUBROUTINE wrf_get_var_ti_double_sca 
7446 
7447 
7448 !--- put_var_ti_double
7449 
7450 SUBROUTINE wrf_put_var_ti_double_arr ( DataHandle,Element,  Varname, Data, Count,  Status )
7451 !<DESCRIPTION>
7452 !<PRE>
7453 !
7454 ! Write Count words of time independent
7455 ! attribute "Element" of variable "Varname"  
7456 ! to the open dataset described by DataHandle.  
7457 ! Attribute of type double is
7458 ! copied from array Data.
7459 ! 
7460 !
7461 !</PRE>
7462 !</DESCRIPTION>
7463 USE module_state_description
7464 IMPLICIT NONE
7465 INTEGER ,       INTENT(IN)  :: DataHandle
7466 CHARACTER*(*) , INTENT(IN)  :: Element
7467 
7468 CHARACTER*(*) , INTENT(IN)  :: VarName 
7469 
7470  real*8  :: Data (*)
7471 
7472 INTEGER ,       INTENT(IN)  :: Count
7473 
7474 INTEGER ,       INTENT(OUT) :: Status
7475 
7476 #include <wrf_status_codes.h>
7477 INTEGER                     :: len_of_str
7478 LOGICAL                     :: for_out
7479 INTEGER, EXTERNAL           :: use_package
7480 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
7481 INTEGER                     :: locCount
7482 
7483 INTEGER io_form , Hndl
7484 
7485 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_double_arr " )
7486 
7487 
7488 
7489 
7490 
7491 Status = 0
7492 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
7493 IF ( Hndl .GT. -1 ) THEN
7494   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
7495     SELECT CASE ( use_package( io_form ) )
7496 #ifdef NETCDF
7497       CASE ( IO_NETCDF   )
7498         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7499            CALL ext_ncd_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7500                                  locCount,  Status ) 
7501         ENDIF
7502         IF ( .NOT. multi_files(io_form) ) THEN
7503           
7504           
7505           
7506           
7507           
7508           
7509           
7510           
7511           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7512         ENDIF
7513 #endif
7514 #ifdef PNETCDF
7515       CASE ( IO_PNETCDF   )
7516         CALL ext_pnc_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7517                               locCount,  Status ) 
7518 #endif
7519 #ifdef PHDF5
7520       CASE ( IO_PHDF5   )
7521         CALL ext_phdf5_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7522                               locCount,  Status ) 
7523 #endif
7524 #ifdef ESMFIO
7525       CASE ( IO_ESMF )
7526         CALL ext_esmf_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7527                               locCount,  Status ) 
7528 #endif
7529 #ifdef XXX
7530       CASE ( IO_XXX   )
7531         CALL ext_xxx_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7532                               locCount,  Status ) 
7533 #endif
7534 #ifdef YYY
7535       CASE ( IO_YYY   )
7536         CALL ext_yyy_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7537                               locCount,  Status ) 
7538 #endif
7539 #ifdef GRIB1
7540       CASE ( IO_GRIB1   )
7541         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7542            CALL ext_gr1_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7543                                  locCount,  Status ) 
7544         ENDIF
7545         IF ( .NOT. multi_files(io_form) ) THEN
7546           
7547           
7548           
7549           
7550           
7551           
7552           
7553           
7554           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7555         ENDIF
7556 #endif
7557 #ifdef GRIB2
7558       CASE ( IO_GRIB2   )
7559         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7560            CALL ext_gr2_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7561                                  locCount,  Status ) 
7562         ENDIF
7563         IF ( .NOT. multi_files(io_form) ) THEN
7564           
7565           
7566           
7567           
7568           
7569           
7570           
7571           
7572           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7573         ENDIF
7574 #endif
7575 #ifdef INTIO
7576       CASE ( IO_INTIO   )
7577         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7578            CALL ext_int_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7579                                  locCount,  Status ) 
7580         ENDIF
7581         IF ( .NOT. multi_files(io_form) ) THEN
7582            
7583            
7584            
7585            
7586            
7587            
7588            
7589            
7590            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7591         ENDIF
7592 #endif
7593       CASE DEFAULT
7594     END SELECT
7595   ELSE IF ( for_out .AND. use_output_servers() ) THEN
7596     CALL wrf_quilt_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7597                           locCount,  Status )
7598   ELSE
7599     Status = 0
7600 ENDIF
7601 ELSE
7602   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
7603 ENDIF
7604 RETURN
7605 END SUBROUTINE wrf_put_var_ti_double_arr 
7606 !--- put_var_ti_double
7607 
7608 SUBROUTINE wrf_put_var_ti_double_sca ( DataHandle,Element,  Varname, Data, Count,  Status )
7609 !<DESCRIPTION>
7610 !<PRE>
7611 !
7612 ! Write time independent
7613 ! attribute "Element" of variable "Varname"  
7614 ! to the open dataset described by DataHandle.  
7615 ! Attribute of type double is
7616 ! copied from scalar Data.
7617 ! 
7618 !
7619 !</PRE>
7620 !</DESCRIPTION>
7621 USE module_state_description
7622 IMPLICIT NONE
7623 INTEGER ,       INTENT(IN)  :: DataHandle
7624 CHARACTER*(*) , INTENT(IN)  :: Element
7625 
7626 CHARACTER*(*) , INTENT(IN)  :: VarName 
7627 
7628  real*8  :: Data 
7629 
7630 INTEGER ,       INTENT(IN)  :: Count
7631 
7632 INTEGER ,       INTENT(OUT) :: Status
7633 
7634 #include <wrf_status_codes.h>
7635 INTEGER                     :: len_of_str
7636 LOGICAL                     :: for_out
7637 INTEGER, EXTERNAL           :: use_package
7638 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
7639 INTEGER                     :: locCount
7640 
7641 INTEGER io_form , Hndl
7642 
7643 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_double_sca " )
7644 
7645 
7646 
7647 
7648 
7649 Status = 0
7650 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
7651 IF ( Hndl .GT. -1 ) THEN
7652   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
7653     SELECT CASE ( use_package( io_form ) )
7654 #ifdef NETCDF
7655       CASE ( IO_NETCDF   )
7656         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7657            CALL ext_ncd_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7658                                  locCount,  Status ) 
7659         ENDIF
7660         IF ( .NOT. multi_files(io_form) ) THEN
7661           
7662           
7663           
7664           
7665           
7666           
7667           
7668           
7669           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7670         ENDIF
7671 #endif
7672 #ifdef PNETCDF
7673       CASE ( IO_PNETCDF   )
7674         CALL ext_pnc_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7675                               locCount,  Status ) 
7676 #endif
7677 #ifdef PHDF5
7678       CASE ( IO_PHDF5   )
7679         CALL ext_phdf5_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7680                               locCount,  Status ) 
7681 #endif
7682 #ifdef ESMFIO
7683       CASE ( IO_ESMF )
7684         CALL ext_esmf_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7685                               locCount,  Status ) 
7686 #endif
7687 #ifdef XXX
7688       CASE ( IO_XXX   )
7689         CALL ext_xxx_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7690                               locCount,  Status ) 
7691 #endif
7692 #ifdef YYY
7693       CASE ( IO_YYY   )
7694         CALL ext_yyy_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7695                               locCount,  Status ) 
7696 #endif
7697 #ifdef GRIB1
7698       CASE ( IO_GRIB1   )
7699         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7700            CALL ext_gr1_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7701                                  locCount,  Status ) 
7702         ENDIF
7703         IF ( .NOT. multi_files(io_form) ) THEN
7704           
7705           
7706           
7707           
7708           
7709           
7710           
7711           
7712           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7713         ENDIF
7714 #endif
7715 #ifdef GRIB2
7716       CASE ( IO_GRIB2   )
7717         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7718            CALL ext_gr2_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7719                                  locCount,  Status ) 
7720         ENDIF
7721         IF ( .NOT. multi_files(io_form) ) THEN
7722           
7723           
7724           
7725           
7726           
7727           
7728           
7729           
7730           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7731         ENDIF
7732 #endif
7733 #ifdef INTIO
7734       CASE ( IO_INTIO   )
7735         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7736            CALL ext_int_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7737                                  locCount,  Status ) 
7738         ENDIF
7739         IF ( .NOT. multi_files(io_form) ) THEN
7740            
7741            
7742            
7743            
7744            
7745            
7746            
7747            
7748            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7749         ENDIF
7750 #endif
7751       CASE DEFAULT
7752     END SELECT
7753   ELSE IF ( for_out .AND. use_output_servers() ) THEN
7754     CALL wrf_quilt_put_var_ti_double ( Hndl, Element,  Varname, Data, &
7755                           locCount,  Status )
7756   ELSE
7757     Status = 0
7758 ENDIF
7759 ELSE
7760   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
7761 ENDIF
7762 RETURN
7763 END SUBROUTINE wrf_put_var_ti_double_sca 
7764 
7765 
7766 !--- get_var_ti_integer
7767 
7768 SUBROUTINE wrf_get_var_ti_integer_arr ( DataHandle,Element,  Varname, Data, Count, Outcount, Status )
7769 !<DESCRIPTION>
7770 !<PRE>
7771 !
7772 ! Attempt to read Count words of time independent
7773 ! attribute "Element" of variable "Varname"  
7774 ! from the open dataset described by DataHandle.  
7775 ! Attribute of type integer is
7776 ! stored in array Data.
7777 ! Actual number of words read is returned in OutCount.
7778 !
7779 !</PRE>
7780 !</DESCRIPTION>
7781 USE module_state_description
7782 IMPLICIT NONE
7783 INTEGER ,       INTENT(IN)  :: DataHandle
7784 CHARACTER*(*) , INTENT(IN)  :: Element
7785 
7786 CHARACTER*(*) , INTENT(IN)  :: VarName 
7787 
7788  integer  :: Data (*)
7789 
7790 INTEGER ,       INTENT(IN)  :: Count
7791 INTEGER ,       INTENT(OUT)  :: OutCount
7792 INTEGER ,       INTENT(OUT) :: Status
7793 
7794 #include <wrf_status_codes.h>
7795 INTEGER                     :: len_of_str
7796 LOGICAL                     :: for_out
7797 INTEGER, EXTERNAL           :: use_package
7798 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
7799 INTEGER                     :: locCount
7800 
7801 INTEGER io_form , Hndl
7802 
7803 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_integer_arr " )
7804 
7805 locCount = Count
7806 
7807 
7808 
7809 Status = 0
7810 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
7811 IF ( Hndl .GT. -1 ) THEN
7812   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
7813     SELECT CASE ( use_package( io_form ) )
7814 #ifdef NETCDF
7815       CASE ( IO_NETCDF   )
7816         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7817            CALL ext_ncd_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7818                                  locCount, Outcount, Status ) 
7819         ENDIF
7820         IF ( .NOT. multi_files(io_form) ) THEN
7821           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
7822           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
7823           
7824           
7825           
7826           
7827           
7828           
7829           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7830         ENDIF
7831 #endif
7832 #ifdef PNETCDF
7833       CASE ( IO_PNETCDF   )
7834         CALL ext_pnc_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7835                               locCount, Outcount, Status ) 
7836 #endif
7837 #ifdef PHDF5
7838       CASE ( IO_PHDF5   )
7839         CALL ext_phdf5_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7840                               locCount, Outcount, Status ) 
7841 #endif
7842 #ifdef ESMFIO
7843       CASE ( IO_ESMF )
7844         CALL ext_esmf_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7845                               locCount, Outcount, Status ) 
7846 #endif
7847 #ifdef XXX
7848       CASE ( IO_XXX   )
7849         CALL ext_xxx_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7850                               locCount, Outcount, Status ) 
7851 #endif
7852 #ifdef YYY
7853       CASE ( IO_YYY   )
7854         CALL ext_yyy_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7855                               locCount, Outcount, Status ) 
7856 #endif
7857 #ifdef GRIB1
7858       CASE ( IO_GRIB1   )
7859         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7860            CALL ext_gr1_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7861                                  locCount, Outcount, Status ) 
7862         ENDIF
7863         IF ( .NOT. multi_files(io_form) ) THEN
7864           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
7865           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
7866           
7867           
7868           
7869           
7870           
7871           
7872           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7873         ENDIF
7874 #endif
7875 #ifdef GRIB2
7876       CASE ( IO_GRIB2   )
7877         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7878            CALL ext_gr2_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7879                                  locCount, Outcount, Status ) 
7880         ENDIF
7881         IF ( .NOT. multi_files(io_form) ) THEN
7882           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
7883           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
7884           
7885           
7886           
7887           
7888           
7889           
7890           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7891         ENDIF
7892 #endif
7893 #ifdef INTIO
7894       CASE ( IO_INTIO   )
7895         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7896            CALL ext_int_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7897                                  locCount, Outcount, Status ) 
7898         ENDIF
7899         IF ( .NOT. multi_files(io_form) ) THEN
7900            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
7901            CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
7902            
7903            
7904            
7905            
7906            
7907            
7908            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7909         ENDIF
7910 #endif
7911       CASE DEFAULT
7912     END SELECT
7913   ELSE IF ( for_out .AND. use_output_servers() ) THEN
7914     CALL wrf_quilt_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7915                           locCount, Outcount, Status )
7916   ELSE
7917     Status = 0
7918 ENDIF
7919 ELSE
7920   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
7921 ENDIF
7922 RETURN
7923 END SUBROUTINE wrf_get_var_ti_integer_arr 
7924 !--- get_var_ti_integer
7925 
7926 SUBROUTINE wrf_get_var_ti_integer_sca ( DataHandle,Element,  Varname, Data, Count, Outcount, Status )
7927 !<DESCRIPTION>
7928 !<PRE>
7929 !
7930 ! Attempt to read time independent
7931 ! attribute "Element" of variable "Varname"  
7932 ! from the open dataset described by DataHandle.  
7933 ! Attribute of type integer is
7934 ! stored in scalar Data.
7935 ! 
7936 !
7937 !</PRE>
7938 !</DESCRIPTION>
7939 USE module_state_description
7940 IMPLICIT NONE
7941 INTEGER ,       INTENT(IN)  :: DataHandle
7942 CHARACTER*(*) , INTENT(IN)  :: Element
7943 
7944 CHARACTER*(*) , INTENT(IN)  :: VarName 
7945 
7946  integer  :: Data 
7947 
7948 INTEGER ,       INTENT(IN)  :: Count
7949 INTEGER ,       INTENT(OUT)  :: OutCount
7950 INTEGER ,       INTENT(OUT) :: Status
7951 
7952 #include <wrf_status_codes.h>
7953 INTEGER                     :: len_of_str
7954 LOGICAL                     :: for_out
7955 INTEGER, EXTERNAL           :: use_package
7956 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
7957 INTEGER                     :: locCount
7958 
7959 INTEGER io_form , Hndl
7960 
7961 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_integer_sca " )
7962 
7963 locCount = Count
7964 
7965 
7966 
7967 Status = 0
7968 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
7969 IF ( Hndl .GT. -1 ) THEN
7970   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
7971     SELECT CASE ( use_package( io_form ) )
7972 #ifdef NETCDF
7973       CASE ( IO_NETCDF   )
7974         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
7975            CALL ext_ncd_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7976                                  locCount, Outcount, Status ) 
7977         ENDIF
7978         IF ( .NOT. multi_files(io_form) ) THEN
7979           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
7980           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
7981           
7982           
7983           
7984           
7985           
7986           
7987           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
7988         ENDIF
7989 #endif
7990 #ifdef PNETCDF
7991       CASE ( IO_PNETCDF   )
7992         CALL ext_pnc_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7993                               locCount, Outcount, Status ) 
7994 #endif
7995 #ifdef PHDF5
7996       CASE ( IO_PHDF5   )
7997         CALL ext_phdf5_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
7998                               locCount, Outcount, Status ) 
7999 #endif
8000 #ifdef ESMFIO
8001       CASE ( IO_ESMF )
8002         CALL ext_esmf_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
8003                               locCount, Outcount, Status ) 
8004 #endif
8005 #ifdef XXX
8006       CASE ( IO_XXX   )
8007         CALL ext_xxx_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
8008                               locCount, Outcount, Status ) 
8009 #endif
8010 #ifdef YYY
8011       CASE ( IO_YYY   )
8012         CALL ext_yyy_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
8013                               locCount, Outcount, Status ) 
8014 #endif
8015 #ifdef GRIB1
8016       CASE ( IO_GRIB1   )
8017         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8018            CALL ext_gr1_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
8019                                  locCount, Outcount, Status ) 
8020         ENDIF
8021         IF ( .NOT. multi_files(io_form) ) THEN
8022           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8023           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
8024           
8025           
8026           
8027           
8028           
8029           
8030           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8031         ENDIF
8032 #endif
8033 #ifdef GRIB2
8034       CASE ( IO_GRIB2   )
8035         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8036            CALL ext_gr2_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
8037                                  locCount, Outcount, Status ) 
8038         ENDIF
8039         IF ( .NOT. multi_files(io_form) ) THEN
8040           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8041           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
8042           
8043           
8044           
8045           
8046           
8047           
8048           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8049         ENDIF
8050 #endif
8051 #ifdef INTIO
8052       CASE ( IO_INTIO   )
8053         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8054            CALL ext_int_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
8055                                  locCount, Outcount, Status ) 
8056         ENDIF
8057         IF ( .NOT. multi_files(io_form) ) THEN
8058            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8059            CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
8060            
8061            
8062            
8063            
8064            
8065            
8066            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8067         ENDIF
8068 #endif
8069       CASE DEFAULT
8070     END SELECT
8071   ELSE IF ( for_out .AND. use_output_servers() ) THEN
8072     CALL wrf_quilt_get_var_ti_integer ( Hndl, Element,  Varname, Data, &
8073                           locCount, Outcount, Status )
8074   ELSE
8075     Status = 0
8076 ENDIF
8077 ELSE
8078   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
8079 ENDIF
8080 RETURN
8081 END SUBROUTINE wrf_get_var_ti_integer_sca 
8082 
8083 
8084 !--- put_var_ti_integer
8085 
8086 SUBROUTINE wrf_put_var_ti_integer_arr ( DataHandle,Element,  Varname, Data, Count,  Status )
8087 !<DESCRIPTION>
8088 !<PRE>
8089 !
8090 ! Write Count words of time independent
8091 ! attribute "Element" of variable "Varname"  
8092 ! to the open dataset described by DataHandle.  
8093 ! Attribute of type integer is
8094 ! copied from array Data.
8095 ! 
8096 !
8097 !</PRE>
8098 !</DESCRIPTION>
8099 USE module_state_description
8100 IMPLICIT NONE
8101 INTEGER ,       INTENT(IN)  :: DataHandle
8102 CHARACTER*(*) , INTENT(IN)  :: Element
8103 
8104 CHARACTER*(*) , INTENT(IN)  :: VarName 
8105 
8106  integer  :: Data (*)
8107 
8108 INTEGER ,       INTENT(IN)  :: Count
8109 
8110 INTEGER ,       INTENT(OUT) :: Status
8111 
8112 #include <wrf_status_codes.h>
8113 INTEGER                     :: len_of_str
8114 LOGICAL                     :: for_out
8115 INTEGER, EXTERNAL           :: use_package
8116 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
8117 INTEGER                     :: locCount
8118 
8119 INTEGER io_form , Hndl
8120 
8121 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_integer_arr " )
8122 
8123 locCount = Count
8124 
8125 
8126 
8127 Status = 0
8128 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
8129 IF ( Hndl .GT. -1 ) THEN
8130   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
8131     SELECT CASE ( use_package( io_form ) )
8132 #ifdef NETCDF
8133       CASE ( IO_NETCDF   )
8134         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8135            CALL ext_ncd_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8136                                  locCount,  Status ) 
8137         ENDIF
8138         IF ( .NOT. multi_files(io_form) ) THEN
8139           
8140           
8141           
8142           
8143           
8144           
8145           
8146           
8147           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8148         ENDIF
8149 #endif
8150 #ifdef PNETCDF
8151       CASE ( IO_PNETCDF   )
8152         CALL ext_pnc_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8153                               locCount,  Status ) 
8154 #endif
8155 #ifdef PHDF5
8156       CASE ( IO_PHDF5   )
8157         CALL ext_phdf5_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8158                               locCount,  Status ) 
8159 #endif
8160 #ifdef ESMFIO
8161       CASE ( IO_ESMF )
8162         CALL ext_esmf_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8163                               locCount,  Status ) 
8164 #endif
8165 #ifdef XXX
8166       CASE ( IO_XXX   )
8167         CALL ext_xxx_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8168                               locCount,  Status ) 
8169 #endif
8170 #ifdef YYY
8171       CASE ( IO_YYY   )
8172         CALL ext_yyy_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8173                               locCount,  Status ) 
8174 #endif
8175 #ifdef GRIB1
8176       CASE ( IO_GRIB1   )
8177         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8178            CALL ext_gr1_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8179                                  locCount,  Status ) 
8180         ENDIF
8181         IF ( .NOT. multi_files(io_form) ) THEN
8182           
8183           
8184           
8185           
8186           
8187           
8188           
8189           
8190           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8191         ENDIF
8192 #endif
8193 #ifdef GRIB2
8194       CASE ( IO_GRIB2   )
8195         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8196            CALL ext_gr2_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8197                                  locCount,  Status ) 
8198         ENDIF
8199         IF ( .NOT. multi_files(io_form) ) THEN
8200           
8201           
8202           
8203           
8204           
8205           
8206           
8207           
8208           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8209         ENDIF
8210 #endif
8211 #ifdef INTIO
8212       CASE ( IO_INTIO   )
8213         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8214            CALL ext_int_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8215                                  locCount,  Status ) 
8216         ENDIF
8217         IF ( .NOT. multi_files(io_form) ) THEN
8218            
8219            
8220            
8221            
8222            
8223            
8224            
8225            
8226            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8227         ENDIF
8228 #endif
8229       CASE DEFAULT
8230     END SELECT
8231   ELSE IF ( for_out .AND. use_output_servers() ) THEN
8232     CALL wrf_quilt_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8233                           locCount,  Status )
8234   ELSE
8235     Status = 0
8236 ENDIF
8237 ELSE
8238   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
8239 ENDIF
8240 RETURN
8241 END SUBROUTINE wrf_put_var_ti_integer_arr 
8242 !--- put_var_ti_integer
8243 
8244 SUBROUTINE wrf_put_var_ti_integer_sca ( DataHandle,Element,  Varname, Data, Count,  Status )
8245 !<DESCRIPTION>
8246 !<PRE>
8247 !
8248 ! Write time independent
8249 ! attribute "Element" of variable "Varname"  
8250 ! to the open dataset described by DataHandle.  
8251 ! Attribute of type integer is
8252 ! copied from scalar Data.
8253 ! 
8254 !
8255 !</PRE>
8256 !</DESCRIPTION>
8257 USE module_state_description
8258 IMPLICIT NONE
8259 INTEGER ,       INTENT(IN)  :: DataHandle
8260 CHARACTER*(*) , INTENT(IN)  :: Element
8261 
8262 CHARACTER*(*) , INTENT(IN)  :: VarName 
8263 
8264  integer  :: Data 
8265 
8266 INTEGER ,       INTENT(IN)  :: Count
8267 
8268 INTEGER ,       INTENT(OUT) :: Status
8269 
8270 #include <wrf_status_codes.h>
8271 INTEGER                     :: len_of_str
8272 LOGICAL                     :: for_out
8273 INTEGER, EXTERNAL           :: use_package
8274 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
8275 INTEGER                     :: locCount
8276 
8277 INTEGER io_form , Hndl
8278 
8279 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_integer_sca " )
8280 
8281 locCount = Count
8282 
8283 
8284 
8285 Status = 0
8286 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
8287 IF ( Hndl .GT. -1 ) THEN
8288   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
8289     SELECT CASE ( use_package( io_form ) )
8290 #ifdef NETCDF
8291       CASE ( IO_NETCDF   )
8292         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8293            CALL ext_ncd_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8294                                  locCount,  Status ) 
8295         ENDIF
8296         IF ( .NOT. multi_files(io_form) ) THEN
8297           
8298           
8299           
8300           
8301           
8302           
8303           
8304           
8305           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8306         ENDIF
8307 #endif
8308 #ifdef PNETCDF
8309       CASE ( IO_PNETCDF   )
8310         CALL ext_pnc_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8311                               locCount,  Status ) 
8312 #endif
8313 #ifdef PHDF5
8314       CASE ( IO_PHDF5   )
8315         CALL ext_phdf5_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8316                               locCount,  Status ) 
8317 #endif
8318 #ifdef ESMFIO
8319       CASE ( IO_ESMF )
8320         CALL ext_esmf_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8321                               locCount,  Status ) 
8322 #endif
8323 #ifdef XXX
8324       CASE ( IO_XXX   )
8325         CALL ext_xxx_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8326                               locCount,  Status ) 
8327 #endif
8328 #ifdef YYY
8329       CASE ( IO_YYY   )
8330         CALL ext_yyy_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8331                               locCount,  Status ) 
8332 #endif
8333 #ifdef GRIB1
8334       CASE ( IO_GRIB1   )
8335         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8336            CALL ext_gr1_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8337                                  locCount,  Status ) 
8338         ENDIF
8339         IF ( .NOT. multi_files(io_form) ) THEN
8340           
8341           
8342           
8343           
8344           
8345           
8346           
8347           
8348           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8349         ENDIF
8350 #endif
8351 #ifdef GRIB2
8352       CASE ( IO_GRIB2   )
8353         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8354            CALL ext_gr2_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8355                                  locCount,  Status ) 
8356         ENDIF
8357         IF ( .NOT. multi_files(io_form) ) THEN
8358           
8359           
8360           
8361           
8362           
8363           
8364           
8365           
8366           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8367         ENDIF
8368 #endif
8369 #ifdef INTIO
8370       CASE ( IO_INTIO   )
8371         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8372            CALL ext_int_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8373                                  locCount,  Status ) 
8374         ENDIF
8375         IF ( .NOT. multi_files(io_form) ) THEN
8376            
8377            
8378            
8379            
8380            
8381            
8382            
8383            
8384            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8385         ENDIF
8386 #endif
8387       CASE DEFAULT
8388     END SELECT
8389   ELSE IF ( for_out .AND. use_output_servers() ) THEN
8390     CALL wrf_quilt_put_var_ti_integer ( Hndl, Element,  Varname, Data, &
8391                           locCount,  Status )
8392   ELSE
8393     Status = 0
8394 ENDIF
8395 ELSE
8396   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
8397 ENDIF
8398 RETURN
8399 END SUBROUTINE wrf_put_var_ti_integer_sca 
8400 
8401 
8402 !--- get_var_ti_logical
8403 
8404 SUBROUTINE wrf_get_var_ti_logical_arr ( DataHandle,Element,  Varname, Data, Count, Outcount, Status )
8405 !<DESCRIPTION>
8406 !<PRE>
8407 !
8408 ! Attempt to read Count words of time independent
8409 ! attribute "Element" of variable "Varname"  
8410 ! from the open dataset described by DataHandle.  
8411 ! Attribute of type logical is
8412 ! stored in array Data.
8413 ! Actual number of words read is returned in OutCount.
8414 !
8415 !</PRE>
8416 !</DESCRIPTION>
8417 USE module_state_description
8418 IMPLICIT NONE
8419 INTEGER ,       INTENT(IN)  :: DataHandle
8420 CHARACTER*(*) , INTENT(IN)  :: Element
8421 
8422 CHARACTER*(*) , INTENT(IN)  :: VarName 
8423 
8424  logical  :: Data (*)
8425 
8426 INTEGER ,       INTENT(IN)  :: Count
8427 INTEGER ,       INTENT(OUT)  :: OutCount
8428 INTEGER ,       INTENT(OUT) :: Status
8429 
8430 #include <wrf_status_codes.h>
8431 INTEGER                     :: len_of_str
8432 LOGICAL                     :: for_out
8433 INTEGER, EXTERNAL           :: use_package
8434 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
8435 INTEGER                     :: locCount
8436 
8437 INTEGER io_form , Hndl
8438 
8439 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_logical_arr " )
8440 
8441 
8442 
8443 locCount = Count
8444 
8445 Status = 0
8446 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
8447 IF ( Hndl .GT. -1 ) THEN
8448   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
8449     SELECT CASE ( use_package( io_form ) )
8450 #ifdef NETCDF
8451       CASE ( IO_NETCDF   )
8452         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8453            CALL ext_ncd_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8454                                  locCount, Outcount, Status ) 
8455         ENDIF
8456         IF ( .NOT. multi_files(io_form) ) THEN
8457           
8458           
8459           
8460           
8461           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8462           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
8463           
8464           
8465           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8466         ENDIF
8467 #endif
8468 #ifdef PNETCDF
8469       CASE ( IO_PNETCDF   )
8470         CALL ext_pnc_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8471                               locCount, Outcount, Status ) 
8472 #endif
8473 #ifdef PHDF5
8474       CASE ( IO_PHDF5   )
8475         CALL ext_phdf5_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8476                               locCount, Outcount, Status ) 
8477 #endif
8478 #ifdef ESMFIO
8479       CASE ( IO_ESMF )
8480         CALL ext_esmf_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8481                               locCount, Outcount, Status ) 
8482 #endif
8483 #ifdef XXX
8484       CASE ( IO_XXX   )
8485         CALL ext_xxx_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8486                               locCount, Outcount, Status ) 
8487 #endif
8488 #ifdef YYY
8489       CASE ( IO_YYY   )
8490         CALL ext_yyy_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8491                               locCount, Outcount, Status ) 
8492 #endif
8493 #ifdef GRIB1
8494       CASE ( IO_GRIB1   )
8495         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8496            CALL ext_gr1_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8497                                  locCount, Outcount, Status ) 
8498         ENDIF
8499         IF ( .NOT. multi_files(io_form) ) THEN
8500           
8501           
8502           
8503           
8504           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8505           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
8506           
8507           
8508           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8509         ENDIF
8510 #endif
8511 #ifdef GRIB2
8512       CASE ( IO_GRIB2   )
8513         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8514            CALL ext_gr2_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8515                                  locCount, Outcount, Status ) 
8516         ENDIF
8517         IF ( .NOT. multi_files(io_form) ) THEN
8518           
8519           
8520           
8521           
8522           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8523           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
8524           
8525           
8526           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8527         ENDIF
8528 #endif
8529 #ifdef INTIO
8530       CASE ( IO_INTIO   )
8531         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8532            CALL ext_int_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8533                                  locCount, Outcount, Status ) 
8534         ENDIF
8535         IF ( .NOT. multi_files(io_form) ) THEN
8536            
8537            
8538            
8539            
8540            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8541            CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
8542            
8543            
8544            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8545         ENDIF
8546 #endif
8547       CASE DEFAULT
8548     END SELECT
8549   ELSE IF ( for_out .AND. use_output_servers() ) THEN
8550     CALL wrf_quilt_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8551                           locCount, Outcount, Status )
8552   ELSE
8553     Status = 0
8554 ENDIF
8555 ELSE
8556   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
8557 ENDIF
8558 RETURN
8559 END SUBROUTINE wrf_get_var_ti_logical_arr 
8560 !--- get_var_ti_logical
8561 
8562 SUBROUTINE wrf_get_var_ti_logical_sca ( DataHandle,Element,  Varname, Data, Count, Outcount, Status )
8563 !<DESCRIPTION>
8564 !<PRE>
8565 !
8566 ! Attempt to read time independent
8567 ! attribute "Element" of variable "Varname"  
8568 ! from the open dataset described by DataHandle.  
8569 ! Attribute of type logical is
8570 ! stored in scalar Data.
8571 ! 
8572 !
8573 !</PRE>
8574 !</DESCRIPTION>
8575 USE module_state_description
8576 IMPLICIT NONE
8577 INTEGER ,       INTENT(IN)  :: DataHandle
8578 CHARACTER*(*) , INTENT(IN)  :: Element
8579 
8580 CHARACTER*(*) , INTENT(IN)  :: VarName 
8581 
8582  logical  :: Data 
8583 
8584 INTEGER ,       INTENT(IN)  :: Count
8585 INTEGER ,       INTENT(OUT)  :: OutCount
8586 INTEGER ,       INTENT(OUT) :: Status
8587 
8588 #include <wrf_status_codes.h>
8589 INTEGER                     :: len_of_str
8590 LOGICAL                     :: for_out
8591 INTEGER, EXTERNAL           :: use_package
8592 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
8593 INTEGER                     :: locCount
8594 
8595 INTEGER io_form , Hndl
8596 
8597 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_logical_sca " )
8598 
8599 
8600 
8601 locCount = Count
8602 
8603 Status = 0
8604 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
8605 IF ( Hndl .GT. -1 ) THEN
8606   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
8607     SELECT CASE ( use_package( io_form ) )
8608 #ifdef NETCDF
8609       CASE ( IO_NETCDF   )
8610         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8611            CALL ext_ncd_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8612                                  locCount, Outcount, Status ) 
8613         ENDIF
8614         IF ( .NOT. multi_files(io_form) ) THEN
8615           
8616           
8617           
8618           
8619           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8620           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
8621           
8622           
8623           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8624         ENDIF
8625 #endif
8626 #ifdef PNETCDF
8627       CASE ( IO_PNETCDF   )
8628         CALL ext_pnc_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8629                               locCount, Outcount, Status ) 
8630 #endif
8631 #ifdef PHDF5
8632       CASE ( IO_PHDF5   )
8633         CALL ext_phdf5_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8634                               locCount, Outcount, Status ) 
8635 #endif
8636 #ifdef ESMFIO
8637       CASE ( IO_ESMF )
8638         CALL ext_esmf_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8639                               locCount, Outcount, Status ) 
8640 #endif
8641 #ifdef XXX
8642       CASE ( IO_XXX   )
8643         CALL ext_xxx_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8644                               locCount, Outcount, Status ) 
8645 #endif
8646 #ifdef YYY
8647       CASE ( IO_YYY   )
8648         CALL ext_yyy_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8649                               locCount, Outcount, Status ) 
8650 #endif
8651 #ifdef GRIB1
8652       CASE ( IO_GRIB1   )
8653         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8654            CALL ext_gr1_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8655                                  locCount, Outcount, Status ) 
8656         ENDIF
8657         IF ( .NOT. multi_files(io_form) ) THEN
8658           
8659           
8660           
8661           
8662           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8663           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
8664           
8665           
8666           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8667         ENDIF
8668 #endif
8669 #ifdef GRIB2
8670       CASE ( IO_GRIB2   )
8671         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8672            CALL ext_gr2_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8673                                  locCount, Outcount, Status ) 
8674         ENDIF
8675         IF ( .NOT. multi_files(io_form) ) THEN
8676           
8677           
8678           
8679           
8680           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8681           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
8682           
8683           
8684           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8685         ENDIF
8686 #endif
8687 #ifdef INTIO
8688       CASE ( IO_INTIO   )
8689         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8690            CALL ext_int_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8691                                  locCount, Outcount, Status ) 
8692         ENDIF
8693         IF ( .NOT. multi_files(io_form) ) THEN
8694            
8695            
8696            
8697            
8698            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
8699            CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
8700            
8701            
8702            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8703         ENDIF
8704 #endif
8705       CASE DEFAULT
8706     END SELECT
8707   ELSE IF ( for_out .AND. use_output_servers() ) THEN
8708     CALL wrf_quilt_get_var_ti_logical ( Hndl, Element,  Varname, Data, &
8709                           locCount, Outcount, Status )
8710   ELSE
8711     Status = 0
8712 ENDIF
8713 ELSE
8714   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
8715 ENDIF
8716 RETURN
8717 END SUBROUTINE wrf_get_var_ti_logical_sca 
8718 
8719 
8720 !--- put_var_ti_logical
8721 
8722 SUBROUTINE wrf_put_var_ti_logical_arr ( DataHandle,Element,  Varname, Data, Count,  Status )
8723 !<DESCRIPTION>
8724 !<PRE>
8725 !
8726 ! Write Count words of time independent
8727 ! attribute "Element" of variable "Varname"  
8728 ! to the open dataset described by DataHandle.  
8729 ! Attribute of type logical is
8730 ! copied from array Data.
8731 ! 
8732 !
8733 !</PRE>
8734 !</DESCRIPTION>
8735 USE module_state_description
8736 IMPLICIT NONE
8737 INTEGER ,       INTENT(IN)  :: DataHandle
8738 CHARACTER*(*) , INTENT(IN)  :: Element
8739 
8740 CHARACTER*(*) , INTENT(IN)  :: VarName 
8741 
8742  logical  :: Data (*)
8743 
8744 INTEGER ,       INTENT(IN)  :: Count
8745 
8746 INTEGER ,       INTENT(OUT) :: Status
8747 
8748 #include <wrf_status_codes.h>
8749 INTEGER                     :: len_of_str
8750 LOGICAL                     :: for_out
8751 INTEGER, EXTERNAL           :: use_package
8752 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
8753 INTEGER                     :: locCount
8754 
8755 INTEGER io_form , Hndl
8756 
8757 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_logical_arr " )
8758 
8759 
8760 
8761 locCount = Count
8762 
8763 Status = 0
8764 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
8765 IF ( Hndl .GT. -1 ) THEN
8766   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
8767     SELECT CASE ( use_package( io_form ) )
8768 #ifdef NETCDF
8769       CASE ( IO_NETCDF   )
8770         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8771            CALL ext_ncd_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8772                                  locCount,  Status ) 
8773         ENDIF
8774         IF ( .NOT. multi_files(io_form) ) THEN
8775           
8776           
8777           
8778           
8779           
8780           
8781           
8782           
8783           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8784         ENDIF
8785 #endif
8786 #ifdef PNETCDF
8787       CASE ( IO_PNETCDF   )
8788         CALL ext_pnc_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8789                               locCount,  Status ) 
8790 #endif
8791 #ifdef PHDF5
8792       CASE ( IO_PHDF5   )
8793         CALL ext_phdf5_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8794                               locCount,  Status ) 
8795 #endif
8796 #ifdef ESMFIO
8797       CASE ( IO_ESMF )
8798         CALL ext_esmf_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8799                               locCount,  Status ) 
8800 #endif
8801 #ifdef XXX
8802       CASE ( IO_XXX   )
8803         CALL ext_xxx_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8804                               locCount,  Status ) 
8805 #endif
8806 #ifdef YYY
8807       CASE ( IO_YYY   )
8808         CALL ext_yyy_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8809                               locCount,  Status ) 
8810 #endif
8811 #ifdef GRIB1
8812       CASE ( IO_GRIB1   )
8813         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8814            CALL ext_gr1_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8815                                  locCount,  Status ) 
8816         ENDIF
8817         IF ( .NOT. multi_files(io_form) ) THEN
8818           
8819           
8820           
8821           
8822           
8823           
8824           
8825           
8826           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8827         ENDIF
8828 #endif
8829 #ifdef GRIB2
8830       CASE ( IO_GRIB2   )
8831         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8832            CALL ext_gr2_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8833                                  locCount,  Status ) 
8834         ENDIF
8835         IF ( .NOT. multi_files(io_form) ) THEN
8836           
8837           
8838           
8839           
8840           
8841           
8842           
8843           
8844           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8845         ENDIF
8846 #endif
8847 #ifdef INTIO
8848       CASE ( IO_INTIO   )
8849         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8850            CALL ext_int_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8851                                  locCount,  Status ) 
8852         ENDIF
8853         IF ( .NOT. multi_files(io_form) ) THEN
8854            
8855            
8856            
8857            
8858            
8859            
8860            
8861            
8862            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8863         ENDIF
8864 #endif
8865       CASE DEFAULT
8866     END SELECT
8867   ELSE IF ( for_out .AND. use_output_servers() ) THEN
8868     CALL wrf_quilt_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8869                           locCount,  Status )
8870   ELSE
8871     Status = 0
8872 ENDIF
8873 ELSE
8874   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
8875 ENDIF
8876 RETURN
8877 END SUBROUTINE wrf_put_var_ti_logical_arr 
8878 !--- put_var_ti_logical
8879 
8880 SUBROUTINE wrf_put_var_ti_logical_sca ( DataHandle,Element,  Varname, Data, Count,  Status )
8881 !<DESCRIPTION>
8882 !<PRE>
8883 !
8884 ! Write time independent
8885 ! attribute "Element" of variable "Varname"  
8886 ! to the open dataset described by DataHandle.  
8887 ! Attribute of type logical is
8888 ! copied from scalar Data.
8889 ! 
8890 !
8891 !</PRE>
8892 !</DESCRIPTION>
8893 USE module_state_description
8894 IMPLICIT NONE
8895 INTEGER ,       INTENT(IN)  :: DataHandle
8896 CHARACTER*(*) , INTENT(IN)  :: Element
8897 
8898 CHARACTER*(*) , INTENT(IN)  :: VarName 
8899 
8900  logical  :: Data 
8901 
8902 INTEGER ,       INTENT(IN)  :: Count
8903 
8904 INTEGER ,       INTENT(OUT) :: Status
8905 
8906 #include <wrf_status_codes.h>
8907 INTEGER                     :: len_of_str
8908 LOGICAL                     :: for_out
8909 INTEGER, EXTERNAL           :: use_package
8910 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
8911 INTEGER                     :: locCount
8912 
8913 INTEGER io_form , Hndl
8914 
8915 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_logical_sca " )
8916 
8917 
8918 
8919 locCount = Count
8920 
8921 Status = 0
8922 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
8923 IF ( Hndl .GT. -1 ) THEN
8924   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
8925     SELECT CASE ( use_package( io_form ) )
8926 #ifdef NETCDF
8927       CASE ( IO_NETCDF   )
8928         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8929            CALL ext_ncd_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8930                                  locCount,  Status ) 
8931         ENDIF
8932         IF ( .NOT. multi_files(io_form) ) THEN
8933           
8934           
8935           
8936           
8937           
8938           
8939           
8940           
8941           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8942         ENDIF
8943 #endif
8944 #ifdef PNETCDF
8945       CASE ( IO_PNETCDF   )
8946         CALL ext_pnc_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8947                               locCount,  Status ) 
8948 #endif
8949 #ifdef PHDF5
8950       CASE ( IO_PHDF5   )
8951         CALL ext_phdf5_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8952                               locCount,  Status ) 
8953 #endif
8954 #ifdef ESMFIO
8955       CASE ( IO_ESMF )
8956         CALL ext_esmf_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8957                               locCount,  Status ) 
8958 #endif
8959 #ifdef XXX
8960       CASE ( IO_XXX   )
8961         CALL ext_xxx_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8962                               locCount,  Status ) 
8963 #endif
8964 #ifdef YYY
8965       CASE ( IO_YYY   )
8966         CALL ext_yyy_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8967                               locCount,  Status ) 
8968 #endif
8969 #ifdef GRIB1
8970       CASE ( IO_GRIB1   )
8971         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8972            CALL ext_gr1_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8973                                  locCount,  Status ) 
8974         ENDIF
8975         IF ( .NOT. multi_files(io_form) ) THEN
8976           
8977           
8978           
8979           
8980           
8981           
8982           
8983           
8984           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
8985         ENDIF
8986 #endif
8987 #ifdef GRIB2
8988       CASE ( IO_GRIB2   )
8989         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
8990            CALL ext_gr2_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
8991                                  locCount,  Status ) 
8992         ENDIF
8993         IF ( .NOT. multi_files(io_form) ) THEN
8994           
8995           
8996           
8997           
8998           
8999           
9000           
9001           
9002           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9003         ENDIF
9004 #endif
9005 #ifdef INTIO
9006       CASE ( IO_INTIO   )
9007         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9008            CALL ext_int_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
9009                                  locCount,  Status ) 
9010         ENDIF
9011         IF ( .NOT. multi_files(io_form) ) THEN
9012            
9013            
9014            
9015            
9016            
9017            
9018            
9019            
9020            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9021         ENDIF
9022 #endif
9023       CASE DEFAULT
9024     END SELECT
9025   ELSE IF ( for_out .AND. use_output_servers() ) THEN
9026     CALL wrf_quilt_put_var_ti_logical ( Hndl, Element,  Varname, Data, &
9027                           locCount,  Status )
9028   ELSE
9029     Status = 0
9030 ENDIF
9031 ELSE
9032   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
9033 ENDIF
9034 RETURN
9035 END SUBROUTINE wrf_put_var_ti_logical_sca 
9036 
9037 
9038 !--- get_var_ti_char
9039 
9040 SUBROUTINE wrf_get_var_ti_char_arr ( DataHandle,Element,  Varname, Data,  Status )
9041 !<DESCRIPTION>
9042 !<PRE>
9043 !
9044 ! Attempt to read time independent
9045 ! attribute "Element" of variable "Varname"  
9046 ! from the open dataset described by DataHandle.  
9047 ! Attribute of type char is
9048 ! stored in string Data.
9049 ! 
9050 !
9051 !</PRE>
9052 !</DESCRIPTION>
9053 USE module_state_description
9054 IMPLICIT NONE
9055 INTEGER ,       INTENT(IN)  :: DataHandle
9056 CHARACTER*(*) , INTENT(IN)  :: Element
9057 
9058 CHARACTER*(*) , INTENT(IN)  :: VarName 
9059 
9060  CHARACTER*(*)  :: Data
9061 
9062 
9063 
9064 INTEGER ,       INTENT(OUT) :: Status
9065 
9066 #include <wrf_status_codes.h>
9067 INTEGER                     :: len_of_str
9068 LOGICAL                     :: for_out
9069 INTEGER, EXTERNAL           :: use_package
9070 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
9071 INTEGER                     :: locCount
9072 
9073 INTEGER io_form , Hndl
9074 
9075 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_ti_char_arr " )
9076 
9077 
9078 
9079 
9080 
9081 Status = 0
9082 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
9083 IF ( Hndl .GT. -1 ) THEN
9084   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
9085     SELECT CASE ( use_package( io_form ) )
9086 #ifdef NETCDF
9087       CASE ( IO_NETCDF   )
9088         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9089            CALL ext_ncd_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9090                                   Status ) 
9091         ENDIF
9092         IF ( .NOT. multi_files(io_form) ) THEN
9093           
9094           
9095           
9096           
9097           
9098           
9099           len_of_str = LEN(Data)
9100           CALL wrf_dm_bcast_string( Data, len_of_str )
9101           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9102         ENDIF
9103 #endif
9104 #ifdef PNETCDF
9105       CASE ( IO_PNETCDF   )
9106         CALL ext_pnc_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9107                                Status ) 
9108 #endif
9109 #ifdef PHDF5
9110       CASE ( IO_PHDF5   )
9111         CALL ext_phdf5_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9112                                Status ) 
9113 #endif
9114 #ifdef ESMFIO
9115       CASE ( IO_ESMF )
9116         CALL ext_esmf_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9117                                Status ) 
9118 #endif
9119 #ifdef XXX
9120       CASE ( IO_XXX   )
9121         CALL ext_xxx_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9122                                Status ) 
9123 #endif
9124 #ifdef YYY
9125       CASE ( IO_YYY   )
9126         CALL ext_yyy_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9127                                Status ) 
9128 #endif
9129 #ifdef GRIB1
9130       CASE ( IO_GRIB1   )
9131         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9132            CALL ext_gr1_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9133                                   Status ) 
9134         ENDIF
9135         IF ( .NOT. multi_files(io_form) ) THEN
9136           
9137           
9138           
9139           
9140           
9141           
9142           len_of_str = LEN(Data)
9143           CALL wrf_dm_bcast_string( Data, len_of_str )
9144           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9145         ENDIF
9146 #endif
9147 #ifdef GRIB2
9148       CASE ( IO_GRIB2   )
9149         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9150            CALL ext_gr2_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9151                                   Status ) 
9152         ENDIF
9153         IF ( .NOT. multi_files(io_form) ) THEN
9154           
9155           
9156           
9157           
9158           
9159           
9160           len_of_str = LEN(Data)
9161           CALL wrf_dm_bcast_string( Data, len_of_str )
9162           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9163         ENDIF
9164 #endif
9165 #ifdef INTIO
9166       CASE ( IO_INTIO   )
9167         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9168            CALL ext_int_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9169                                   Status ) 
9170         ENDIF
9171         IF ( .NOT. multi_files(io_form) ) THEN
9172            
9173            
9174            
9175            
9176            
9177            
9178            len_of_str = LEN(Data)
9179            CALL wrf_dm_bcast_string( Data, len_of_str )
9180            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9181         ENDIF
9182 #endif
9183       CASE DEFAULT
9184     END SELECT
9185   ELSE IF ( for_out .AND. use_output_servers() ) THEN
9186     CALL wrf_quilt_get_var_ti_char ( Hndl, Element,  Varname, Data, &
9187                            Status )
9188   ELSE
9189     Status = 0
9190 ENDIF
9191 ELSE
9192   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
9193 ENDIF
9194 RETURN
9195 END SUBROUTINE wrf_get_var_ti_char_arr 
9196 
9197 
9198 !--- put_var_ti_char
9199 
9200 SUBROUTINE wrf_put_var_ti_char_arr ( DataHandle,Element,  Varname, Data,  Status )
9201 !<DESCRIPTION>
9202 !<PRE>
9203 !
9204 ! Write time independent
9205 ! attribute "Element" of variable "Varname"  
9206 ! to the open dataset described by DataHandle.  
9207 ! Attribute of type char is
9208 ! copied from string Data.
9209 ! 
9210 !
9211 !</PRE>
9212 !</DESCRIPTION>
9213 USE module_state_description
9214 IMPLICIT NONE
9215 INTEGER ,       INTENT(IN)  :: DataHandle
9216 CHARACTER*(*) , INTENT(IN)  :: Element
9217 
9218 CHARACTER*(*) , INTENT(IN)  :: VarName 
9219 
9220  CHARACTER*(*)  :: Data
9221 
9222 
9223 
9224 INTEGER ,       INTENT(OUT) :: Status
9225 
9226 #include <wrf_status_codes.h>
9227 INTEGER                     :: len_of_str
9228 LOGICAL                     :: for_out
9229 INTEGER, EXTERNAL           :: use_package
9230 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
9231 INTEGER                     :: locCount
9232 
9233 INTEGER io_form , Hndl
9234 
9235 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_ti_char_arr " )
9236 
9237 
9238 
9239 
9240 
9241 Status = 0
9242 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
9243 IF ( Hndl .GT. -1 ) THEN
9244   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
9245     SELECT CASE ( use_package( io_form ) )
9246 #ifdef NETCDF
9247       CASE ( IO_NETCDF   )
9248         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9249            CALL ext_ncd_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9250                                   Status ) 
9251         ENDIF
9252         IF ( .NOT. multi_files(io_form) ) THEN
9253           
9254           
9255           
9256           
9257           
9258           
9259           
9260           
9261           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9262         ENDIF
9263 #endif
9264 #ifdef PNETCDF
9265       CASE ( IO_PNETCDF   )
9266         CALL ext_pnc_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9267                                Status ) 
9268 #endif
9269 #ifdef PHDF5
9270       CASE ( IO_PHDF5   )
9271         CALL ext_phdf5_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9272                                Status ) 
9273 #endif
9274 #ifdef ESMFIO
9275       CASE ( IO_ESMF )
9276         CALL ext_esmf_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9277                                Status ) 
9278 #endif
9279 #ifdef XXX
9280       CASE ( IO_XXX   )
9281         CALL ext_xxx_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9282                                Status ) 
9283 #endif
9284 #ifdef YYY
9285       CASE ( IO_YYY   )
9286         CALL ext_yyy_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9287                                Status ) 
9288 #endif
9289 #ifdef GRIB1
9290       CASE ( IO_GRIB1   )
9291         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9292            CALL ext_gr1_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9293                                   Status ) 
9294         ENDIF
9295         IF ( .NOT. multi_files(io_form) ) THEN
9296           
9297           
9298           
9299           
9300           
9301           
9302           
9303           
9304           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9305         ENDIF
9306 #endif
9307 #ifdef GRIB2
9308       CASE ( IO_GRIB2   )
9309         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9310            CALL ext_gr2_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9311                                   Status ) 
9312         ENDIF
9313         IF ( .NOT. multi_files(io_form) ) THEN
9314           
9315           
9316           
9317           
9318           
9319           
9320           
9321           
9322           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9323         ENDIF
9324 #endif
9325 #ifdef INTIO
9326       CASE ( IO_INTIO   )
9327         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9328            CALL ext_int_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9329                                   Status ) 
9330         ENDIF
9331         IF ( .NOT. multi_files(io_form) ) THEN
9332            
9333            
9334            
9335            
9336            
9337            
9338            
9339            
9340            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9341         ENDIF
9342 #endif
9343       CASE DEFAULT
9344     END SELECT
9345   ELSE IF ( for_out .AND. use_output_servers() ) THEN
9346     CALL wrf_quilt_put_var_ti_char ( Hndl, Element,  Varname, Data, &
9347                            Status )
9348   ELSE
9349     Status = 0
9350 ENDIF
9351 ELSE
9352   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
9353 ENDIF
9354 RETURN
9355 END SUBROUTINE wrf_put_var_ti_char_arr 
9356 
9357 
9358 
9359 !--- get_var_td_real
9360 
9361 SUBROUTINE wrf_get_var_td_real_arr ( DataHandle,Element, DateStr, Varname, Data, Count, Outcount, Status )
9362 !<DESCRIPTION>
9363 !<PRE>
9364 !
9365 ! Attempt to read Count words of time dependent
9366 ! attribute "Element" of variable "Varname" valid at time DateStr 
9367 ! from the open dataset described by DataHandle.  
9368 ! Attribute of type real is
9369 ! stored in array Data.
9370 ! Actual number of words read is returned in OutCount.
9371 !
9372 !</PRE>
9373 !</DESCRIPTION>
9374 USE module_state_description
9375 IMPLICIT NONE
9376 INTEGER ,       INTENT(IN)  :: DataHandle
9377 CHARACTER*(*) , INTENT(IN)  :: Element
9378 CHARACTER*(*) , INTENT(IN)  :: DateStr
9379 CHARACTER*(*) , INTENT(IN)  :: VarName 
9380 
9381  real  :: Data (*)
9382 
9383 INTEGER ,       INTENT(IN)  :: Count
9384 INTEGER ,       INTENT(OUT)  :: OutCount
9385 INTEGER ,       INTENT(OUT) :: Status
9386 
9387 #include <wrf_status_codes.h>
9388 INTEGER                     :: len_of_str
9389 LOGICAL                     :: for_out
9390 INTEGER, EXTERNAL           :: use_package
9391 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
9392 INTEGER                     :: locCount
9393 
9394 INTEGER io_form , Hndl
9395 
9396 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_real_arr " )
9397 
9398 
9399 locCount = Count
9400 
9401 
9402 Status = 0
9403 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
9404 IF ( Hndl .GT. -1 ) THEN
9405   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
9406     SELECT CASE ( use_package( io_form ) )
9407 #ifdef NETCDF
9408       CASE ( IO_NETCDF   )
9409         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9410 #  if ( RWORDSIZE == DWORDSIZE )
9411            CALL ext_ncd_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9412                                  locCount, Outcount, Status )
9413 #  else
9414            CALL ext_ncd_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9415                                  locCount, Outcount, Status )
9416 #  endif
9417         ENDIF
9418         IF ( .NOT. multi_files(io_form) ) THEN
9419           
9420           
9421           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
9422           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
9423           
9424           
9425           
9426           
9427           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9428         ENDIF
9429 #endif
9430 #ifdef PNETCDF
9431       CASE ( IO_PNETCDF   )
9432 #  if ( RWORDSIZE == DWORDSIZE )
9433         CALL ext_pnc_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9434                               locCount, Outcount, Status )
9435 #  else
9436         CALL ext_pnc_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9437                               locCount, Outcount, Status )
9438 #  endif
9439 #endif
9440 #ifdef PHDF5
9441       CASE ( IO_PHDF5   )
9442 #  if ( RWORDSIZE == DWORDSIZE )
9443         CALL ext_phdf5_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9444                               locCount, Outcount, Status )
9445 #  else
9446         CALL ext_phdf5_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9447                               locCount, Outcount, Status )
9448 #  endif
9449 #endif
9450 #ifdef ESMFIO
9451       CASE ( IO_ESMF )
9452 #  if ( RWORDSIZE == DWORDSIZE )
9453         CALL ext_esmf_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9454                               locCount, Outcount, Status )
9455 #  else
9456         CALL ext_esmf_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9457                               locCount, Outcount, Status )
9458 #  endif
9459 #endif
9460 #ifdef XXX
9461       CASE ( IO_XXX   )
9462 #  if ( RWORDSIZE == DWORDSIZE )
9463         CALL ext_xxx_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9464                               locCount, Outcount, Status )
9465 #  else
9466         CALL ext_xxx_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9467                               locCount, Outcount, Status )
9468 #  endif
9469 #endif
9470 #ifdef YYY
9471       CASE ( IO_YYY   )
9472 #  if ( RWORDSIZE == DWORDSIZE )
9473         CALL ext_yyy_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9474                               locCount, Outcount, Status )
9475 #  else
9476         CALL ext_yyy_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9477                               locCount, Outcount, Status )
9478 #  endif
9479 #endif
9480 #ifdef GRIB1
9481       CASE ( IO_GRIB1   )
9482         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9483 #  if ( RWORDSIZE == DWORDSIZE )
9484            CALL ext_gr1_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9485                                  locCount, Outcount, Status )
9486 #  else
9487            CALL ext_gr1_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9488                                  locCount, Outcount, Status )
9489 #  endif
9490         ENDIF
9491         IF ( .NOT. multi_files(io_form) ) THEN
9492           
9493           
9494           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
9495           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
9496           
9497           
9498           
9499           
9500           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9501         ENDIF
9502 #endif
9503 #ifdef GRIB2
9504       CASE ( IO_GRIB2   )
9505         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9506 #  if ( RWORDSIZE == DWORDSIZE )
9507            CALL ext_gr2_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9508                                  locCount, Outcount, Status )
9509 #  else
9510            CALL ext_gr2_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9511                                  locCount, Outcount, Status )
9512 #  endif
9513         ENDIF
9514         IF ( .NOT. multi_files(io_form) ) THEN
9515           
9516           
9517           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
9518           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
9519           
9520           
9521           
9522           
9523           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9524         ENDIF
9525 #endif
9526 #ifdef INTIO
9527       CASE ( IO_INTIO   )
9528         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9529 #  if ( RWORDSIZE == DWORDSIZE )
9530            CALL ext_int_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9531                                  locCount, Outcount, Status )
9532 #  else
9533            CALL ext_int_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9534                                  locCount, Outcount, Status )
9535 #  endif
9536         ENDIF
9537         IF ( .NOT. multi_files(io_form) ) THEN
9538            
9539            
9540            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
9541            CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
9542            
9543            
9544            
9545            
9546            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9547         ENDIF
9548 #endif
9549       CASE DEFAULT
9550     END SELECT
9551   ELSE IF ( for_out .AND. use_output_servers() ) THEN
9552     CALL wrf_quilt_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9553                           locCount, Outcount, Status )
9554   ELSE
9555     Status = 0
9556 ENDIF
9557 ELSE
9558   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
9559 ENDIF
9560 RETURN
9561 END SUBROUTINE wrf_get_var_td_real_arr 
9562 !--- get_var_td_real
9563 
9564 SUBROUTINE wrf_get_var_td_real_sca ( DataHandle,Element, DateStr, Varname, Data, Count, Outcount, Status )
9565 !<DESCRIPTION>
9566 !<PRE>
9567 !
9568 ! Attempt to read time dependent
9569 ! attribute "Element" of variable "Varname" valid at time DateStr 
9570 ! from the open dataset described by DataHandle.  
9571 ! Attribute of type real is
9572 ! stored in scalar Data.
9573 ! 
9574 !
9575 !</PRE>
9576 !</DESCRIPTION>
9577 USE module_state_description
9578 IMPLICIT NONE
9579 INTEGER ,       INTENT(IN)  :: DataHandle
9580 CHARACTER*(*) , INTENT(IN)  :: Element
9581 CHARACTER*(*) , INTENT(IN)  :: DateStr
9582 CHARACTER*(*) , INTENT(IN)  :: VarName 
9583 
9584  real  :: Data 
9585 
9586 INTEGER ,       INTENT(IN)  :: Count
9587 INTEGER ,       INTENT(OUT)  :: OutCount
9588 INTEGER ,       INTENT(OUT) :: Status
9589 
9590 #include <wrf_status_codes.h>
9591 INTEGER                     :: len_of_str
9592 LOGICAL                     :: for_out
9593 INTEGER, EXTERNAL           :: use_package
9594 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
9595 INTEGER                     :: locCount
9596 
9597 INTEGER io_form , Hndl
9598 
9599 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_real_sca " )
9600 
9601 
9602 locCount = Count
9603 
9604 
9605 Status = 0
9606 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
9607 IF ( Hndl .GT. -1 ) THEN
9608   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
9609     SELECT CASE ( use_package( io_form ) )
9610 #ifdef NETCDF
9611       CASE ( IO_NETCDF   )
9612         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9613 #  if ( RWORDSIZE == DWORDSIZE )
9614            CALL ext_ncd_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9615                                  locCount, Outcount, Status )
9616 #  else
9617            CALL ext_ncd_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9618                                  locCount, Outcount, Status )
9619 #  endif
9620         ENDIF
9621         IF ( .NOT. multi_files(io_form) ) THEN
9622           
9623           
9624           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
9625           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
9626           
9627           
9628           
9629           
9630           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9631         ENDIF
9632 #endif
9633 #ifdef PNETCDF
9634       CASE ( IO_PNETCDF   )
9635 #  if ( RWORDSIZE == DWORDSIZE )
9636         CALL ext_pnc_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9637                               locCount, Outcount, Status )
9638 #  else
9639         CALL ext_pnc_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9640                               locCount, Outcount, Status )
9641 #  endif
9642 #endif
9643 #ifdef PHDF5
9644       CASE ( IO_PHDF5   )
9645 #  if ( RWORDSIZE == DWORDSIZE )
9646         CALL ext_phdf5_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9647                               locCount, Outcount, Status )
9648 #  else
9649         CALL ext_phdf5_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9650                               locCount, Outcount, Status )
9651 #  endif
9652 #endif
9653 #ifdef ESMFIO
9654       CASE ( IO_ESMF )
9655 #  if ( RWORDSIZE == DWORDSIZE )
9656         CALL ext_esmf_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9657                               locCount, Outcount, Status )
9658 #  else
9659         CALL ext_esmf_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9660                               locCount, Outcount, Status )
9661 #  endif
9662 #endif
9663 #ifdef XXX
9664       CASE ( IO_XXX   )
9665 #  if ( RWORDSIZE == DWORDSIZE )
9666         CALL ext_xxx_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9667                               locCount, Outcount, Status )
9668 #  else
9669         CALL ext_xxx_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9670                               locCount, Outcount, Status )
9671 #  endif
9672 #endif
9673 #ifdef YYY
9674       CASE ( IO_YYY   )
9675 #  if ( RWORDSIZE == DWORDSIZE )
9676         CALL ext_yyy_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9677                               locCount, Outcount, Status )
9678 #  else
9679         CALL ext_yyy_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9680                               locCount, Outcount, Status )
9681 #  endif
9682 #endif
9683 #ifdef GRIB1
9684       CASE ( IO_GRIB1   )
9685         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9686 #  if ( RWORDSIZE == DWORDSIZE )
9687            CALL ext_gr1_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9688                                  locCount, Outcount, Status )
9689 #  else
9690            CALL ext_gr1_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9691                                  locCount, Outcount, Status )
9692 #  endif
9693         ENDIF
9694         IF ( .NOT. multi_files(io_form) ) THEN
9695           
9696           
9697           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
9698           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
9699           
9700           
9701           
9702           
9703           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9704         ENDIF
9705 #endif
9706 #ifdef GRIB2
9707       CASE ( IO_GRIB2   )
9708         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9709 #  if ( RWORDSIZE == DWORDSIZE )
9710            CALL ext_gr2_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9711                                  locCount, Outcount, Status )
9712 #  else
9713            CALL ext_gr2_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9714                                  locCount, Outcount, Status )
9715 #  endif
9716         ENDIF
9717         IF ( .NOT. multi_files(io_form) ) THEN
9718           
9719           
9720           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
9721           CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
9722           
9723           
9724           
9725           
9726           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9727         ENDIF
9728 #endif
9729 #ifdef INTIO
9730       CASE ( IO_INTIO   )
9731         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9732 #  if ( RWORDSIZE == DWORDSIZE )
9733            CALL ext_int_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9734                                  locCount, Outcount, Status )
9735 #  else
9736            CALL ext_int_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9737                                  locCount, Outcount, Status )
9738 #  endif
9739         ENDIF
9740         IF ( .NOT. multi_files(io_form) ) THEN
9741            
9742            
9743            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
9744            CALL wrf_dm_bcast_bytes( Data, RWORDSIZE*locCount )
9745            
9746            
9747            
9748            
9749            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9750         ENDIF
9751 #endif
9752       CASE DEFAULT
9753     END SELECT
9754   ELSE IF ( for_out .AND. use_output_servers() ) THEN
9755     CALL wrf_quilt_get_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9756                           locCount, Outcount, Status )
9757   ELSE
9758     Status = 0
9759 ENDIF
9760 ELSE
9761   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
9762 ENDIF
9763 RETURN
9764 END SUBROUTINE wrf_get_var_td_real_sca 
9765 
9766 
9767 !--- put_var_td_real
9768 
9769 SUBROUTINE wrf_put_var_td_real_arr ( DataHandle,Element, DateStr, Varname, Data, Count,  Status )
9770 !<DESCRIPTION>
9771 !<PRE>
9772 !
9773 ! Write Count words of time dependent
9774 ! attribute "Element" of variable "Varname" valid at time DateStr 
9775 ! to the open dataset described by DataHandle.  
9776 ! Attribute of type real is
9777 ! copied from array Data.
9778 ! 
9779 !
9780 !</PRE>
9781 !</DESCRIPTION>
9782 USE module_state_description
9783 IMPLICIT NONE
9784 INTEGER ,       INTENT(IN)  :: DataHandle
9785 CHARACTER*(*) , INTENT(IN)  :: Element
9786 CHARACTER*(*) , INTENT(IN)  :: DateStr
9787 CHARACTER*(*) , INTENT(IN)  :: VarName 
9788 
9789  real  :: Data (*)
9790 
9791 INTEGER ,       INTENT(IN)  :: Count
9792 
9793 INTEGER ,       INTENT(OUT) :: Status
9794 
9795 #include <wrf_status_codes.h>
9796 INTEGER                     :: len_of_str
9797 LOGICAL                     :: for_out
9798 INTEGER, EXTERNAL           :: use_package
9799 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
9800 INTEGER                     :: locCount
9801 
9802 INTEGER io_form , Hndl
9803 
9804 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_real_arr " )
9805 
9806 
9807 locCount = Count
9808 
9809 
9810 Status = 0
9811 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
9812 IF ( Hndl .GT. -1 ) THEN
9813   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
9814     SELECT CASE ( use_package( io_form ) )
9815 #ifdef NETCDF
9816       CASE ( IO_NETCDF   )
9817         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9818 #  if ( RWORDSIZE == DWORDSIZE )
9819            CALL ext_ncd_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9820                                  locCount,  Status )
9821 #  else
9822            CALL ext_ncd_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9823                                  locCount,  Status )
9824 #  endif
9825         ENDIF
9826         IF ( .NOT. multi_files(io_form) ) THEN
9827           
9828           
9829           
9830           
9831           
9832           
9833           
9834           
9835           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9836         ENDIF
9837 #endif
9838 #ifdef PNETCDF
9839       CASE ( IO_PNETCDF   )
9840 #  if ( RWORDSIZE == DWORDSIZE )
9841         CALL ext_pnc_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9842                               locCount,  Status )
9843 #  else
9844         CALL ext_pnc_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9845                               locCount,  Status )
9846 #  endif
9847 #endif
9848 #ifdef PHDF5
9849       CASE ( IO_PHDF5   )
9850 #  if ( RWORDSIZE == DWORDSIZE )
9851         CALL ext_phdf5_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9852                               locCount,  Status )
9853 #  else
9854         CALL ext_phdf5_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9855                               locCount,  Status )
9856 #  endif
9857 #endif
9858 #ifdef ESMFIO
9859       CASE ( IO_ESMF )
9860 #  if ( RWORDSIZE == DWORDSIZE )
9861         CALL ext_esmf_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9862                               locCount,  Status )
9863 #  else
9864         CALL ext_esmf_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9865                               locCount,  Status )
9866 #  endif
9867 #endif
9868 #ifdef XXX
9869       CASE ( IO_XXX   )
9870 #  if ( RWORDSIZE == DWORDSIZE )
9871         CALL ext_xxx_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9872                               locCount,  Status )
9873 #  else
9874         CALL ext_xxx_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9875                               locCount,  Status )
9876 #  endif
9877 #endif
9878 #ifdef YYY
9879       CASE ( IO_YYY   )
9880 #  if ( RWORDSIZE == DWORDSIZE )
9881         CALL ext_yyy_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9882                               locCount,  Status )
9883 #  else
9884         CALL ext_yyy_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9885                               locCount,  Status )
9886 #  endif
9887 #endif
9888 #ifdef GRIB1
9889       CASE ( IO_GRIB1   )
9890         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9891 #  if ( RWORDSIZE == DWORDSIZE )
9892            CALL ext_gr1_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9893                                  locCount,  Status )
9894 #  else
9895            CALL ext_gr1_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9896                                  locCount,  Status )
9897 #  endif
9898         ENDIF
9899         IF ( .NOT. multi_files(io_form) ) THEN
9900           
9901           
9902           
9903           
9904           
9905           
9906           
9907           
9908           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9909         ENDIF
9910 #endif
9911 #ifdef GRIB2
9912       CASE ( IO_GRIB2   )
9913         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9914 #  if ( RWORDSIZE == DWORDSIZE )
9915            CALL ext_gr2_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9916                                  locCount,  Status )
9917 #  else
9918            CALL ext_gr2_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9919                                  locCount,  Status )
9920 #  endif
9921         ENDIF
9922         IF ( .NOT. multi_files(io_form) ) THEN
9923           
9924           
9925           
9926           
9927           
9928           
9929           
9930           
9931           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9932         ENDIF
9933 #endif
9934 #ifdef INTIO
9935       CASE ( IO_INTIO   )
9936         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
9937 #  if ( RWORDSIZE == DWORDSIZE )
9938            CALL ext_int_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
9939                                  locCount,  Status )
9940 #  else
9941            CALL ext_int_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9942                                  locCount,  Status )
9943 #  endif
9944         ENDIF
9945         IF ( .NOT. multi_files(io_form) ) THEN
9946            
9947            
9948            
9949            
9950            
9951            
9952            
9953            
9954            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
9955         ENDIF
9956 #endif
9957       CASE DEFAULT
9958     END SELECT
9959   ELSE IF ( for_out .AND. use_output_servers() ) THEN
9960     CALL wrf_quilt_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
9961                           locCount,  Status )
9962   ELSE
9963     Status = 0
9964 ENDIF
9965 ELSE
9966   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
9967 ENDIF
9968 RETURN
9969 END SUBROUTINE wrf_put_var_td_real_arr 
9970 !--- put_var_td_real
9971 
9972 SUBROUTINE wrf_put_var_td_real_sca ( DataHandle,Element, DateStr, Varname, Data, Count,  Status )
9973 !<DESCRIPTION>
9974 !<PRE>
9975 !
9976 ! Write time dependent
9977 ! attribute "Element" of variable "Varname" valid at time DateStr 
9978 ! to the open dataset described by DataHandle.  
9979 ! Attribute of type real is
9980 ! copied from scalar Data.
9981 ! 
9982 !
9983 !</PRE>
9984 !</DESCRIPTION>
9985 USE module_state_description
9986 IMPLICIT NONE
9987 INTEGER ,       INTENT(IN)  :: DataHandle
9988 CHARACTER*(*) , INTENT(IN)  :: Element
9989 CHARACTER*(*) , INTENT(IN)  :: DateStr
9990 CHARACTER*(*) , INTENT(IN)  :: VarName 
9991 
9992  real  :: Data 
9993 
9994 INTEGER ,       INTENT(IN)  :: Count
9995 
9996 INTEGER ,       INTENT(OUT) :: Status
9997 
9998 #include <wrf_status_codes.h>
9999 INTEGER                     :: len_of_str
10000 LOGICAL                     :: for_out
10001 INTEGER, EXTERNAL           :: use_package
10002 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
10003 INTEGER                     :: locCount
10004 
10005 INTEGER io_form , Hndl
10006 
10007 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_real_sca " )
10008 
10009 
10010 locCount = Count
10011 
10012 
10013 Status = 0
10014 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
10015 IF ( Hndl .GT. -1 ) THEN
10016   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
10017     SELECT CASE ( use_package( io_form ) )
10018 #ifdef NETCDF
10019       CASE ( IO_NETCDF   )
10020         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10021 #  if ( RWORDSIZE == DWORDSIZE )
10022            CALL ext_ncd_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10023                                  locCount,  Status )
10024 #  else
10025            CALL ext_ncd_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10026                                  locCount,  Status )
10027 #  endif
10028         ENDIF
10029         IF ( .NOT. multi_files(io_form) ) THEN
10030           
10031           
10032           
10033           
10034           
10035           
10036           
10037           
10038           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10039         ENDIF
10040 #endif
10041 #ifdef PNETCDF
10042       CASE ( IO_PNETCDF   )
10043 #  if ( RWORDSIZE == DWORDSIZE )
10044         CALL ext_pnc_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10045                               locCount,  Status )
10046 #  else
10047         CALL ext_pnc_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10048                               locCount,  Status )
10049 #  endif
10050 #endif
10051 #ifdef PHDF5
10052       CASE ( IO_PHDF5   )
10053 #  if ( RWORDSIZE == DWORDSIZE )
10054         CALL ext_phdf5_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10055                               locCount,  Status )
10056 #  else
10057         CALL ext_phdf5_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10058                               locCount,  Status )
10059 #  endif
10060 #endif
10061 #ifdef ESMFIO
10062       CASE ( IO_ESMF )
10063 #  if ( RWORDSIZE == DWORDSIZE )
10064         CALL ext_esmf_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10065                               locCount,  Status )
10066 #  else
10067         CALL ext_esmf_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10068                               locCount,  Status )
10069 #  endif
10070 #endif
10071 #ifdef XXX
10072       CASE ( IO_XXX   )
10073 #  if ( RWORDSIZE == DWORDSIZE )
10074         CALL ext_xxx_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10075                               locCount,  Status )
10076 #  else
10077         CALL ext_xxx_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10078                               locCount,  Status )
10079 #  endif
10080 #endif
10081 #ifdef YYY
10082       CASE ( IO_YYY   )
10083 #  if ( RWORDSIZE == DWORDSIZE )
10084         CALL ext_yyy_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10085                               locCount,  Status )
10086 #  else
10087         CALL ext_yyy_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10088                               locCount,  Status )
10089 #  endif
10090 #endif
10091 #ifdef GRIB1
10092       CASE ( IO_GRIB1   )
10093         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10094 #  if ( RWORDSIZE == DWORDSIZE )
10095            CALL ext_gr1_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10096                                  locCount,  Status )
10097 #  else
10098            CALL ext_gr1_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10099                                  locCount,  Status )
10100 #  endif
10101         ENDIF
10102         IF ( .NOT. multi_files(io_form) ) THEN
10103           
10104           
10105           
10106           
10107           
10108           
10109           
10110           
10111           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10112         ENDIF
10113 #endif
10114 #ifdef GRIB2
10115       CASE ( IO_GRIB2   )
10116         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10117 #  if ( RWORDSIZE == DWORDSIZE )
10118            CALL ext_gr2_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10119                                  locCount,  Status )
10120 #  else
10121            CALL ext_gr2_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10122                                  locCount,  Status )
10123 #  endif
10124         ENDIF
10125         IF ( .NOT. multi_files(io_form) ) THEN
10126           
10127           
10128           
10129           
10130           
10131           
10132           
10133           
10134           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10135         ENDIF
10136 #endif
10137 #ifdef INTIO
10138       CASE ( IO_INTIO   )
10139         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10140 #  if ( RWORDSIZE == DWORDSIZE )
10141            CALL ext_int_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10142                                  locCount,  Status )
10143 #  else
10144            CALL ext_int_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10145                                  locCount,  Status )
10146 #  endif
10147         ENDIF
10148         IF ( .NOT. multi_files(io_form) ) THEN
10149            
10150            
10151            
10152            
10153            
10154            
10155            
10156            
10157            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10158         ENDIF
10159 #endif
10160       CASE DEFAULT
10161     END SELECT
10162   ELSE IF ( for_out .AND. use_output_servers() ) THEN
10163     CALL wrf_quilt_put_var_td_real ( Hndl, Element, DateStr, Varname, Data, &
10164                           locCount,  Status )
10165   ELSE
10166     Status = 0
10167 ENDIF
10168 ELSE
10169   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
10170 ENDIF
10171 RETURN
10172 END SUBROUTINE wrf_put_var_td_real_sca 
10173 
10174 
10175 !--- get_var_td_double
10176 
10177 SUBROUTINE wrf_get_var_td_double_arr ( DataHandle,Element, DateStr, Varname, Data, Count, Outcount, Status )
10178 !<DESCRIPTION>
10179 !<PRE>
10180 !
10181 ! Attempt to read Count words of time dependent
10182 ! attribute "Element" of variable "Varname" valid at time DateStr 
10183 ! from the open dataset described by DataHandle.  
10184 ! Attribute of type double is
10185 ! stored in array Data.
10186 ! Actual number of words read is returned in OutCount.
10187 !
10188 !</PRE>
10189 !</DESCRIPTION>
10190 USE module_state_description
10191 IMPLICIT NONE
10192 INTEGER ,       INTENT(IN)  :: DataHandle
10193 CHARACTER*(*) , INTENT(IN)  :: Element
10194 CHARACTER*(*) , INTENT(IN)  :: DateStr
10195 CHARACTER*(*) , INTENT(IN)  :: VarName 
10196 
10197  real*8  :: Data (*)
10198 
10199 INTEGER ,       INTENT(IN)  :: Count
10200 INTEGER ,       INTENT(OUT)  :: OutCount
10201 INTEGER ,       INTENT(OUT) :: Status
10202 
10203 #include <wrf_status_codes.h>
10204 INTEGER                     :: len_of_str
10205 LOGICAL                     :: for_out
10206 INTEGER, EXTERNAL           :: use_package
10207 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
10208 INTEGER                     :: locCount
10209 
10210 INTEGER io_form , Hndl
10211 
10212 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_double_arr " )
10213 
10214 
10215 
10216 
10217 
10218 Status = 0
10219 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
10220 IF ( Hndl .GT. -1 ) THEN
10221   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
10222     SELECT CASE ( use_package( io_form ) )
10223 #ifdef NETCDF
10224       CASE ( IO_NETCDF   )
10225         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10226            CALL ext_ncd_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10227                                  locCount, Outcount, Status ) 
10228         ENDIF
10229         IF ( .NOT. multi_files(io_form) ) THEN
10230           
10231           
10232           
10233           
10234           
10235           
10236           
10237           
10238           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10239         ENDIF
10240 #endif
10241 #ifdef PNETCDF
10242       CASE ( IO_PNETCDF   )
10243         CALL ext_pnc_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10244                               locCount, Outcount, Status ) 
10245 #endif
10246 #ifdef PHDF5
10247       CASE ( IO_PHDF5   )
10248         CALL ext_phdf5_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10249                               locCount, Outcount, Status ) 
10250 #endif
10251 #ifdef ESMFIO
10252       CASE ( IO_ESMF )
10253         CALL ext_esmf_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10254                               locCount, Outcount, Status ) 
10255 #endif
10256 #ifdef XXX
10257       CASE ( IO_XXX   )
10258         CALL ext_xxx_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10259                               locCount, Outcount, Status ) 
10260 #endif
10261 #ifdef YYY
10262       CASE ( IO_YYY   )
10263         CALL ext_yyy_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10264                               locCount, Outcount, Status ) 
10265 #endif
10266 #ifdef GRIB1
10267       CASE ( IO_GRIB1   )
10268         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10269            CALL ext_gr1_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10270                                  locCount, Outcount, Status ) 
10271         ENDIF
10272         IF ( .NOT. multi_files(io_form) ) THEN
10273           
10274           
10275           
10276           
10277           
10278           
10279           
10280           
10281           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10282         ENDIF
10283 #endif
10284 #ifdef GRIB2
10285       CASE ( IO_GRIB2   )
10286         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10287            CALL ext_gr2_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10288                                  locCount, Outcount, Status ) 
10289         ENDIF
10290         IF ( .NOT. multi_files(io_form) ) THEN
10291           
10292           
10293           
10294           
10295           
10296           
10297           
10298           
10299           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10300         ENDIF
10301 #endif
10302 #ifdef INTIO
10303       CASE ( IO_INTIO   )
10304         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10305            CALL ext_int_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10306                                  locCount, Outcount, Status ) 
10307         ENDIF
10308         IF ( .NOT. multi_files(io_form) ) THEN
10309            
10310            
10311            
10312            
10313            
10314            
10315            
10316            
10317            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10318         ENDIF
10319 #endif
10320       CASE DEFAULT
10321     END SELECT
10322   ELSE IF ( for_out .AND. use_output_servers() ) THEN
10323     CALL wrf_quilt_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10324                           locCount, Outcount, Status )
10325   ELSE
10326     Status = 0
10327 ENDIF
10328 ELSE
10329   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
10330 ENDIF
10331 RETURN
10332 END SUBROUTINE wrf_get_var_td_double_arr 
10333 !--- get_var_td_double
10334 
10335 SUBROUTINE wrf_get_var_td_double_sca ( DataHandle,Element, DateStr, Varname, Data, Count, Outcount, Status )
10336 !<DESCRIPTION>
10337 !<PRE>
10338 !
10339 ! Attempt to read time dependent
10340 ! attribute "Element" of variable "Varname" valid at time DateStr 
10341 ! from the open dataset described by DataHandle.  
10342 ! Attribute of type double is
10343 ! stored in scalar Data.
10344 ! 
10345 !
10346 !</PRE>
10347 !</DESCRIPTION>
10348 USE module_state_description
10349 IMPLICIT NONE
10350 INTEGER ,       INTENT(IN)  :: DataHandle
10351 CHARACTER*(*) , INTENT(IN)  :: Element
10352 CHARACTER*(*) , INTENT(IN)  :: DateStr
10353 CHARACTER*(*) , INTENT(IN)  :: VarName 
10354 
10355  real*8  :: Data 
10356 
10357 INTEGER ,       INTENT(IN)  :: Count
10358 INTEGER ,       INTENT(OUT)  :: OutCount
10359 INTEGER ,       INTENT(OUT) :: Status
10360 
10361 #include <wrf_status_codes.h>
10362 INTEGER                     :: len_of_str
10363 LOGICAL                     :: for_out
10364 INTEGER, EXTERNAL           :: use_package
10365 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
10366 INTEGER                     :: locCount
10367 
10368 INTEGER io_form , Hndl
10369 
10370 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_double_sca " )
10371 
10372 
10373 
10374 
10375 
10376 Status = 0
10377 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
10378 IF ( Hndl .GT. -1 ) THEN
10379   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
10380     SELECT CASE ( use_package( io_form ) )
10381 #ifdef NETCDF
10382       CASE ( IO_NETCDF   )
10383         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10384            CALL ext_ncd_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10385                                  locCount, Outcount, Status ) 
10386         ENDIF
10387         IF ( .NOT. multi_files(io_form) ) THEN
10388           
10389           
10390           
10391           
10392           
10393           
10394           
10395           
10396           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10397         ENDIF
10398 #endif
10399 #ifdef PNETCDF
10400       CASE ( IO_PNETCDF   )
10401         CALL ext_pnc_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10402                               locCount, Outcount, Status ) 
10403 #endif
10404 #ifdef PHDF5
10405       CASE ( IO_PHDF5   )
10406         CALL ext_phdf5_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10407                               locCount, Outcount, Status ) 
10408 #endif
10409 #ifdef ESMFIO
10410       CASE ( IO_ESMF )
10411         CALL ext_esmf_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10412                               locCount, Outcount, Status ) 
10413 #endif
10414 #ifdef XXX
10415       CASE ( IO_XXX   )
10416         CALL ext_xxx_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10417                               locCount, Outcount, Status ) 
10418 #endif
10419 #ifdef YYY
10420       CASE ( IO_YYY   )
10421         CALL ext_yyy_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10422                               locCount, Outcount, Status ) 
10423 #endif
10424 #ifdef GRIB1
10425       CASE ( IO_GRIB1   )
10426         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10427            CALL ext_gr1_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10428                                  locCount, Outcount, Status ) 
10429         ENDIF
10430         IF ( .NOT. multi_files(io_form) ) THEN
10431           
10432           
10433           
10434           
10435           
10436           
10437           
10438           
10439           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10440         ENDIF
10441 #endif
10442 #ifdef GRIB2
10443       CASE ( IO_GRIB2   )
10444         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10445            CALL ext_gr2_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10446                                  locCount, Outcount, Status ) 
10447         ENDIF
10448         IF ( .NOT. multi_files(io_form) ) THEN
10449           
10450           
10451           
10452           
10453           
10454           
10455           
10456           
10457           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10458         ENDIF
10459 #endif
10460 #ifdef INTIO
10461       CASE ( IO_INTIO   )
10462         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10463            CALL ext_int_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10464                                  locCount, Outcount, Status ) 
10465         ENDIF
10466         IF ( .NOT. multi_files(io_form) ) THEN
10467            
10468            
10469            
10470            
10471            
10472            
10473            
10474            
10475            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10476         ENDIF
10477 #endif
10478       CASE DEFAULT
10479     END SELECT
10480   ELSE IF ( for_out .AND. use_output_servers() ) THEN
10481     CALL wrf_quilt_get_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10482                           locCount, Outcount, Status )
10483   ELSE
10484     Status = 0
10485 ENDIF
10486 ELSE
10487   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
10488 ENDIF
10489 RETURN
10490 END SUBROUTINE wrf_get_var_td_double_sca 
10491 
10492 
10493 !--- put_var_td_double
10494 
10495 SUBROUTINE wrf_put_var_td_double_arr ( DataHandle,Element, DateStr, Varname, Data, Count,  Status )
10496 !<DESCRIPTION>
10497 !<PRE>
10498 !
10499 ! Write Count words of time dependent
10500 ! attribute "Element" of variable "Varname" valid at time DateStr 
10501 ! to the open dataset described by DataHandle.  
10502 ! Attribute of type double is
10503 ! copied from array Data.
10504 ! 
10505 !
10506 !</PRE>
10507 !</DESCRIPTION>
10508 USE module_state_description
10509 IMPLICIT NONE
10510 INTEGER ,       INTENT(IN)  :: DataHandle
10511 CHARACTER*(*) , INTENT(IN)  :: Element
10512 CHARACTER*(*) , INTENT(IN)  :: DateStr
10513 CHARACTER*(*) , INTENT(IN)  :: VarName 
10514 
10515  real*8  :: Data (*)
10516 
10517 INTEGER ,       INTENT(IN)  :: Count
10518 
10519 INTEGER ,       INTENT(OUT) :: Status
10520 
10521 #include <wrf_status_codes.h>
10522 INTEGER                     :: len_of_str
10523 LOGICAL                     :: for_out
10524 INTEGER, EXTERNAL           :: use_package
10525 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
10526 INTEGER                     :: locCount
10527 
10528 INTEGER io_form , Hndl
10529 
10530 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_double_arr " )
10531 
10532 
10533 
10534 
10535 
10536 Status = 0
10537 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
10538 IF ( Hndl .GT. -1 ) THEN
10539   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
10540     SELECT CASE ( use_package( io_form ) )
10541 #ifdef NETCDF
10542       CASE ( IO_NETCDF   )
10543         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10544            CALL ext_ncd_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10545                                  locCount,  Status ) 
10546         ENDIF
10547         IF ( .NOT. multi_files(io_form) ) THEN
10548           
10549           
10550           
10551           
10552           
10553           
10554           
10555           
10556           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10557         ENDIF
10558 #endif
10559 #ifdef PNETCDF
10560       CASE ( IO_PNETCDF   )
10561         CALL ext_pnc_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10562                               locCount,  Status ) 
10563 #endif
10564 #ifdef PHDF5
10565       CASE ( IO_PHDF5   )
10566         CALL ext_phdf5_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10567                               locCount,  Status ) 
10568 #endif
10569 #ifdef ESMFIO
10570       CASE ( IO_ESMF )
10571         CALL ext_esmf_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10572                               locCount,  Status ) 
10573 #endif
10574 #ifdef XXX
10575       CASE ( IO_XXX   )
10576         CALL ext_xxx_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10577                               locCount,  Status ) 
10578 #endif
10579 #ifdef YYY
10580       CASE ( IO_YYY   )
10581         CALL ext_yyy_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10582                               locCount,  Status ) 
10583 #endif
10584 #ifdef GRIB1
10585       CASE ( IO_GRIB1   )
10586         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10587            CALL ext_gr1_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10588                                  locCount,  Status ) 
10589         ENDIF
10590         IF ( .NOT. multi_files(io_form) ) THEN
10591           
10592           
10593           
10594           
10595           
10596           
10597           
10598           
10599           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10600         ENDIF
10601 #endif
10602 #ifdef GRIB2
10603       CASE ( IO_GRIB2   )
10604         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10605            CALL ext_gr2_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10606                                  locCount,  Status ) 
10607         ENDIF
10608         IF ( .NOT. multi_files(io_form) ) THEN
10609           
10610           
10611           
10612           
10613           
10614           
10615           
10616           
10617           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10618         ENDIF
10619 #endif
10620 #ifdef INTIO
10621       CASE ( IO_INTIO   )
10622         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10623            CALL ext_int_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10624                                  locCount,  Status ) 
10625         ENDIF
10626         IF ( .NOT. multi_files(io_form) ) THEN
10627            
10628            
10629            
10630            
10631            
10632            
10633            
10634            
10635            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10636         ENDIF
10637 #endif
10638       CASE DEFAULT
10639     END SELECT
10640   ELSE IF ( for_out .AND. use_output_servers() ) THEN
10641     CALL wrf_quilt_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10642                           locCount,  Status )
10643   ELSE
10644     Status = 0
10645 ENDIF
10646 ELSE
10647   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
10648 ENDIF
10649 RETURN
10650 END SUBROUTINE wrf_put_var_td_double_arr 
10651 !--- put_var_td_double
10652 
10653 SUBROUTINE wrf_put_var_td_double_sca ( DataHandle,Element, DateStr, Varname, Data, Count,  Status )
10654 !<DESCRIPTION>
10655 !<PRE>
10656 !
10657 ! Write time dependent
10658 ! attribute "Element" of variable "Varname" valid at time DateStr 
10659 ! to the open dataset described by DataHandle.  
10660 ! Attribute of type double is
10661 ! copied from scalar Data.
10662 ! 
10663 !
10664 !</PRE>
10665 !</DESCRIPTION>
10666 USE module_state_description
10667 IMPLICIT NONE
10668 INTEGER ,       INTENT(IN)  :: DataHandle
10669 CHARACTER*(*) , INTENT(IN)  :: Element
10670 CHARACTER*(*) , INTENT(IN)  :: DateStr
10671 CHARACTER*(*) , INTENT(IN)  :: VarName 
10672 
10673  real*8  :: Data 
10674 
10675 INTEGER ,       INTENT(IN)  :: Count
10676 
10677 INTEGER ,       INTENT(OUT) :: Status
10678 
10679 #include <wrf_status_codes.h>
10680 INTEGER                     :: len_of_str
10681 LOGICAL                     :: for_out
10682 INTEGER, EXTERNAL           :: use_package
10683 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
10684 INTEGER                     :: locCount
10685 
10686 INTEGER io_form , Hndl
10687 
10688 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_double_sca " )
10689 
10690 
10691 
10692 
10693 
10694 Status = 0
10695 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
10696 IF ( Hndl .GT. -1 ) THEN
10697   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
10698     SELECT CASE ( use_package( io_form ) )
10699 #ifdef NETCDF
10700       CASE ( IO_NETCDF   )
10701         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10702            CALL ext_ncd_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10703                                  locCount,  Status ) 
10704         ENDIF
10705         IF ( .NOT. multi_files(io_form) ) THEN
10706           
10707           
10708           
10709           
10710           
10711           
10712           
10713           
10714           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10715         ENDIF
10716 #endif
10717 #ifdef PNETCDF
10718       CASE ( IO_PNETCDF   )
10719         CALL ext_pnc_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10720                               locCount,  Status ) 
10721 #endif
10722 #ifdef PHDF5
10723       CASE ( IO_PHDF5   )
10724         CALL ext_phdf5_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10725                               locCount,  Status ) 
10726 #endif
10727 #ifdef ESMFIO
10728       CASE ( IO_ESMF )
10729         CALL ext_esmf_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10730                               locCount,  Status ) 
10731 #endif
10732 #ifdef XXX
10733       CASE ( IO_XXX   )
10734         CALL ext_xxx_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10735                               locCount,  Status ) 
10736 #endif
10737 #ifdef YYY
10738       CASE ( IO_YYY   )
10739         CALL ext_yyy_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10740                               locCount,  Status ) 
10741 #endif
10742 #ifdef GRIB1
10743       CASE ( IO_GRIB1   )
10744         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10745            CALL ext_gr1_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10746                                  locCount,  Status ) 
10747         ENDIF
10748         IF ( .NOT. multi_files(io_form) ) THEN
10749           
10750           
10751           
10752           
10753           
10754           
10755           
10756           
10757           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10758         ENDIF
10759 #endif
10760 #ifdef GRIB2
10761       CASE ( IO_GRIB2   )
10762         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10763            CALL ext_gr2_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10764                                  locCount,  Status ) 
10765         ENDIF
10766         IF ( .NOT. multi_files(io_form) ) THEN
10767           
10768           
10769           
10770           
10771           
10772           
10773           
10774           
10775           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10776         ENDIF
10777 #endif
10778 #ifdef INTIO
10779       CASE ( IO_INTIO   )
10780         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10781            CALL ext_int_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10782                                  locCount,  Status ) 
10783         ENDIF
10784         IF ( .NOT. multi_files(io_form) ) THEN
10785            
10786            
10787            
10788            
10789            
10790            
10791            
10792            
10793            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10794         ENDIF
10795 #endif
10796       CASE DEFAULT
10797     END SELECT
10798   ELSE IF ( for_out .AND. use_output_servers() ) THEN
10799     CALL wrf_quilt_put_var_td_double ( Hndl, Element, DateStr, Varname, Data, &
10800                           locCount,  Status )
10801   ELSE
10802     Status = 0
10803 ENDIF
10804 ELSE
10805   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
10806 ENDIF
10807 RETURN
10808 END SUBROUTINE wrf_put_var_td_double_sca 
10809 
10810 
10811 !--- get_var_td_integer
10812 
10813 SUBROUTINE wrf_get_var_td_integer_arr ( DataHandle,Element, DateStr, Varname, Data, Count, Outcount, Status )
10814 !<DESCRIPTION>
10815 !<PRE>
10816 !
10817 ! Attempt to read Count words of time dependent
10818 ! attribute "Element" of variable "Varname" valid at time DateStr 
10819 ! from the open dataset described by DataHandle.  
10820 ! Attribute of type integer is
10821 ! stored in array Data.
10822 ! Actual number of words read is returned in OutCount.
10823 !
10824 !</PRE>
10825 !</DESCRIPTION>
10826 USE module_state_description
10827 IMPLICIT NONE
10828 INTEGER ,       INTENT(IN)  :: DataHandle
10829 CHARACTER*(*) , INTENT(IN)  :: Element
10830 CHARACTER*(*) , INTENT(IN)  :: DateStr
10831 CHARACTER*(*) , INTENT(IN)  :: VarName 
10832 
10833  integer  :: Data (*)
10834 
10835 INTEGER ,       INTENT(IN)  :: Count
10836 INTEGER ,       INTENT(OUT)  :: OutCount
10837 INTEGER ,       INTENT(OUT) :: Status
10838 
10839 #include <wrf_status_codes.h>
10840 INTEGER                     :: len_of_str
10841 LOGICAL                     :: for_out
10842 INTEGER, EXTERNAL           :: use_package
10843 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
10844 INTEGER                     :: locCount
10845 
10846 INTEGER io_form , Hndl
10847 
10848 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_integer_arr " )
10849 
10850 locCount = Count
10851 
10852 
10853 
10854 Status = 0
10855 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
10856 IF ( Hndl .GT. -1 ) THEN
10857   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
10858     SELECT CASE ( use_package( io_form ) )
10859 #ifdef NETCDF
10860       CASE ( IO_NETCDF   )
10861         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10862            CALL ext_ncd_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10863                                  locCount, Outcount, Status ) 
10864         ENDIF
10865         IF ( .NOT. multi_files(io_form) ) THEN
10866           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
10867           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
10868           
10869           
10870           
10871           
10872           
10873           
10874           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10875         ENDIF
10876 #endif
10877 #ifdef PNETCDF
10878       CASE ( IO_PNETCDF   )
10879         CALL ext_pnc_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10880                               locCount, Outcount, Status ) 
10881 #endif
10882 #ifdef PHDF5
10883       CASE ( IO_PHDF5   )
10884         CALL ext_phdf5_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10885                               locCount, Outcount, Status ) 
10886 #endif
10887 #ifdef ESMFIO
10888       CASE ( IO_ESMF )
10889         CALL ext_esmf_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10890                               locCount, Outcount, Status ) 
10891 #endif
10892 #ifdef XXX
10893       CASE ( IO_XXX   )
10894         CALL ext_xxx_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10895                               locCount, Outcount, Status ) 
10896 #endif
10897 #ifdef YYY
10898       CASE ( IO_YYY   )
10899         CALL ext_yyy_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10900                               locCount, Outcount, Status ) 
10901 #endif
10902 #ifdef GRIB1
10903       CASE ( IO_GRIB1   )
10904         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10905            CALL ext_gr1_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10906                                  locCount, Outcount, Status ) 
10907         ENDIF
10908         IF ( .NOT. multi_files(io_form) ) THEN
10909           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
10910           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
10911           
10912           
10913           
10914           
10915           
10916           
10917           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10918         ENDIF
10919 #endif
10920 #ifdef GRIB2
10921       CASE ( IO_GRIB2   )
10922         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10923            CALL ext_gr2_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10924                                  locCount, Outcount, Status ) 
10925         ENDIF
10926         IF ( .NOT. multi_files(io_form) ) THEN
10927           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
10928           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
10929           
10930           
10931           
10932           
10933           
10934           
10935           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10936         ENDIF
10937 #endif
10938 #ifdef INTIO
10939       CASE ( IO_INTIO   )
10940         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
10941            CALL ext_int_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10942                                  locCount, Outcount, Status ) 
10943         ENDIF
10944         IF ( .NOT. multi_files(io_form) ) THEN
10945            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
10946            CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
10947            
10948            
10949            
10950            
10951            
10952            
10953            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
10954         ENDIF
10955 #endif
10956       CASE DEFAULT
10957     END SELECT
10958   ELSE IF ( for_out .AND. use_output_servers() ) THEN
10959     CALL wrf_quilt_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
10960                           locCount, Outcount, Status )
10961   ELSE
10962     Status = 0
10963 ENDIF
10964 ELSE
10965   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
10966 ENDIF
10967 RETURN
10968 END SUBROUTINE wrf_get_var_td_integer_arr 
10969 !--- get_var_td_integer
10970 
10971 SUBROUTINE wrf_get_var_td_integer_sca ( DataHandle,Element, DateStr, Varname, Data, Count, Outcount, Status )
10972 !<DESCRIPTION>
10973 !<PRE>
10974 !
10975 ! Attempt to read time dependent
10976 ! attribute "Element" of variable "Varname" valid at time DateStr 
10977 ! from the open dataset described by DataHandle.  
10978 ! Attribute of type integer is
10979 ! stored in scalar Data.
10980 ! 
10981 !
10982 !</PRE>
10983 !</DESCRIPTION>
10984 USE module_state_description
10985 IMPLICIT NONE
10986 INTEGER ,       INTENT(IN)  :: DataHandle
10987 CHARACTER*(*) , INTENT(IN)  :: Element
10988 CHARACTER*(*) , INTENT(IN)  :: DateStr
10989 CHARACTER*(*) , INTENT(IN)  :: VarName 
10990 
10991  integer  :: Data 
10992 
10993 INTEGER ,       INTENT(IN)  :: Count
10994 INTEGER ,       INTENT(OUT)  :: OutCount
10995 INTEGER ,       INTENT(OUT) :: Status
10996 
10997 #include <wrf_status_codes.h>
10998 INTEGER                     :: len_of_str
10999 LOGICAL                     :: for_out
11000 INTEGER, EXTERNAL           :: use_package
11001 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
11002 INTEGER                     :: locCount
11003 
11004 INTEGER io_form , Hndl
11005 
11006 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_integer_sca " )
11007 
11008 locCount = Count
11009 
11010 
11011 
11012 Status = 0
11013 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
11014 IF ( Hndl .GT. -1 ) THEN
11015   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
11016     SELECT CASE ( use_package( io_form ) )
11017 #ifdef NETCDF
11018       CASE ( IO_NETCDF   )
11019         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11020            CALL ext_ncd_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11021                                  locCount, Outcount, Status ) 
11022         ENDIF
11023         IF ( .NOT. multi_files(io_form) ) THEN
11024           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11025           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
11026           
11027           
11028           
11029           
11030           
11031           
11032           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11033         ENDIF
11034 #endif
11035 #ifdef PNETCDF
11036       CASE ( IO_PNETCDF   )
11037         CALL ext_pnc_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11038                               locCount, Outcount, Status ) 
11039 #endif
11040 #ifdef PHDF5
11041       CASE ( IO_PHDF5   )
11042         CALL ext_phdf5_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11043                               locCount, Outcount, Status ) 
11044 #endif
11045 #ifdef ESMFIO
11046       CASE ( IO_ESMF )
11047         CALL ext_esmf_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11048                               locCount, Outcount, Status ) 
11049 #endif
11050 #ifdef XXX
11051       CASE ( IO_XXX   )
11052         CALL ext_xxx_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11053                               locCount, Outcount, Status ) 
11054 #endif
11055 #ifdef YYY
11056       CASE ( IO_YYY   )
11057         CALL ext_yyy_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11058                               locCount, Outcount, Status ) 
11059 #endif
11060 #ifdef GRIB1
11061       CASE ( IO_GRIB1   )
11062         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11063            CALL ext_gr1_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11064                                  locCount, Outcount, Status ) 
11065         ENDIF
11066         IF ( .NOT. multi_files(io_form) ) THEN
11067           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11068           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
11069           
11070           
11071           
11072           
11073           
11074           
11075           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11076         ENDIF
11077 #endif
11078 #ifdef GRIB2
11079       CASE ( IO_GRIB2   )
11080         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11081            CALL ext_gr2_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11082                                  locCount, Outcount, Status ) 
11083         ENDIF
11084         IF ( .NOT. multi_files(io_form) ) THEN
11085           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11086           CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
11087           
11088           
11089           
11090           
11091           
11092           
11093           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11094         ENDIF
11095 #endif
11096 #ifdef INTIO
11097       CASE ( IO_INTIO   )
11098         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11099            CALL ext_int_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11100                                  locCount, Outcount, Status ) 
11101         ENDIF
11102         IF ( .NOT. multi_files(io_form) ) THEN
11103            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11104            CALL wrf_dm_bcast_bytes( Data, IWORDSIZE*locCount )
11105            
11106            
11107            
11108            
11109            
11110            
11111            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11112         ENDIF
11113 #endif
11114       CASE DEFAULT
11115     END SELECT
11116   ELSE IF ( for_out .AND. use_output_servers() ) THEN
11117     CALL wrf_quilt_get_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11118                           locCount, Outcount, Status )
11119   ELSE
11120     Status = 0
11121 ENDIF
11122 ELSE
11123   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
11124 ENDIF
11125 RETURN
11126 END SUBROUTINE wrf_get_var_td_integer_sca 
11127 
11128 
11129 !--- put_var_td_integer
11130 
11131 SUBROUTINE wrf_put_var_td_integer_arr ( DataHandle,Element, DateStr, Varname, Data, Count,  Status )
11132 !<DESCRIPTION>
11133 !<PRE>
11134 !
11135 ! Write Count words of time dependent
11136 ! attribute "Element" of variable "Varname" valid at time DateStr 
11137 ! to the open dataset described by DataHandle.  
11138 ! Attribute of type integer is
11139 ! copied from array Data.
11140 ! 
11141 !
11142 !</PRE>
11143 !</DESCRIPTION>
11144 USE module_state_description
11145 IMPLICIT NONE
11146 INTEGER ,       INTENT(IN)  :: DataHandle
11147 CHARACTER*(*) , INTENT(IN)  :: Element
11148 CHARACTER*(*) , INTENT(IN)  :: DateStr
11149 CHARACTER*(*) , INTENT(IN)  :: VarName 
11150 
11151  integer  :: Data (*)
11152 
11153 INTEGER ,       INTENT(IN)  :: Count
11154 
11155 INTEGER ,       INTENT(OUT) :: Status
11156 
11157 #include <wrf_status_codes.h>
11158 INTEGER                     :: len_of_str
11159 LOGICAL                     :: for_out
11160 INTEGER, EXTERNAL           :: use_package
11161 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
11162 INTEGER                     :: locCount
11163 
11164 INTEGER io_form , Hndl
11165 
11166 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_integer_arr " )
11167 
11168 locCount = Count
11169 
11170 
11171 
11172 Status = 0
11173 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
11174 IF ( Hndl .GT. -1 ) THEN
11175   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
11176     SELECT CASE ( use_package( io_form ) )
11177 #ifdef NETCDF
11178       CASE ( IO_NETCDF   )
11179         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11180            CALL ext_ncd_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11181                                  locCount,  Status ) 
11182         ENDIF
11183         IF ( .NOT. multi_files(io_form) ) THEN
11184           
11185           
11186           
11187           
11188           
11189           
11190           
11191           
11192           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11193         ENDIF
11194 #endif
11195 #ifdef PNETCDF
11196       CASE ( IO_PNETCDF   )
11197         CALL ext_pnc_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11198                               locCount,  Status ) 
11199 #endif
11200 #ifdef PHDF5
11201       CASE ( IO_PHDF5   )
11202         CALL ext_phdf5_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11203                               locCount,  Status ) 
11204 #endif
11205 #ifdef ESMFIO
11206       CASE ( IO_ESMF )
11207         CALL ext_esmf_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11208                               locCount,  Status ) 
11209 #endif
11210 #ifdef XXX
11211       CASE ( IO_XXX   )
11212         CALL ext_xxx_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11213                               locCount,  Status ) 
11214 #endif
11215 #ifdef YYY
11216       CASE ( IO_YYY   )
11217         CALL ext_yyy_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11218                               locCount,  Status ) 
11219 #endif
11220 #ifdef GRIB1
11221       CASE ( IO_GRIB1   )
11222         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11223            CALL ext_gr1_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11224                                  locCount,  Status ) 
11225         ENDIF
11226         IF ( .NOT. multi_files(io_form) ) THEN
11227           
11228           
11229           
11230           
11231           
11232           
11233           
11234           
11235           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11236         ENDIF
11237 #endif
11238 #ifdef GRIB2
11239       CASE ( IO_GRIB2   )
11240         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11241            CALL ext_gr2_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11242                                  locCount,  Status ) 
11243         ENDIF
11244         IF ( .NOT. multi_files(io_form) ) THEN
11245           
11246           
11247           
11248           
11249           
11250           
11251           
11252           
11253           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11254         ENDIF
11255 #endif
11256 #ifdef INTIO
11257       CASE ( IO_INTIO   )
11258         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11259            CALL ext_int_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11260                                  locCount,  Status ) 
11261         ENDIF
11262         IF ( .NOT. multi_files(io_form) ) THEN
11263            
11264            
11265            
11266            
11267            
11268            
11269            
11270            
11271            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11272         ENDIF
11273 #endif
11274       CASE DEFAULT
11275     END SELECT
11276   ELSE IF ( for_out .AND. use_output_servers() ) THEN
11277     CALL wrf_quilt_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11278                           locCount,  Status )
11279   ELSE
11280     Status = 0
11281 ENDIF
11282 ELSE
11283   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
11284 ENDIF
11285 RETURN
11286 END SUBROUTINE wrf_put_var_td_integer_arr 
11287 !--- put_var_td_integer
11288 
11289 SUBROUTINE wrf_put_var_td_integer_sca ( DataHandle,Element, DateStr, Varname, Data, Count,  Status )
11290 !<DESCRIPTION>
11291 !<PRE>
11292 !
11293 ! Write time dependent
11294 ! attribute "Element" of variable "Varname" valid at time DateStr 
11295 ! to the open dataset described by DataHandle.  
11296 ! Attribute of type integer is
11297 ! copied from scalar Data.
11298 ! 
11299 !
11300 !</PRE>
11301 !</DESCRIPTION>
11302 USE module_state_description
11303 IMPLICIT NONE
11304 INTEGER ,       INTENT(IN)  :: DataHandle
11305 CHARACTER*(*) , INTENT(IN)  :: Element
11306 CHARACTER*(*) , INTENT(IN)  :: DateStr
11307 CHARACTER*(*) , INTENT(IN)  :: VarName 
11308 
11309  integer  :: Data 
11310 
11311 INTEGER ,       INTENT(IN)  :: Count
11312 
11313 INTEGER ,       INTENT(OUT) :: Status
11314 
11315 #include <wrf_status_codes.h>
11316 INTEGER                     :: len_of_str
11317 LOGICAL                     :: for_out
11318 INTEGER, EXTERNAL           :: use_package
11319 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
11320 INTEGER                     :: locCount
11321 
11322 INTEGER io_form , Hndl
11323 
11324 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_integer_sca " )
11325 
11326 locCount = Count
11327 
11328 
11329 
11330 Status = 0
11331 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
11332 IF ( Hndl .GT. -1 ) THEN
11333   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
11334     SELECT CASE ( use_package( io_form ) )
11335 #ifdef NETCDF
11336       CASE ( IO_NETCDF   )
11337         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11338            CALL ext_ncd_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11339                                  locCount,  Status ) 
11340         ENDIF
11341         IF ( .NOT. multi_files(io_form) ) THEN
11342           
11343           
11344           
11345           
11346           
11347           
11348           
11349           
11350           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11351         ENDIF
11352 #endif
11353 #ifdef PNETCDF
11354       CASE ( IO_PNETCDF   )
11355         CALL ext_pnc_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11356                               locCount,  Status ) 
11357 #endif
11358 #ifdef PHDF5
11359       CASE ( IO_PHDF5   )
11360         CALL ext_phdf5_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11361                               locCount,  Status ) 
11362 #endif
11363 #ifdef ESMFIO
11364       CASE ( IO_ESMF )
11365         CALL ext_esmf_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11366                               locCount,  Status ) 
11367 #endif
11368 #ifdef XXX
11369       CASE ( IO_XXX   )
11370         CALL ext_xxx_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11371                               locCount,  Status ) 
11372 #endif
11373 #ifdef YYY
11374       CASE ( IO_YYY   )
11375         CALL ext_yyy_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11376                               locCount,  Status ) 
11377 #endif
11378 #ifdef GRIB1
11379       CASE ( IO_GRIB1   )
11380         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11381            CALL ext_gr1_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11382                                  locCount,  Status ) 
11383         ENDIF
11384         IF ( .NOT. multi_files(io_form) ) THEN
11385           
11386           
11387           
11388           
11389           
11390           
11391           
11392           
11393           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11394         ENDIF
11395 #endif
11396 #ifdef GRIB2
11397       CASE ( IO_GRIB2   )
11398         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11399            CALL ext_gr2_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11400                                  locCount,  Status ) 
11401         ENDIF
11402         IF ( .NOT. multi_files(io_form) ) THEN
11403           
11404           
11405           
11406           
11407           
11408           
11409           
11410           
11411           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11412         ENDIF
11413 #endif
11414 #ifdef INTIO
11415       CASE ( IO_INTIO   )
11416         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11417            CALL ext_int_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11418                                  locCount,  Status ) 
11419         ENDIF
11420         IF ( .NOT. multi_files(io_form) ) THEN
11421            
11422            
11423            
11424            
11425            
11426            
11427            
11428            
11429            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11430         ENDIF
11431 #endif
11432       CASE DEFAULT
11433     END SELECT
11434   ELSE IF ( for_out .AND. use_output_servers() ) THEN
11435     CALL wrf_quilt_put_var_td_integer ( Hndl, Element, DateStr, Varname, Data, &
11436                           locCount,  Status )
11437   ELSE
11438     Status = 0
11439 ENDIF
11440 ELSE
11441   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
11442 ENDIF
11443 RETURN
11444 END SUBROUTINE wrf_put_var_td_integer_sca 
11445 
11446 
11447 !--- get_var_td_logical
11448 
11449 SUBROUTINE wrf_get_var_td_logical_arr ( DataHandle,Element, DateStr, Varname, Data, Count, Outcount, Status )
11450 !<DESCRIPTION>
11451 !<PRE>
11452 !
11453 ! Attempt to read Count words of time dependent
11454 ! attribute "Element" of variable "Varname" valid at time DateStr 
11455 ! from the open dataset described by DataHandle.  
11456 ! Attribute of type logical is
11457 ! stored in array Data.
11458 ! Actual number of words read is returned in OutCount.
11459 !
11460 !</PRE>
11461 !</DESCRIPTION>
11462 USE module_state_description
11463 IMPLICIT NONE
11464 INTEGER ,       INTENT(IN)  :: DataHandle
11465 CHARACTER*(*) , INTENT(IN)  :: Element
11466 CHARACTER*(*) , INTENT(IN)  :: DateStr
11467 CHARACTER*(*) , INTENT(IN)  :: VarName 
11468 
11469  logical  :: Data (*)
11470 
11471 INTEGER ,       INTENT(IN)  :: Count
11472 INTEGER ,       INTENT(OUT)  :: OutCount
11473 INTEGER ,       INTENT(OUT) :: Status
11474 
11475 #include <wrf_status_codes.h>
11476 INTEGER                     :: len_of_str
11477 LOGICAL                     :: for_out
11478 INTEGER, EXTERNAL           :: use_package
11479 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
11480 INTEGER                     :: locCount
11481 
11482 INTEGER io_form , Hndl
11483 
11484 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_logical_arr " )
11485 
11486 
11487 
11488 locCount = Count
11489 
11490 Status = 0
11491 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
11492 IF ( Hndl .GT. -1 ) THEN
11493   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
11494     SELECT CASE ( use_package( io_form ) )
11495 #ifdef NETCDF
11496       CASE ( IO_NETCDF   )
11497         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11498            CALL ext_ncd_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11499                                  locCount, Outcount, Status ) 
11500         ENDIF
11501         IF ( .NOT. multi_files(io_form) ) THEN
11502           
11503           
11504           
11505           
11506           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11507           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
11508           
11509           
11510           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11511         ENDIF
11512 #endif
11513 #ifdef PNETCDF
11514       CASE ( IO_PNETCDF   )
11515         CALL ext_pnc_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11516                               locCount, Outcount, Status ) 
11517 #endif
11518 #ifdef PHDF5
11519       CASE ( IO_PHDF5   )
11520         CALL ext_phdf5_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11521                               locCount, Outcount, Status ) 
11522 #endif
11523 #ifdef ESMFIO
11524       CASE ( IO_ESMF )
11525         CALL ext_esmf_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11526                               locCount, Outcount, Status ) 
11527 #endif
11528 #ifdef XXX
11529       CASE ( IO_XXX   )
11530         CALL ext_xxx_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11531                               locCount, Outcount, Status ) 
11532 #endif
11533 #ifdef YYY
11534       CASE ( IO_YYY   )
11535         CALL ext_yyy_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11536                               locCount, Outcount, Status ) 
11537 #endif
11538 #ifdef GRIB1
11539       CASE ( IO_GRIB1   )
11540         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11541            CALL ext_gr1_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11542                                  locCount, Outcount, Status ) 
11543         ENDIF
11544         IF ( .NOT. multi_files(io_form) ) THEN
11545           
11546           
11547           
11548           
11549           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11550           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
11551           
11552           
11553           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11554         ENDIF
11555 #endif
11556 #ifdef GRIB2
11557       CASE ( IO_GRIB2   )
11558         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11559            CALL ext_gr2_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11560                                  locCount, Outcount, Status ) 
11561         ENDIF
11562         IF ( .NOT. multi_files(io_form) ) THEN
11563           
11564           
11565           
11566           
11567           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11568           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
11569           
11570           
11571           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11572         ENDIF
11573 #endif
11574 #ifdef INTIO
11575       CASE ( IO_INTIO   )
11576         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11577            CALL ext_int_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11578                                  locCount, Outcount, Status ) 
11579         ENDIF
11580         IF ( .NOT. multi_files(io_form) ) THEN
11581            
11582            
11583            
11584            
11585            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11586            CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
11587            
11588            
11589            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11590         ENDIF
11591 #endif
11592       CASE DEFAULT
11593     END SELECT
11594   ELSE IF ( for_out .AND. use_output_servers() ) THEN
11595     CALL wrf_quilt_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11596                           locCount, Outcount, Status )
11597   ELSE
11598     Status = 0
11599 ENDIF
11600 ELSE
11601   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
11602 ENDIF
11603 RETURN
11604 END SUBROUTINE wrf_get_var_td_logical_arr 
11605 !--- get_var_td_logical
11606 
11607 SUBROUTINE wrf_get_var_td_logical_sca ( DataHandle,Element, DateStr, Varname, Data, Count, Outcount, Status )
11608 !<DESCRIPTION>
11609 !<PRE>
11610 !
11611 ! Attempt to read time dependent
11612 ! attribute "Element" of variable "Varname" valid at time DateStr 
11613 ! from the open dataset described by DataHandle.  
11614 ! Attribute of type logical is
11615 ! stored in scalar Data.
11616 ! 
11617 !
11618 !</PRE>
11619 !</DESCRIPTION>
11620 USE module_state_description
11621 IMPLICIT NONE
11622 INTEGER ,       INTENT(IN)  :: DataHandle
11623 CHARACTER*(*) , INTENT(IN)  :: Element
11624 CHARACTER*(*) , INTENT(IN)  :: DateStr
11625 CHARACTER*(*) , INTENT(IN)  :: VarName 
11626 
11627  logical  :: Data 
11628 
11629 INTEGER ,       INTENT(IN)  :: Count
11630 INTEGER ,       INTENT(OUT)  :: OutCount
11631 INTEGER ,       INTENT(OUT) :: Status
11632 
11633 #include <wrf_status_codes.h>
11634 INTEGER                     :: len_of_str
11635 LOGICAL                     :: for_out
11636 INTEGER, EXTERNAL           :: use_package
11637 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
11638 INTEGER                     :: locCount
11639 
11640 INTEGER io_form , Hndl
11641 
11642 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_logical_sca " )
11643 
11644 
11645 
11646 locCount = Count
11647 
11648 Status = 0
11649 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
11650 IF ( Hndl .GT. -1 ) THEN
11651   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
11652     SELECT CASE ( use_package( io_form ) )
11653 #ifdef NETCDF
11654       CASE ( IO_NETCDF   )
11655         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11656            CALL ext_ncd_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11657                                  locCount, Outcount, Status ) 
11658         ENDIF
11659         IF ( .NOT. multi_files(io_form) ) THEN
11660           
11661           
11662           
11663           
11664           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11665           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
11666           
11667           
11668           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11669         ENDIF
11670 #endif
11671 #ifdef PNETCDF
11672       CASE ( IO_PNETCDF   )
11673         CALL ext_pnc_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11674                               locCount, Outcount, Status ) 
11675 #endif
11676 #ifdef PHDF5
11677       CASE ( IO_PHDF5   )
11678         CALL ext_phdf5_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11679                               locCount, Outcount, Status ) 
11680 #endif
11681 #ifdef ESMFIO
11682       CASE ( IO_ESMF )
11683         CALL ext_esmf_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11684                               locCount, Outcount, Status ) 
11685 #endif
11686 #ifdef XXX
11687       CASE ( IO_XXX   )
11688         CALL ext_xxx_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11689                               locCount, Outcount, Status ) 
11690 #endif
11691 #ifdef YYY
11692       CASE ( IO_YYY   )
11693         CALL ext_yyy_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11694                               locCount, Outcount, Status ) 
11695 #endif
11696 #ifdef GRIB1
11697       CASE ( IO_GRIB1   )
11698         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11699            CALL ext_gr1_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11700                                  locCount, Outcount, Status ) 
11701         ENDIF
11702         IF ( .NOT. multi_files(io_form) ) THEN
11703           
11704           
11705           
11706           
11707           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11708           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
11709           
11710           
11711           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11712         ENDIF
11713 #endif
11714 #ifdef GRIB2
11715       CASE ( IO_GRIB2   )
11716         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11717            CALL ext_gr2_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11718                                  locCount, Outcount, Status ) 
11719         ENDIF
11720         IF ( .NOT. multi_files(io_form) ) THEN
11721           
11722           
11723           
11724           
11725           CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11726           CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
11727           
11728           
11729           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11730         ENDIF
11731 #endif
11732 #ifdef INTIO
11733       CASE ( IO_INTIO   )
11734         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11735            CALL ext_int_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11736                                  locCount, Outcount, Status ) 
11737         ENDIF
11738         IF ( .NOT. multi_files(io_form) ) THEN
11739            
11740            
11741            
11742            
11743            CALL wrf_dm_bcast_bytes( locCount, IWORDSIZE )
11744            CALL wrf_dm_bcast_bytes( Data, LWORDSIZE*locCount )
11745            
11746            
11747            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11748         ENDIF
11749 #endif
11750       CASE DEFAULT
11751     END SELECT
11752   ELSE IF ( for_out .AND. use_output_servers() ) THEN
11753     CALL wrf_quilt_get_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11754                           locCount, Outcount, Status )
11755   ELSE
11756     Status = 0
11757 ENDIF
11758 ELSE
11759   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
11760 ENDIF
11761 RETURN
11762 END SUBROUTINE wrf_get_var_td_logical_sca 
11763 
11764 
11765 !--- put_var_td_logical
11766 
11767 SUBROUTINE wrf_put_var_td_logical_arr ( DataHandle,Element, DateStr, Varname, Data, Count,  Status )
11768 !<DESCRIPTION>
11769 !<PRE>
11770 !
11771 ! Write Count words of time dependent
11772 ! attribute "Element" of variable "Varname" valid at time DateStr 
11773 ! to the open dataset described by DataHandle.  
11774 ! Attribute of type logical is
11775 ! copied from array Data.
11776 ! 
11777 !
11778 !</PRE>
11779 !</DESCRIPTION>
11780 USE module_state_description
11781 IMPLICIT NONE
11782 INTEGER ,       INTENT(IN)  :: DataHandle
11783 CHARACTER*(*) , INTENT(IN)  :: Element
11784 CHARACTER*(*) , INTENT(IN)  :: DateStr
11785 CHARACTER*(*) , INTENT(IN)  :: VarName 
11786 
11787  logical  :: Data (*)
11788 
11789 INTEGER ,       INTENT(IN)  :: Count
11790 
11791 INTEGER ,       INTENT(OUT) :: Status
11792 
11793 #include <wrf_status_codes.h>
11794 INTEGER                     :: len_of_str
11795 LOGICAL                     :: for_out
11796 INTEGER, EXTERNAL           :: use_package
11797 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
11798 INTEGER                     :: locCount
11799 
11800 INTEGER io_form , Hndl
11801 
11802 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_logical_arr " )
11803 
11804 
11805 
11806 locCount = Count
11807 
11808 Status = 0
11809 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
11810 IF ( Hndl .GT. -1 ) THEN
11811   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
11812     SELECT CASE ( use_package( io_form ) )
11813 #ifdef NETCDF
11814       CASE ( IO_NETCDF   )
11815         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11816            CALL ext_ncd_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11817                                  locCount,  Status ) 
11818         ENDIF
11819         IF ( .NOT. multi_files(io_form) ) THEN
11820           
11821           
11822           
11823           
11824           
11825           
11826           
11827           
11828           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11829         ENDIF
11830 #endif
11831 #ifdef PNETCDF
11832       CASE ( IO_PNETCDF   )
11833         CALL ext_pnc_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11834                               locCount,  Status ) 
11835 #endif
11836 #ifdef PHDF5
11837       CASE ( IO_PHDF5   )
11838         CALL ext_phdf5_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11839                               locCount,  Status ) 
11840 #endif
11841 #ifdef ESMFIO
11842       CASE ( IO_ESMF )
11843         CALL ext_esmf_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11844                               locCount,  Status ) 
11845 #endif
11846 #ifdef XXX
11847       CASE ( IO_XXX   )
11848         CALL ext_xxx_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11849                               locCount,  Status ) 
11850 #endif
11851 #ifdef YYY
11852       CASE ( IO_YYY   )
11853         CALL ext_yyy_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11854                               locCount,  Status ) 
11855 #endif
11856 #ifdef GRIB1
11857       CASE ( IO_GRIB1   )
11858         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11859            CALL ext_gr1_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11860                                  locCount,  Status ) 
11861         ENDIF
11862         IF ( .NOT. multi_files(io_form) ) THEN
11863           
11864           
11865           
11866           
11867           
11868           
11869           
11870           
11871           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11872         ENDIF
11873 #endif
11874 #ifdef GRIB2
11875       CASE ( IO_GRIB2   )
11876         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11877            CALL ext_gr2_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11878                                  locCount,  Status ) 
11879         ENDIF
11880         IF ( .NOT. multi_files(io_form) ) THEN
11881           
11882           
11883           
11884           
11885           
11886           
11887           
11888           
11889           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11890         ENDIF
11891 #endif
11892 #ifdef INTIO
11893       CASE ( IO_INTIO   )
11894         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11895            CALL ext_int_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11896                                  locCount,  Status ) 
11897         ENDIF
11898         IF ( .NOT. multi_files(io_form) ) THEN
11899            
11900            
11901            
11902            
11903            
11904            
11905            
11906            
11907            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11908         ENDIF
11909 #endif
11910       CASE DEFAULT
11911     END SELECT
11912   ELSE IF ( for_out .AND. use_output_servers() ) THEN
11913     CALL wrf_quilt_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11914                           locCount,  Status )
11915   ELSE
11916     Status = 0
11917 ENDIF
11918 ELSE
11919   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
11920 ENDIF
11921 RETURN
11922 END SUBROUTINE wrf_put_var_td_logical_arr 
11923 !--- put_var_td_logical
11924 
11925 SUBROUTINE wrf_put_var_td_logical_sca ( DataHandle,Element, DateStr, Varname, Data, Count,  Status )
11926 !<DESCRIPTION>
11927 !<PRE>
11928 !
11929 ! Write time dependent
11930 ! attribute "Element" of variable "Varname" valid at time DateStr 
11931 ! to the open dataset described by DataHandle.  
11932 ! Attribute of type logical is
11933 ! copied from scalar Data.
11934 ! 
11935 !
11936 !</PRE>
11937 !</DESCRIPTION>
11938 USE module_state_description
11939 IMPLICIT NONE
11940 INTEGER ,       INTENT(IN)  :: DataHandle
11941 CHARACTER*(*) , INTENT(IN)  :: Element
11942 CHARACTER*(*) , INTENT(IN)  :: DateStr
11943 CHARACTER*(*) , INTENT(IN)  :: VarName 
11944 
11945  logical  :: Data 
11946 
11947 INTEGER ,       INTENT(IN)  :: Count
11948 
11949 INTEGER ,       INTENT(OUT) :: Status
11950 
11951 #include <wrf_status_codes.h>
11952 INTEGER                     :: len_of_str
11953 LOGICAL                     :: for_out
11954 INTEGER, EXTERNAL           :: use_package
11955 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
11956 INTEGER                     :: locCount
11957 
11958 INTEGER io_form , Hndl
11959 
11960 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_logical_sca " )
11961 
11962 
11963 
11964 locCount = Count
11965 
11966 Status = 0
11967 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
11968 IF ( Hndl .GT. -1 ) THEN
11969   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
11970     SELECT CASE ( use_package( io_form ) )
11971 #ifdef NETCDF
11972       CASE ( IO_NETCDF   )
11973         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
11974            CALL ext_ncd_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11975                                  locCount,  Status ) 
11976         ENDIF
11977         IF ( .NOT. multi_files(io_form) ) THEN
11978           
11979           
11980           
11981           
11982           
11983           
11984           
11985           
11986           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
11987         ENDIF
11988 #endif
11989 #ifdef PNETCDF
11990       CASE ( IO_PNETCDF   )
11991         CALL ext_pnc_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11992                               locCount,  Status ) 
11993 #endif
11994 #ifdef PHDF5
11995       CASE ( IO_PHDF5   )
11996         CALL ext_phdf5_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
11997                               locCount,  Status ) 
11998 #endif
11999 #ifdef ESMFIO
12000       CASE ( IO_ESMF )
12001         CALL ext_esmf_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
12002                               locCount,  Status ) 
12003 #endif
12004 #ifdef XXX
12005       CASE ( IO_XXX   )
12006         CALL ext_xxx_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
12007                               locCount,  Status ) 
12008 #endif
12009 #ifdef YYY
12010       CASE ( IO_YYY   )
12011         CALL ext_yyy_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
12012                               locCount,  Status ) 
12013 #endif
12014 #ifdef GRIB1
12015       CASE ( IO_GRIB1   )
12016         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12017            CALL ext_gr1_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
12018                                  locCount,  Status ) 
12019         ENDIF
12020         IF ( .NOT. multi_files(io_form) ) THEN
12021           
12022           
12023           
12024           
12025           
12026           
12027           
12028           
12029           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12030         ENDIF
12031 #endif
12032 #ifdef GRIB2
12033       CASE ( IO_GRIB2   )
12034         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12035            CALL ext_gr2_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
12036                                  locCount,  Status ) 
12037         ENDIF
12038         IF ( .NOT. multi_files(io_form) ) THEN
12039           
12040           
12041           
12042           
12043           
12044           
12045           
12046           
12047           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12048         ENDIF
12049 #endif
12050 #ifdef INTIO
12051       CASE ( IO_INTIO   )
12052         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12053            CALL ext_int_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
12054                                  locCount,  Status ) 
12055         ENDIF
12056         IF ( .NOT. multi_files(io_form) ) THEN
12057            
12058            
12059            
12060            
12061            
12062            
12063            
12064            
12065            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12066         ENDIF
12067 #endif
12068       CASE DEFAULT
12069     END SELECT
12070   ELSE IF ( for_out .AND. use_output_servers() ) THEN
12071     CALL wrf_quilt_put_var_td_logical ( Hndl, Element, DateStr, Varname, Data, &
12072                           locCount,  Status )
12073   ELSE
12074     Status = 0
12075 ENDIF
12076 ELSE
12077   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
12078 ENDIF
12079 RETURN
12080 END SUBROUTINE wrf_put_var_td_logical_sca 
12081 
12082 
12083 !--- get_var_td_char
12084 
12085 SUBROUTINE wrf_get_var_td_char_arr ( DataHandle,Element, DateStr, Varname, Data,  Status )
12086 !<DESCRIPTION>
12087 !<PRE>
12088 !
12089 ! Attempt to read time dependent
12090 ! attribute "Element" of variable "Varname" valid at time DateStr 
12091 ! from the open dataset described by DataHandle.  
12092 ! Attribute of type char is
12093 ! stored in string Data.
12094 ! 
12095 !
12096 !</PRE>
12097 !</DESCRIPTION>
12098 USE module_state_description
12099 IMPLICIT NONE
12100 INTEGER ,       INTENT(IN)  :: DataHandle
12101 CHARACTER*(*) , INTENT(IN)  :: Element
12102 CHARACTER*(*) , INTENT(IN)  :: DateStr
12103 CHARACTER*(*) , INTENT(IN)  :: VarName 
12104 
12105  CHARACTER*(*)  :: Data
12106 
12107 
12108 
12109 INTEGER ,       INTENT(OUT) :: Status
12110 
12111 #include <wrf_status_codes.h>
12112 INTEGER                     :: len_of_str
12113 LOGICAL                     :: for_out
12114 INTEGER, EXTERNAL           :: use_package
12115 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
12116 INTEGER                     :: locCount
12117 
12118 INTEGER io_form , Hndl
12119 
12120 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_get_var_td_char_arr " )
12121 
12122 
12123 
12124 
12125 
12126 Status = 0
12127 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
12128 IF ( Hndl .GT. -1 ) THEN
12129   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
12130     SELECT CASE ( use_package( io_form ) )
12131 #ifdef NETCDF
12132       CASE ( IO_NETCDF   )
12133         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12134            CALL ext_ncd_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12135                                   Status ) 
12136         ENDIF
12137         IF ( .NOT. multi_files(io_form) ) THEN
12138           
12139           
12140           
12141           
12142           
12143           
12144           len_of_str = LEN(Data)
12145           CALL wrf_dm_bcast_string( Data, len_of_str )
12146           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12147         ENDIF
12148 #endif
12149 #ifdef PNETCDF
12150       CASE ( IO_PNETCDF   )
12151         CALL ext_pnc_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12152                                Status ) 
12153 #endif
12154 #ifdef PHDF5
12155       CASE ( IO_PHDF5   )
12156         CALL ext_phdf5_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12157                                Status ) 
12158 #endif
12159 #ifdef ESMFIO
12160       CASE ( IO_ESMF )
12161         CALL ext_esmf_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12162                                Status ) 
12163 #endif
12164 #ifdef XXX
12165       CASE ( IO_XXX   )
12166         CALL ext_xxx_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12167                                Status ) 
12168 #endif
12169 #ifdef YYY
12170       CASE ( IO_YYY   )
12171         CALL ext_yyy_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12172                                Status ) 
12173 #endif
12174 #ifdef GRIB1
12175       CASE ( IO_GRIB1   )
12176         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12177            CALL ext_gr1_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12178                                   Status ) 
12179         ENDIF
12180         IF ( .NOT. multi_files(io_form) ) THEN
12181           
12182           
12183           
12184           
12185           
12186           
12187           len_of_str = LEN(Data)
12188           CALL wrf_dm_bcast_string( Data, len_of_str )
12189           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12190         ENDIF
12191 #endif
12192 #ifdef GRIB2
12193       CASE ( IO_GRIB2   )
12194         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12195            CALL ext_gr2_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12196                                   Status ) 
12197         ENDIF
12198         IF ( .NOT. multi_files(io_form) ) THEN
12199           
12200           
12201           
12202           
12203           
12204           
12205           len_of_str = LEN(Data)
12206           CALL wrf_dm_bcast_string( Data, len_of_str )
12207           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12208         ENDIF
12209 #endif
12210 #ifdef INTIO
12211       CASE ( IO_INTIO   )
12212         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12213            CALL ext_int_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12214                                   Status ) 
12215         ENDIF
12216         IF ( .NOT. multi_files(io_form) ) THEN
12217            
12218            
12219            
12220            
12221            
12222            
12223            len_of_str = LEN(Data)
12224            CALL wrf_dm_bcast_string( Data, len_of_str )
12225            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12226         ENDIF
12227 #endif
12228       CASE DEFAULT
12229     END SELECT
12230   ELSE IF ( for_out .AND. use_output_servers() ) THEN
12231     CALL wrf_quilt_get_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12232                            Status )
12233   ELSE
12234     Status = 0
12235 ENDIF
12236 ELSE
12237   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
12238 ENDIF
12239 RETURN
12240 END SUBROUTINE wrf_get_var_td_char_arr 
12241 
12242 
12243 !--- put_var_td_char
12244 
12245 SUBROUTINE wrf_put_var_td_char_arr ( DataHandle,Element, DateStr, Varname, Data,  Status )
12246 !<DESCRIPTION>
12247 !<PRE>
12248 !
12249 ! Write time dependent
12250 ! attribute "Element" of variable "Varname" valid at time DateStr 
12251 ! to the open dataset described by DataHandle.  
12252 ! Attribute of type char is
12253 ! copied from string Data.
12254 ! 
12255 !
12256 !</PRE>
12257 !</DESCRIPTION>
12258 USE module_state_description
12259 IMPLICIT NONE
12260 INTEGER ,       INTENT(IN)  :: DataHandle
12261 CHARACTER*(*) , INTENT(IN)  :: Element
12262 CHARACTER*(*) , INTENT(IN)  :: DateStr
12263 CHARACTER*(*) , INTENT(IN)  :: VarName 
12264 
12265  CHARACTER*(*)  :: Data
12266 
12267 
12268 
12269 INTEGER ,       INTENT(OUT) :: Status
12270 
12271 #include <wrf_status_codes.h>
12272 INTEGER                     :: len_of_str
12273 LOGICAL                     :: for_out
12274 INTEGER, EXTERNAL           :: use_package
12275 LOGICAL, EXTERNAL           :: wrf_dm_on_monitor, multi_files, use_output_servers
12276 INTEGER                     :: locCount
12277 
12278 INTEGER io_form , Hndl
12279 
12280 CALL wrf_debug( DEBUG_LVL, "module_io.F (md_calls.m4) : in wrf_put_var_td_char_arr " )
12281 
12282 
12283 
12284 
12285 
12286 Status = 0
12287 CALL get_handle ( Hndl, io_form , for_out, DataHandle )
12288 IF ( Hndl .GT. -1 ) THEN
12289   IF ( multi_files( io_form ) .OR. .NOT. (for_out .AND. use_output_servers()) ) THEN
12290     SELECT CASE ( use_package( io_form ) )
12291 #ifdef NETCDF
12292       CASE ( IO_NETCDF   )
12293         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12294            CALL ext_ncd_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12295                                   Status ) 
12296         ENDIF
12297         IF ( .NOT. multi_files(io_form) ) THEN
12298           
12299           
12300           
12301           
12302           
12303           
12304           
12305           
12306           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12307         ENDIF
12308 #endif
12309 #ifdef PNETCDF
12310       CASE ( IO_PNETCDF   )
12311         CALL ext_pnc_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12312                                Status ) 
12313 #endif
12314 #ifdef PHDF5
12315       CASE ( IO_PHDF5   )
12316         CALL ext_phdf5_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12317                                Status ) 
12318 #endif
12319 #ifdef ESMFIO
12320       CASE ( IO_ESMF )
12321         CALL ext_esmf_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12322                                Status ) 
12323 #endif
12324 #ifdef XXX
12325       CASE ( IO_XXX   )
12326         CALL ext_xxx_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12327                                Status ) 
12328 #endif
12329 #ifdef YYY
12330       CASE ( IO_YYY   )
12331         CALL ext_yyy_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12332                                Status ) 
12333 #endif
12334 #ifdef GRIB1
12335       CASE ( IO_GRIB1   )
12336         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12337            CALL ext_gr1_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12338                                   Status ) 
12339         ENDIF
12340         IF ( .NOT. multi_files(io_form) ) THEN
12341           
12342           
12343           
12344           
12345           
12346           
12347           
12348           
12349           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12350         ENDIF
12351 #endif
12352 #ifdef GRIB2
12353       CASE ( IO_GRIB2   )
12354         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12355            CALL ext_gr2_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12356                                   Status ) 
12357         ENDIF
12358         IF ( .NOT. multi_files(io_form) ) THEN
12359           
12360           
12361           
12362           
12363           
12364           
12365           
12366           
12367           CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12368         ENDIF
12369 #endif
12370 #ifdef INTIO
12371       CASE ( IO_INTIO   )
12372         IF ( multi_files(io_form) .OR.  wrf_dm_on_monitor() ) THEN
12373            CALL ext_int_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12374                                   Status ) 
12375         ENDIF
12376         IF ( .NOT. multi_files(io_form) ) THEN
12377            
12378            
12379            
12380            
12381            
12382            
12383            
12384            
12385            CALL wrf_dm_bcast_bytes( Status, IWORDSIZE )
12386         ENDIF
12387 #endif
12388       CASE DEFAULT
12389     END SELECT
12390   ELSE IF ( for_out .AND. use_output_servers() ) THEN
12391     CALL wrf_quilt_put_var_td_char ( Hndl, Element, DateStr, Varname, Data, &
12392                            Status )
12393   ELSE
12394     Status = 0
12395 ENDIF
12396 ELSE
12397   Status = WRF_ERR_FATAL_BAD_FILE_STATUS
12398 ENDIF
12399 RETURN
12400 END SUBROUTINE wrf_put_var_td_char_arr 
12401 
12402 
12403