From 407b929889d45522bc03233184d211e2145426df Mon Sep 17 00:00:00 2001 From: daniel-koehn Date: Thu, 18 Mar 2021 00:18:45 +0100 Subject: [PATCH] Added GRAD_FORM parameter to input file --- par/DENISE_marm_OBC.inp | 1 + src/AC/FWI_AC.c | 5 -- src/AC/RTM_AC.c | 5 -- src/PSV/FWI_PSV.c | 5 -- src/PSV/RTM_PSV.c | 5 -- src/read_par.c | 101 +++++++++++++++++++++------------------- 6 files changed, 53 insertions(+), 69 deletions(-) diff --git a/par/DENISE_marm_OBC.inp b/par/DENISE_marm_OBC.inp index 858e6b1..78cf96a 100644 --- a/par/DENISE_marm_OBC.inp +++ b/par/DENISE_marm_OBC.inp @@ -134,6 +134,7 @@ cosine_taper_(yes=1/no=0)_(TAPER) = 0 taper_length_(in_rec_numbers)_(TAPERLENGTH) = 4 gradient_taper_geometry_(GRADT1,GRADT2,GRADT3,GRADT4) = 21, 25, 490, 500 type_of_material_parameters_to_invert_(Vp,Vs,rho=1/Zp,Zs,rho=2/lam,mu,rho=3)_(INVMAT1) = 1 +gradient_formulation_(GRAD_FORM) = 1 adjoint_source_type_(x-y_components=1/y_comp=2/x_comp=3/p_comp=4/x-p_comp=5/y-p_comp=6/x-y-p_comp=7)_(QUELLTYPB) = 1 # # diff --git a/src/AC/FWI_AC.c b/src/AC/FWI_AC.c index afe93a5..ea18d78 100755 --- a/src/AC/FWI_AC.c +++ b/src/AC/FWI_AC.c @@ -226,11 +226,6 @@ case 4 : /* everything */ /* calculate memory requirements for AC forward problem */ mem_fwiPSV(nseismograms,ntr,ns,fdo3,nd,buffsize,ntr_glob); -/* Define gradient formulation */ -/* GRAD_FORM = 1 - stress-displacement gradients */ -/* GRAD_FORM = 2 - stress-velocity gradients for decomposed impedance matrix */ -GRAD_FORM = 1; - if(GRAVITY==1 || GRAVITY==2){ if(GRAV_TYPE == 1){ diff --git a/src/AC/RTM_AC.c b/src/AC/RTM_AC.c index a2a46f0..4e6c2be 100644 --- a/src/AC/RTM_AC.c +++ b/src/AC/RTM_AC.c @@ -219,11 +219,6 @@ case 4 : /* everything */ /* calculate memory requirements for AC forward problem */ mem_fwiPSV(nseismograms,ntr,ns,fdo3,nd,buffsize,ntr_glob); -/* Define gradient formulation */ -/* GRAD_FORM = 1 - stress-displacement gradients */ -/* GRAD_FORM = 2 - stress-velocity gradients for decomposed impedance matrix */ -GRAD_FORM = 1; - /* allocate memory for AC forward problem */ alloc_AC(&waveAC,&waveAC_PML); diff --git a/src/PSV/FWI_PSV.c b/src/PSV/FWI_PSV.c index 2b865b0..6e6a157 100644 --- a/src/PSV/FWI_PSV.c +++ b/src/PSV/FWI_PSV.c @@ -238,11 +238,6 @@ void FWI_PSV() /* calculate memory requirements for PSV forward problem */ mem_fwiPSV(nseismograms, ntr, ns, fdo3, nd, buffsize, ntr_glob); - /* Define gradient formulation */ - /* GRAD_FORM = 1 - stress-displacement gradients */ - /* GRAD_FORM = 2 - stress-velocity gradients for decomposed impedance matrix */ - GRAD_FORM = 1; - if (GRAVITY == 1 || GRAVITY == 2) { diff --git a/src/PSV/RTM_PSV.c b/src/PSV/RTM_PSV.c index 201714f..020b74e 100644 --- a/src/PSV/RTM_PSV.c +++ b/src/PSV/RTM_PSV.c @@ -204,11 +204,6 @@ case 4 : /* everything */ /* calculate memory requirements for PSV forward problem */ mem_fwiPSV(nseismograms,ntr,ns,fdo3,nd,buffsize,ntr_glob); -/* Define gradient formulation */ -/* GRAD_FORM = 1 - stress-displacement gradients */ -/* GRAD_FORM = 2 - stress-velocity gradients for decomposed impedance matrix */ -GRAD_FORM = 1; - /* allocate memory for PSV forward problem */ alloc_PSV(&wavePSV,&wavePSV_PML); diff --git a/src/read_par.c b/src/read_par.c index 286646a..71926c1 100644 --- a/src/read_par.c +++ b/src/read_par.c @@ -26,7 +26,7 @@ extern char SEIS_FILE_VX[STRING_SIZE], SEIS_FILE_VY[STRING_SIZE]; extern char SEIS_FILE_CURL[STRING_SIZE], SEIS_FILE_DIV[STRING_SIZE], SEIS_FILE_P[STRING_SIZE]; extern char JACOBIAN[STRING_SIZE],DATA_DIR[STRING_SIZE]; extern int NPROC, NPROCX, NPROCY, MYID, IDX, IDY; -extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, INVMAT1, QUELLTYPB; +extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, INVMAT1, GRAD_FORM, QUELLTYPB; extern int HESSIAN, GRAD_METHOD, NFREQ, PCG_BETA, RTM_SHOT; extern float FC_HESS_START, FC_HESS_INC; extern int FILT_SIZE, MODEL_FILTER; @@ -295,148 +295,151 @@ int c=0, lineno=0, l; case 66 : fscanf(fp_in,"%s =%i",s,&INVMAT1); break; - case 67 : + case 67 : + fscanf(fp_in,"%s =%i",s,&GRAD_FORM); + break; + case 68 : fscanf(fp_in,"%s =%i",s,&QUELLTYPB); break; - case 68 : + case 69 : fscanf(fp_in,"%s =%i, %i, %i",s,&TESTSHOT_START,&TESTSHOT_END,&TESTSHOT_INCR); break; - case 69 : + case 70 : fscanf(fp_in,"%s =%i",s,&SWS_TAPER_GRAD_VERT); break; - case 70 : + case 71 : fscanf(fp_in,"%s =%i",s,&SWS_TAPER_GRAD_HOR); break; - case 71 : + case 72 : fscanf(fp_in,"%s =%f",s,&EXP_TAPER_GRAD_HOR); break; - case 72 : + case 73 : fscanf(fp_in,"%s =%i",s,&SWS_TAPER_GRAD_SOURCES); break; - case 73 : + case 74 : fscanf(fp_in,"%s =%i",s,&SWS_TAPER_CIRCULAR_PER_SHOT); break; - case 74 : + case 75 : fscanf(fp_in,"%s =%i",s,&SRTSHAPE); break; - case 75 : + case 76 : fscanf(fp_in,"%s =%f",s,&SRTRADIUS); break; - case 76 : + case 77 : fscanf(fp_in,"%s =%i",s,&FILTSIZE); break; - case 77 : + case 78 : fscanf(fp_in,"%s =%i",s,&SWS_TAPER_FILE); break; - case 78 : + case 79 : fscanf(fp_in,"%s =%s",s,TFILE); break; - case 79 : + case 80 : fscanf(fp_in,"%s =%i",s,&INV_MOD_OUT); break; - case 80 : + case 81 : fscanf(fp_in,"%s =%s",s,INV_MODELFILE); break; - case 81 : + case 82 : fscanf(fp_in,"%s =%f",s,&VPUPPERLIM); break; - case 82 : + case 83 : fscanf(fp_in,"%s =%f",s,&VPLOWERLIM); break; - case 83 : + case 84 : fscanf(fp_in,"%s =%f",s,&VSUPPERLIM); break; - case 84 : + case 85 : fscanf(fp_in,"%s =%f",s,&VSLOWERLIM); break; - case 85 : + case 86 : fscanf(fp_in,"%s =%f",s,&RHOUPPERLIM); break; - case 86 : + case 87 : fscanf(fp_in,"%s =%f",s,&RHOLOWERLIM); break; - case 87 : + case 88 : fscanf(fp_in,"%s =%f",s,&QSUPPERLIM); break; - case 88 : + case 89 : fscanf(fp_in,"%s =%f",s,&QSLOWERLIM); break; - case 89 : + case 90 : fscanf(fp_in,"%s =%i",s,&GRAD_METHOD); break; - case 90 : + case 91 : fscanf(fp_in,"%s =%i",s,&PCG_BETA); break; - case 91 : + case 92 : fscanf(fp_in,"%s =%i",s,&NLBFGS); break; - case 92 : + case 93 : fscanf(fp_in,"%s =%i",s,&MODEL_FILTER); break; - case 93 : + case 94 : fscanf(fp_in,"%s =%i",s,&FILT_SIZE); break; - case 94 : + case 95 : fscanf(fp_in,"%s =%i",s,&DTINV); break; - case 95 : + case 96 : fscanf(fp_in,"%s =%f",s,&EPS_SCALE); break; - case 96 : + case 97 : fscanf(fp_in,"%s =%i",s,&STEPMAX); break; - case 97 : + case 98 : fscanf(fp_in,"%s =%f",s,&SCALEFAC); break; - case 98 : + case 99 : fscanf(fp_in,"%s =%i",s,&TRKILL); break; - case 99 : + case 100 : fscanf(fp_in,"%s =%s",s,TRKILL_FILE); break; - case 100 : + case 101 : fscanf(fp_in,"%s =%s",s,PICKS_FILE); break; - case 101 : + case 102 : fscanf(fp_in,"%s =%s",s,&MISFIT_LOG_FILE); break; - case 102 : + case 103 : fscanf(fp_in,"%s =%i",s,&MIN_ITER); break; - case 103 : + case 104 : fscanf(fp_in,"%s =%i",s,&GRAD_FILTER); break; - case 104 : + case 105 : fscanf(fp_in,"%s =%i",s,&FILT_SIZE_GRAD); break; - case 105 : + case 106 : fscanf(fp_in,"%s =%i",s,&TIMELAPSE); break; - case 106 : + case 107 : fscanf(fp_in,"%s =%s",s,DATA_DIR_T0); break; - case 107 : + case 108 : fscanf(fp_in,"%s =%i",s,&RTMOD); break; - case 108 : + case 109 : fscanf(fp_in,"%s =%i",s,&GRAVITY); break; - case 109 : + case 110 : fscanf(fp_in,"%s =%i",s,&NGRAVB); break; - case 110 : + case 111 : fscanf(fp_in,"%s =%i",s,&NZGRAV); break; - case 111 : + case 112 : fscanf(fp_in,"%s =%i",s,&GRAV_TYPE); break; - case 112 : + case 113 : fscanf(fp_in,"%s =%i",s,&BACK_DENSITY); break; - case 113 : + case 114 : fscanf(fp_in,"%s =%s",s,DFILE); break; - case 114 : + case 115 : fscanf(fp_in,"%s =%i",s,&RTM_SHOT); break; default: