Adds timing info.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(timer_obj), | intent(inout) | :: | this |
Timer |
||
| character(len=*), | intent(in) | :: | name |
Name of timing data |
pure subroutine timer_obj_AddTiming(this,name) !> Adds timing info. implicit none class(timer_obj), intent(inout) :: this !! Timer character(len=*), intent(in) :: name !! Name of timing data ! Work bariables real(wp), allocatable :: tmp_array(:) integer :: idx ! Expand timing array to add a new element if (.not.allocated(this%timing)) then allocate(this%timing(1)) else ! Allocate temporary array allocate(tmp_array(size(this%timing)+1)) ! Store old values tmp_array(1:size(this%timing)) = this%timing(:) ! Move the allocation from the ! temporary array to the final one call move_alloc(tmp_array,this%timing) end if ! Add to hash table idx = size(this%timing) call this%tbl%Put(key=this%tbl%HashString(name),val=idx) ! Set initial timing to zero this%timing(idx) = this%itertime return end subroutine timer_obj_AddTiming