aboutsummaryrefslogtreecommitdiff
path: root/src/EHFinder_FindSurface.F90
diff options
context:
space:
mode:
Diffstat (limited to 'src/EHFinder_FindSurface.F90')
-rw-r--r--src/EHFinder_FindSurface.F9016
1 files changed, 15 insertions, 1 deletions
diff --git a/src/EHFinder_FindSurface.F90 b/src/EHFinder_FindSurface.F90
index 8f1f1e7..bbd9521 100644
--- a/src/EHFinder_FindSurface.F90
+++ b/src/EHFinder_FindSurface.F90
@@ -46,8 +46,10 @@ subroutine EHFinder_FindSurface(CCTK_ARGUMENTS)
! the 3D grid functions.
#include "include/physical_part.h"
+! Initialize find_surface_status to 0. If something goes wrong it will be
+! set to -1.
+ find_surface_status = 0
sn = surface_counter - integrate_counter + 1
-
write(info_message,'(a26,i3)') 'Finding points on surface ',sn
call CCTK_INFO ( info_message )
@@ -461,6 +463,12 @@ subroutine EHFinder_FindSurface(CCTK_ARGUMENTS)
lsh(1) * lsh(2), CCTK_VARIABLE_REAL, &
interp_coords, 1, in_array, &
1, CCTK_VARIABLE_REAL, out_array(1) )
+ if ( status .lt. 0 ) then
+ call CCTK_INFO ( 'Interpolation failed. Giving up on finding surfaces' )
+ find_surface_status = -1
+ integrate_counter = integrate_counter - 1
+ return
+ end if
maxdr_loc = maxval ( drsurf )
call CCTK_ReduceLocScalar ( status, cctkGH, -1, max_handle, &
@@ -526,6 +534,12 @@ subroutine EHFinder_FindSurface(CCTK_ARGUMENTS)
lsh(1) * lsh(2), CCTK_VARIABLE_REAL, &
interp_coords, 1, in_array, &
4, out_types, out_array )
+ if ( status .lt. 0 ) then
+ call CCTK_INFO ( 'Interpolation failed. Giving up on finding surfaces' )
+ find_surface_status = -1
+ integrate_counter = integrate_counter - 1
+ return
+ end if
maxf_loc = maxval ( abs ( f_interp ) )
call CCTK_ReduceLocScalar ( status, cctkGH, -1, max_handle, &