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