[cig-commits] [commit] devel: includes a fall-back option in model interpolation (58c92bd)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Nov 25 06:56:14 PST 2014
Repository : https://github.com/geodynamics/specfem3d_globe
On branch : devel
Link : https://github.com/geodynamics/specfem3d_globe/compare/0e5b55c6f30be94583639fd325373eecd6facc6d...8be3e0b0267c8d4cf5af3bc26e8903da17bc4fd1
>---------------------------------------------------------------
commit 58c92bd3eb3ce62bccfcb376db053b63f2aaa41c
Author: daniel peter <peterda at ethz.ch>
Date: Sun Nov 9 15:50:07 2014 +0100
includes a fall-back option in model interpolation
>---------------------------------------------------------------
58c92bd3eb3ce62bccfcb376db053b63f2aaa41c
src/tomography/interpolate_model.F90 | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/tomography/interpolate_model.F90 b/src/tomography/interpolate_model.F90
index ee78e19..a0d3279 100644
--- a/src/tomography/interpolate_model.F90
+++ b/src/tomography/interpolate_model.F90
@@ -1111,6 +1111,9 @@
! special case for elements
! e.g. around 410-km discontinuity and surface (due to moho-stretching) where internal topography distorts meshes
logical,parameter :: DO_SPECIAL_SEPARATION = .true.
+
+ ! use closest point value in case of large differences
+ logical,parameter :: USE_FALLBACK = .false.
!------------------------------------------------------
! checks given ispec
@@ -1315,6 +1318,17 @@
nspec_max_old,model1(:,:,:,:,iker,rank_selected), &
val,xigll,yigll,zigll)
+ ! note: interpolation of values close to the surface or 3D moho encounters problems;
+ ! this is a fall-back to the closest point value
+ !
+ ! uses closest point value if too far off (by more than 5%)
+ if (USE_FALLBACK) then
+ val_initial = model1(i_selected,j_selected,k_selected,ispec_selected,iker,rank_selected)
+ if (abs(val - val_initial ) > abs( 0.05 * val_initial ) ) then
+ val = val_initial
+ endif
+ endif
+
! sets new model value
model2(i,j,k,ispec,iker) = val
enddo
@@ -1345,9 +1359,11 @@
!stop 'Error model value invalid'
endif
endif
+
! debug
!if (myrank == 0 .and. iglob < 100) &
! print*,'new model ',iker,': value ',val,'initial ',val_initial,'diff ',(val - val_initial)/val_initial*100.0,'(%)'
+
enddo
enddo
More information about the CIG-COMMITS
mailing list