From c72f60094d3c133bac269d246513a12dc8a994b1 Mon Sep 17 00:00:00 2001 From: daminton Date: Thu, 23 Feb 2017 03:14:04 +0000 Subject: [PATCH] Fixed OMP bug in crater_soften_accumulate --- src/crater/crater_soften_accumulate.f90 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/crater/crater_soften_accumulate.f90 b/src/crater/crater_soften_accumulate.f90 index 6de77875..cc2c6c79 100644 --- a/src/crater/crater_soften_accumulate.f90 +++ b/src/crater/crater_soften_accumulate.f90 @@ -46,19 +46,20 @@ subroutine crater_soften_accumulate(user,surf,crater,domain,kdiff) kappatmax = user%soften_factor / (PI * (SOFTEN_SIZE * crater%frad)**(user%soften_slope - 2.0_DP)) + kappatmax = kappatmax - 0.84_DP / (PI * (SOFTEN_SIZE * crater%frad)**2.0) inc = SOFTEN_SIZE * crater%fradpx + 2 crater%maxinc = max(crater%maxinc,inc) fradsq = crater%frad**2 incsq = inc**2 ! Loop over affected matrix area - !$OMP PARALLEL DO DEFAULT(PRIVATE) IF(2*N > INCPAR) & - !$OMP SHARED(user,crater,fradsq,incsq,kappatmax,SOFTEN_SIZE) & + !$OMP PARALLEL DO DEFAULT(PRIVATE) IF(inc > INCPAR) & + !$OMP SHARED(user,crater,fradsq,inc,incsq,kappatmax,SOFTEN_SIZE) & !$OMP REDUCTION(+:kdiff) - do j=-inc,inc ! Do the loop in pixel space - do i=-inc,inc + do j = -inc,inc ! Do the loop in pixel space + do i = -inc,inc ! find distance from crater center - iradsq = i*i + j*j + iradsq = i**2 + j**2 if (iradsq <= incsq) then ! find elevation and grid point xpi = crater%xlpx + i