7 use module_io_int_idx
, only
: io_int_index
, r_info
8 use module_io_int_read
, only
: io_int_fetch_data
13 integer, parameter :: llong_t
= selected_int_kind(16) ! int64_t
19 integer(kind
=llong_t
) :: offset
21 character(len
=256) :: filename
22 type(r_info
), pointer :: records(:) => NULL()
24 character(len
=256) :: var
25 character(len
=256) :: value
38 ! Get the file name to index
40 if (argc
.lt
. 2 ) then
41 write(0, *) 'Must supply a filename to index and a variable to get.'
42 write(0, *) 'i.e.: test_io_mpi MMINLU'
45 call getarg(1, filename
)
48 call io_int_index(filename
, records
, ierr
)
53 call mpi_file_open(mpi_comm_world
, trim(filename
), &
54 mpi_mode_rdonly
, mpi_info_null
, &
57 call io_int_fetch_data(iunit
, records
, trim(var
), value
, ierr
)
58 write(6,*) trim(var
), ': ', trim(value
)
60 call mpi_file_close(iunit
, ierr
)
61 call mpi_finalize(ierr
)
63 end program test_io_mpi
66 subroutine wrf_message(message
)
70 character(len
=*), intent(in
) :: message
72 write(0,*) trim(message
)
73 end subroutine wrf_message
75 subroutine wrf_error_fatal3(file
, line
, message
)
79 character(len
=*), intent(in
) :: file
80 integer, intent(in
) :: line
81 character(len
=*), intent(in
) :: message
83 write(0,*) trim(file
), 'line: ', line
, ': ', trim(message
)
85 end subroutine wrf_error_fatal3