diff options
author | knarf <knarf@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45> | 2010-04-06 19:36:40 +0000 |
---|---|---|
committer | knarf <knarf@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45> | 2010-04-06 19:36:40 +0000 |
commit | 958e330232906ff86d44e19e48bb1c65f4384729 (patch) | |
tree | 61b90f3860645856feb352d097c9a988fae48522 /src | |
parent | 55e42caa20dc5e49fa85c53eb7a71ec77131df27 (diff) |
openmp and a bit of cleanup for Conservative2Primitive()
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/GRHydro/trunk@100 c83d129a-5a75-4d5a-9c4d-ed3a5855bf45
Diffstat (limited to 'src')
-rw-r--r-- | src/Whisky_Con2Prim.F90 | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/src/Whisky_Con2Prim.F90 b/src/Whisky_Con2Prim.F90 index 19d9a5c..0f462e8 100644 --- a/src/Whisky_Con2Prim.F90 +++ b/src/Whisky_Con2Prim.F90 @@ -167,9 +167,8 @@ subroutine Conservative2Primitive(CCTK_ARGUMENTS) pmin = EOS_Pressure(whisky_polytrope_handle, whisky_rho_min, 1.0d0) epsmin = EOS_SpecificIntEnergy(whisky_polytrope_handle, whisky_rho_min, pmin) -!!$ do k = whisky_stencil + 1, nz - whisky_stencil -!!$ do j = whisky_stencil + 1, ny - whisky_stencil -!!$ do i = whisky_stencil + 1, nx - whisky_stencil + !$OMP PARALLEL DO PRIVATE(i,j,itracer,& + !$OMP uxx, uxy, uxz, uyy, uyz, uzz, det, psi4pt, epsnegative) do k = 1, nz do j = 1, ny do i = 1, nx @@ -241,6 +240,7 @@ subroutine Conservative2Primitive(CCTK_ARGUMENTS) if (epsnegative) then +#if 1 ! cott 2010/03/30: ! Set point to atmosphere, but continue evolution -- this is better than using ! the poly EOS -- it will lead the code to crash if this happens inside a (neutron) star, @@ -272,9 +272,7 @@ subroutine Conservative2Primitive(CCTK_ARGUMENTS) ! w_lorentz=1, so the expression for tau reduces to: tau(i,j,k) = sqrt(det) * (rho(i,j,k)+rho(i,j,k)*eps(i,j,k)) - dens(i,j,k) - - -#if 0 +#else ! cott 2010/03/27: ! Honestly, this should never happen. We need to flag the point where ! this happened as having led to failing con2prim. @@ -290,42 +288,11 @@ subroutine Conservative2Primitive(CCTK_ARGUMENTS) z(i,j,k), r(i,j,k),whisky_rho_min, whisky_reflevel, whisky_C2P_failed(i,j,k)) #endif - end if - - if (eps(i,j,k) .lt. 0.0d0) then - - whisky_C2P_failed(i,j,k) = 1 - - !$OMP CRITICAL - call CCTK_WARN(1, 'Specific internal energy just went below 0! ') - write(warnline,'(a28,i2)') 'on carpet reflevel: ',whisky_reflevel - call CCTK_WARN(1,warnline) - write(warnline,'(a20,3g16.7)') 'xyz location: ',& - x(i,j,k),y(i,j,k),z(i,j,k) - call CCTK_WARN(1,warnline) - write(warnline,'(a20,g16.7)') 'radius: ',r(i,j,k) - call CCTK_WARN(1,warnline) - call CCTK_WARN(1,"Setting the point to atmosphere") - !$OMP END CRITICAL - - ! for safety, let's set the point to atmosphere - dens(i,j,k) = sqrt(det)*whisky_rho_min !/(1.d0+whisky_atmo_tolerance) - rho(i,j,k) = whisky_rho_min - scon(i,j,k,:) = 0.d0 - vel(i,j,k,:) = 0.d0 - w_lorentz(i,j,k) = 1.d0 - press(i,j,k) = EOS_Pressure(whisky_polytrope_handle, rho(i,j,k), eps(i,j,k)) - eps(i,j,k) = EOS_SpecificIntEnergy(whisky_polytrope_handle, rho(i,j,k), press(i,j,k)) - ! w_lorentz=1, so the expression for tau reduces to: - tau(i,j,k) = sqrt(det) * (rho(i,j,k)+rho(i,j,k)*eps(i,j,k)) - dens(i,j,k) - - end if - - end do end do end do + !$OMP END PARALLEL DO return |