From b240c4c4761508c7e9795e59478ce8d568102fe2 Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Fri, 26 Jul 2024 18:34:40 -0700 Subject: [PATCH] fix: Avoid thread conflicts Makes root finder initialization status `threadprivate` to avoid thread conflicts. --- source/merger_trees.construct.read.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/merger_trees.construct.read.F90 b/source/merger_trees.construct.read.F90 index 2f202bd1cb..eee8cec90c 100644 --- a/source/merger_trees.construct.read.F90 +++ b/source/merger_trees.construct.read.F90 @@ -2056,7 +2056,7 @@ subroutine readAssignScaleRadii(self,nodes,nodeList) & useFallbackScaleMethod type (rootFinder ) , save :: finder logical , save :: finderConstructed =.false. - !$omp threadprivate(finder) + !$omp threadprivate(finder,finderConstructed) type (varying_string ) :: message character (len=16 ) :: label @@ -2161,11 +2161,11 @@ subroutine readAssignScaleRadii(self,nodes,nodeList) ! The node mass is below the reliability threshold, or no scale information is available. Set the scale radius using ! the fallback method. node_ => nodeList(iIsolatedNode)%node - radiusScale=max( & - & min( & + radiusScale=max( & + & min( & & self%darkMatterProfileScaleRadius_%radius (node_) , & & self%darkMatterHaloScale_ %radiusVirial(node_)/self%presetScaleRadiiConcentrationMinimum & - & ) , & + & ) , & & self%darkMatterHaloScale_ %radiusVirial(node_)/self%presetScaleRadiiConcentrationMaximum & & ) call darkMatterProfile%scaleSet(radiusScale)