Skip to content

Commit

Permalink
MW: patch driver.f to handle negative weights
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien committed Mar 4, 2015
1 parent 2a5e8b7 commit b7ec294
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
11 changes: 10 additions & 1 deletion MG_interference_patches/MW_prodonly/patch_MW.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,14 @@ then
else
echo "Couldn't find directory $dir".
fi


dir=$MGWORKDIR/Subprocesses/
if [ -d $dir ]
then
echo "Back-uping and patching $dir/driver.f"
cp $dir/driver.f $dir/driver.f.backup
patch $dir/driver.f patch_driver.f
else
echo "Couldn't find directory $dir".
fi

24 changes: 24 additions & 0 deletions MG_interference_patches/MW_prodonly/patch_driver.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
421c421
< cross = cross + perm_value_it(i,1)/(perm_error_it(i,1)+1d-99)
---
> cross = cross + abs(perm_value_it(i,1))/(perm_error_it(i,1)+1d-99)
428c428
< value = perm_value_it(j,1)/
---
> value = abs(perm_value_it(j,1))/
474c474
< if (data(i).ge.data(i-j)) then
---
> if (abs(data(i)).ge.abs(data(i-j))) then
487c487
< cross = cross + perm_value(i,1)
---
> cross = cross + abs(perm_value(i,1))
492c492
< tmp = perm_value(j,1)
---
> tmp = abs(perm_value(j,1))
521c521
< if (data(i).ge.data(i-j)) then
---
> if (abs(data(i)).ge.abs(data(i-j))) then

0 comments on commit b7ec294

Please sign in to comment.