Commit 14beb822 authored by fabian.kuehn's avatar fabian.kuehn

Added Reverse Time Migration (RTM)

parent 04ca7c45
This diff is collapsed.
...@@ -19,19 +19,19 @@ EXEC= ../bin ...@@ -19,19 +19,19 @@ EXEC= ../bin
# LINUX with OpenMPI / IntelMPI and INTEL Compiler # LINUX with OpenMPI / IntelMPI and INTEL Compiler
# Use icc whenever possible, this will be much faster than gcc # Use icc whenever possible, this will be much faster than gcc
#CC=mpiicc
#LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++
#CFLAGS=-O3
#SFLAGS=-L./../contrib/libcseife -L./../contrib/bin
#IFLAGS=-I./../contrib/libcseife -I./../contrib/header -I.
# LINUX with OpenMPI / IntelMPI and GCC Compiler
CC=mpicc CC=mpicc
LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++ LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++
CFLAGS=-O3 CFLAGS=-O3
SFLAGS=-L./../contrib/libcseife -L./../contrib/bin SFLAGS=-L./../contrib/libcseife -L./../contrib/bin
IFLAGS=-I./../contrib/libcseife -I./../contrib/header -I. IFLAGS=-I./../contrib/libcseife -I./../contrib/header -I.
# LINUX with OpenMPI / IntelMPI and GCC Compiler
#CC=mpicc
#LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lstdc++
#CFLAGS=-O3
#SFLAGS=-L./../contrib/libcseife -L./../contrib/bin
#IFLAGS=-I./../contrib/libcseife -I./../contrib/header -I.
ifeq ($(TERM_PROGRAM),Apple_Terminal) ifeq ($(TERM_PROGRAM),Apple_Terminal)
LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lc++ LFLAGS=-lm -lcseife -lstfinv -laff -lfourierxx -lfftw3 -lc++
CC=mpicc CC=mpicc
...@@ -70,7 +70,6 @@ IFOS2D= \ ...@@ -70,7 +70,6 @@ IFOS2D= \
IFOS2D.c \ IFOS2D.c \
stf.c \ stf.c \
window_cos.c \ window_cos.c \
alloc_sections.c \
calc_mat_change_test.c \ calc_mat_change_test.c \
calc_res.c \ calc_res.c \
calc_misfit.c \ calc_misfit.c \
...@@ -206,4 +205,4 @@ clean: ...@@ -206,4 +205,4 @@ clean:
install: clean all install: clean all
-include $(IFOS_OBJ:.o=.d) -include $(IFOS_OBJ:.o=.d)
\ No newline at end of file
/*-----------------------------------------------------------------------------------------
* Copyright (C) 2016 For the list of authors, see file AUTHORS.
*
* This file is part of IFOS.
*
* IFOS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2.0 of the License only.
*
* IFOS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/
/* Computation of local source coordinates
*
*
*/
#include "fd.h"
void alloc_sections(int ntr,int ns,float ***sectionvx,float ***sectionvy,float ***sectionvz,float ***sectionp,float ***sectionpnp1,float ***sectionpn,float ***sectioncurl,float ***sectiondiv,
float ***sectionpdata,float ***sectionpdiff,float ***sectionpdiffold,float ***sectionvxdata,float ***sectionvxdiff,float ***sectionvxdiffold,float ***sectionvydata,
float ***sectionvydiff,float ***sectionvydiffold,float ***sectionvzdata,float ***sectionvzdiff,float ***sectionvzdiffold)
{
extern int SEISMO, WAVETYPE;
extern FILE *FP;
switch (SEISMO){
case 1 : /* particle velocities only */
switch (WAVETYPE) {
case 1:
*sectionvx=matrix(1,ntr,1,ns);
*sectionvy=matrix(1,ntr,1,ns);
break;
case 2:
*sectionvz=matrix(1,ntr,1,ns);
break;
case 3:
*sectionvx=matrix(1,ntr,1,ns);
*sectionvy=matrix(1,ntr,1,ns);
*sectionvz=matrix(1,ntr,1,ns);
break;
}
break;
case 2 : /* pressure only */
*sectionp=matrix(1,ntr,1,ns);
*sectionpnp1=matrix(1,ntr,1,ns);
*sectionpn=matrix(1,ntr,1,ns);
break;
case 3 : /* curl and div only */
*sectioncurl=matrix(1,ntr,1,ns);
*sectiondiv=matrix(1,ntr,1,ns);
break;
case 4 : /* everything */
switch (WAVETYPE) {
case 1:
*sectionvx=matrix(1,ntr,1,ns);
*sectionvy=matrix(1,ntr,1,ns);
break;
case 2:
*sectionvz=matrix(1,ntr,1,ns);
break;
case 3:
*sectionvx=matrix(1,ntr,1,ns);
*sectionvy=matrix(1,ntr,1,ns);
*sectionvz=matrix(1,ntr,1,ns);
break;
}
*sectioncurl=matrix(1,ntr,1,ns);
*sectiondiv=matrix(1,ntr,1,ns);
*sectionp=matrix(1,ntr,1,ns);
break;
case 5 : /* everything except curl and div*/
switch (WAVETYPE) {
case 1:
*sectionvx=matrix(1,ntr,1,ns);
*sectionvy=matrix(1,ntr,1,ns);
break;
case 2:
*sectionvz=matrix(1,ntr,1,ns);
break;
case 3:
*sectionvx=matrix(1,ntr,1,ns);
*sectionvy=matrix(1,ntr,1,ns);
*sectionvz=matrix(1,ntr,1,ns);
break;
}
*sectionp=matrix(1,ntr,1,ns);
break;
}
*sectionpdata=matrix(1,ntr,1,ns);
*sectionpdiff=matrix(1,ntr,1,ns);
*sectionpdiffold=matrix(1,ntr,1,ns);
switch (WAVETYPE) {
case 1:
*sectionvxdata=matrix(1,ntr,1,ns);
*sectionvxdiff=matrix(1,ntr,1,ns);
*sectionvxdiffold=matrix(1,ntr,1,ns);
*sectionvydata=matrix(1,ntr,1,ns);
*sectionvydiff=matrix(1,ntr,1,ns);
*sectionvydiffold=matrix(1,ntr,1,ns);
break;
case 2:
*sectionvzdata=matrix(1,ntr,1,ns);
*sectionvzdiff=matrix(1,ntr,1,ns);
*sectionvzdiffold=matrix(1,ntr,1,ns);
break;
case 3:
*sectionvxdata=matrix(1,ntr,1,ns);
*sectionvxdiff=matrix(1,ntr,1,ns);
*sectionvxdiffold=matrix(1,ntr,1,ns);
*sectionvydata=matrix(1,ntr,1,ns);
*sectionvydiff=matrix(1,ntr,1,ns);
*sectionvydiffold=matrix(1,ntr,1,ns);
*sectionvzdata=matrix(1,ntr,1,ns);
*sectionvzdiff=matrix(1,ntr,1,ns);
*sectionvzdiffold=matrix(1,ntr,1,ns);
break;
}
}
void dealloc_sections(int ntr,int ns,int **recpos_loc,float **sectionvx,float **sectionvy,float **sectionvz,float **sectionp,float **sectionpnp1,float **sectionpn,float **sectioncurl,float **sectiondiv,
float **sectionpdata,float **sectionpdiff,float **sectionpdiffold,float **sectionvxdata,float **sectionvxdiff,float **sectionvxdiffold,float **sectionvydata,
float **sectionvydiff,float **sectionvydiffold,float **sectionvzdata,float **sectionvzdiff,float **sectionvzdiffold)
{
extern int SEISMO, WAVETYPE;
extern FILE *FP;
free_imatrix(recpos_loc,1,3,1,ntr);
switch (SEISMO){
case 1 : /* particle velocities only */
if (WAVETYPE==1 || WAVETYPE==3) {
free_matrix(sectionvx,1,ntr,1,ns);
free_matrix(sectionvy,1,ntr,1,ns);
}
if (WAVETYPE==2 || WAVETYPE==3) {
free_matrix(sectionvz,1,ntr,1,ns);
}
break;
case 2 : /* pressure only */
if (WAVETYPE==1 || WAVETYPE==3) {
free_matrix(sectionp,1,ntr,1,ns);
free_matrix(sectionpn,1,ntr,1,ns);
free_matrix(sectionpnp1,1,ntr,1,ns);
}
break;
case 3 : /* curl and div only */
if (WAVETYPE==1 || WAVETYPE==3) {
free_matrix(sectioncurl,1,ntr,1,ns);
free_matrix(sectiondiv,1,ntr,1,ns);
}
break;
case 4 : /* everything */
if (WAVETYPE==1 || WAVETYPE==3) {
free_matrix(sectionvx,1,ntr,1,ns);
free_matrix(sectionvy,1,ntr,1,ns);
free_matrix(sectionp,1,ntr,1,ns);
free_matrix(sectioncurl,1,ntr,1,ns);
free_matrix(sectiondiv,1,ntr,1,ns);
}
if (WAVETYPE==2 || WAVETYPE==3) {
free_matrix(sectionvz,1,ntr,1,ns);
}
break;
case 5 : /* everything except curl and div */
if (WAVETYPE==1 || WAVETYPE==3) {
free_matrix(sectionvx,1,ntr,1,ns);
free_matrix(sectionvy,1,ntr,1,ns);
free_matrix(sectionp,1,ntr,1,ns);
}
if (WAVETYPE==2 || WAVETYPE==3) {
free_matrix(sectionvz,1,ntr,1,ns);
}
break;
}
if (WAVETYPE==1 || WAVETYPE==3) {
free_matrix(sectionvxdata,1,ntr,1,ns);
free_matrix(sectionvxdiff,1,ntr,1,ns);
free_matrix(sectionvydata,1,ntr,1,ns);
free_matrix(sectionvydiff,1,ntr,1,ns);
free_matrix(sectionvydiffold,1,ntr,1,ns);
free_matrix(sectionvxdiffold,1,ntr,1,ns);
free_matrix(sectionpdata,1,ntr,1,ns);
free_matrix(sectionpdiff,1,ntr,1,ns);
free_matrix(sectionpdiffold,1,ntr,1,ns);
}
if (WAVETYPE==2 || WAVETYPE==3) {
free_matrix(sectionvzdata,1,ntr,1,ns);
free_matrix(sectionvzdiff,1,ntr,1,ns);
free_matrix(sectionvzdiffold,1,ntr,1,ns);
}
}
\ No newline at end of file
...@@ -31,14 +31,12 @@ void apply_workflow(float ** workflow,int workflow_lines,char workflow_header[ST ...@@ -31,14 +31,12 @@ void apply_workflow(float ** workflow,int workflow_lines,char workflow_header[ST
/* extern variables */ /* extern variables */
extern int INV_RHO_ITER,INV_VS_ITER,INV_VP_ITER; extern int INV_RHO_ITER,INV_VS_ITER,INV_VP_ITER;
extern int TIME_FILT,MYID; extern int TIME_FILT,MYID;
extern float F_HIGH_PASS;
extern float PRO; extern float PRO;
extern int WAVETYPE; extern int WAVETYPE;
extern float JOINT_INVERSION_PSV_SH_ALPHA_VS; extern float JOINT_INVERSION_PSV_SH_ALPHA_VS;
extern float JOINT_INVERSION_PSV_SH_ALPHA_RHO; extern float JOINT_INVERSION_PSV_SH_ALPHA_RHO;
extern int EPRECOND; extern int EPRECOND;
extern float EPSILON_WE; extern float EPSILON_WE;
extern float GAMMA;
extern int GRAD_METHOD; extern int GRAD_METHOD;
extern int WORKFLOW_STAGE; extern int WORKFLOW_STAGE;
...@@ -90,49 +88,44 @@ void apply_workflow(float ** workflow,int workflow_lines,char workflow_header[ST ...@@ -90,49 +88,44 @@ void apply_workflow(float ** workflow,int workflow_lines,char workflow_header[ST
PRO=workflow[WORKFLOW_STAGE][5]; PRO=workflow[WORKFLOW_STAGE][5];
/* Frequency filtering */ /* Frequency filtering */
if( TIME_FILT == 1 ) { if(TIME_FILT==1) {
TIME_FILT=workflow[WORKFLOW_STAGE][6]; TIME_FILT=workflow[WORKFLOW_STAGE][6];
if(*F_LOW_PASS>workflow[WORKFLOW_STAGE][7]&&(workflow[WORKFLOW_STAGE][6]>0)) {
if( TIME_FILT > 0 ) { if(MYID==0)printf("\n Due to the abort criteriom F_LOW_PASS is already higher than specified in workflow\n");
if( F_HIGH_PASS != workflow[WORKFLOW_STAGE][7] ) *LBFGS_iter_start=*iter; if(MYID==0)printf(" therefore instead of %.2f HZ F_LOW_PASS=%.2f HZ is used\n",workflow[WORKFLOW_STAGE][7],*F_LOW_PASS);
F_HIGH_PASS=workflow[WORKFLOW_STAGE][7]; } else {
if(*F_LOW_PASS!=workflow[WORKFLOW_STAGE][7]) *LBFGS_iter_start=*iter;
if( *F_LOW_PASS != workflow[WORKFLOW_STAGE][8] ) *LBFGS_iter_start=*iter; *F_LOW_PASS=workflow[WORKFLOW_STAGE][7];
*F_LOW_PASS=workflow[WORKFLOW_STAGE][8];
} }
} else { } else {
if(MYID==0&&(workflow[WORKFLOW_STAGE][6]>0))printf("\n TIME_FILT cannot be activated due to it is not activated in the JSON File \n"); if(MYID==0&&(workflow[WORKFLOW_STAGE][6]>0))printf("\n TIME_FILT cannot be activated due to it is not activated in the JSON File \n");
} }
/* Change of wavetype */ /* Change of wavetype */
if(wavetype_start!=3&&(WAVETYPE!=workflow[WORKFLOW_STAGE][9])){ if(wavetype_start!=3&&(WAVETYPE!=workflow[WORKFLOW_STAGE][8])){
if(MYID==0)printf("\n Sorry, change of WAVETYPE with workflow only possible if WAVETYPE==3 in *.json"); if(MYID==0)printf("\n Sorry, change of WAVETYPE with workflow only possible if WAVETYPE==3 in *.json");
if(MYID==0)printf("\n WAVETYPE will remain unchanged %i",WAVETYPE); if(MYID==0)printf("\n WAVETYPE will remain unchanged %i",WAVETYPE);
} else { } else {
/* detect change and reset some things */ /* detect change and reset some things */
if(WAVETYPE!=workflow[WORKFLOW_STAGE][9]) { if(WAVETYPE!=workflow[WORKFLOW_STAGE][8]) {
*change_wavetype_iter=*iter; *change_wavetype_iter=*iter;
*LBFGS_iter_start=*iter; *LBFGS_iter_start=*iter;
} }
WAVETYPE=workflow[WORKFLOW_STAGE][9]; WAVETYPE=workflow[WORKFLOW_STAGE][8];
} }
/* Joint inversion PSV and SH */ /* Joint inversion PSV and SH */
JOINT_INVERSION_PSV_SH_ALPHA_VS=workflow[WORKFLOW_STAGE][10]; JOINT_INVERSION_PSV_SH_ALPHA_VS=workflow[WORKFLOW_STAGE][9];
JOINT_INVERSION_PSV_SH_ALPHA_RHO=workflow[WORKFLOW_STAGE][11]; JOINT_INVERSION_PSV_SH_ALPHA_RHO=workflow[WORKFLOW_STAGE][10];
/* Approx. Hessian */ /* Approx. Hessian */
if(EPRECOND==0 && workflow[WORKFLOW_STAGE][12]!=0){ if(EPRECOND==0 && workflow[WORKFLOW_STAGE][11]!=0){
if(MYID==0) printf(" WARNING: EPRECOND have to be set >0 in JSON (if so, ignore this message)"); if(MYID==0) printf(" WARNING: EPRECOND have to be set >0 in JSON (if so, ignore this message)");
} }
EPRECOND=workflow[WORKFLOW_STAGE][11];
EPRECOND=workflow[WORKFLOW_STAGE][12]; EPSILON_WE=workflow[WORKFLOW_STAGE][12];
EPSILON_WE=workflow[WORKFLOW_STAGE][13];
GAMMA=workflow[WORKFLOW_STAGE][14];
if(*LBFGS_iter_start==*iter && GRAD_METHOD==2){ if(*LBFGS_iter_start==*iter && GRAD_METHOD==2){
if(MYID==0)printf("\n L-BFGS will be used from iteration %d on.",*LBFGS_iter_start+1); if(MYID==0)printf("\n L-BFGS will be used from iteration %d on.",*LBFGS_iter_start+1);
} }
} }
\ No newline at end of file
...@@ -29,7 +29,7 @@ double calc_misfit(float **sectiondata, float **section, int ntr, int ns, int LN ...@@ -29,7 +29,7 @@ double calc_misfit(float **sectiondata, float **section, int ntr, int ns, int LN
extern int TRKILL, NORMALIZE, F_LOW_PASS, TIMEWIN; extern int TRKILL, NORMALIZE, F_LOW_PASS, TIMEWIN;
extern char TRKILL_FILE[STRING_SIZE]; extern char TRKILL_FILE[STRING_SIZE];
extern int VELOCITY; extern int VELOCITY;
extern int WRITE_FILTERED_DATA;
int i,j; int i,j;
float l2; float l2;
int h; int h;
...@@ -180,10 +180,8 @@ double calc_misfit(float **sectiondata, float **section, int ntr, int ns, int LN ...@@ -180,10 +180,8 @@ double calc_misfit(float **sectiondata, float **section, int ntr, int ns, int LN
abs_sectiondata+=intseis_sectiondata[i][j]*intseis_sectiondata[i][j]; abs_sectiondata+=intseis_sectiondata[i][j]*intseis_sectiondata[i][j];
abs_section+=intseis_section[i][j]*intseis_section[i][j]; abs_section+=intseis_section[i][j]*intseis_section[i][j];
} }
if (abs_sectiondata==0) abs_sectiondata=1; abs_sectiondata=sqrt(abs_sectiondata);
else abs_sectiondata=sqrt(abs_sectiondata); abs_section=sqrt(abs_section);
if (abs_section==0) abs_section==1;
else abs_section=sqrt(abs_section);
} }
/* calculate L2 residuals */ /* calculate L2 residuals */
...@@ -202,15 +200,6 @@ double calc_misfit(float **sectiondata, float **section, int ntr, int ns, int LN ...@@ -202,15 +200,6 @@ double calc_misfit(float **sectiondata, float **section, int ntr, int ns, int LN
} }
} }
if(WRITE_FILTERED_DATA==2){
for(i=1;i<=ntr;i++){
for(j=1;j<=ns;j++){
sectiondata[i][j]=intseis_sectiondata[i][j];
section[i][j]=intseis_section[i][j];
}
}
}
l2=L2; l2=L2;
/* printf("\n MYID = %i IN CALC_MISFIT: L2 = %10.12f \n",MYID,l2); */ /* printf("\n MYID = %i IN CALC_MISFIT: L2 = %10.12f \n",MYID,l2); */
......
...@@ -27,6 +27,7 @@ double calc_res(float **sectiondata, float **section, float **sectiondiff, float ...@@ -27,6 +27,7 @@ double calc_res(float **sectiondata, float **section, float **sectiondiff, float
extern float DT, WATERLEVEL_LNORM8; extern float DT, WATERLEVEL_LNORM8;
extern int REC1, REC2, MYID, ACOUSTIC; extern int REC1, REC2, MYID, ACOUSTIC;
extern int TRKILL, NORMALIZE, F_LOW_PASS, TIMEWIN; extern int TRKILL, NORMALIZE, F_LOW_PASS, TIMEWIN;
extern int RTM;
extern char TRKILL_FILE[STRING_SIZE]; extern char TRKILL_FILE[STRING_SIZE];
extern int VELOCITY, USE_WORKFLOW, WORKFLOW_STAGE; extern int VELOCITY, USE_WORKFLOW, WORKFLOW_STAGE;
float RMS, signL1; float RMS, signL1;
...@@ -207,10 +208,8 @@ double calc_res(float **sectiondata, float **section, float **sectiondiff, float ...@@ -207,10 +208,8 @@ double calc_res(float **sectiondata, float **section, float **sectiondiff, float
abs_section+=intseis_section[i][j]*intseis_section[i][j]; abs_section+=intseis_section[i][j]*intseis_section[i][j];
sectiondata_mult_section+=intseis_sectiondata[i][j]*intseis_section[i][j]; /* calculation of dot product for measured (section) and synthetic (sectiondata) data*/ sectiondata_mult_section+=intseis_sectiondata[i][j]*intseis_section[i][j]; /* calculation of dot product for measured (section) and synthetic (sectiondata) data*/
} }
if (abs_sectiondata==0) abs_sectiondata=1; abs_sectiondata=sqrt(abs_sectiondata);
else abs_sectiondata=sqrt(abs_sectiondata); abs_section=sqrt(abs_section);
if (abs_section==0) abs_section==1;
else abs_section=sqrt(abs_section);
} }
/* calculate residual seismograms and norm */ /* calculate residual seismograms and norm */
...@@ -275,6 +274,12 @@ double calc_res(float **sectiondata, float **section, float **sectiondiff, float ...@@ -275,6 +274,12 @@ double calc_res(float **sectiondata, float **section, float **sectiondiff, float
L2+=fabs(sectiondiff[i][invtime])*fabs(sectiondiffold[i][j]); L2+=fabs(sectiondiff[i][invtime])*fabs(sectiondiffold[i][j]);
} }
/* replace residuals for reverse time migration*/
if(RTM==1){
sectiondiff[i][invtime]=sectiondata[i][j];
}
sectiondiff[i][invtime]=sectiondata[i][j];
/*L2+=sectiondiff[i][invtime];*/ /*L2+=sectiondiff[i][invtime];*/
invtime--; /* reverse time direction */ invtime--; /* reverse time direction */
......
...@@ -277,7 +277,7 @@ void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus, ...@@ -277,7 +277,7 @@ void checkfd(FILE *fp, float ** prho, float ** ppi, float ** pu, float ** ptaus,
therefore we determine the minimum/maximum position in y-direction by the ZREC1 variable and vice versa. therefore we determine the minimum/maximum position in y-direction by the ZREC1 variable and vice versa.
this has to be considered for the receiver line coordinates specified in both the input file and separate source/receiver files*/ this has to be considered for the receiver line coordinates specified in both the input file and separate source/receiver files*/
if (READREC==0 || READREC==2) { if (READREC==0) {
if (XREC1>XREC2) { if (XREC1>XREC2) {
srec_maxx=XREC1; srec_maxx=XREC1;
srec_minx=XREC2; srec_minx=XREC2;
......
...@@ -30,7 +30,7 @@ void exchange_par(void){ ...@@ -30,7 +30,7 @@ void exchange_par(void){
extern float XREC1, XREC2, YREC1, YREC2, FPML; extern float XREC1, XREC2, YREC1, YREC2, FPML;
extern float REC_ARRAY_DEPTH, REC_ARRAY_DIST, MUN, EPSILON, EPSILON_u, EPSILON_rho; extern float REC_ARRAY_DEPTH, REC_ARRAY_DIST, MUN, EPSILON, EPSILON_u, EPSILON_rho;
extern int SEISMO, NDT, NGEOPH, SEIS_FORMAT, FREE_SURF, READMOD, READREC, SRCREC; extern int SEISMO, NDT, NGEOPH, SEIS_FORMAT, FREE_SURF, READMOD, READREC, SRCREC;
extern int BOUNDARY, REC_ARRAY, DRX, FW, STF_FULL; extern int BOUNDARY, REC_ARRAY, DRX, FW;
extern int SNAPSHOT_START,SNAPSHOT_END,SNAPSHOT_INCR; extern int SNAPSHOT_START,SNAPSHOT_END,SNAPSHOT_INCR;
extern float TSNAP1, TSNAP2, TSNAPINC, REFREC[4]; extern float TSNAP1, TSNAP2, TSNAPINC, REFREC[4];
extern char MFILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE],SIGNAL_FILE_SH[STRING_SIZE], LOG_FILE[STRING_SIZE]; extern char MFILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE],SIGNAL_FILE_SH[STRING_SIZE], LOG_FILE[STRING_SIZE];
...@@ -59,9 +59,10 @@ void exchange_par(void){ ...@@ -59,9 +59,10 @@ void exchange_par(void){
extern float npower, k_max_PML; extern float npower, k_max_PML;
extern int INV_STF, N_STF, N_STF_START; extern int INV_STF, N_STF, N_STF_START;
extern char PARA[STRING_SIZE]; extern char PARA[STRING_SIZE];
extern int TIME_FILT, ORDER,WRITE_FILTERED_DATA; extern int TIME_FILT, ORDER, ZERO_PHASE,WRITE_FILTERED_DATA;
extern float F_LOW_PASS_START, F_LOW_PASS_END, F_LOW_PASS_INCR, F_HIGH_PASS; extern float F_LOW_PASS_START, F_LOW_PASS_END, F_LOW_PASS_INCR, F_HIGH_PASS;
extern int LNORM, DTINV; extern int LNORM, DTINV;
extern int RTM;
extern int STEPMAX; extern int STEPMAX;
extern float EPS_SCALE, SCALEFAC; extern float EPS_SCALE, SCALEFAC;
extern float PRO; extern float PRO;
...@@ -95,7 +96,6 @@ void exchange_par(void){ ...@@ -95,7 +96,6 @@ void exchange_par(void){
extern int WAVETYPE; extern int WAVETYPE;
extern int SOURCE_SHAPE_SH; extern int SOURCE_SHAPE_SH;
extern int JOINT_INVERSION_PSV_SH_TYPE; extern int JOINT_INVERSION_PSV_SH_TYPE;
extern int JOINT_EQUAL_WEIGHTING;
/* Workflow */ /* Workflow */
extern char FILE_WORKFLOW[STRING_SIZE]; extern char FILE_WORKFLOW[STRING_SIZE];
extern int USE_WORKFLOW; extern int USE_WORKFLOW;
...@@ -326,7 +326,7 @@ void exchange_par(void){ ...@@ -326,7 +326,7 @@ void exchange_par(void){
idum[85] = NO_OF_TESTSHOTS; idum[85] = NO_OF_TESTSHOTS;
// idum[86] = EMPTY; idum[86] = ZERO_PHASE;
idum[87] = VELOCITY; idum[87] = VELOCITY;
...@@ -375,9 +375,9 @@ void exchange_par(void){ ...@@ -375,9 +375,9 @@ void exchange_par(void){
idum[114]=TRKILL_OFFSET; idum[114]=TRKILL_OFFSET;
idum[115]=TRKILL_STF_OFFSET; idum[115]=TRKILL_STF_OFFSET;
idum[116]=TRKILL_STF_OFFSET_INVERT; idum[116]=TRKILL_STF_OFFSET_INVERT;
idum[117]=RTM;
idum[117]=JOINT_EQUAL_WEIGHTING;
idum[118]=STF_FULL;
} /** if (MYID == 0) **/ } /** if (MYID == 0) **/
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
...@@ -612,7 +612,7 @@ void exchange_par(void){ ...@@ -612,7 +612,7 @@ void exchange_par(void){
NO_OF_TESTSHOTS = idum[85]; NO_OF_TESTSHOTS = idum[85];
// EMPTY = idum[86]; ZERO_PHASE = idum[86];
VELOCITY = idum[87]; VELOCITY = idum[87];
...@@ -662,9 +662,9 @@ void exchange_par(void){ ...@@ -662,9 +662,9 @@ void exchange_par(void){
TRKILL_OFFSET=idum[114]; TRKILL_OFFSET=idum[114];
TRKILL_STF_OFFSET=idum[115]; TRKILL_STF_OFFSET=idum[115];
TRKILL_STF_OFFSET_INVERT=idum[116]; TRKILL_STF_OFFSET_INVERT=idum[116];
RTM=idum[117];
JOINT_EQUAL_WEIGHTING=idum[117];
STF_FULL=idum[118];
if ( MYID!=0 && L>0 ) { if ( MYID!=0 && L>0 ) {
FL=vector(1,L); FL=vector(1,L);
} }
......
This diff is collapsed.
...@@ -14,7 +14,7 @@ float XREC1, XREC2, YREC1, YREC2; ...@@ -14,7 +14,7 @@ float XREC1, XREC2, YREC1, YREC2;
float REC_ARRAY_DEPTH, REC_ARRAY_DIST; float REC_ARRAY_DEPTH, REC_ARRAY_DIST;
float REFREC[4]={0.0, 0.0, 0.0, 0.0}, FPML; float REFREC[4]={0.0, 0.0, 0.0, 0.0}, FPML;
int SEISMO, NDT, NGEOPH, NSRC=1, SEIS_FORMAT, FREE_SURF, READMOD, READREC, SRCREC, FW=0; int SEISMO, NDT, NGEOPH, NSRC=1, SEIS_FORMAT, FREE_SURF, READMOD, READREC, SRCREC, FW=0;
int NX, NY, NT, SOURCE_SHAPE,SOURCE_SHAPE_SH, SOURCE_TYPE, SNAP, SNAP_FORMAT, REC_ARRAY, RUN_MULTIPLE_SHOTS, NTRG,STF_FULL; int NX, NY, NT, SOURCE_SHAPE,SOURCE_SHAPE_SH, SOURCE_TYPE, SNAP, SNAP_FORMAT, REC_ARRAY, RUN_MULTIPLE_SHOTS, NTRG;
int L, BOUNDARY, DC, DRX, NXG, NYG, IDX, IDY, FDORDER, MAXRELERROR; int L, BOUNDARY, DC, DRX, NXG, NYG, IDX, IDY, FDORDER, MAXRELERROR;
char SNAP_FILE[STRING_SIZE], SOURCE_FILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE], SIGNAL_FILE_SH[STRING_SIZE]; char SNAP_FILE[STRING_SIZE], SOURCE_FILE[STRING_SIZE], SIGNAL_FILE[STRING_SIZE], SIGNAL_FILE_SH[STRING_SIZE];
char MFILE[STRING_SIZE], REC_FILE[STRING_SIZE]; char MFILE[STRING_SIZE], REC_FILE[STRING_SIZE];
...@@ -72,11 +72,12 @@ int TAPER_STF; ...@@ -72,11 +72,12 @@ int TAPER_STF;
int INV_STF, N_STF, N_STF_START,TW_IND; int INV_STF, N_STF, N_STF_START,TW_IND;
char PARA[STRING_SIZE]; char PARA[STRING_SIZE];
int TIME_FILT, ORDER; int TIME_FILT, ORDER, ZERO_PHASE;
int WRITE_FILTERED_DATA; int WRITE_FILTERED_DATA;
float F_LOW_PASS_START, F_LOW_PASS_END, F_LOW_PASS_INCR, F_HIGH_PASS; float F_LOW_PASS_START, F_LOW_PASS_END, F_LOW_PASS_INCR, F_HIGH_PASS;
int LNORM, DTINV; int LNORM, DTINV;
int RTM;
int STEPMAX; int STEPMAX;
float EPS_SCALE, SCALEFAC; float EPS_SCALE, SCALEFAC;
...@@ -143,8 +144,6 @@ int VERBOSE; ...@@ -143,8 +144,6 @@ int VERBOSE;
int WAVETYPE; int WAVETYPE;
int JOINT_INVERSION_PSV_SH_TYPE; int JOINT_INVERSION_PSV_SH_TYPE;
int JOINT_EQUAL_WEIGHTING;
float JOINT_INVERSION_PSV_SH_ALPHA_VS; float JOINT_INVERSION_PSV_SH_ALPHA_VS;
float JOINT_INVERSION_PSV_SH_ALPHA_RHO; float JOINT_INVERSION_PSV_SH_ALPHA_RHO;
int SNAPSHOT_START,SNAPSHOT_END,SNAPSHOT_INCR; int SNAPSHOT_START,SNAPSHOT_END,SNAPSHOT_INCR;
File mode changed from 100755 to 100644
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
void info(FILE *fp){ void info(FILE *fp){
fprintf(fp," ***********************************************************\n"); fprintf(fp," ***********************************************************\n");
fprintf(fp," This is program IFOS2D. Version 2.0.3 \n"); fprintf(fp," This is program IFOS2D. Version 2.0.1 \n");
fprintf(fp," Parallel 2-D elastic Full Waveform Inversion code. \n"); fprintf(fp," Parallel 2-D elastic Full Waveform Inversion code. \n");
fprintf(fp," \n"); fprintf(fp," \n");
fprintf(fp," ***********************************************************\n"); fprintf(fp," ***********************************************************\n");
......
...@@ -61,7 +61,8 @@ void inseis_source_wavelet(float *section, int ns, int ishot, int SH, int STF){ ...@@ -61,7 +61,8 @@ void inseis_source_wavelet(float *section, int ns, int ishot, int SH, int STF){
} }
fpdata = fopen(data,"r"); fpdata = fopen(data,"r");
if (fpdata==NULL) declare_error(" Source wavelet not found "); if (fpdata==NULL){ declare_error(" Source wavelet not found ");
fprintf("\n...STF %d...\n",STF);}
/* SEGY (without file-header) */ /* SEGY (without file-header) */
fread(&tr,240,1,fpdata); fread(&tr,240,1,fpdata);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "fd.h" #include "fd.h"
void write_matrix_disk(float ** local_matrix,char path_name[STRING_SIZE]){ void write_matrix_disk(float ** gradient,char path_name[STRING_SIZE]){
char joint[225]; char joint[225];
FILE *FPjoint; FILE *FPjoint;
extern int POS[3],MYID; extern int POS[3],MYID;
...@@ -32,7 +32,7 @@ void write_matrix_disk(float ** local_matrix,char path_name[STRING_SIZE]){ ...@@ -32,7 +32,7 @@ void write_matrix_disk(float ** local_matrix,char path_name[STRING_SIZE]){
for (i=1;i<=NX;i=i+IDX){ for (i=1;i<=NX;i=i+IDX){
for (j=1;j<=NY;j=j+IDY){ for (j=1;j<=NY;j=j+IDY){
fwrite(&local_matrix[j][i],sizeof(float),1,FPjoint); fwrite(&gradient[j][i],sizeof(float),1,FPjoint);
} }
} }
...@@ -122,70 +122,6 @@ float matrix_product(float ** matrix1, float **matrix2) { ...@@ -122,70 +122,6 @@ float matrix_product(float ** matrix1, float **matrix2) {
return global_sum; return global_sum;
} }
float ** get_global_from_local_matrix(float ** local_matrix) {
extern int NXG, NYG;
extern int NX,NY;
extern int POS[3];
float ** global_matrix=NULL,** global_matrix_temp=NULL;
int i=0,j=0;