[Commits] [svn:einsteintoolkit] GRHydro/trunk/src/ (Rev. 541)

rhaas at tapir.caltech.edu rhaas at tapir.caltech.edu
Sat Jul 6 13:10:12 CDT 2013


User: rhaas
Date: 2013/07/06 01:10 PM

Modified:
 /trunk/src/
  GRHydro_Prim2Con.F90

Log:
 GRHydro: limit temperature to valid range in prim2con
 
 add some more error checking
 
 From: Christian David Ott <cott at zwicky-b.(none)>

File Changes:

Directory: /trunk/src/
======================

File [modified]: GRHydro_Prim2Con.F90
Delta lines: +45 -3
===================================================================
--- trunk/src/GRHydro_Prim2Con.F90	2013-07-06 18:10:08 UTC (rev 540)
+++ trunk/src/GRHydro_Prim2Con.F90	2013-07-06 18:10:12 UTC (rev 541)
@@ -322,14 +322,56 @@
        *dvelz*dvelz + 2*gxy*dvelx*dvely + 2*gxz*dvelx *dvelz + 2*gyz&
        *dvely*dvelz))  
 
+  ! make sure Y_e and temperature within allowed range
   ye = max(min(ye,GRHydro_Y_e_max),GRHydro_Y_e_min)
+  temp = max(GRHydro_hot_atmo_temp,min(temp,GRHydro_max_temp))
 
   call EOS_Omni_press(handle,lkeytemp,GRHydro_eos_rf_prec,n,&
        drho,deps,temp,ye,dpress,keyerr,anyerr)  
   ! error handling
   if(anyerr.ne.0) then
      if(reconstruct_temper.ne.0) then
-
+        if(keytemp.eq.1) then
+           !$OMP CRITICAL
+           call CCTK_WARN(1,"EOS error in prim2con_hot:")
+           write(warnline,"(i8,4i5,1P10E15.6)") cctk_iteration,GRHydro_Reflevel,ii,jj,kk,x,y,z,r
+           call CCTK_WARN(1,warnline)
+           write(warnline,"(1P10E15.6)") drho,deps,temp,ye
+           call CCTK_WARN(1,warnline)
+           write(warnline,"(A7,i8,A10,i8)") "keyerr: ",keyerr(1)," keytemp:",lkeytemp
+           call CCTK_WARN(0,warnline)
+           !$OMP END CRITICAL
+        else
+           if(keyerr(1).eq.668 .and. temp(1).lt.10.0d0) then
+              !$OMP CRITICAL
+              write(warnline,"(A18,i7,4i4,1P10E15.6)") "p2c resetting T: ",cctk_iteration, &
+                   GRHydro_reflevel,ii,jj,kk,drho,deps,temp,ye
+              call CCTK_WARN(1,warnline)
+              !$OMP END CRITICAL
+              temp = GRHydro_hot_atmo_temp
+              lkeytemp = 1
+              call EOS_Omni_press(handle,lkeytemp,GRHydro_eos_rf_prec,n,&
+                   drho,deps,temp,ye,dpress,keyerr,anyerr)  
+              lkeytemp = 0
+              if(anyerr.ne.0) then
+                 !$OMP CRITICAL
+                 write(warnline,"(A7,i8,A10,i8)") "keyerr: ",keyerr(1)," keytemp:",lkeytemp
+                 call CCTK_WARN(1,warnline)
+                 call CCTK_WARN(0,"Fatal EOS error in p2c!")
+                 !$OMP END CRITICAL
+              endif
+           else
+              !$OMP CRITICAL
+              call CCTK_WARN(1,"EOS error in prim2con_hot:")
+              write(warnline,"(i8,4i5,1P10E15.6)") cctk_iteration,GRHydro_Reflevel,ii,jj,kk,x,y,z,r
+              call CCTK_WARN(1,warnline)
+              write(warnline,"(1P10E15.6)") drho,deps,temp,ye
+              call CCTK_WARN(1,warnline)
+              write(warnline,"(A7,i8,A10,i8)") "keyerr: ",keyerr(1)," keytemp:",lkeytemp
+              call CCTK_WARN(0,warnline)
+              !$OMP END CRITICAL
+           endif
+        endif
      else
         if(GRHydro_reflevel.lt.GRHydro_c2p_warn_from_reflevel) then
            ! in this case (coarse grid error that is hopefully restricted
@@ -341,7 +383,7 @@
            lkeytemp=0
            if(anyerr.ne.0) then
               !$OMP CRITICAL
-              call CCTK_WARN(1,"EOS error in prim2con_hot: lev 2")
+              call CCTK_WARN(1,"EOS error in prim2con_hot:")
               write(warnline,"(i8,3i5,1P10E15.6)") cctk_iteration,ii,jj,kk,x,y,z,r
               call CCTK_WARN(1,warnline)
               write(warnline,"(1P10E15.6)") drho,deps,temp,ye
@@ -391,7 +433,7 @@
         endif
      endif
   endif
-
+  
   vlowx = gxx*dvelx + gxy*dvely + gxz*dvelz
   vlowy = gxy*dvelx + gyy*dvely + gyz*dvelz
   vlowz = gxz*dvelx + gyz*dvely + gzz*dvelz



More information about the Commits mailing list