From b25529e2b2c9b2654886e3296e742f6bd272e509 Mon Sep 17 00:00:00 2001 From: Hongjian Fang Date: Thu, 28 Apr 2016 17:21:37 +0200 Subject: [PATCH] fix bug bug caused by severly varied layer depth, 'minthk' = layerthick / sublayernum, can be 1, 2 ,3 --- srcsmooth/CalSurfG.f90 | 4 +++- srcsparsity/CalSurfG.f90 | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/srcsmooth/CalSurfG.f90 b/srcsmooth/CalSurfG.f90 index aac7efc..287d288 100644 --- a/srcsmooth/CalSurfG.f90 +++ b/srcsmooth/CalSurfG.f90 @@ -2263,7 +2263,7 @@ ENDDO END SUBROUTINE bilinear - subroutine refineGrid2LayerMdl(minthk,mmax,dep,vp,vs,rho,& + subroutine refineGrid2LayerMdl(minthk0,mmax,dep,vp,vs,rho,& rmax,rdep,rvp,rvs,rrho,rthk) !!--------------------------------------------------------------------c !!refine grid based model to layerd based model @@ -2277,6 +2277,7 @@ END SUBROUTINE bilinear integer NL parameter (NL=200) integer mmax,rmax + real minthk0 real minthk real dep(*),vp(*),vs(*),rho(*) real rdep(NL),rvp(NL),rvs(NL),rrho(NL),rthk(NL) @@ -2288,6 +2289,7 @@ END SUBROUTINE bilinear initdep = 0.0 do i = 1, mmax-1 thk = dep(i+1)-dep(i) + minthk = thk/minthk0 nsublay(i) = int((thk+1.0e-4)/minthk) + 1 ngrid = nsublay(i)+1 newthk = thk/nsublay(i) diff --git a/srcsparsity/CalSurfG.f90 b/srcsparsity/CalSurfG.f90 index f01c262..50c441d 100644 --- a/srcsparsity/CalSurfG.f90 +++ b/srcsparsity/CalSurfG.f90 @@ -2266,7 +2266,7 @@ ENDDO END SUBROUTINE bilinear - subroutine refineGrid2LayerMdl(minthk,mmax,dep,vp,vs,rho,& + subroutine refineGrid2LayerMdl(minthk0,mmax,dep,vp,vs,rho,& rmax,rdep,rvp,rvs,rrho,rthk) !!--------------------------------------------------------------------c !!refine grid based model to layerd based model @@ -2281,6 +2281,7 @@ END SUBROUTINE bilinear parameter (NL=200) integer mmax,rmax real minthk + real minthk0 real dep(*),vp(*),vs(*),rho(*) real rdep(NL),rvp(NL),rvs(NL),rrho(NL),rthk(NL) integer nsublay(NL) @@ -2291,6 +2292,7 @@ END SUBROUTINE bilinear initdep = 0.0 do i = 1, mmax-1 thk = dep(i+1)-dep(i) + minthk = thk/minthk0 nsublay(i) = int((thk+1.0e-4)/minthk) + 1 ngrid = nsublay(i)+1 newthk = thk/nsublay(i)