Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Content Layer
id1195548671
Content Column
width50.00001%
id1195578110
classrm_pagetree_col mobile-hide
Content Block
id1195578111
 
Content Column
width50.00001%
id1195548673
classhdf-rm-main-column
Content Block
id1195548672

Include Content
render-without-blockstrue
page.rm-navbar
HTML Wrap
classhdf-print-only

Page Title

HTML Wrap
classhdf-rm-summary-block

Hdf rm anchor
AnchorNamesummary

Excerpt

Writes data to an attribute

HTML Wrap
classhdf-rm-content-block

Hdf rm anchor
AnchorNameprocedure

Procedure:
HTML Wrap
classhdf-rm-section
HTML Wrap
classhdf_procedure

H5A_WRITE(attr_id, mem_type_id, buf)

Hdf rm anchor
AnchorNamesignature

Signature:
HTML Wrap
classhdf-rm-section
HTML Wrap
classhdf-togglebox hdf-c

HTML Add Class
hdf-togglebutton-visible
hdf-togglebutton-visible
selector.hdf-togglebutton.hdf-c

HTML
<pre><code class="language-c">herr_t H5Awrite
(
    hid_t       attr_id,
    hid_t       mem_type_id,
    const void *buf
)</code></pre>
HTML Wrap
classhdf-togglebox hdf-fortran hdf-togglebox-hidden

HTML Add Class
hdf-togglebutton-visible
hdf-togglebutton-visible
selector.hdf-togglebutton.hdf-fortran

Fortran90:

HTML
<pre><code class="language-fortran">  SUBROUTINE h5awrite_f(attr_id, memtype_id, buf, dims, hdferr) 
    INTEGER(HID_T)  , INTENT(IN)               :: attr_id
    INTEGER(HID_T)  , INTENT(IN)               :: memtype_id
    TYPE            , INTENT(IN)               :: buf
    INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims
    INTEGER         , INTENT(OUT)              :: hdferr</code></pre>

Fortran2003:

HTML
<pre><code class="language-fortran"> SUBROUTINE h5awrite_f(attr_id, memtype_id, buf, hdferr) 
    INTEGER(HID_T)  , INTENT(IN)  :: attr_id
    INTEGER(HID_T)  , INTENT(IN)  :: memtype_id
    TYPE(C_PTR)     , INTENT(IN)  :: buf
    INTEGER         , INTENT(OUT) :: hdferr</code></pre>

Hdf rm anchor
AnchorNameparameters

Parameters:
HTML Wrap
classhdf-rm-section
hid_t attr_idIN: Identifier of an attribute to write
hid_t mem_type_id    IN: Identifier of the attribute datatype (in memory)
const void * bufIN: Data to be written

Hdf rm anchor
AnchorNamedescription

Description:
HTML Wrap
classhdf-rm-section

H5A_WRITE  writes an attribute, specified with  attr_id . The attribute's memory datatype is specified with  mem_type_id . The entire attribute is written from  buf  to the file.

If mem_type_id is either a fixed-length or variable-length string, it is important to set the string length when defining the datatype. String datatypes are derived from H5T_C_S1 (or H5T_FORTRAN_S1 for Fortran codes), which defaults to 1 character in size. See  H5T_SET_SIZE  and Creating variable-length string datatypes.

Datatype conversion takes place at the time of a read or write and is automatic. See the “Data the “Data Transfer: Datatype Conversion and Selection” section Selection” section in the “HDF5 Datatypes” chapter of the HDF5 User’s Guide for a discussion of data conversion.

Hdf rm anchor
AnchorNamereturns

Returns:
HTML Wrap
classhdf-rm-section

Returns a non-negative value if successful; otherwise returns a negative value.

Hdf rm anchor
AnchorNameexample

Example:
HTML Wrap
classhdf-rm-section

Coming Soon!

Comment
HTML Wrap
classhdf-togglebox hdf-c

Bitbucket Server file
repoSlughdf5
branchIdrefs/heads/1.10/master
projectKeyHDFFV
filepathexamples/h5_subset.c
showLineNumberstrue
lineStart32
progLangcpp
lineEnd42
applicationLink5ac7b370-7412-3c8c-ad20-807a68261336

HTML Wrap
classhdf-togglebox hdf-fortran hdf-togglebox-hidden

Bitbucket Server file
repoSlughdf5
branchIdrefs/heads/1.10/master
projectKeyHDFFV
filepathfortran/examples/compound.f90
showLineNumberstrue
lineStart25
progLangplain
lineEnd35
applicationLink5ac7b370-7412-3c8c-ad20-807a68261336

Hdf rm anchor
AnchorNamehistory

History:
HTML Wrap
classhdf-rm-section
Release    Change
1.8.8Fortran updated to Fortran2003.
1.4.2Fortran dims parameter added in this release.