1 integer(hid_t) :: loc_id
2 integer(hid_t) :: space_id
3 integer(hid_t) :: attr_id
4 integer(hsize_t) :: dims(1)
5 type(h5o_info_t) :: object_info
7 dims = int([1], hsize_t)
10 call h5oget_info_by_name_f(handle%file_id, objpath, object_info, error)
11 sll_assert_always(error == 0)
14 select case (object_info%type)
16 call h5gopen_f(handle%file_id, objpath, loc_id, error)
17 sll_assert_always(error == 0)
18 case (h5o_type_dataset)
19 call h5dopen_f(handle%file_id, objpath, loc_id, error)
20 sll_assert_always(error == 0)
24 call h5screate_f(h5s_scalar_f, space_id, error)
25 sll_assert_always(error == 0)
28 call h5acreate_f(loc_id, attrname, datatype, space_id, attr_id, error)
29 sll_assert_always(error == 0)
32 call h5awrite_f(attr_id, datatype, attrvalue, dims, error)
33 sll_assert_always(error == 0)
36 call h5aclose_f(attr_id, error)
37 sll_assert_always(error == 0)
40 call h5sclose_f(space_id, error)
41 sll_assert_always(error == 0)
44 select case (object_info%type)
46 call h5gclose_f(loc_id, error)
47 sll_assert_always(error == 0)
48 case (h5o_type_dataset)
49 call h5dclose_f(loc_id, error)
50 sll_assert_always(error == 0)