diff options
author | knarf <knarf@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45> | 2010-02-26 05:18:09 +0000 |
---|---|---|
committer | knarf <knarf@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45> | 2010-02-26 05:18:09 +0000 |
commit | c53825d6a37bec894be09536dff341a6a62c40fc (patch) | |
tree | 7051b9cf33a0abae947a2c457c36cb534106e63a | |
parent | 4fa41099ea4a1e859a420517c393ef546890579d (diff) |
Do not use overly large value of w in a sqrt(<0) case, but use 0 instead. Both is wrong, but 0 is better.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/GRHydro/trunk@78 c83d129a-5a75-4d5a-9c4d-ed3a5855bf45
-rw-r--r-- | src/Whisky_Prim2Con.F90 | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Whisky_Prim2Con.F90 b/src/Whisky_Prim2Con.F90 index eae7ec8..01f3d9f 100644 --- a/src/Whisky_Prim2Con.F90 +++ b/src/Whisky_Prim2Con.F90 @@ -342,7 +342,13 @@ subroutine prim2conpolytype(handle, gxx, gxy, gxz, gyy, gyz, & w_tmp = gxx*dvelx*dvelx + gyy*dvely*dvely + gzz *dvelz*dvelz + & 2*gxy*dvelx*dvely + 2*gxz*dvelx*dvelz + 2*gyz*dvely*dvelz if (w_tmp .ge. 1.d0) then - w = 1.d100 + ! In theory this should not happen, and even when accepting the fact + ! that numerically it can, one might be tempted to set w to some large + ! value in that case. However, this would lead to completely bogus + ! and hard to trace wrong values below. There is no good value to + ! choose in this case, but something small is probably the best of + ! all bad choices. + w = 1.d-20 else w = 1.d0 / sqrt(1.d0 - w_tmp) endif |