Class | counter_class |
In: |
LatticeClass/counter_class.F90
|
$Id: counter_class.F90,v 1.10 2011/01/31 11:10:24 ishikawa Exp $
Function : | |
ave : | real(DP) |
this : | type(counter), intent(inout) |
return average inclements
ave <= this%iter/this%itry
function get_average_counter(this) result(ave) ! ! return average inclements ! ! ave <= this%iter/this%itry ! ! * this%itry : call inc count ! * this%iter : total increment count ! implicit none type(counter), intent(inout) :: this real(DP) :: ave if (this%itry /= 0) then this%ave=dble(this%iter)/this%itry else this%ave=0.0_DP endif ave = this%ave return end function
Subroutine : | |||
this : | type(counter),
intent(inout)
| ||
incl : | integer, optional, intent(in)
|
increments counter by incl
this also counts call count
subroutine inc_counter(this,incl) ! ! increments counter by incl ! ! this also counts call count ! implicit none type(counter), intent(inout) :: this ! counter integer, optional, intent(in) :: incl ! inclement by incl if (present(incl)) then this%iter=this%iter+incl else this%iter=this%iter+1 endif ! ! count call inc ! this%itry=this%itry+1 return end subroutine