hdf5_obj_ReadGroupNames Subroutine

private impure subroutine hdf5_obj_ReadGroupNames(this, basegroup, names)

Uses

  • proc~~hdf5_obj_readgroupnames~~UsesGraph proc~hdf5_obj_readgroupnames hdf5_obj%hdf5_obj_ReadGroupNames iso_c_binding iso_c_binding proc~hdf5_obj_readgroupnames->iso_c_binding

Reads the groups (i.e., directories) under a given base group in an HDF5 file.

Type Bound

hdf5_obj

Arguments

Type IntentOptional Attributes Name
class(hdf5_obj), intent(inout) :: this

A HDF5 object

character(len=*), intent(in) :: basegroup

Base group to explore

character(len=str64), intent(out), allocatable :: names(:)

Names of groups under the base group


Calls

proc~~hdf5_obj_readgroupnames~~CallsGraph proc~hdf5_obj_readgroupnames hdf5_obj%hdf5_obj_ReadGroupNames h5gn_members_f h5gn_members_f proc~hdf5_obj_readgroupnames->h5gn_members_f h5iget_name_f h5iget_name_f proc~hdf5_obj_readgroupnames->h5iget_name_f h5oclose_f h5oclose_f proc~hdf5_obj_readgroupnames->h5oclose_f h5oget_info_f h5oget_info_f proc~hdf5_obj_readgroupnames->h5oget_info_f h5oopen_by_idx_f h5oopen_by_idx_f proc~hdf5_obj_readgroupnames->h5oopen_by_idx_f proc~hdf5_obj_fixgroupname hdf5_obj%hdf5_obj_FixGroupName proc~hdf5_obj_readgroupnames->proc~hdf5_obj_fixgroupname

Called by

proc~~hdf5_obj_readgroupnames~~CalledByGraph proc~hdf5_obj_readgroupnames hdf5_obj%hdf5_obj_ReadGroupNames proc~bc_set_read bc_set%bc_set_Read proc~bc_set_read->proc~hdf5_obj_readgroupnames proc~h5hut_obj_getnfields h5hut_obj%h5hut_obj_GetNFields proc~h5hut_obj_getnfields->proc~hdf5_obj_readgroupnames proc~h5hut_obj_getnsteps h5hut_obj%h5hut_obj_GetNSteps proc~h5hut_obj_getnsteps->proc~hdf5_obj_readgroupnames proc~h5hut_obj_lasttimestep h5hut_obj%h5hut_obj_LastTimeStep proc~h5hut_obj_lasttimestep->proc~h5hut_obj_getnsteps proc~h5hut_obj_newtimestep h5hut_obj%h5hut_obj_NewTimeStep proc~h5hut_obj_newtimestep->proc~h5hut_obj_getnsteps proc~h5hut_obj_readattributes0d h5hut_obj%h5hut_obj_ReadAttributes0D proc~h5hut_obj_readattributes0d->proc~h5hut_obj_getnsteps proc~h5hut_obj_readattributes1d h5hut_obj%h5hut_obj_ReadAttributes1D proc~h5hut_obj_readattributes1d->proc~h5hut_obj_getnsteps proc~h5hut_obj_stepcount h5hut_obj%h5hut_obj_StepCount proc~h5hut_obj_stepcount->proc~h5hut_obj_getnsteps proc~h5hut_obj_writeattributes0d h5hut_obj%h5hut_obj_WriteAttributes0D proc~h5hut_obj_writeattributes0d->proc~h5hut_obj_getnsteps proc~h5hut_obj_writeattributes1d h5hut_obj%h5hut_obj_WriteAttributes1D proc~h5hut_obj_writeattributes1d->proc~h5hut_obj_getnsteps none~readattributes~2 h5hut_obj%ReadAttributes none~readattributes~2->proc~h5hut_obj_readattributes0d none~readattributes~2->proc~h5hut_obj_readattributes1d none~writeattributes~2 h5hut_obj%WriteAttributes none~writeattributes~2->proc~h5hut_obj_writeattributes0d none~writeattributes~2->proc~h5hut_obj_writeattributes1d proc~eulerian_set_readh5hut eulerian_set%eulerian_set_ReadH5HUT proc~eulerian_set_readh5hut->proc~h5hut_obj_lasttimestep proc~eulerian_set_writeh5hut eulerian_set%eulerian_set_WriteH5HUT proc~eulerian_set_writeh5hut->proc~h5hut_obj_newtimestep proc~marker_set_readh5hut marker_set%marker_set_ReadH5HUT proc~marker_set_readh5hut->proc~h5hut_obj_lasttimestep proc~marker_set_writeh5hut marker_set%marker_set_WriteH5HUT proc~marker_set_writeh5hut->proc~h5hut_obj_newtimestep proc~particle_set_readh5hut particle_set%particle_set_ReadH5HUT proc~particle_set_readh5hut->proc~h5hut_obj_lasttimestep proc~particle_set_writeh5hut particle_set%particle_set_WriteH5HUT proc~particle_set_writeh5hut->proc~h5hut_obj_newtimestep proc~respart_set_readh5hut ResPart_set%ResPart_set_ReadH5HUT proc~respart_set_readh5hut->proc~h5hut_obj_lasttimestep proc~respart_set_writeh5hut ResPart_set%ResPart_set_WriteH5HUT proc~respart_set_writeh5hut->proc~h5hut_obj_newtimestep proc~respart_set_writeh5hut->proc~marker_set_writeh5hut proc~solid_set_readh5hut solid_set%solid_set_ReadH5HUT proc~solid_set_readh5hut->none~readattributes~2 proc~solid_set_writeh5hut solid_set%solid_set_WriteH5HUT proc~solid_set_writeh5hut->none~writeattributes~2

Source Code

    impure subroutine hdf5_obj_ReadGroupNames(this,basegroup,names)
      !> Reads the groups (i.e., directories) under a given base group
      ! in an HDF5 file.
      use iso_c_binding
      implicit none
      class(hdf5_obj),  intent(inout) :: this                                  !! A HDF5 object
      character(len=*), intent(in)    :: basegroup                             !! Base group to explore
      character(len=str64), &
           allocatable, intent(out)   :: names(:)                              !! Names of groups under the base group
      ! Work variables
      integer(HID_T)      :: obj
      type(H5O_info_t)    :: info
      character(len=str64):: obj_name
      integer(SIZE_T)     :: name_size
      integer             :: idx
      integer             :: ierr
      integer             :: nobj
      character(len=:), &
              allocatable :: groupname
      character(len=:), &
              allocatable :: name_

      ! Initilize the array of names as an empty array
      names = [character(len=str64)::]

      ! Make sure basegroup is properly formatted,
      ! with '/' at the begining and end
      groupname=this%FixGroupName(basegroup)

      ! Get total number of objects under this group
      call H5Gn_members_f(this%fid,groupname,nobj,ierr)

      ! Iterate over objects under the basegroup
      do idx = 0, nobj - 1
        ! Open object
        call H5Oopen_by_idx_f(this%fid,groupname,H5_INDEX_NAME_F,H5_ITER_NATIVE_F, int(idx,HSIZE_T),obj,ierr)
        if (ierr.eq.0) then
          ! Get name and info of the object
          call H5Iget_name_f(obj,obj_name,int(str64,SIZE_T),name_size,ierr)
          call H5Oget_info_f(obj,info,ierr)

          ! Consider only objects that are groups
          if ( info%type .eq. H5O_TYPE_GROUP_F) then
            ! Add object name to list
            name_ = obj_name(len(groupname)+1:name_size)
            names = [character(len=str64):: names(:), name_]

          end if

          ! Close object
          call H5Oclose_f(obj,ierr)
        end if
      end do

      return
    end subroutine hdf5_obj_ReadGroupNames