1 program readwrite 2 use iso_c_binding 3 include "common.h" 4 include "mpif.h" 5 6 integer :: rank, ierror, ione, nfiles 7 type(c_ptr), TARGET :: igeom 8 type(c_ptr) :: p 9 10 call MPI_Init(ierror) 11 call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierror) 12 13 ione = 1 14 nfiles = 2 15 p = c_loc(igeom) 16 write (*,*) 'rank numfiles', rank, numfiles 17 call phio_openfile_read('geombc-dat.' // char(0), nfiles, p) 18 write (*,*) 'rank numfiles', rank, numfiles 19 ! call phio_readheader(igeom,'number of nodes' // char(0),numnp,ione, 20 ! & 'integer' // char(0), iotype) 21 write (*,*) rank, ' calling closefile_read' 22 23 call phio_closefile_read(igeom) 24 25 26 call MPI_Finalize(ierror) 27 end 28