-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite_vel.f
More file actions
30 lines (22 loc) · 789 Bytes
/
write_vel.f
File metadata and controls
30 lines (22 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
subroutine write_vel( u )
include 'sam.h'
include 'mpif.h'
real u(Nx,Ny,nzp,Lu)
integer(kind=mpi_offset_kind) :: offset, irecl_out
integer amode, status(mpi_status_size)
n_words_out = Nx*Ny
irecl_out = n_words_out*8
amode = ior( mpi_mode_create, mpi_mode_wronly )
call mpi_file_open( mpi_comm_world, 'vel.out', amode,
& mpi_info_null, fh(4), ierr )
do n=1, Lu
do k=1, nzp
kk = izs + k-1
offset = int(((n-1)*Nz + (kk-1)),8)*irecl_out
call mpi_file_write_at( fh(4), offset, u(1,1,k,n),
& n_words_out, mpi_double_precision, status, ierr )
end do
end do
call mpi_file_close( fh(4), ierr )
return
end