diff options
author | diener <diener@2a26948c-0e4f-0410-aee8-f1d3e353619c> | 2003-09-30 09:03:44 +0000 |
---|---|---|
committer | diener <diener@2a26948c-0e4f-0410-aee8-f1d3e353619c> | 2003-09-30 09:03:44 +0000 |
commit | be12e621fe75e9b7fabfe531c6f03dabf98882ad (patch) | |
tree | 071a6cf23381184ed2b75da25abef18f5fc38bd4 /src/EHFinder_Check.F90 | |
parent | a18a0d30a72672b037362064cad51c5ff6f503fc (diff) |
Preparing for release. Added comments, deleted obsolete pieces of code, fixed
a few bugs.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/EHFinder/trunk@143 2a26948c-0e4f-0410-aee8-f1d3e353619c
Diffstat (limited to 'src/EHFinder_Check.F90')
-rw-r--r-- | src/EHFinder_Check.F90 | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/EHFinder_Check.F90 b/src/EHFinder_Check.F90 index 22b3703..1fd07d4 100644 --- a/src/EHFinder_Check.F90 +++ b/src/EHFinder_Check.F90 @@ -17,7 +17,7 @@ subroutine EHFinder_ReInitialize_Check(CCTK_ARGUMENTS) DECLARE_CCTK_FUNCTIONS CCTK_INT :: i, j, k, l - CCTK_REAL :: fmin_extremum, fmin_extremum_loc, fmax_loc, fmin_bound_loc + CCTK_REAL :: fmin_extremum, fmin_extremum_loc, fmax_loc character(len=128) :: info_message logical :: check_re_init CCTK_INT, dimension(3) :: ex_loc @@ -45,15 +45,20 @@ subroutine EHFinder_ReInitialize_Check(CCTK_ARGUMENTS) ! values in the extremum. fmax_loc = zero +! On the local processor find the maximum value of f and the maximum value +! of f in any local extrema where f is negative. fmin_extremum_loc = ex_value do k = kzl, kzr do j = jyl, jyr do i = ixl, ixr fmax_loc = max ( f(i,j,k,l), fmax_loc ) if ( f(i,j,k,l) .lt. zero ) then - if ( ( (f(i,j,k,l)-f(i-1,j,k,l))*(f(i+1,j,k,l)-f(i,j,k,l)).le.zero ).and. & - ( (f(i,j,k,l)-f(i,j-1,k,l))*(f(i,j+1,k,l)-f(i,j,k,l)).le.zero ).and. & - ( (f(i,j,k,l)-f(i,j,k-1,l))*(f(i,j,k+1,l)-f(i,j,k,l)).le.zero ) ) then + if ( ( (f(i,j,k,l) - f(i-1,j,k,l)) * & + (f(i+1,j,k,l) - f(i,j,k,l)) .le. zero ) .and. & + ( (f(i,j,k,l) - f(i,j-1,k,l)) * & + (f(i,j+1,k,l) - f(i,j,k,l)) .le. zero ) .and. & + ( (f(i,j,k,l) - f(i,j,k-1,l)) * & + (f(i,j,k+1,l) - f(i,j,k,l)) .le. zero ) ) then fmin_extremum_loc = max ( f(i,j,k,l), fmin_extremum_loc ) end if end if @@ -61,6 +66,7 @@ subroutine EHFinder_ReInitialize_Check(CCTK_ARGUMENTS) end do end do +! Maximum reduction over all processors. call CCTK_ReduceLocScalar ( ierr, cctkGH, -1, max_handle, & fmin_extremum_loc, fmin_extremum, CCTK_VARIABLE_REAL ) @@ -68,15 +74,18 @@ subroutine EHFinder_ReInitialize_Check(CCTK_ARGUMENTS) call CCTK_WARN(0,'Reduction of fmax_extremum failed') end if +! Write an info message about the local extremum. write(info_message,'(a39,i3,a6,f12.5)') & 'Minimum f at the extrema for level set ', l, ' is : ',fmin_extremum call CCTK_INFO(info_message) +! If the local extremum indicate and imminent pinch off undo the +! re-initialization if this is requested by the user. if ( re_init_undo .gt. 0 ) then if ( fmin_extremum .gt. -two * minval(cctk_delta_space) ) then - write(info_message,'(a45,i3,a6,f12.5)') & + write(info_message,'(a45,i3,a33)') & 'Re-initialization of level set ', l, & - 'undone due to imminent pinch-off' + ' undone due to imminent pinch-off' call CCTK_INFO(info_message) f(:,:,:,l) = fbak(:,:,:,l) eh_mask(:,:,:,l) = eh_mask_bak(:,:,:,l) |