Skip to content

Commit

Permalink
Change array handling in OpenMP section
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristopherson committed Mar 26, 2024
1 parent c3069f8 commit 5300f30
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fstats_bootstrap.f90
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ subroutine bootstrap_linear_least_squares(order, intercept, x, y, &
! Compute the fit of the perturbed data set
call linear_least_squares(order, intercept, x, yLocal, &
allcoeffs(:,i), fLocal, rLocal, alpha = alph)

! Clean up allocated arrays
if (allocated(fLocal)) deallocate(fLocal)
if (allocated(yLocal)) deallocate(yLocal)
if (allocated(rLocal)) deallocate(rLocal)
end do
!$OMP END PARALLEL DO
#else
Expand Down Expand Up @@ -596,6 +601,11 @@ subroutine bootstrap_nonlinear_least_squares(fun, x, y, params, ymod, resid, &
call nonlinear_least_squares(fun, x, yLocal, allcoeffs(:,i), fLocal, &
rLocal, weights = weights, maxp = maxp, minp = minp, alpha = alph, &
controls = controls, settings = settings, info = info)

! Clean up allocated arrays
if (allocated(fLocal)) deallocate(fLocal)
if (allocated(yLocal)) deallocate(yLocal)
if (allocated(rLocal)) deallocate(rLocal)
end do
!$OMP END PARALLEL DO
#else
Expand Down

0 comments on commit 5300f30

Please sign in to comment.