sllist_obj_Remove Subroutine

private pure subroutine sllist_obj_Remove(this, key)

Remove key-value pair from list.

Type Bound

sllist_obj

Arguments

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

List object

integer, intent(in) :: key

Key of key-val pair to remove


Called by

proc~~sllist_obj_remove~~CalledByGraph proc~sllist_obj_remove sllist_obj%sllist_obj_Remove proc~hashtbl_obj_remove hashtbl_obj%hashtbl_obj_Remove proc~hashtbl_obj_remove->proc~sllist_obj_remove proc~hdf5_obj_closegroup hdf5_obj%hdf5_obj_CloseGroup proc~hdf5_obj_closegroup->proc~hashtbl_obj_remove proc~hdf5_obj_creategroup hdf5_obj%hdf5_obj_CreateGroup proc~hdf5_obj_creategroup->proc~hdf5_obj_closegroup proc~hdf5_obj_getnpoints hdf5_obj%hdf5_obj_GetNPoints proc~hdf5_obj_getnpoints->proc~hdf5_obj_closegroup proc~hdf5_obj_read1d hdf5_obj%hdf5_obj_Read1D proc~hdf5_obj_read1d->proc~hdf5_obj_closegroup proc~hdf5_obj_read3d hdf5_obj%hdf5_obj_Read3D proc~hdf5_obj_read3d->proc~hdf5_obj_closegroup proc~hdf5_obj_readattributes0d hdf5_obj%hdf5_obj_ReadAttributes0D proc~hdf5_obj_readattributes0d->proc~hdf5_obj_closegroup proc~hdf5_obj_readattributes1d hdf5_obj%hdf5_obj_ReadAttributes1D proc~hdf5_obj_readattributes1d->proc~hdf5_obj_closegroup proc~hdf5_obj_readcoord hdf5_obj%hdf5_obj_ReadCoord proc~hdf5_obj_readcoord->proc~hdf5_obj_closegroup proc~hdf5_obj_write1d hdf5_obj%hdf5_obj_Write1D proc~hdf5_obj_write1d->proc~hdf5_obj_closegroup proc~hdf5_obj_write3d hdf5_obj%hdf5_obj_Write3D proc~hdf5_obj_write3d->proc~hdf5_obj_closegroup proc~hdf5_obj_writeattributes0d hdf5_obj%hdf5_obj_WriteAttributes0D proc~hdf5_obj_writeattributes0d->proc~hdf5_obj_closegroup proc~hdf5_obj_writeattributes1d hdf5_obj%hdf5_obj_WriteAttributes1D proc~hdf5_obj_writeattributes1d->proc~hdf5_obj_closegroup proc~hdf5_obj_writecoord hdf5_obj%hdf5_obj_WriteCoord proc~hdf5_obj_writecoord->proc~hdf5_obj_closegroup none~readattributes hdf5_obj%ReadAttributes none~readattributes->proc~hdf5_obj_readattributes0d none~readattributes->proc~hdf5_obj_readattributes1d none~writeattributes hdf5_obj%WriteAttributes none~writeattributes->proc~hdf5_obj_writeattributes0d none~writeattributes->proc~hdf5_obj_writeattributes1d proc~bc_set_write bc_set%bc_set_Write proc~bc_set_write->proc~hdf5_obj_creategroup proc~bc_set_write->none~writeattributes proc~block_obj_read block_obj%block_obj_Read proc~block_obj_read->proc~hdf5_obj_readcoord proc~block_obj_read->none~readattributes proc~block_obj_write block_obj%block_obj_Write proc~block_obj_write->proc~hdf5_obj_writecoord proc~block_obj_write->none~writeattributes proc~h5hut_obj_getnpoints h5hut_obj%h5hut_obj_GetNPoints proc~h5hut_obj_getnpoints->proc~hdf5_obj_getnpoints proc~h5hut_obj_setstep h5hut_obj%h5hut_obj_SetStep proc~h5hut_obj_setstep->proc~hdf5_obj_creategroup proc~h5hut_obj_write3d h5hut_obj%h5hut_obj_Write3D proc~h5hut_obj_write3d->proc~hdf5_obj_creategroup proc~h5hut_obj_writegrid h5hut_obj%h5hut_obj_WriteGrid proc~h5hut_obj_writegrid->proc~hdf5_obj_creategroup proc~h5hut_obj_writegrid->none~writeattributes proc~bc_set_read bc_set%bc_set_Read proc~bc_set_read->none~readattributes proc~eulerian_set_readhdf5 eulerian_set%eulerian_set_ReadHDF5 proc~eulerian_set_readhdf5->none~readattributes proc~eulerian_set_writehdf5 eulerian_set%eulerian_set_WriteHDF5 proc~eulerian_set_writehdf5->none~writeattributes none~writesingle eulerian_set%WriteSingle proc~eulerian_set_writehdf5->none~writesingle proc~eulerian_set_writesingleh5hut eulerian_set%eulerian_set_WriteSingleH5HUT proc~eulerian_set_writesingleh5hut->proc~h5hut_obj_writegrid proc~h5hut_obj_jumptostep h5hut_obj%h5hut_obj_JumpToStep proc~h5hut_obj_jumptostep->none~readattributes proc~h5hut_obj_jumptostep->proc~h5hut_obj_setstep proc~h5hut_obj_lasttimestep h5hut_obj%h5hut_obj_LastTimeStep proc~h5hut_obj_lasttimestep->none~readattributes proc~h5hut_obj_lasttimestep->proc~h5hut_obj_setstep proc~h5hut_obj_newtimestep h5hut_obj%h5hut_obj_NewTimeStep proc~h5hut_obj_newtimestep->none~writeattributes proc~h5hut_obj_newtimestep->proc~h5hut_obj_setstep proc~h5hut_obj_readattributes0d h5hut_obj%h5hut_obj_ReadAttributes0D proc~h5hut_obj_readattributes0d->none~readattributes proc~h5hut_obj_readattributes0d->proc~h5hut_obj_setstep proc~h5hut_obj_readattributes1d h5hut_obj%h5hut_obj_ReadAttributes1D proc~h5hut_obj_readattributes1d->none~readattributes proc~h5hut_obj_readattributes1d->proc~h5hut_obj_setstep proc~h5hut_obj_writeattributes0d h5hut_obj%h5hut_obj_WriteAttributes0D proc~h5hut_obj_writeattributes0d->none~writeattributes proc~h5hut_obj_writeattributes0d->proc~h5hut_obj_setstep proc~h5hut_obj_writeattributes1d h5hut_obj%h5hut_obj_WriteAttributes1D proc~h5hut_obj_writeattributes1d->none~writeattributes proc~h5hut_obj_writeattributes1d->proc~h5hut_obj_setstep proc~marker_set_readh5hut marker_set%marker_set_ReadH5HUT proc~marker_set_readh5hut->proc~h5hut_obj_getnpoints proc~marker_set_readh5hut->proc~h5hut_obj_jumptostep proc~marker_set_readh5hut->proc~h5hut_obj_lasttimestep proc~marker_set_readhdf5 marker_set%marker_set_ReadHDF5 proc~marker_set_readhdf5->none~readattributes proc~marker_set_writehdf5 marker_set%marker_set_WriteHDF5 proc~marker_set_writehdf5->none~writeattributes proc~particle_set_readh5hut particle_set%particle_set_ReadH5HUT proc~particle_set_readh5hut->proc~h5hut_obj_getnpoints proc~particle_set_readh5hut->proc~h5hut_obj_jumptostep proc~particle_set_readh5hut->proc~h5hut_obj_lasttimestep proc~particle_set_readhdf5 particle_set%particle_set_ReadHDF5 proc~particle_set_readhdf5->none~readattributes proc~particle_set_writehdf5 particle_set%particle_set_WriteHDF5 proc~particle_set_writehdf5->none~writeattributes proc~respart_set_readh5hut ResPart_set%ResPart_set_ReadH5HUT proc~respart_set_readh5hut->proc~h5hut_obj_getnpoints proc~respart_set_readh5hut->proc~h5hut_obj_jumptostep proc~respart_set_readh5hut->proc~h5hut_obj_lasttimestep proc~respart_set_readhdf5 ResPart_set%ResPart_set_ReadHDF5 proc~respart_set_readhdf5->none~readattributes proc~respart_set_readhdf5->proc~marker_set_readhdf5 proc~respart_set_writehdf5 ResPart_set%ResPart_set_WriteHDF5 proc~respart_set_writehdf5->none~writeattributes proc~respart_set_writehdf5->proc~marker_set_writehdf5 proc~solid_set_readhdf5 solid_set%solid_set_ReadHDF5 proc~solid_set_readhdf5->none~readattributes proc~solid_set_readhdf5->proc~marker_set_readhdf5 proc~solid_set_writehdf5 solid_set%solid_set_WriteHDF5 proc~solid_set_writehdf5->none~writeattributes proc~solid_set_writehdf5->proc~marker_set_writehdf5 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 none~writesingle->proc~eulerian_set_writesingleh5hut proc~eulerian_set_readh5hut eulerian_set%eulerian_set_ReadH5HUT proc~eulerian_set_readh5hut->proc~h5hut_obj_jumptostep 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~eulerian_set_writeh5hut->none~writesingle proc~marker_set_writeh5hut marker_set%marker_set_WriteH5HUT proc~marker_set_writeh5hut->proc~h5hut_obj_newtimestep proc~particle_set_writeh5hut particle_set%particle_set_WriteH5HUT proc~particle_set_writeh5hut->proc~h5hut_obj_newtimestep 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~eulerian_set_writesilo eulerian_set%eulerian_set_WriteSILO proc~eulerian_set_writesilo->none~writesingle 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

    pure subroutine sllist_obj_Remove(this,key)
      !> Remove key-value pair from list.
      implicit none
      class(sllist_obj), intent(inout),  &
                         target         :: this                                !! List object
      integer,           intent(in)     :: key                                 !! Key of key-val pair to remove
      ! Work variables
      type(sllist_obj), pointer :: current
      type(sllist_obj), pointer :: prev

      if (this%key == key) then
        ! Removing the head node
        if (.not.associated(this%child)) then
          this%key   = -1
          deallocate(this%val)
          this%child => null()
        else
          this%key   = this%child%key
          deallocate(this%val)
          allocate(this%val, source = this%child%val)
          this%child => this%child%child
        end if
      else
        ! Removing other nodes
        prev => null()
        current => this
        do while (associated(current))
            if (current%key == key) then
              prev%child => current%child
              deallocate(current)
              return
            end if
            prev => current
            current => current%child
        end do
      end if

      return
    end subroutine sllist_obj_Remove