74 subroutine get_info_binary(np, type, file_size, ierr, iio, fname)
bind(c)
76 integer(c_int64_t),
intent(out) :: np
77 integer(c_int),
intent(out) ::
type
78 integer(c_int64_t),
intent(out) :: file_size
79 integer(c_int),
intent(out) :: ierr
80 integer(c_int),
intent(inout) :: iio
81 character(kind=c_char),
intent(in) :: fname(*)
84 subroutine write_header(np, type, ierr, iio, fname)
bind(c, name="io_write_header")
86 integer(c_int64_t),
intent(in) :: np
87 integer(c_int),
intent(in) :: type
88 integer(c_int),
intent(out) :: ierr
89 integer(c_int),
intent(inout) :: iio
90 character(kind=c_char),
intent(in) :: fname(*)
93 subroutine write_binary(np, ff, type, ierr, iio, nhd, flpe, fname)
bind(c, name="write_binary")
95 integer(c_int64_t),
intent(in) :: np
96 type(c_ptr),
value :: ff
97 integer(c_int),
intent(in) :: type
98 integer(c_int),
intent(out) :: ierr
99 integer(c_int),
intent(inout) :: iio
100 integer(c_int),
intent(in) :: nhd
101 integer(c_int),
intent(in) :: flpe
102 character(kind=c_char),
intent(in) :: fname(*)
105 subroutine read_binary(np, offset, ff, output_type, ierr, iio, fname)
bind(c, name="read_binary")
107 integer(c_int64_t),
intent(in) :: np
108 integer(c_int64_t),
intent(in) :: offset
109 type(c_ptr),
value :: ff
110 integer(c_int),
intent(in) :: output_type
111 integer(c_int),
intent(out) :: ierr
112 integer(c_int),
intent(inout) :: iio
113 character(kind=c_char),
intent(in) :: fname(*)
122 logical pure function io_binary_is_little_endian() result(is_little)
124 integer,
parameter:: I4P = selected_int_kind(9)
125 integer,
parameter:: I1P = selected_int_kind(2)
126 integer(I1P) :: int1(1:4)
128 int1 = transfer(1_i4p, int1)
129 is_little = (int1(1) == 1_i1p)
135 character(len=*),
intent(in) :: fname
136 type(MPI_File),
intent(out) :: file_handle
137 type(MPI_Comm),
intent(in) :: comm
138 integer(int64),
intent(in) :: xlocal
139 integer,
intent(in) :: np
140 integer,
intent(in) :: sizeof_ff
141 logical,
intent(in) :: is_write
142 integer,
intent(out) :: ierr
145 integer(MPI_OFFSET_KIND) :: offset
154 offset = (xlocal-1)*sizeof_ff+64
157 amode = ior(mpi_mode_wronly,mpi_mode_append)
159 amode = mpi_mode_rdonly
161 call mpi_file_open(comm, fname, amode, mpi_info_null, file_handle, mpi_err)
162 call io_incr_open_count()
164 if (mpi_err == 0)
then
165 call mpi_file_set_atomicity(file_handle, .
true., mpi_err)
166 call mpi_file_seek(file_handle, offset, mpi_seek_set, mpi_err)
177 type(mpi_file),
intent(inout) :: file_handle
182 call mpi_file_close(file_handle, mpi_err)
183 call io_incr_close_count()
193 character(len=*),
intent(in) :: fname
194 integer(int64),
intent(in) :: np
195 complex(real64),
intent(out) :: ff(:)
196 integer,
intent(out) :: ierr
197 integer(int64),
optional,
intent(in) :: offset
199 integer(int64) :: read_np, file_size
200 integer :: number_type, iio
201 real(real64),
allocatable :: read_ff(:)
202 character(kind=c_char),
dimension(c_str_len(fname)) :: cname
208 cname = string_f_to_c(fname)
209 call get_info_binary(read_np, number_type, file_size, ierr, iio, cname)
210 call io_incr_counters(iio)
213 if (number_type /= type_double_complex)
then
215 write(message(1),
'(a,i2,a,i2)')
"Debug: Found type = ", number_type,
" instead of ", type_double_complex
216 call messages_info(1)
219 safe_allocate(read_ff(1:np))
222 safe_deallocate_a(read_ff)
234 character(len=*),
intent(in) :: fname
235 type(mpi_comm),
intent(in) :: comm
236 integer(int64),
intent(in) :: xlocal
237 integer,
intent(in) :: np
238 complex(real64),
intent(inout) :: ff(:)
239 integer,
intent(out) :: ierr
241 integer(int64) :: read_np, file_size
242 integer :: number_type, iio
243 real(real64),
allocatable :: read_ff(:)
248 call get_info_binary(read_np, number_type, file_size, ierr, iio, string_f_to_c(fname))
249 call io_incr_counters(iio)
251 if (number_type /= type_double_complex)
then
253 write(message(1),
'(a,i2,a,i2)')
"Debug: Found type = ", number_type,
" instead of ", type_double_complex
254 call messages_info(1)
256 safe_allocate(read_ff(1:np))
259 safe_deallocate_a(read_ff)
271 character(len=*),
intent(in) :: fname
272 integer(int64),
intent(out) :: np
273 integer(int64),
intent(out) :: file_size
274 integer,
intent(out) :: ierr
281 call get_info_binary(np,
type, file_size, ierr, iio, string_f_to_c(fname))
282 call io_incr_counters(iio)
288 integer pure function logical_to_integer(flag) result(iflag)
289 logical,
intent(in) :: flag
294#include "complex.F90"
295#include "io_binary_f_inc.F90"
300#include "io_binary_f_inc.F90"
304#include "integer.F90"
305#include "io_binary_f_inc.F90"
309#include "integer8.F90"
310#include "io_binary_f_inc.F90"
subroutine lwrite_binary(fname, np, ff, ierr, nohead, fendian)
subroutine iwrite_binary2(fname, np, ff, ierr, nohead, fendian)
subroutine zread_binary2(fname, np, ff, ierr)
subroutine zread_binary3(fname, np, ff, ierr)
subroutine zwrite_binary4(fname, np, ff, ierr, nohead, fendian)
subroutine dwrite_binary3(fname, np, ff, ierr, nohead, fendian)
subroutine dwrite_binary5(fname, np, ff, ierr, nohead, fendian)
subroutine iread_binary(fname, np, ff, ierr, offset)
subroutine dwrite_binary(fname, np, ff, ierr, nohead, fendian)
logical pure function, public io_binary_is_little_endian()
check endianness Logical output: true is the running architecture uses little endian ordering,...
subroutine iread_parallel(fname, comm, xlocal, np, ff, ierr)
subroutine try_dread_parallel(fname, comm, xlocal, np, ff, ierr)
subroutine io_binary_parallel_start(fname, file_handle, comm, xlocal, np, sizeof_ff, is_write, ierr)
subroutine zwrite_binary3(fname, np, ff, ierr, nohead, fendian)
subroutine lwrite_binary2(fname, np, ff, ierr, nohead, fendian)
subroutine zwrite_binary2(fname, np, ff, ierr, nohead, fendian)
subroutine iwrite_binary5(fname, np, ff, ierr, nohead, fendian)
subroutine iread_binary3(fname, np, ff, ierr)
subroutine dwrite_binary2(fname, np, ff, ierr, nohead, fendian)
subroutine iwrite_binary3(fname, np, ff, ierr, nohead, fendian)
subroutine zread_binary(fname, np, ff, ierr, offset)
subroutine zwrite_parallel(fname, comm, xlocal, np, ff, ierr)
subroutine iwrite_binary4(fname, np, ff, ierr, nohead, fendian)
subroutine dread_binary5(fname, np, ff, ierr)
subroutine dread_binary4(fname, np, ff, ierr)
subroutine dread_binary(fname, np, ff, ierr, offset)
subroutine try_dread_binary(fname, np, ff, ierr, offset)
subroutine iread_binary4(fname, np, ff, ierr)
subroutine zwrite_binary5(fname, np, ff, ierr, nohead, fendian)
subroutine, public dwrite_header(fname, np_global, ierr)
subroutine io_binary_parallel_end(file_handle)
subroutine, public lwrite_header(fname, np_global, ierr)
subroutine zwrite_binary(fname, np, ff, ierr, nohead, fendian)
subroutine, public zwrite_header(fname, np_global, ierr)
subroutine zread_binary5(fname, np, ff, ierr)
subroutine lwrite_binary5(fname, np, ff, ierr, nohead, fendian)
subroutine, public io_binary_get_info(fname, np, file_size, ierr)
subroutine lwrite_binary4(fname, np, ff, ierr, nohead, fendian)
subroutine dread_binary3(fname, np, ff, ierr)
subroutine lwrite_binary3(fname, np, ff, ierr, nohead, fendian)
subroutine lread_binary5(fname, np, ff, ierr)
subroutine lread_binary4(fname, np, ff, ierr)
subroutine iwrite_binary(fname, np, ff, ierr, nohead, fendian)
subroutine zread_parallel(fname, comm, xlocal, np, ff, ierr)
integer pure function logical_to_integer(flag)
subroutine dread_binary2(fname, np, ff, ierr)
subroutine lread_binary2(fname, np, ff, ierr)
subroutine iread_binary5(fname, np, ff, ierr)
subroutine lread_parallel(fname, comm, xlocal, np, ff, ierr)
subroutine lread_binary(fname, np, ff, ierr, offset)
subroutine zread_binary4(fname, np, ff, ierr)
subroutine iwrite_parallel(fname, comm, xlocal, np, ff, ierr)
subroutine lwrite_parallel(fname, comm, xlocal, np, ff, ierr)
subroutine, public iwrite_header(fname, np_global, ierr)
subroutine dwrite_binary4(fname, np, ff, ierr, nohead, fendian)
subroutine iread_binary2(fname, np, ff, ierr)
subroutine lread_binary3(fname, np, ff, ierr)
subroutine dread_parallel(fname, comm, xlocal, np, ff, ierr)
subroutine dwrite_parallel(fname, comm, xlocal, np, ff, ierr)