Skip to content

Commit

Permalink
Added GRAD_FORM parameter to input file
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-koehn committed Mar 17, 2021
1 parent 96ac042 commit 407b929
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 69 deletions.
1 change: 1 addition & 0 deletions par/DENISE_marm_OBC.inp
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
#
Expand Down
5 changes: 0 additions & 5 deletions src/AC/FWI_AC.c
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
5 changes: 0 additions & 5 deletions src/AC/RTM_AC.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 0 additions & 5 deletions src/PSV/FWI_PSV.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand Down
5 changes: 0 additions & 5 deletions src/PSV/RTM_PSV.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
101 changes: 52 additions & 49 deletions src/read_par.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 407b929

Please sign in to comment.