SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. subroutine write_field( fname, u )
  2.  
  3.   include 'sam.h'
  4.   include 'mpif.h'
  5.  
  6.   complex u(Nz_min,Ny_min,nxp,Lu)
  7.   character(*) fname
  8.   character(6) ext
  9.   integer(kind=mpi_offset_kind) :: offset, irecl_out
  10.   integer amode, status(mpi_status_size)
  11.  
  12.   n_words_out = Nz_min*Ny_min
  13.   irecl_out   = n_words_out*16
  14.  
  15.   amode = ior( mpi_mode_create, mpi_mode_wronly )
  16.  
  17.   call mpi_file_open( mpi_comm_world, fname, amode,
  18.  &                    mpi_info_null, fh(3), ierr )
  19.  
  20.   do n=1, Lu
  21.      do i=1, nxp
  22.         ii = ixs + i-1
  23.         offset = int(((n-1)*Nx_min + (ii-1)),8)*irecl_out
  24.         call mpi_file_write_at( fh(3), offset, u(1,1,i,n),
  25.  &           n_words_out, mpi_double_complex, status, ierr )
  26.      end do
  27.   end do
  28.  
  29.   call mpi_file_close( fh(3), ierr )
  30.  
  31.   return
  32.   end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top