small bug fixed

remove model estimation
This commit is contained in:
Hongjian Fang 2017-07-02 14:20:24 +08:00
parent 79282acedf
commit db87c3c9d8
5 changed files with 68 additions and 69 deletions

View File

@ -1,5 +1,5 @@
# #
# GMT-SYSTEM 4.5.9 [64-bit] Defaults file # GMT-SYSTEM 4.5.15 [64-bit] Defaults file
# #
#-------- Plot Media Parameters ------------- #-------- Plot Media Parameters -------------
PAGE_COLOR = white PAGE_COLOR = white

View File

@ -19,5 +19,3 @@ surfdataTB.dat c: data file
0 c: synthetic flag(0:real data,1:synthetic) 0 c: synthetic flag(0:real data,1:synthetic)
0.02 c: noiselevel 0.02 c: noiselevel
2.5 c: threshold 2.5 c: threshold
1 c: modest (1: estimate model variation, 0: no estimation)
30 c: number of random models

View File

@ -1145,7 +1145,8 @@ subroutine CalSurfG(nx,ny,nz,nparpi,vels,iw,rw,col,dsurf, &
do ig = 1,igroup do ig = 1,igroup
if (ig ==2 .and. wavetype(srcnum,knumi) == 2) then if (ig ==2 .and. wavetype(srcnum,knumi) == 2) then
velf(1:nx*ny) = pvRc(1:nx*ny,periods(srcnum,knumi)) velf(1:nx*ny) = pvRc(1:nx*ny,periods(srcnum,knumi))
else endif
if (ig ==2 .and. wavetype(srcnum,knumi) == 1) then
velf(1:nx*ny) = pvLc(1:nx*ny,periods(srcnum,knumi)) velf(1:nx*ny) = pvLc(1:nx*ny,periods(srcnum,knumi))
endif endif
call gridder(velf) call gridder(velf)

Binary file not shown.

View File

@ -218,8 +218,8 @@ program SurfTomo
read(10,*)ifsyn read(10,*)ifsyn
read(10,*)noiselevel read(10,*)noiselevel
read(10,*) threshold0 read(10,*) threshold0
read(10,*) modest ! read(10,*) modest
read(10,*) numrand ! read(10,*) numrand
close(10) close(10)
nrc=nsrc nrc=nsrc
kmax=kmaxRc+kmaxRg+kmaxLc+kmaxLg kmax=kmaxRc+kmaxRg+kmaxLc+kmaxLg
@ -607,69 +607,69 @@ program SurfTomo
close(nout) !close lsmr.txt close(nout) !close lsmr.txt
close(66) !close surf_tomo.log close(66) !close surf_tomo.log
! USE RANDOM MODEL TO OBTAIN THE MODEL VARIATION !! USE RANDOM MODEL TO OBTAIN THE MODEL VARIATION
!modest = 1 ! !modest = 1
if (modest ==1) then ! if (modest ==1) then
!
write(*,*) 'model variation estimation begin...' ! write(*,*) 'model variation estimation begin...'
do iter = 1,numrand ! do iter = 1,numrand
call init_random_seed() ! call init_random_seed()
vsftrue=vsf ! vsftrue=vsf
DO K=1,NZ-1 ! DO K=1,NZ-1
DO J=2,NY-1 ! DO J=2,NY-1
DO I=2,NX-1 ! DO I=2,NX-1
idx = (k-1)*(ny-2)*(nx-2)+(j-2)*(nx-2)+i-1 ! idx = (k-1)*(ny-2)*(nx-2)+(j-2)*(nx-2)+i-1
dv(idx) = 0.1/EXP(2*NORM(idx)/maxnorm)*gaussian() ! dv(idx) = 0.1/EXP(2*NORM(idx)/maxnorm)*gaussian()
VSFTRUE(I,J,K) = VSF(I,J,K)+dv(idx) ! VSFTRUE(I,J,K) = VSF(I,J,K)+dv(idx)
ENDDO ! ENDDO
ENDDO ! ENDDO
ENDDO ! ENDDO
write(*,*),'maximum and minimum velocity variation',maxval(dv),minval(dv) ! write(*,*),'maximum and minimum velocity variation',maxval(dv),minval(dv)
!
call synthetic(nx,ny,nz,maxvp,vsftrue,dsyn,& ! call synthetic(nx,ny,nz,maxvp,vsftrue,dsyn,&
goxd,gozd,dvxd,dvzd,kmaxRc,kmaxRg,kmaxLc,kmaxLg,& ! goxd,gozd,dvxd,dvzd,kmaxRc,kmaxRg,kmaxLc,kmaxLg,&
tRc,tRg,tLc,tLg,wavetype,igrt,periods,depz,minthk,& ! tRc,tRg,tLc,tLg,wavetype,igrt,periods,depz,minthk,&
scxf,sczf,rcxf,rczf,nrc1,nsrc1,kmax,& ! scxf,sczf,rcxf,rczf,nrc1,nsrc1,kmax,&
nsrc,nrc,0.0) ! nsrc,nrc,0.0)
!
do i = 1,dall ! do i = 1,dall
cbst(i) = obst(i) - dsyn(i) ! cbst(i) = obst(i) - dsyn(i)
enddo ! enddo
!
write(*,*), dnrm2(dall,cbst,1)/sqrt(real(dall)), 1.05*std_devs ! write(*,*), dnrm2(dall,cbst,1)/sqrt(real(dall)), 1.05*std_devs
if (dnrm2(dall,cbst,1)/sqrt(real(dall)) < 1.05*std_devs) then ! if (dnrm2(dall,cbst,1)/sqrt(real(dall)) < 1.05*std_devs) then
counte = counte + 1 ! counte = counte + 1
modstat(counte,:) = dv ! modstat(counte,:) = dv
endif ! endif
!
enddo ! iteration for random models ! enddo ! iteration for random models
!
write(*,*),'number of of models satisfy requirements',counte ! write(*,*),'number of of models satisfy requirements',counte
modsig = 1.0 ! modsig = 1.0
if (counte>0) then ! if (counte>0) then
do i=1,maxvp ! do i=1,maxvp
!statis ! !statis
!mean = sum(cbst(1:dall))/dall ! !mean = sum(cbst(1:dall))/dall
!std_devs = sqrt(sum(cbst(1:dall)**2)/dall - mean**2) ! !std_devs = sqrt(sum(cbst(1:dall)**2)/dall - mean**2)
mean = sum(modstat(1:counte,i))/counte ! mean = sum(modstat(1:counte,i))/counte
stdvs = sqrt(sum(modstat(1:counte,i)**2)/counte-mean**2) ! stdvs = sqrt(sum(modstat(1:counte,i)**2)/counte-mean**2)
modsig(i) = stdvs ! modsig(i) = stdvs
enddo ! enddo
endif ! endif
!
write(*,*),'write model variation to "model_variation.dat"' ! write(*,*),'write model variation to "model_variation.dat"'
open (64,file='model_variation.dat') ! open (64,file='model_variation.dat')
do k=1,nz-1 ! do k=1,nz-1
do j=1,ny-2 ! do j=1,ny-2
do i=1,nx-2 ! do i=1,nx-2
idx = (k-1)*(ny-2)*(nx-2)+(j-1)*(nx-2)+i ! idx = (k-1)*(ny-2)*(nx-2)+(j-1)*(nx-2)+i
write(64,'(5f8.4)') gozd+(j-1)*dvzd,goxd-(i-1)*dvxd,depz(k),modsig(idx) ! write(64,'(5f8.4)') gozd+(j-1)*dvzd,goxd-(i-1)*dvxd,depz(k),modsig(idx)
enddo ! enddo
enddo ! enddo
enddo ! enddo
close(64) ! close(64)
write(*,*) 'finishing model variation estimation' ! write(*,*) 'finishing model variation estimation'
endif ! endif