xref: /phasta/phSolver/common/test/phIOwrite.f (revision e5afe575c31e8c8ddf3ee8a1daadc21a50758f4b)
1      program readwrite
2      use iso_c_binding
3      use phio
4      include "mpif.h"
5
6      integer :: rank, ierror, ione, nfiles, numnp
7      type(c_ptr) :: handle
8      character(len=30) :: dataInt, iotype
9      dataInt = c_char_"integer"//c_null_char
10      iotype =  c_char_"binary"//c_null_char
11
12      call MPI_Init(ierror)
13      call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierror)
14
15      ione = 1
16      nfiles = 2
17      call phio_openfile_read(c_char_"geombc-dat."//c_null_char, nfiles, handle)
18      call phio_readheader(handle,
19     &  c_char_"number of nodes"//char(0),
20     &  c_loc(numnp), ione, dataInt, iotype)
21      write (*,*) rank, ' calling closefile_read'
22
23      call phio_closefile_read(handle)
24
25      call MPI_Finalize(ierror)
26      end
27