-
Notifications
You must be signed in to change notification settings - Fork 0
/
inicut.f90
executable file
·59 lines (40 loc) · 1.51 KB
/
inicut.f90
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
subroutine inimov_hdf_xcut
use param
use mpih
use hdf5
IMPLICIT none
integer j,k
integer hdf_error
integer(HID_T) :: file_id
integer(HID_T) :: cordin_dset_rid
integer(HID_T) :: cordin_dset_zid
integer(HID_T) :: cordin_dspace_id
integer(HSIZE_T) :: dims(2)
real rmov(n2m,n3m),zmov(n2m,n3m)
character(70) namfile
do k=1,n3m
do j=1,n2m
rmov(j,k) = ym(j)
zmov(j,k) = zm(k)
end do
end do
namfile='flowmov/cordin_info_x.h5'
dims(1)=n2m
dims(2)=n3m
if (myid.eq.0) then
call h5fcreate_f(namfile, H5F_ACC_TRUNC_F, file_id, hdf_error)
call h5screate_simple_f(2, dims, cordin_dspace_id, hdf_error)
call h5dcreate_f(file_id, 'y', H5T_NATIVE_DOUBLE, &
cordin_dspace_id, &
cordin_dset_rid, hdf_error)
call h5dwrite_f(cordin_dset_rid, H5T_NATIVE_DOUBLE, rmov, dims, hdf_error)
call h5dcreate_f(file_id, 'z', H5T_NATIVE_DOUBLE, &
cordin_dspace_id, &
cordin_dset_zid, hdf_error)
call h5dwrite_f(cordin_dset_zid, H5T_NATIVE_DOUBLE, zmov, dims, hdf_error)
call h5dclose_f(cordin_dset_rid, hdf_error)
call h5dclose_f(cordin_dset_zid, hdf_error)
call h5sclose_f(cordin_dspace_id, hdf_error)
call h5fclose_f(file_id, hdf_error)
endif
end