You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Examples.md
+24-25Lines changed: 24 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ type(hdf5_file) :: h5f
10
10
* gzip compression may be applied for rank ≥ 2 arrays by setting `comp_lvl` to a value between 1 and 9.
11
11
Shuffle filter is automatically applied for better compression
12
12
* string attributes may be applied to any variable at time of writing or later.
13
-
* h5f%initialize(..., `comp_lvl=1`) option enables GZIP compression., where comp_lvl is from 1 to 9. bigger comp_lvl gives more compression but isslower to write.
13
+
* h5f%open(..., `comp_lvl=1`) option enables GZIP compression., where comp_lvl is from 1 to 9. bigger comp_lvl gives more compression but isslower to write.
14
14
15
15
`integer, intent(out) :: ierr` is an optional parameter. It will be non-zero if error detected.
16
16
This value should be checked, particularly for write operations to avoid missing error conditions.
@@ -19,11 +19,11 @@ If `ierr` is omitted, then h5fortran will raise `error stop` if an error occurs.
19
19
## Create new HDF5 file, with variable "value1"
20
20
21
21
```fortran
22
-
call h5f%initialize('test.h5', status='new')
22
+
call h5f%open('test.h5', status='new')
23
23
24
24
call h5f%write('/value1', 123.)
25
25
26
-
call h5f%finalize()
26
+
call h5f%close()
27
27
```
28
28
29
29
## create soft links to actual variable
@@ -47,11 +47,11 @@ This flushes and closes ALL HDF5 files, even those that may be invoked directly
47
47
call hdf5_close()
48
48
```
49
49
50
-
Normally, you should be calling `%finalize()` on each file to flush to disk when done using a file.
51
-
If `%finalize()` or hdf5_close is not called, data loss can result.
50
+
Normally, you should be calling `%close()` on each file to flush to disk when done using a file.
51
+
If `%close()` or hdf5_close is not called, data loss can result.
52
52
53
53
```fortran
54
-
call h5f%finalize()
54
+
call h5f%close()
55
55
```
56
56
57
57
At any time during the program, the `%flush()` method can be called to request the operating system to write a file to disk.
@@ -123,12 +123,12 @@ If the full path is not specified, the system temporary directory will be used i
123
123
Otherwise, the current working directory + filename will be used.
124
124
125
125
```sh
126
-
call h5%initialize('orbits.h5', status='scratch')
126
+
call h5%open('orbits.h5', status='scratch')
127
127
128
128
...
129
129
130
-
call h5%finalize()
131
-
!! scratch file deleted by %finalize
130
+
call h5%close()
131
+
!! scratch file deleted by %close
132
132
```
133
133
134
134
## Add/append variable "value1" to existing HDF5 file "test.h5"
@@ -137,23 +137,23 @@ call h5%finalize()
137
137
* if file `test.h5` does not exist, create it and add a variable to it.
0 commit comments