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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
|
<html>
<head><title>
HDF5/H5D API Specification
</title>
<!-- #BeginLibraryItem "/ed_libs/styles_RM.lbi" -->
<!--
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-->
<link href="ed_styles/RMelect.css" rel="stylesheet" type="text/css">
<!-- #EndLibraryItem -->
</head>
<body bgcolor="#FFFFFF">
<!-- HEADER RIGHT " " -->
<!-- #BeginLibraryItem "/ed_libs/NavBar_RM.lbi" --><hr>
<center>
<table border=0 width=98%>
<tr><td valign=top align=left>
<a href="index.html">HDF5 documents and links</a> <br>
<a href="H5.intro.html">Introduction to HDF5</a> <br>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/UG/index.html">HDF5 User Guide</a> <br>
<!--
<a href="Glossary.html">Glossary</a><br>
-->
</td>
<td valign=top align=right>
And in this document, the
<a href="RM_H5Front.html">HDF5 Reference Manual</a> <br>
<a href="RM_H5.html">H5</a>
<a href="RM_H5A.html">H5A</a>
<a href="RM_H5D.html">H5D</a>
<a href="RM_H5E.html">H5E</a>
<a href="RM_H5F.html">H5F</a>
<a href="RM_H5G.html">H5G</a>
<a href="RM_H5I.html">H5I</a>
<a href="RM_H5P.html">H5P</a> <br>
<a href="RM_H5R.html">H5R</a>
<a href="RM_H5S.html">H5S</a>
<a href="RM_H5T.html">H5T</a>
<a href="RM_H5Z.html">H5Z</a>
<a href="Tools.html">Tools</a>
<a href="PredefDTypes.html">Datatypes</a>
</td></tr>
<tr><td colspan="2" align="right">
<i><small>(<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/">PDF</a>
of complete manual formatted as print volume) </small></i>
</td></tr>
</table>
</center>
<hr>
<!-- #EndLibraryItem --><center>
<h1>H5D: Datasets Interface</h1>
</center>
<h2>Dataset Object API Functions</h2>
These functions create and manipulate dataset objects,
and set and retrieve their constant or persistent properties.
<p>
<strong>The C Interfaces:</strong>
<table border=0>
<tr><td valign=top>
<ul>
<li><a href="#Dataset-Create">H5Dcreate</a>
<li><a href="#Dataset-Open">H5Dopen</a>
<li><a href="#Dataset-Close">H5Dclose</a>
<li><a href="#Dataset-GetSpace">H5Dget_space</a>
<li><a href="#Dataset-GetSpaceStatus">H5Dget_space_status</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Dataset-GetType">H5Dget_type</a>
<li><a href="#Dataset-GetCreatePlist">H5Dget_create_plist</a>
<li><a href="#Dataset-GetOffset">H5Dget_offset</a>
<li><a href="#Dataset-GetStorageSize">H5Dget_storage_size</a>
<li><a href="#Dataset-VLGetBuf">H5Dvlen_get_buf_size</a>
<li><a href="#Dataset-VLReclaim">H5Dvlen_reclaim</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<!--
<li><a href="#Dataset-Debug">H5Ddebug</a>
This function is in the distributed source code and is technically
a public function, but it is NOT intended for public use.
It is used only by certain tools.
DO NOT list it in the Reference Manual.
-->
<li><a href="#Dataset-Read">H5Dread</a>
<li><a href="#Dataset-Write">H5Dwrite</a>
<li><a href="#Dataset-Iterate">H5Diterate</a>
<li><a href="#Dataset-Extend">H5Dextend</a>
<li><a href="#Dataset-Fill">H5Dfill</a>
</ul>
</td></tr>
</table>
<br>
<i>Alphabetical Listing</i>
<table border="0">
<tr>
<td valign="top">
<ul>
<li><a href="#Dataset-Close">H5Dclose</a>
<li><a href="#Dataset-Create">H5Dcreate</a>
<li><a href="#Dataset-Extend">H5Dextend</a>
<li><a href="#Dataset-Fill">H5Dfill</a>
<li><a href="#Dataset-GetCreatePlist">H5Dget_create_plist</a>
<li><a href="#Dataset-GetOffset">H5Dget_offset</a>
</ul>
</td>
<td> </td>
<td valign="top">
<ul>
<li><a href="#Dataset-GetSpace">H5Dget_space</a>
<li><a href="#Dataset-GetSpaceStatus">H5Dget_space_status</a>
<li><a href="#Dataset-GetStorageSize">H5Dget_storage_size</a>
<li><a href="#Dataset-GetType">H5Dget_type</a>
<li><a href="#Dataset-Iterate">H5Diterate</a>
<li><a href="#Dataset-Open">H5Dopen</a>
</ul>
</td>
<td> </td>
<td valign="top">
<ul>
<li><a href="#Dataset-Read">H5Dread</a>
<li><a href="#Dataset-VLGetBuf">H5Dvlen_get_buf_size</a>
<li><a href="#Dataset-VLReclaim">H5Dvlen_reclaim</a>
<li><a href="#Dataset-Write">H5Dwrite</a>
</ul>
</td>
</tr>
</table>
<br>
<strong>The FORTRAN90 Interfaces:</strong>
<br>
In general, each FORTRAN90 subroutine performs exactly the same task
as the corresponding C function.
<br>
<table border=0>
<tr><td valign=top>
<ul>
<li><a href="#Dataset-Create">h5dcreate_f</a>
<li><a href="#Dataset-Open">h5dopen_f</a>
<li><a href="#Dataset-Close">h5dclose_f</a>
<li><a href="#Dataset-GetSpace">h5dget_space_f</a>
<li><a href="#Dataset-GetSpaceStatus">h5dget_space_status_f</a>
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Dataset-GetType">h5dget_type_f</a>
<li><a href="#Dataset-GetCreatePlist">h5dget_create_plist_f</a>
<li><a href="#Dataset-GetOffset">h5dget_offset_f</a>
<li><a href="#Dataset-GetStorageSize">h5dget_storage_size_f</a>
<li><a href="#Dataset-VLGetBuf">h5dvlen_get_max_len_f</a>
<!--<li><a href="#Dataset-VLReclaim">h5dvlen_reclaim_f</a> -->
</ul>
</td><td> </td><td valign=top>
<ul>
<li><a href="#Dataset-Read">h5dread_f</a>
<li><a href="#Dataset-Write">h5dwrite_f</a>
<!--<li><a href="#Dataset-Iterate">h5diterate_f</a> -->
<!--<li><a href="#Dataset-Debug">h5ddebug_f</a> -->
<li><a href="#Dataset-Extend">h5dextend_f</a>
<li><a href="#Dataset-Fill">h5dfill_f</a>
</ul>
</td></tr>
</table>
<!-- NEW PAGE -->
<!-- HEADER RIGHT " " -->
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dclose" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-Close">H5Dclose</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Dclose</code>(<em>hid_t </em><code>dataset_id</code>
)
<dt><strong>Purpose:</strong>
<dd>Closes the specified dataset.
<dt><strong>Description:</strong>
<dd><code>H5Dclose</code> ends access to a dataset specified by
<code>dataset_id</code> and releases resources used by it.
Further use of the dataset identifier is illegal in calls to
the dataset API.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id </code></td>
<td valign="top">IN: Identifier of the dataset to close access to.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dclose_f
<dd>
<pre>
SUBROUTINE h5dclose_f(dset_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dclose_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dcreate" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-Create">H5Dcreate</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t </em><code>H5Dcreate</code>(<em>hid_t </em><code>loc_id</code>,
<em>const char *</em><code>name</code>,
<em>hid_t</em> <code>type_id</code>,
<em>hid_t</em> <code>space_id</code>,
<em>hid_t</em> <code>create_plist_id</code>
)
<dt><strong>Purpose:</strong>
<dd>Creates a dataset at the specified location.
<dt><strong>Description:</strong>
<dd><code>H5Dcreate</code> creates a data set with a name,
<code>name</code>, in the file or in the group specified by
the identifier <code>loc_id</code>.
The dataset has the datatype and dataspace identified by
<code>type_id</code> and <code>space_id</code>, respectively.
The specified datatype and dataspace are the datatype and
dataspace of the dataset as it will exist in the file,
which may be different than in application memory.
Dataset creation properties are specified by the argument
<code>create_plist_id</code>.
<p>
Dataset names within a group are unique:
<code>H5Dcreate</code> will return an error if a dataset with
the name specified in <code>name</code> already exists at the
location specified in <code>loc_id</code>.
<p>
<code>create_plist_id</code> is a <code>H5P_DATASET_CREATE</code>
property list created with <code>H5Pcreate</code> and
initialized with the various functions described above.
<p>
<code>H5Dcreate</code> returns an error if the dataset's datatype
includes a variable-length (VL) datatype and the fill value
is undefined, i.e., set to <code>NULL</code> in the
dataset creation property list.
Such a VL datatype may be directly included,
indirectly included as part of a compound or array datatype, or
indirectly included as part of a nested compound or array datatype.
<p>
<code>H5Dcreate</code> returns a dataset identifier for success
or a negative value for failure.
The dataset identifier should eventually be closed by
calling <code>H5Dclose</code> to release resources it uses.
<p>
<strong>Fill values and space allocation:</strong><br>
The HDF5 library provides flexible means
of specifying a fill value,
of specifying when space will be allocated for a dataset, and
of specifying when fill values will be written to a dataset.
For further information on these topics, see the document
<a href="http://hdf.ncsa.uiuc.edu/RFC/Fill_Value/FillValue.html">
<cite>Fill Value and Dataset Storage Allocation Issues in HDF5</cite></a>
and the descriptions of the following HDF5 functions in this
<cite>HDF5 Reference Manual</cite>:
<table width=80% border="0">
<tr valign="top" align="left"><td width=10%>
</td><td width=45%>
<a href="#Dataset-Fill"><code>H5Dfill</code></a><br>
<a href="RM_H5P.html#Property-SetFillValue"><code>H5Pset_fill_value</code></a><br>
<a href="RM_H5P.html#Property-GetFillValue"><code>H5Pget_fill_value</code></a><br>
<a href="RM_H5P.html#Property-FillValueDefined"><code>H5Pfill_value_defined</code></a>
</td><td width=45%>
<a href="RM_H5P.html#Property-SetFillTime"><code>H5Pset_fill_time</code></a><br>
<a href="RM_H5P.html#Property-GetFillTime"><code>H5Pget_fill_time</code></a><br>
<a href="RM_H5P.html#Property-SetAllocTime"><code>H5Pset_alloc_time</code></a><br>
<a href="RM_H5P.html#Property-GetAllocTime"><code>H5Pget_alloc_time</code></a>
</td></tr>
</table>
This information is also included in the
“HDF5 Datasets” chapter of
the new <cite>HDF5 User's Guide</cite>,
which is being prepared for release.
<dt><strong>Note:</strong>
<dd><code>H5Dcreate</code> can fail if there has been an error
in setting up an element of the dataset creation property list.
In such cases, each item in the property list must be examined
to ensure that the setup satisfies to all required conditions.
This problem is most likely to occur with the use of filters.
<p>
For example, <code>H5Dcreate</code> will fail without a meaningful
explanation if
<ul>
<li>SZIP compression is being used on the dataset and
<li>the SZIP parameter <code>pixels_per_block</code>
is set to an inappropriate value.
</ul>
<p>
In such a case, one would refer to the description of
<a href="RM_H5P.html#Property-SetSzip"><code>H5Pset_szip</code></a>,
looking for any conditions or requirements that might affect the
local computing environment.
<!--
<p>
Other known similar problems can occur with . . .
-->
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>loc_id</code></td>
<td valign="top">IN: Identifier of the file or group
within which to create the dataset.</td></tr>
<tr>
<td valign="top"><em>const char *</em> <code>name</code></td>
<td valign="top">IN: The name of the dataset to create.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>type_id</code></td>
<td valign="top">IN: Identifier of the datatype to use
when creating the dataset.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>space_id</code></td>
<td valign="top">IN: Identifier of the dataspace to use
when creating the dataset.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>create_plist_id </code></td>
<td valign="top">IN: Identifier of the set creation property list.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataset identifier if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dcreate_f
<dd>
<pre>
SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, &
hdferr, creation_prp)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp
! Dataset creation propertly
! list identifier , default
! value is H5P_DEFAULT_F (6)
END SUBROUTINE h5dcreate_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dextend" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-Extend">H5Dextend</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Dextend</code>(<em>hid_t </em><code>dataset_id</code>,
<em>const hsize_t *</em> <code>size</code>
)
<dt><strong>Purpose:</strong>
<dd>Extends a dataset with unlimited dimension.
<dt><strong>Description:</strong>
<dd><code>H5Dextend</code> verifies that the dataset is at least of size
<code>size</code>.
The dimensionality of <code>size</code> is the same as that of
the dataspace of the dataset being changed.
This function cannot be applied to a dataset with fixed dimensions.
<p>
Space on disk is immediately allocated for the new dataset extent
if the dataset's space allocation time is set to
<code>H5D_ALLOC_TIME_EARLY</code>.
Fill values will be written to the dataset if the dataset's fill time
is set to <code>H5D_FILL_TIME_IFSET</code> or
<code>H5D_FILL_TIME_ALLOC</code>.
(Also see
<a href="RM_H5P.html#Property-SetFillTime">H5Pset_fill_time</a>
and
<a href="RM_H5P.html#Property-SetAllocTime">H5Pset_alloc_time</a>.)
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id</code></td>
<td valign="top">IN: Identifier of the dataset.</td></tr>
<tr>
<td valign="top"><em>const hsize_t *</em> <code>size </code></td>
<td valign="top">IN: Array containing the new magnitude of each dimension.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dextend_f
<dd>
<pre>
SUBROUTINE h5dextend_f(dataset_id, size, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier
INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size
! Array containing
! dimensions' sizes
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dextend_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dfill" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-Fill">H5Dfill</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Dfill</code>(
<em>const void *</em><code>fill</code>,
<em>hid_t </em><code>fill_type_id</code>,
<em>void *</em><code>buf</code>,
<em>hid_t </em><code>buf_type_id</code>,
<em>hid_t </em><code>space_id</code>
)
<dt><strong>Purpose:</strong>
<dd>Fills dataspace elements with a fill value in a memory buffer.
<dt><strong>Description:</strong>
<dd><code>H5Dfill</code> explicitly fills
the dataspace selection in memory, <code>space_id</code>,
with the fill value specified in <code>fill</code>.
If <code>fill</code> is <code>NULL</code>,
a fill value of <code>0</code> (zero) is used.
<p>
<code>fill_type_id</code> specifies the datatype
of the fill value.<br>
<code>buf</code> specifies the buffer in which
the dataspace elements will be written.<br>
<code>buf_type_id</code> specifies the datatype of
those data elements.
<p>
Note that if the fill value datatype differs
from the memory buffer datatype, the fill value
will be converted to the memory buffer datatype
before filling the selection.
<dt><strong>Note:</strong>
<dd>Applications sometimes write data only to portions of
an allocated dataset. It is often useful in such cases
to fill the unused space with a known
<span class="termEmphasis">fill value</span>.
See <a href="RM_H5P.html#Property-SetFillValue">H5Pset_fill_value</a>
for further discussion.
Other related functions include
<a href="RM_H5P.html#Property-GetFillValue">H5Pget_fill_value</a>,
<a href="RM_H5P.html#Property-FillValueDefined">H5Pfill_value_defined</a>,
<a href="RM_H5P.html#Property-SetFillTime">H5Pset_fill_time</a>,
<a href="RM_H5P.html#Property-GetFillTime">H5Pget_fill_time</a>,
and
<a href="#Dataset-Create">H5Dcreate</a>.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>const void *</em><code>fill</code></td>
<td valign="top">IN: Pointer to the fill value to be used.</td></tr>
<tr>
<td valign="top"><em>hid_t </em><code>fill_type_id </code></td>
<td valign="top">IN: Fill value datatype identifier.</td></tr>
<tr>
<td valign="top"><em>void *</em><code>buf</code></td>
<td valign="top">IN/OUT: Pointer to the memory buffer containing the
selection to be filled.</td></tr>
<tr>
<td valign="top"><em>hid_t </em><code>buf_type_id</code></td>
<td valign="top">IN: Datatype of dataspace elements to be filled.</td></tr>
<tr>
<td valign="top"><em>hid_t </em><code>space_id</code></td>
<td valign="top">IN: Dataspace describing memory buffer and
containing the selection to be filled.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dfill_f
<dd>
<pre>
SUBROUTINE h5dfill_f(fill_value, space_id, buf, hdferr)
IMPLICIT NONE
TYPE, INTENET(IN) :: fill_value ! Fill value; may be have one of the
! following types:
! INTEGER, REAL, DOUBLE PRECISION,
! CHARACTER
INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier
TYPE, DIMENSION(*) :: buf ! Memory buffer to fill in; must have
! the same datatype as fill value
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dfill_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dget_create_plist" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-GetCreatePlist">H5Dget_create_plist</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t </em><code>H5Dget_create_plist</code>(<em>hid_t </em><code>dataset_id</code>
)
<dt><strong>Purpose:</strong>
<dd>Returns an identifier for a copy of the
dataset creation property list for a dataset.
<dt><strong>Description:</strong>
<dd><code>H5Dget_create_plist</code> returns an identifier for a
copy of the dataset creation property list for a dataset.
The creation property list identifier should be released with
the <code>H5Pclose</code> function.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id </code></td>
<td valign="top">IN: Identifier of the dataset to query.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataset creation property list identifier if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dget_create_plist_f
<dd>
<pre>
SUBROUTINE h5dget_create_plist_f(dataset_id, creation_prp, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier
INTEGER(HID_T), INTENT(OUT) :: creation_id ! Dataset creation
! property list identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dget_create_plist_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dget_offset" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-GetOffset">H5Dget_offset</a>
<dt><strong>Signature:</strong>
<dd><em>haddr_t </em><code>H5Dget_offset</code>(<em>hid_t </em><code>dset_id</code>)
<dt><strong>Purpose:</strong>
<dd>Returns dataset address in file.
<dt><strong>Description:</strong>
<dd><code>H5Dget_offset</code> returns the address in the file
of the dataset <code>dset_id</code>.
That address is expressed as the offset in bytes from
the beginning of the file.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t </em><code>dset_id </code></td>
<td valign="top">Dataset identifier.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the offset in bytes;
otherwise returns <code>HADDR_UNDEF</code>, a negative value.
<dt><strong>Fortran90 Interface:</strong>
<dd>None.
<!--
<pre>
SUBROUTINE
</pre>
-->
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td></tr>
<tr>
<td valign="top">1.6.0</td>
<td valign="top">
Function introduced in this release.</td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dget_space" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-GetSpace">H5Dget_space</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t </em><code>H5Dget_space</code>(<em>hid_t </em><code>dataset_id</code>
)
<dt><strong>Purpose:</strong>
<dd>Returns an identifier for a copy of the dataspace for a dataset.
<dt><strong>Description:</strong>
<dd><code>H5Dget_space</code> returns an identifier for a copy of the
dataspace for a dataset.
The dataspace identifier should be released with the
<code>H5Sclose</code> function.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id </code></td>
<td valign="top">IN: Identifier of the dataset to query.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataspace identifier if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dget_space_f
<dd>
<pre>
SUBROUTINE h5dget_space_f(dataset_id, dataspace_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier
INTEGER(HID_T), INTENT(OUT) :: dataspace_id ! Dataspace identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dget_space_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dget_space_status" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-GetSpaceStatus">H5Dget_space_status</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5Dget_space_status</code>(<em>hid_t </em><code>dset_id</code>,
<em>H5D_space_status_t *</em><code>status</code>)
<dt><strong>Purpose:</strong>
<dd>Determines whether space has been allocated for a dataset.
<dt><strong>Description:</strong>
<dd><code>H5Dget_space_status</code> determines whether space has been
allocated for the dataset <code>dset_id</code>.
<p>
Space allocation status is returned in <code>status</code>,
which will have one of the following values:
<center>
<table border="0">
<tr valign="top"><td rowspan="3"> </td><td>
<code>H5D_SPACE_STATUS_NOT_ALLOCATED</code>
</td><td>
Space has not been allocated for this dataset.
</td></tr><tr valign="top"><td>
<code>H5D_SPACE_STATUS_ALLOCATED</code>
</td><td>
Space has been allocated for this dataset.
</td></tr><tr valign="top"><td>
<code>H5D_SPACE_STATUS_PART_ALLOCATED</code>
</td><td>
Space has been partially allocated for this dataset.
(Used only for datasets with chunked storage.)
</td></tr>
</table>
</center>
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dset_id</code></td>
<td valign="top">IN: Identifier of the dataset to query.</td></tr>
<tr>
<td valign="top"><em>H5D_space_status_t *</em><code>status </code></td>
<td valign="top">OUT: Space allocation status.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dget_space_status_f
<dd>
<pre>
SUBROUTINE h5dget_space_status_f(dset_id, flag, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
INTEGER, INTENET(OUT) :: flag ! Status flag ; possible values:
! H5D_SPACE_STS_ERROR_F
! H5D_SPACE_STS_NOT_ALLOCATED_F
! H5D_SPACE_STS_PART_ALLOCATED_F
! H5D_SPACE_STS_ALLOCATED_F
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dget_space_status_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td></tr>
<tr>
<td valign="top">1.6.0</td>
<td valign="top">
Function introduced in this release.</td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dget_storage_size" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-GetStorageSize">H5Dget_storage_size</a>
<dt><strong>Signature:</strong>
<dd><em>hsize_t </em><code>H5Dget_storage_size</code>(<em>hid_t </em><code>dataset_id</code>
)
<dt><strong>Purpose:</strong>
<dd>Returns the amount of storage required for a dataset.
<dt><strong>Description:</strong>
<dd><code>H5Dget_storage_size</code> returns the amount of storage
that is required for the specified dataset, <code>dataset_id</code>.
For chunked datasets, this is the number of allocated chunks times
the chunk size.
The return value may be zero if no data has been stored.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id </code></td>
<td valign="top">IN: Identifier of the dataset to query.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the amount of storage space allocated for the dataset,
not counting meta data;
otherwise returns 0 (zero).
<dt><strong>Fortran90 Interface:</strong> h5dget_storage_size_f
<dd>
<pre>
SUBROUTINE h5dget_storage_size_f(dset_id, size, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
INTEGER(HSIZE_T), INTENT(OUT) :: size ! Amount of storage required
! for dataset
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dget_storage_size_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>Fortran90</strong></td></tr>
<tr>
<td valign="top">1.4.5</td>
<td valign="top">
Function introduced in this release.</td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dget_type" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-GetType">H5Dget_type</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t </em><code>H5Dget_type</code>(<em>hid_t </em><code>dataset_id</code>
)
<dt><strong>Purpose:</strong>
<dd>Returns an identifier for a copy of the datatype for a dataset.
<dt><strong>Description:</strong>
<dd><code>H5Dget_type</code> returns an identifier for a copy of the
datatype for a dataset.
The datatype should be released with the <code>H5Tclose</code> function.
<p>
If a dataset has a named datatype, then an identifier to the
opened datatype is returned.
Otherwise, the returned datatype is read-only.
If atomization of the datatype fails, then the datatype is closed.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id </code></td>
<td valign="top">IN: Identifier of the dataset to query.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a datatype identifier if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dget_type_f
<dd>
<pre>
SUBROUTINE h5dget_type_f(dataset_id, datatype_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier
INTEGER(HID_T), INTENT(OUT) :: datatype_id ! Datatype identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dget_type_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Diterate" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-Iterate">H5Diterate</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Diterate</code>(
<em>void *</em><code>buf</code>,
<em>hid_t </em><code>type_id</code>,
<em>hid_t </em><code>space_id</code>,
<em>H5D_operator_t </em><code>operator</code>,
<em>void *</em><code>operator_data</code>
)
<dt><strong>Purpose:</strong>
<dd>Iterates over all selected elements in a dataspace.
<dt><strong>Description:</strong>
<dd><code>H5Diterate</code> iterates over all the elements selected
in a memory buffer. The callback function is called once for each
element selected in the dataspace.
<p>
The selection in the dataspace is modified so that any elements
already iterated over are removed from the selection if the
iteration is interrupted (by the <code>H5D_operator_t</code>
function returning non-zero) before the iteration is complete;
the iteration may then be re-started by the user where it left off.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>void *</em><code>buf</code></td>
<td valign="top">IN/OUT: Pointer to the buffer in memory containing the
elements to iterate over.</td></tr>
<tr>
<td valign="top"><em>hid_t </em><code>type_id</code></td>
<td valign="top">IN: Datatype identifier for the elements stored in
<code>buf</code>.</td></tr>
<tr>
<td valign="top"><em>hid_t </em><code>space_id</code></td>
<td valign="top">IN: Dataspace identifier for <code>buf</code>.
Also contains the selection to iterate over.</td></tr>
<tr>
<td valign="top"><em>H5D_operator_t </em><code>operator </code></td>
<td valign="top">IN: Function pointer to the routine to be called
for each element in <code>buf</code> iterated over.</td></tr>
<tr>
<td valign="top"><em>void *</em><code>operator_data</code></td>
<td valign="top">IN/OUT: Pointer to any user-defined data associated
with the operation.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the return value of the last operator if it was non-zero,
or zero if all elements have been processed.
Otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong>
<dd>None.
<!--
<pre>
SUBROUTINE
</pre>
-->
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History</strong>:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td></tr>
<tr>
<td valign="top">1.6.4</td>
<td valign="top">
The following changes occured in the
<code>H5D_operator_t</code> function in this release:<br>
<code>ndim</code> parameter type was changed to
<em>unsigned</em><br>
<code>point</code> parameter type was changed to
<em>const hsize_t</em></td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dopen" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-Open">H5Dopen</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t </em><code>H5Dopen</code>(<em>hid_t </em><code>loc_id</code>,
<em>const char *</em><code>name</code>
)
<dt><strong>Purpose:</strong>
<dd>Opens an existing dataset.
<dt><strong>Description:</strong>
<dd><code>H5Dopen</code> opens an existing dataset for access in the file
or group specified in <code>loc_id</code>. <code>name</code> is
a dataset name and is used to identify the dataset in the file.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>loc_id</code></td>
<td valign="top">IN: Identifier of the file or group
within which the dataset to be accessed will be found.</td></tr>
<tr>
<td valign="top"><em>const char *</em> <code>name </code></td>
<td valign="top">IN: The name of the dataset to access.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataset identifier if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dopen_f
<dd>
<pre>
SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset
INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dopen_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dread" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-Read">H5Dread</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Dread</code>(<em>hid_t </em><code>dataset_id</code>,
<em>hid_t</em> <code>mem_type_id</code>,
<em>hid_t</em> <code>mem_space_id</code>,
<em>hid_t</em> <code>file_space_id</code>,
<em>hid_t</em> <code>xfer_plist_id</code>,
<em>void *</em> <code>buf</code>
)
<dt><strong>Purpose:</strong>
<dd>Reads raw data from a dataset into a buffer.
<dt><strong>Description:</strong>
<dd><code>H5Dread</code> reads a (partial) dataset, specified by its
identifier <code>dataset_id</code>, from the
file into an application memory buffer <code>buf</code>.
Data transfer properties are defined by the argument
<code>xfer_plist_id</code>.
The memory datatype of the (partial) dataset is identified by
the identifier <code>mem_type_id</code>.
The part of the dataset to read is defined by
<code>mem_space_id</code> and <code>file_space_id</code>.
<p>
<code>file_space_id</code> is used to specify only the selection within
the file dataset's dataspace. Any dataspace specified in <code>file_space_id</code>
is ignored by the library and the dataset's dataspace is always used.
<code>file_space_id</code> can be the constant <code>H5S_ALL</code>.
which indicates that the entire file dataspace, as defined by the
current dimensions of the dataset, is to be selected.
<p>
<code>mem_space_id</code> is used to specify both the memory dataspace
and the selection within that dataspace.
<code>mem_space_id</code> can be the constant <code>H5S_ALL</code>,
in which case the file dataspace is used for the memory dataspace and
the selection defined with <code>file_space_id</code> is used for the
selection within that dataspace.
<p>
If raw data storage space has not been allocated for the dataset
and a fill value has been defined, the returned buffer <code>buf</code>
is filled with the fill value.
<p>
The behavior of the library for the various combinations of valid
dataspace identifiers and H5S_ALL for the <code>mem_space_id</code> and the
<code>file_space_id</code> parameters is described below:
<br><br>
<table border=0>
<tr>
<th>
<code>mem_space_id </code>
</th>
<th>
<code>file_space_id </code>
</th>
<th>
Behavior
</th>
</tr>
<tr valign="top">
<td>
valid dataspace identifier
</td>
<td>
valid dataspace identifier
</td>
<td>
<code>mem_space_id</code> specifies the memory dataspace and the
selection within it.
<code>file_space_id</code> specifies the selection within the file
dataset's dataspace.
</td>
</tr>
<tr valign="top">
<td>
<code>H5S_ALL</code>
</td>
<td>
valid dataspace identifier
</td>
<td>
The file dataset's dataspace is used for the memory dataspace and the
selection specified with <code>file_space_id</code> specifies the
selection within it.
The combination of the file dataset's dataspace and the selection from
<code>file_space_id</code> is used for memory also.
</td>
</tr>
<tr valign="top">
<td>
valid dataspace identifier
</td>
<td>
<code>H5S_ALL</code>
</td>
<td>
<code>mem_space_id</code> specifies the memory dataspace and the
selection within it.
The selection within the file dataset's dataspace is set to the "all"
selection.
</td>
</tr>
<tr valign="top">
<td>
<code>H5S_ALL</code>
</td>
<td>
<code>H5S_ALL</code>
</td>
<td>
The file dataset's dataspace is used for the memory dataspace and the
selection within the memory dataspace is set to the "all" selection.
The selection within the file dataset's dataspace is set to the "all"
selection.
</td>
</tr>
</table>
<p>
Setting an <code>H5S_ALL</code> selection indicates that the entire dataspace, as
defined by the current dimensions of a dataspace, will be selected.
The number of elements selected in the memory dataspace must match the
number of elements selected in the file dataspace.
<p>
<code>xfer_plist_id</code> can be the constant <code>H5P_DEFAULT</code>.
in which case the default data transfer properties are used.
<p>
Data is automatically converted from the file datatype
and dataspace to the memory datatype and dataspace
at the time of the read. See the
<a href="Datatypes.html#Datatypes-DataConversion">Data Conversion</a>
section of <cite>The Data Type Interface (H5T)</cite> in the
<cite>HDF5 User's Guide</cite> for a discussion of
data conversion, including the range of conversions currently
supported by the HDF5 libraries.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id</code></td>
<td valign="top">IN: Identifier of the dataset read from.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>mem_type_id</code></td>
<td valign="top">IN: Identifier of the memory datatype.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>mem_space_id</code></td>
<td valign="top">IN: Identifier of the memory dataspace.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>file_space_id </code></td>
<td valign="top">IN: Identifier of the dataset's dataspace in the file.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>xfer_plist_id </code></td>
<td valign="top">IN: Identifier of a transfer property list
for this I/O operation.</td></tr>
<tr>
<td valign="top"><em>void *</em> <code>buf</code></td>
<td valign="top">OUT: Buffer to receive data read from file.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dread_f
<dd>
<pre>
SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, dims, hdferr, &
mem_space_id, file_space_id, xfer_prp)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier
TYPE, INTENT(INOUT) :: buf ! Data buffer; may be a scalar
! or an array
DIMENSION(*), INTEGER(HSIZE_T), INTENT(IN) :: dims
! Array to hold corresponding
! dimension sizes of data
! buffer buf
! dim(k) has value of the k-th
! dimension of buffer buf
! Values are ignored if buf is
! a scalar
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id
! Memory dataspace identfier
! Default value is H5S_ALL_F
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id
! File dataspace identfier
! Default value is H5S_ALL_F
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp
! Transfer property list identifier
! Default value is H5P_DEFAULT_F
END SUBROUTINE h5dread_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>Fortran90</strong></td></tr>
<tr>
<td valign="top">1.4.2</td>
<td valign="top">
The <code>dims</code> parameter was added in this release.</td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dvlen_get_buf_size" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-VLGetBuf">H5Dvlen_get_buf_size</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Dvlen_get_buf_size</code>(<em>hid_t </em><code>dataset_id</code>,
<em>hid_t</em> <code>type_id</code>,
<em>hid_t</em> <code>space_id</code>,
<em>hsize_t</em> *<code>size</code>
)
<dt><strong>Purpose:</strong>
<dd>Determines the number of bytes required to store VL data.
<dt><strong>Description:</strong>
<dd><code>H5Dvlen_get_buf_size</code> determines the number of bytes
required to store the VL data from the dataset, using the
<code>space_id</code> for the selection in the dataset on
disk and the <code>type_id</code> for the memory representation
of the VL data in memory.
<p>
<code>*size</code> is returned with the number of bytes
required to store the VL data in memory.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id </code></td>
<td valign="top">IN: Identifier of the dataset to query.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>type_id</code></td>
<td valign="top">IN: Datatype identifier.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>space_id</code></td>
<td valign="top">IN: Dataspace identifier.</td></tr>
<tr>
<td valign="top"><em>hsize_t</em> *<code>size</code></td>
<td valign="top">OUT: The size in bytes of the memory
buffer required to store the VL data.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dvlen_get_max_len_f
<dd>There is no direct FORTRAN couterpart for the C function
<code>H5Dvlen_get_buf_size</code>;
corresponding functionality is provided by the FORTRAN function
<code>h5dvlen_get_max_len_f</code></a>.
<br>
<pre>
SUBROUTINE h5dvlen_get_max_len_f(dset_id, size, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
INTEGER(SIZE_T), INTENT(OUT) :: elem_len ! Maximum length of the element
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5dvlen_get_max_len_f
</pre>
<!--
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>C</strong></td>
<td valign="top" align="left">
</td>
<td valign="top" align="left">
<strong>Fortran90</strong></td></tr>
<tr>
<td valign="top">1.4.5</td>
<td valign="top"> </td>
<td valign="top"> </td>
<td valign="top">Function introduced
in this release.</td></tr>
<tr>
<td valign="top">1.4.0</td>
<td valign="top">
Function introduced in this release.</td>
<td valign="top"> </td>
<td valign="top"> </td></tr>
</table></ul>
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dvlen_reclaim" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-VLReclaim">H5Dvlen_reclaim</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Dvlen_reclaim</code>(<em>hid_t </em><code>type_id</code>,
<em>hid_t</em> <code>space_id</code>,
<em>hid_t</em> <code>plist_id</code>,
<em>void</em> *<code>buf</code>
)
<dt><strong>Purpose:</strong>
<dd>Reclaims VL datatype memory buffers.
<dt><strong>Description:</strong>
<dd><code>H5Dvlen_reclaim</code> reclaims memory buffers created to
store VL datatypes.
<p>
The <code>type_id</code> must be the datatype stored in the buffer.
The <code>space_id</code> describes the selection for the memory buffer
to free the VL datatypes within.
The <code>plist_id</code> is the dataset transfer property list which
was used for the I/O transfer to create the buffer.
And <code>buf</code> is the pointer to the buffer to be reclaimed.
<p>
The VL structures (<code>hvl_t</code>) in the user's buffer are
modified to zero out the VL information after the memory has been reclaimed.
<p>
If nested VL datatypes were used to create the buffer,
this routine frees them <em>from the bottom up</em>, releasing all
the memory without creating memory leaks.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>type_id</code></td>
<td valign="top">IN: Identifier of the datatype.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>space_id </code></td>
<td valign="top">IN: Identifier of the dataspace.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>plist_id</code></td>
<td valign="top">IN: Identifier of the property list used to create the buffer.</td></tr>
<tr>
<td valign="top"><em>void</em> *<code>buf</code></td>
<td valign="top">IN: Pointer to the buffer to be reclaimed.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong>
<dd>None.
<!--
<pre>
SUBROUTINE
</pre>
-->
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Dwrite" -->
<hr>
<dl>
<dt><strong>Name:</strong> <a name="Dataset-Write">H5Dwrite</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Dwrite</code>(<em>hid_t </em><code>dataset_id</code>,
<em>hid_t</em> <code>mem_type_id</code>,
<em>hid_t</em> <code>mem_space_id</code>,
<em>hid_t</em> <code>file_space_id</code>,
<em>hid_t</em> <code>xfer_plist_id</code>,
<em>const void *</em> <code>buf</code>
)
<dt><strong>Purpose:</strong>
<dd>Writes raw data from a buffer to a dataset.
<dt><strong>Description:</strong>
<dd><code>H5Dwrite</code> writes a (partial) dataset, specified by its
identifier <code>dataset_id</code>, from the
application memory buffer <code>buf</code> into the file.
Data transfer properties are defined by the argument
<code>xfer_plist_id</code>.
The memory datatype of the (partial) dataset is identified by
the identifier <code>mem_type_id</code>.
The part of the dataset to write is defined by
<code>mem_space_id</code> and <code>file_space_id</code>.
<p>
<code>file_space_id</code> is used to specify only the selection within
the file dataset's dataspace. Any dataspace specified in <code>file_space_id</code>
is ignored by the library and the dataset's dataspace is always used.
<code>file_space_id</code> can be the constant <code>H5S_ALL</code>.
which indicates that the entire file dataspace, as defined by the
current dimensions of the dataset, is to be selected.
<p>
<code>mem_space_id</code> is used to specify both the memory dataspace
and the selection within that dataspace.
<code>mem_space_id</code> can be the constant <code>H5S_ALL</code>,
in which case the file dataspace is used for the memory dataspace and
the selection defined with <code>file_space_id</code> is used for the
selection within that dataspace.
<p>
The behavior of the library for the various combinations of valid
dataspace IDs and H5S_ALL for the <code>mem_space_id</code> and the
<code>file_space_id</code> parameters is described below:
<br><br>
<table border=0>
<tr>
<th>
<code>mem_space_id </code>
</th>
<th>
<code>file_space_id </code>
</th>
<th>
Behavior
</th>
</tr>
<tr valign="top">
<td>
valid dataspace identifier
</td>
<td>
valid dataspace identifier
</td>
<td>
<code>mem_space_id</code> specifies the memory dataspace and the
selection within it.
<code>file_space_id</code> specifies the selection within the file
dataset's dataspace.
</td>
</tr>
<tr valign="top">
<td>
H5S_ALL
</td>
<td>
valid dataspace identifier
</td>
<td>
The file dataset's dataspace is used for the memory dataspace and the
selection specified with <code>file_space_id</code> specifies the
selection within it.
The combination of the file dataset's dataspace and the selection from
<code>file_space_id</code> is used for memory also.
</td>
</tr>
<tr valign="top">
<td>
valid dataspace identifier
</td>
<td>
H5S_ALL
</td>
<td>
<code>mem_space_id</code> specifies the memory dataspace and the
selection within it.
The selection within the file dataset's dataspace is set to the "all"
selection.
</td>
</tr>
<tr valign="top">
<td>
H5S_ALL
</td>
<td>
H5S_ALL
</td>
<td>
The file dataset's dataspace is used for the memory dataspace and the
selection within the memory dataspace is set to the "all" selection.
The selection within the file dataset's dataspace is set to the "all"
selection.
</td>
</tr>
</table>
<p>
Setting an "all" selection indicates that the entire dataspace, as
defined by the current dimensions of a dataspace, will be selected.
The number of elements selected in the memory dataspace must match the
number of elements selected in the file dataspace.
<p>
<code>xfer_plist_id</code> can be the constant <code>H5P_DEFAULT</code>.
in which case the default data transfer properties are used.
<p>
Writing to an dataset will fail if the HDF5 file was
not opened with write access permissions.
<p>
Data is automatically converted from the memory datatype
and dataspace to the file datatype and dataspace
at the time of the write. See the
<a href="Datatypes.html#Datatypes-DataConversion">Data Conversion</a>
section of <cite>The Data Type Interface (H5T)</cite> in the
<cite>HDF5 User's Guide</cite> for a discussion of
data conversion, including the range of conversions currently
supported by the HDF5 libraries.
<p>
If the dataset's space allocation time is set to
<code>H5D_ALLOC_TIME_LATE</code> or <code>H5D_ALLOC_TIME_INCR</code>
and the space for the dataset has not yet been allocated,
that space is allocated when the first raw data is written to the
dataset.
Unused space in the dataset will be written with fill values at the
same time if the dataset's fill time is set to
<code>H5D_FILL_TIME_IFSET</code> or <code>H5D_FILL_TIME_ALLOC</code>.
(Also see
<a href="RM_H5P.html#Property-SetFillTime">H5Pset_fill_time</a>
and
<a href="RM_H5P.html#Property-SetAllocTime">H5Pset_alloc_time</a>.)
<p>
If a dataset's storage layout is 'compact', care must be taken when
writing data to the dataset in parallel. A compact dataset's raw data
is cached in memory and may be flushed to the file from any of the
parallel processes, so parallel applications should always attempt to
write identical data to the dataset from all processes.
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
<td valign="top"><em>hid_t</em> <code>dataset_id</code></td>
<td valign="top">IN: Identifier of the dataset to write to.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>mem_type_id</code></td>
<td valign="top">IN: Identifier of the memory datatype.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>mem_space_id</code></td>
<td valign="top">IN: Identifier of the memory dataspace.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>file_space_id </code></td>
<td valign="top">IN: Identifier of the dataset's dataspace in the file.</td></tr>
<tr>
<td valign="top"><em>hid_t</em> <code>xfer_plist_id</code></td>
<td valign="top">IN: Identifier of a transfer property list
for this I/O operation.</td></tr>
<tr>
<td valign="top"><em>const void *</em> <code>buf</code></td>
<td valign="top">IN: Buffer with data to be written to the file.</td></tr>
</table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5dwrite_f
<dd>
<pre>
SUBROUTINE h5dwrite_f(dset_id, mem_type_id, buf, dims, hdferr, &
mem_space_id, file_space_id, xfer_prp)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier
TYPE, INTENT(IN) :: buf ! Data buffer; may be a scalar
! or an array
DIMENSION(*), INTEGER(HSIZE_T), INTENT(IN) :: dims
! Array to hold corresponding
! dimension sizes of data
! buffer buf; dim(k) has value
! of the k-th dimension of
! buffer buf; values are
! ignored if buf is a scalar
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id
! Memory dataspace identfier
! Default value is H5S_ALL_F
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id
! File dataspace identfier
! Default value is H5S_ALL_F
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp
! Transfer property list
! identifier; default value
! is H5P_DEFAULT_F
END SUBROUTINE h5dwrite_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
<dt><strong>History:</strong>
<ul><table width="90%">
<tr>
<td valign="top" align="left" width="10%">
<strong>Release</strong> </td>
<td valign="top" align="left">
<strong>Fortran90</strong></td></tr>
<tr>
<td valign="top">1.4.2</td>
<td valign="top">
A <code>dims</code> parameter has been added.</td></tr>
</table></ul>
</dl>
<!-- #BeginLibraryItem "/ed_libs/NavBar_RM.lbi" --><hr>
<center>
<table border=0 width=98%>
<tr><td valign=top align=left>
<a href="index.html">HDF5 documents and links</a> <br>
<a href="H5.intro.html">Introduction to HDF5</a> <br>
<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/UG/index.html">HDF5 User Guide</a> <br>
<!--
<a href="Glossary.html">Glossary</a><br>
-->
</td>
<td valign=top align=right>
And in this document, the
<a href="RM_H5Front.html">HDF5 Reference Manual</a> <br>
<a href="RM_H5.html">H5</a>
<a href="RM_H5A.html">H5A</a>
<a href="RM_H5D.html">H5D</a>
<a href="RM_H5E.html">H5E</a>
<a href="RM_H5F.html">H5F</a>
<a href="RM_H5G.html">H5G</a>
<a href="RM_H5I.html">H5I</a>
<a href="RM_H5P.html">H5P</a> <br>
<a href="RM_H5R.html">H5R</a>
<a href="RM_H5S.html">H5S</a>
<a href="RM_H5T.html">H5T</a>
<a href="RM_H5Z.html">H5Z</a>
<a href="Tools.html">Tools</a>
<a href="PredefDTypes.html">Datatypes</a>
</td></tr>
<tr><td colspan="2" align="right">
<i><small>(<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/">PDF</a>
of complete manual formatted as print volume) </small></i>
</td></tr>
</table>
</center>
<hr>
<!-- #EndLibraryItem --><!-- #BeginLibraryItem "/ed_libs/Footer.lbi" --><address>
<a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a>
<br>
Describes HDF5 Release 1.6.5, October 2005
</address>
<!-- #EndLibraryItem --><SCRIPT LANGUAGE="JAVASCRIPT">
<!--
document.writeln("Last modified: 8 September 2004");
-->
</SCRIPT>
</body>
</html>
|