diff options
author | knarf <knarf@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45> | 2010-04-08 03:09:32 +0000 |
---|---|---|
committer | knarf <knarf@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45> | 2010-04-08 03:09:32 +0000 |
commit | 64c1daf795c0bbad67e5d250566676ad3e5396f9 (patch) | |
tree | 655b619b9b46d51537062368867ea197d4535670 /src | |
parent | 958e330232906ff86d44e19e48bb1c65f4384729 (diff) |
make c2p not fail (polytype version) if rhonew happens to be <0. Instead guide the method by insisting on a positive value; print more warnings when the c2p_fail mask is set
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/GRHydro/trunk@101 c83d129a-5a75-4d5a-9c4d-ed3a5855bf45
Diffstat (limited to 'src')
-rw-r--r-- | src/Whisky_Con2Prim.F90 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Whisky_Con2Prim.F90 b/src/Whisky_Con2Prim.F90 index 0f462e8..d01dce9 100644 --- a/src/Whisky_Con2Prim.F90 +++ b/src/Whisky_Con2Prim.F90 @@ -358,7 +358,10 @@ subroutine Con2Prim_pt(handle, dens, sx, sy, sz, tau, rho, velx, vely, & if (c2p_reset_pressure .ne. 0) then pold = sqrt(s2 + c2p_reset_pressure_to_value) - utau - udens else + !$OMP CRITICAL + call CCTK_WARN(Whisky_NaN_verbose, "c2p failed and being told not to reset the pressure") whisky_C2P_failed = 1 + !$OMP END CRITICAL endif endif @@ -991,10 +994,14 @@ subroutine Con2Prim_ptPolytype(handle, dens, sx, sy, sz, tau, rho, & rhonew = rhoold - f/df if (rhonew .lt. 0.d0) then +#if 0 whisky_C2P_failed = 1 !$OMP CRITICAL call CCTK_WARN(Whisky_NaN_verbose, 'rhonew went below 0') !$OMP END CRITICAL +#else + rhonew = whisky_rho_min/100; +#endif end if !!$ Recalculate primitive variables and function @@ -2117,7 +2124,10 @@ subroutine Con2PrimPolytypeGeneral(CCTK_ARGUMENTS) !!$ If eps negative then complain vociferously - if (eps(i,j,k) .lt. 0.0d0) whisky_C2P_failed(i,j,k) = 1 + if (eps(i,j,k) .lt. 0.0d0) then + call CCTK_WARN(1, "c2p failed: eps went negative") + whisky_C2P_failed(i,j,k) = 1 + endif end do end do |