Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristopherson committed Feb 18, 2025
1 parent 684051b commit fca407b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fstats_mcmc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function mh_get_chain(this, bin, err) result(rst)
!! The resulting chain with each parameter represented by a column.

! Local Variables
integer(int32) :: npts, nvar, flag, nstart
integer(int32) :: npts, nvar, flag, nstart, n
class(errors), pointer :: errmgr
type(errors), target :: deferr

Expand All @@ -213,6 +213,7 @@ function mh_get_chain(this, bin, err) result(rst)
errmgr => deferr
end if
npts = this%get_chain_length()
n = npts
nvar = this%get_state_variable_count()
if (present(bin)) then
nstart = floor(bin * npts)
Expand All @@ -223,7 +224,7 @@ function mh_get_chain(this, bin, err) result(rst)

! Process
allocate(rst(npts, nvar), stat = flag, &
source = this%m_buffer(nstart:,1:nvar))
source = this%m_buffer(nstart:n,1:nvar))
if (flag /= 0) then
call report_memory_error(errmgr, "mh_get_chain", flag)
return
Expand Down

0 comments on commit fca407b

Please sign in to comment.