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

rhaas at tapir.caltech.edu rhaas at tapir.caltech.edu
Wed Mar 27 20:46:46 CDT 2013


User: rhaas
Date: 2013/03/27 08:46 PM

Modified:
 /trunk/src/
  GRHydro_HLLE.F90, GRHydro_HLLEM.F90, GRHydro_HLLE_AM.F90

Log:
 GRHydro: change CCTK_WARN(0,...) to CCTK_ERROR
 
 this should tell the compiler that the function never returns and help
 optimizing the code by indicating eg slow branches of if statements
 
 From: Roland Haas <rhaas at tapir.caltech.edu>

File Changes:

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

File [modified]: GRHydro_HLLE.F90
Delta lines: +10 -10
===================================================================
--- trunk/src/GRHydro_HLLE.F90	2013-03-28 01:46:42 UTC (rev 496)
+++ trunk/src/GRHydro_HLLE.F90	2013-03-28 01:46:46 UTC (rev 497)
@@ -216,7 +216,7 @@
     call SpaceMask_GetStateBits(trivial, "Hydro_RiemannProblemZ", &
          &"trivial")
   else
-    call CCTK_WARN(0, "Flux direction not x,y,z")
+    call CCTK_ERROR("Flux direction not x,y,z")
   end if
 
   if(evolve_temper.eq.1.and.reconstruct_temper.eq.1) then
@@ -272,7 +272,7 @@
            avg_beta = 0.5d0 * (beta3(i+xoffset,j+yoffset,k+zoffset) + &
                beta3(i,j,k))
         else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
          end if
 
         avg_alp = 0.5 * (alp(i,j,k) + alp(i+xoffset,j+yoffset,k+zoffset))
@@ -311,7 +311,7 @@
                  velzplus(i,j,k),pressplus(i,j,k),&
                  avg_det,avg_alp,avg_beta)
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
           
         else !!! The end of this branch is right at the bottom of the routine
@@ -327,7 +327,7 @@
           else if (flux_direction == 3) then
             usendh = uzzh
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
           
 !!$        Calculate the jumps in the conserved variables
@@ -498,7 +498,7 @@
                  pressminus(i+xoffset,j+yoffset,k+zoffset),&
                  avg_det,avg_alp,avg_beta)
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
 
 !!$        Compute H viscosity if requested
@@ -536,7 +536,7 @@
                            etaY(i,j-1,k, vup, eos_c),&
                            etaY(i,j-1,k+1, vup, eos_c))
             else
-              call CCTK_WARN(0, "Flux direction not x,y,z")
+              call CCTK_ERROR("Flux direction not x,y,z")
             end if
             
             ! modify eigenvalues of Roe's matrix by computed H viscosity
@@ -678,7 +678,7 @@
     call SpaceMask_GetStateBits(trivial, "Hydro_RiemannProblemZ", &
          &"trivial")
   else
-    call CCTK_WARN(0, "Flux direction not x,y,z")
+    call CCTK_ERROR("Flux direction not x,y,z")
   end if
 
   do k = GRHydro_stencil, cctk_lsh(3) - GRHydro_stencil
@@ -714,7 +714,7 @@
            avg_beta = 0.5d0 * (beta3(i+xoffset,j+yoffset,k+zoffset) + &
                beta3(i,j,k))
         else
-           call CCTK_WARN(0, "Flux direction not x,y,z")
+           call CCTK_ERROR("Flux direction not x,y,z")
         end if
 
         avg_alp = 0.5 * (alp(i,j,k) + alp(i+xoffset,j+yoffset,k+zoffset))
@@ -740,7 +740,7 @@
         else if (flux_direction == 3) then
           usendh = uzzh
         else
-          call CCTK_WARN(0, "Flux direction not x,y,z")
+          call CCTK_ERROR("Flux direction not x,y,z")
         end if
           
 !!$        Calculate the jumps in the conserved variables
@@ -813,7 +813,7 @@
           fminus(:) = (velzminus(i+xoffset,j+yoffset,k+zoffset) - avg_beta / avg_alp) * &
                cons_tracerminus(i+xoffset,j+yoffset,k+zoffset,:)
         else
-          call CCTK_WARN(0, "Flux direction not x,y,z")
+          call CCTK_ERROR("Flux direction not x,y,z")
         end if
         
 !!$        Find minimum and maximum wavespeeds

File [modified]: GRHydro_HLLEM.F90
Delta lines: +9 -9
===================================================================
--- trunk/src/GRHydro_HLLEM.F90	2013-03-28 01:46:42 UTC (rev 496)
+++ trunk/src/GRHydro_HLLEM.F90	2013-03-28 01:46:46 UTC (rev 497)
@@ -119,7 +119,7 @@
     call SpaceMask_GetStateBits(trivial, "Hydro_RiemannProblemZ", &
          &"trivial")
   else
-    call CCTK_WARN(0, "Flux direction not x,y,z")
+    call CCTK_ERROR("Flux direction not x,y,z")
   end if
 
   ! constraint transport needs to be able to average fluxes in the directions
@@ -229,7 +229,7 @@
         else if (flux_direction == 3) then
            avg_beta=avg_betaz
         else
-           call CCTK_WARN(0, "Flux direction not x,y,z")
+           call CCTK_ERROR("Flux direction not x,y,z")
         end if
 
         avg_alp = 0.5 * (alp(i,j,k) + alp(i+xoffset,j+yoffset,k+zoffset))
@@ -337,7 +337,7 @@
             endif
             
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
           
         else !!! The end of this branch is right at the bottom of the routine
@@ -349,7 +349,7 @@
           else if (flux_direction == 3) then
             usendh = uzzh
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
           
 !!$        Calculate the jumps in the conserved variables
@@ -541,7 +541,7 @@
             endif
 
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
        
    
@@ -779,7 +779,7 @@
     call SpaceMask_GetStateBits(trivial, "Hydro_RiemannProblemZ", &
          &"trivial")
   else
-    call CCTK_WARN(0, "Flux direction not x,y,z")
+    call CCTK_ERROR("Flux direction not x,y,z")
   end if
 
   do k = GRHydro_stencil, cctk_lsh(3) - GRHydro_stencil
@@ -840,7 +840,7 @@
            avg_beta = 0.5d0 * (beta3(i+xoffset,j+yoffset,k+zoffset) + &
                beta3(i,j,k))
         else
-           call CCTK_WARN(0, "Flux direction not x,y,z")
+           call CCTK_ERROR("Flux direction not x,y,z")
         end if
 
         avg_alp = 0.5 * (alp(i,j,k) + alp(i+xoffset,j+yoffset,k+zoffset))
@@ -865,7 +865,7 @@
         else if (flux_direction == 3) then
           usendh = uzzh
         else
-          call CCTK_WARN(0, "Flux direction not x,y,z")
+          call CCTK_ERROR("Flux direction not x,y,z")
         end if
 
 !!$        b^2 = (1-v^2)B^2+(B dot v)^2 
@@ -929,7 +929,7 @@
            fminus(:) = (velzminus(i+xoffset,j+yoffset,k+zoffset) - avg_beta / avg_alp) * &
                 cons_tracerminus(i+xoffset,j+yoffset,k+zoffset,:)
         else
-           call CCTK_WARN(0, "Flux direction not x,y,z")
+           call CCTK_ERROR("Flux direction not x,y,z")
         end if
         
 !!$        Find minimum and maximum wavespeeds

File [modified]: GRHydro_HLLE_AM.F90
Delta lines: +9 -9
===================================================================
--- trunk/src/GRHydro_HLLE_AM.F90	2013-03-28 01:46:42 UTC (rev 496)
+++ trunk/src/GRHydro_HLLE_AM.F90	2013-03-28 01:46:46 UTC (rev 497)
@@ -117,7 +117,7 @@
     call SpaceMask_GetStateBits(trivial, "Hydro_RiemannProblemZ", &
          &"trivial")
   else
-    call CCTK_WARN(0, "Flux direction not x,y,z")
+    call CCTK_ERROR("Flux direction not x,y,z")
   end if
 
   ! constraint transport needs to be able to average fluxes in the directions
@@ -217,7 +217,7 @@
         else if (flux_direction == 3) then
            avg_beta=avg_betaz
         else
-           call CCTK_WARN(0, "Flux direction not x,y,z")
+           call CCTK_ERROR("Flux direction not x,y,z")
         end if
 
         avg_alp = 0.5 * (alp(i,j,k) + alp(i+xoffset,j+yoffset,k+zoffset))
@@ -316,7 +316,7 @@
             endif
             
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
           
         else !!! The end of this branch is right at the bottom of the routine
@@ -328,7 +328,7 @@
           else if (flux_direction == 3) then
             usendh = uzzh
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
           
 !!$        Calculate the jumps in the conserved variables
@@ -505,7 +505,7 @@
             endif
 
           else
-            call CCTK_WARN(0, "Flux direction not x,y,z")
+            call CCTK_ERROR("Flux direction not x,y,z")
           end if
        
    
@@ -736,7 +736,7 @@
     call SpaceMask_GetStateBits(trivial, "Hydro_RiemannProblemZ", &
          &"trivial")
   else
-    call CCTK_WARN(0, "Flux direction not x,y,z")
+    call CCTK_ERROR("Flux direction not x,y,z")
   end if
 
   do k = GRHydro_stencil, cctk_lsh(3) - GRHydro_stencil
@@ -797,7 +797,7 @@
            avg_beta = 0.5d0 * (beta3(i+xoffset,j+yoffset,k+zoffset) + &
                beta3(i,j,k))
         else
-           call CCTK_WARN(0, "Flux direction not x,y,z")
+           call CCTK_ERROR("Flux direction not x,y,z")
         end if
 
         avg_alp = 0.5 * (alp(i,j,k) + alp(i+xoffset,j+yoffset,k+zoffset))
@@ -822,7 +822,7 @@
         else if (flux_direction == 3) then
           usendh = uzzh
         else
-          call CCTK_WARN(0, "Flux direction not x,y,z")
+          call CCTK_ERROR("Flux direction not x,y,z")
         end if
 
 !!$        b^2 = (1-v^2)B^2+(B dot v)^2 
@@ -886,7 +886,7 @@
            fminus(:) = (velzminus(i+xoffset,j+yoffset,k+zoffset) - avg_beta / avg_alp) * &
                 cons_tracerminus(i+xoffset,j+yoffset,k+zoffset,:)
         else
-           call CCTK_WARN(0, "Flux direction not x,y,z")
+           call CCTK_ERROR("Flux direction not x,y,z")
         end if
         
 !!$        Find minimum and maximum wavespeeds



More information about the Commits mailing list