exchange_par.c 17.9 KB
Newer Older
Tilman Steinweg's avatar
Tilman Steinweg committed
1
/*-----------------------------------------------------------------------------------------
Florian Wittkamp's avatar
Florian Wittkamp committed
2
 * Copyright (C) 2016  For the list of authors, see file AUTHORS.
Tilman Steinweg's avatar
Tilman Steinweg committed
3
 *
Florian Wittkamp's avatar
Florian Wittkamp committed
4
 * This file is part of IFOS.
5
 *
Florian Wittkamp's avatar
Florian Wittkamp committed
6
 * IFOS is free software: you can redistribute it and/or modify
Tilman Steinweg's avatar
Tilman Steinweg committed
7
8
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 2.0 of the License only.
9
 *
Florian Wittkamp's avatar
Florian Wittkamp committed
10
 * IFOS is distributed in the hope that it will be useful,
Tilman Steinweg's avatar
Tilman Steinweg committed
11
12
13
 * 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.
14
 *
Tilman Steinweg's avatar
Tilman Steinweg committed
15
 * You should have received a copy of the GNU General Public License
Florian Wittkamp's avatar
Florian Wittkamp committed
16
 * along with IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
17
 -----------------------------------------------------------------------------------------*/
Tilman Steinweg's avatar
Tilman Steinweg committed
18
19

/*------------------------------------------------------------------------
20
 *   Exchange FD-Parameters between PEs
Tilman Steinweg's avatar
Tilman Steinweg committed
21
22
23
24
25
 *  ----------------------------------------------------------------------*/

#include "fd.h"

void exchange_par(void){
26
27
    
    /* declaration of extern variables */
28
29
    extern int   NX, NY, FDORDER, MAXRELERROR, SOURCE_SHAPE, SOURCE_TYPE, SNAP, SNAP_FORMAT, L;
    extern float DH, TIME, DT, TS, *FL, TAU, VPPML, PLANE_WAVE_DEPTH, PHI, F_REF;
30
31
32
    extern float XREC1, XREC2, YREC1, YREC2, FPML;
    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;
33
    extern int BOUNDARY, REC_ARRAY, DRX, FW, STF_FULL;
34
35
36
37
    extern int SNAPSHOT_START,SNAPSHOT_END,SNAPSHOT_INCR;
    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 SNAP_FILE[STRING_SIZE], SOURCE_FILE[STRING_SIZE], REC_FILE[STRING_SIZE];
38
    extern char SEIS_FILE[STRING_SIZE];
39
40
    extern char JACOBIAN[STRING_SIZE], DATA_DIR[STRING_SIZE], INV_MODELFILE[STRING_SIZE], FREQ_FILE[STRING_SIZE];
    extern int RUN_MULTIPLE_SHOTS, TAPERLENGTH, INVTYPE;
41
    extern int NPROC, NPROCX, NPROCY, MYID, IDX, IDY;
42
    extern int GRADT1, GRADT2, GRADT3, GRADT4, ITERMAX, PARAMETERIZATION, FORWARD_ONLY, ADJOINT_TYPE;
Florian Wittkamp's avatar
Florian Wittkamp committed
43
44
    extern int GRAD_METHOD;
    extern float TSHIFT_back;
45
46
47
48
49
50
51
    extern int MODEL_FILTER, FILT_SIZE;
    extern int FILT_SIZE_GRAD, GRAD_FILTER;
    
    extern int TESTSHOT_START, TESTSHOT_END, TESTSHOT_INCR, NO_OF_TESTSHOTS;
    extern int SWS_TAPER_GRAD_VERT, SWS_TAPER_GRAD_HOR, SWS_TAPER_GRAD_SOURCES, SWS_TAPER_CIRCULAR_PER_SHOT, SRTSHAPE, FILTSIZE;
    extern int SWS_TAPER_FILE, SWS_TAPER_FILE_PER_SHOT;
    extern float SRTRADIUS;
52
    extern char TAPER_FILE_NAME[STRING_SIZE];
53
54
55
56
57
58
59
60
61
    extern int SPATFILTER, SPAT_FILT_SIZE, SPAT_FILT_1, SPAT_FILT_ITER;
    extern int INV_RHO_ITER, INV_VP_ITER, INV_VS_ITER;
    extern int MIN_ITER;
    extern int nfstart, nf;
    extern int nfstart_jac, nf_jac;
    extern float VPUPPERLIM, VPLOWERLIM, VSUPPERLIM, VSLOWERLIM, RHOUPPERLIM, RHOLOWERLIM;
    extern float npower, k_max_PML;
    extern int INV_STF, N_STF, N_STF_START;
    extern char PARA[STRING_SIZE];
62
    extern int TIME_FILT, ORDER,WRITE_FILTERED_DATA;
63
    extern float F_LOW_PASS_START, F_LOW_PASS_END, F_LOW_PASS_INCR, F_HIGH_PASS;
64
65
66
67
68
69
    extern int LNORM, DTINV;
    extern int STEPMAX;
    extern float EPS_SCALE, SCALEFAC;
    extern float PRO;
    extern int TRKILL, TRKILL_STF;
    extern char TRKILL_FILE[STRING_SIZE], TRKILL_FILE_STF[STRING_SIZE];
70
71
    extern int TAPER_STF;
    extern int TIMEWIN, NORMALIZE, TW_IND;
72
73
74
75
76
77
78
79
80
81
82
83
84
    extern float TWLENGTH_PLUS, TWLENGTH_MINUS, GAMMA;
    extern char PICKS_FILE[STRING_SIZE];
    extern char MISFIT_LOG_FILE[STRING_SIZE];
    extern int VELOCITY;
    extern float WATERLEVEL_LNORM8;
    extern float VP_VS_RATIO;
    extern int S;
    extern float S_VP, S_VS, S_RHO;
    extern int GRAD_FILT_WAVELENGTH;
    extern float A;
    extern int ACOUSTIC;
    extern int VERBOSE;
    
85
    extern int TRKILL_STF_OFFSET;
86
    extern int TRKILL_STF_OFFSET_INVERT;
87
88
89
90
91
92
93
    extern float TRKILL_STF_OFFSET_LOWER;
    extern float TRKILL_STF_OFFSET_UPPER;
    
    extern int TRKILL_OFFSET;
    extern float TRKILL_OFFSET_LOWER;
    extern float TRKILL_OFFSET_UPPER;
    
94
95
    // Parameter for inversion of SH waves and joint inversion
    extern int WAVETYPE;
96
    extern int SOURCE_SHAPE_SH;
97
    extern int JOINT_INVERSION_PSV_SH_TYPE;
98
    extern int JOINT_EQUAL_WEIGHTING;
99
100
101
102
103
104
105
106
107
    /* Workflow  */
    extern char FILE_WORKFLOW[STRING_SIZE];
    extern int USE_WORKFLOW;
    
    extern float JOINT_INVERSION_PSV_SH_ALPHA_VS;
    extern float JOINT_INVERSION_PSV_SH_ALPHA_RHO;
    
    extern int EPRECOND;
    extern int EPRECOND_ITER;
108
    extern float EPSILON_WE,EPSILON_WE_SH;
109
    extern int EPRECOND_PER_SHOT;
110
    extern int EPRECOND_PER_SHOT_SH;
111
    
112
    extern float LBFGS_SCALE_GRADIENTS;
113
114
115
116
117
118
119
    extern int LBFGS_STEP_LENGTH;
    
    extern int N_LBFGS;
    
    extern int WOLFE_CONDITION;
    extern int WOLFE_NUM_TEST;
    extern int WOLFE_TRY_OLD_STEPLENGTH;
120
121
    extern float WOLFE_C1_SL;
    extern float WOLFE_C2_SL;
122
123
    
    
124
    /* definition of local variables */
125
126
127
128
129
130
131
    /* NPAR is set in fd.h and must be set to the max. number of elements in idum/fdum +1 (because vector index starts at 0) */
    int idum[NPAR];
    float fdum[NPAR];
    
    
    if (MYID == 0){
        
132
133
134
        /***********/
        /*  Float  */
        /***********/
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
        fdum[1]  = DH;
        fdum[2]  = TIME;
        fdum[3]  = DT;
        fdum[4]  = TS;
        fdum[5]  = 0.0;
        fdum[6]  = 0.0;
        
        fdum[8]  = TAU;
        fdum[10]  = TSNAP1;
        fdum[11]  = TSNAP2;
        fdum[12]  = TSNAPINC;
        fdum[13]  = REFREC[1];
        fdum[14]  = REFREC[2];
        fdum[15]  = PHI;
        
        fdum[16]  = XREC1;
        fdum[17]  = YREC1;
        
        fdum[19]  = XREC2;
        fdum[20]  = YREC2;
        
156
        fdum[22]  = VPPML;
157
158
        fdum[23]  = REC_ARRAY_DEPTH;
        fdum[24]  = REC_ARRAY_DIST;
Tilman Steinweg's avatar
Tilman Steinweg committed
159
        fdum[25]  = PLANE_WAVE_DEPTH;
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
        
        fdum[26]  = MUN;
        fdum[27]  = EPSILON;
        fdum[28]  = EPSILON_u;
        fdum[29]  = EPSILON_rho;
        fdum[31]  = FPML;
        
        fdum[32]  = SRTRADIUS;
        
        fdum[33]  = VPUPPERLIM;
        fdum[34]  = VPLOWERLIM;
        fdum[35]  = VSUPPERLIM;
        fdum[36]  = VSLOWERLIM;
        fdum[37]  = RHOUPPERLIM;
        fdum[38]  = RHOLOWERLIM;
        
        fdum[39]  = npower;
        fdum[40]  = k_max_PML;
Florian Wittkamp's avatar
Florian Wittkamp committed
178

179
180
181
        fdum[42]  = F_LOW_PASS_START;
        fdum[43]  = F_LOW_PASS_END;
        fdum[44]  = F_LOW_PASS_INCR;
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
        
        fdum[45]  = EPS_SCALE;
        fdum[46]  = SCALEFAC;
        fdum[47]  = PRO;
        
        fdum[48]  = TWLENGTH_PLUS;
        fdum[49]  = TWLENGTH_MINUS;
        fdum[50]  = GAMMA;
        
        fdum[51]  = F_REF;
        
        fdum[52]  = TSHIFT_back;
        
        fdum[53]  = WATERLEVEL_LNORM8;
        
        fdum[54]  = VP_VS_RATIO;
        
        fdum[55]  = S_VS;
        
        fdum[56]  = S_VP;
        
        fdum[57]  = S_RHO;
        
        fdum[58]  = A;
        
207
        fdum[59]  = F_HIGH_PASS;
208
209
210
211
212
        
        fdum[60] = JOINT_INVERSION_PSV_SH_ALPHA_VS;
        fdum[61] = JOINT_INVERSION_PSV_SH_ALPHA_RHO;
        
        fdum[62]=EPSILON_WE;
213
        fdum[63]=EPSILON_WE_SH;
214
        
215
216
        fdum[64]=WOLFE_C1_SL;
        fdum[65]=WOLFE_C2_SL;
217
        
218
219
220
221
        fdum[66]=TRKILL_STF_OFFSET_LOWER;
        fdum[67]=TRKILL_STF_OFFSET_UPPER;
        fdum[68]=TRKILL_OFFSET_LOWER;
        fdum[69]=TRKILL_OFFSET_UPPER;
222
223
        
        fdum[70]=LBFGS_SCALE_GRADIENTS;
224

225
226
227
        /***********/
        /* Integer */
        /***********/
228
229
230
231
232
233
234
        idum[1]  = NPROCX;
        idum[2]  = NPROCY;
        
        idum[4]  = NPROCX*NPROCY;
        idum[5]  = NX;
        idum[6]  = NY;
        
235
236
        idum[8]  = SOURCE_SHAPE;
        idum[9]  = SOURCE_TYPE;
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
        idum[10]  = READMOD;
        idum[11]  = L;
        idum[12]  = FREE_SURF;
        idum[13]  = SNAP;
        idum[14]  = DRX;
        
        idum[16]  = BOUNDARY;
        idum[17]  = REC_ARRAY;
        idum[18]  = SRCREC;
        idum[19]  = IDX;
        idum[20]  = IDY;
        idum[21]  = TRKILL_STF;
        idum[22]  = 0;
        idum[23]  = SNAP_FORMAT;
        idum[24]  = SEISMO;
        idum[25]  = READREC;
        idum[26]  = NGEOPH;
        idum[27]  = NDT;
        idum[28]  = SEIS_FORMAT;
256

257
258
259
260
        
        idum[31]  = FDORDER;
        idum[32]  = MAXRELERROR;
        idum[33]  = RUN_MULTIPLE_SHOTS;
Tilman Steinweg's avatar
Tilman Steinweg committed
261
        idum[34]  = TAPERLENGTH;
262
263
264
265
266
267
        idum[35]  = INVTYPE;
        idum[36]  = GRADT1;
        idum[37]  = GRADT2;
        idum[38]  = GRADT3;
        idum[39]  = GRADT4;
        idum[40]  = ITERMAX;
268
        idum[41]  = PARAMETERIZATION;
269
        idum[42]  = FW;
270
        idum[43]  = FORWARD_ONLY;
271
        idum[44]  = ADJOINT_TYPE;
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
        
        idum[45]  = TESTSHOT_START;
        idum[46]  = TESTSHOT_END;
        idum[47]  = TESTSHOT_INCR;
        
        idum[48]  = SWS_TAPER_GRAD_VERT;
        idum[49]  = SWS_TAPER_GRAD_HOR;
        idum[50]  = SWS_TAPER_GRAD_SOURCES;
        idum[51]  = SWS_TAPER_CIRCULAR_PER_SHOT;
        idum[52]  = SRTSHAPE;
        idum[53]  = FILTSIZE;
        
        idum[54]  = SPATFILTER;
        idum[55]  = SPAT_FILT_SIZE;
        idum[56]  = SPAT_FILT_1;
        idum[57]  = SPAT_FILT_ITER;
        
        idum[58]  = INV_RHO_ITER;
        idum[59]  = nfstart;
        idum[60]  = nf;
        
        idum[61]  = nfstart_jac;
        idum[62]  = nf_jac;
        idum[63]  = SWS_TAPER_FILE;
        idum[65]  = GRAD_METHOD;
        
        idum[66]  = MODEL_FILTER;
        idum[67]  = FILT_SIZE;
        
        idum[69]  = INV_STF;
        idum[70]  = N_STF;
        idum[71]  = N_STF_START;
        
        idum[72]  = TIME_FILT;
        idum[73]  = ORDER;
        
        idum[74]  = LNORM;
        idum[75]  = DTINV;
        
        idum[76]  = STEPMAX;
        
        idum[77]  = TRKILL;
        
        idum[78]  = TIMEWIN;
        
        idum[79]  = NORMALIZE;
        
        idum[80]  = INV_VP_ITER;
        idum[81]  = INV_VS_ITER;
        
        idum[82]  = MIN_ITER;
        
        idum[83]  = GRAD_FILTER;
        idum[84]  = FILT_SIZE_GRAD;
        
        idum[85]  = NO_OF_TESTSHOTS;
        
329
        // idum[86]  = EMPTY;
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
        
        idum[87]  = VELOCITY;
        
        idum[88]  = SWS_TAPER_FILE_PER_SHOT;
        
        idum[89]  = S;
        
        idum[90]  = GRAD_FILT_WAVELENGTH;
        
        idum[91]  = ACOUSTIC;
        
        
        idum[92]  = VERBOSE;
        
        idum[93]  = WAVETYPE;
        
346
        idum[94]  = SOURCE_SHAPE_SH;
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
        
        idum[95] = JOINT_INVERSION_PSV_SH_TYPE;
        
        idum[96]  = SNAPSHOT_START;
        idum[97]  = SNAPSHOT_END;
        idum[98]  = SNAPSHOT_INCR;
        
        idum[100]=USE_WORKFLOW;
        
        idum[101]=EPRECOND;
        idum[102]=EPRECOND_ITER;
        
        idum[104]=LBFGS_STEP_LENGTH;
        
        idum[105]=EPRECOND_PER_SHOT;
362
        idum[106]=EPRECOND_PER_SHOT_SH;
363
        
364
        idum[107]=N_LBFGS;
365

366
367
368
        idum[108]=WOLFE_CONDITION;
        idum[109]=WOLFE_NUM_TEST;
        idum[110]=WOLFE_TRY_OLD_STEPLENGTH;
369
        
370
        idum[111]=WRITE_FILTERED_DATA;
371
        
372
373
        idum[112]=TAPER_STF;
        idum[113]=TW_IND;
374
        
375
376
        idum[114]=TRKILL_OFFSET;
        idum[115]=TRKILL_STF_OFFSET;
377
        idum[116]=TRKILL_STF_OFFSET_INVERT;
378
        
379
        idum[117]=JOINT_EQUAL_WEIGHTING;
380
        idum[118]=STF_FULL;
381
382
383
384
385
386
387
388
389
390
391
392
393
    } /** if (MYID == 0) **/
    
    MPI_Barrier(MPI_COMM_WORLD);
    
    MPI_Bcast(&idum,NPAR,MPI_INT,0,MPI_COMM_WORLD);
    MPI_Bcast(&fdum,NPAR,MPI_FLOAT,0,MPI_COMM_WORLD);
    
    
    MPI_Bcast(&FILE_WORKFLOW,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&SOURCE_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&MFILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&SNAP_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&REC_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
394
    MPI_Bcast(&SEIS_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
    MPI_Bcast(&LOG_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&SIGNAL_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&SIGNAL_FILE_SH,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&JACOBIAN,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&DATA_DIR,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&INV_MODELFILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&FREQ_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    
    
    MPI_Bcast(&PARA,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    
    MPI_Bcast(&MISFIT_LOG_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    
    MPI_Bcast(&TRKILL_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    MPI_Bcast(&TRKILL_FILE_STF,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    
    MPI_Bcast(&PICKS_FILE,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    
    MPI_Bcast(&TAPER_FILE_NAME,STRING_SIZE,MPI_CHAR,0,MPI_COMM_WORLD);
    
    MPI_Barrier(MPI_COMM_WORLD);
    
417
418
419
    /***********/
    /*  Float  */
    /***********/
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
    DH=fdum[1];
    TIME=fdum[2];
    DT=fdum[3];
    TS=fdum[4];
    
    TAU=fdum[8];
    TSNAP1=fdum[10];
    TSNAP2=fdum[11];
    TSNAPINC=fdum[12];
    REFREC[1]=fdum[13];
    REFREC[2]=fdum[14];
    PHI=fdum[15];
    XREC1=fdum[16];
    YREC1=fdum[17];
    
    XREC2=fdum[19];
    YREC2=fdum[20];
    
438
    VPPML=fdum[22];
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
    REC_ARRAY_DEPTH=fdum[23];
    REC_ARRAY_DIST=fdum[24];
    PLANE_WAVE_DEPTH=fdum[25];
    
    MUN = fdum[26];
    EPSILON = fdum[27];
    EPSILON_u = fdum[28];
    EPSILON_rho = fdum[29];
    FPML = fdum[31];
    
    SRTRADIUS = fdum[32];
    
    VPUPPERLIM = fdum[33];
    VPLOWERLIM = fdum[34];
    VSUPPERLIM = fdum[35];
    VSLOWERLIM = fdum[36];
    RHOUPPERLIM = fdum[37];
    RHOLOWERLIM = fdum[38];
    
    npower = fdum[39];
    k_max_PML = fdum[40];
    
    
462
463
464
    F_LOW_PASS_START = fdum[42];
    F_LOW_PASS_END = fdum[43];
    F_LOW_PASS_INCR = fdum[44];
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
    
    EPS_SCALE = fdum[45];
    SCALEFAC = fdum[46];
    
    PRO = fdum[47];
    
    TWLENGTH_PLUS = fdum[48];
    TWLENGTH_MINUS = fdum[49];
    GAMMA = fdum[50];
    
    F_REF = fdum[51];
    
    TSHIFT_back = fdum[52];
    
    WATERLEVEL_LNORM8 = fdum[53];
    
    VP_VS_RATIO = fdum[54];
    
    S_VS = fdum[55];
    
    S_VP = fdum[56];
    
    S_RHO = fdum[57];
    
    A = fdum[58];
    
491
    F_HIGH_PASS = fdum[59];
492
493
494
495
496
    
    JOINT_INVERSION_PSV_SH_ALPHA_VS = fdum[60];
    JOINT_INVERSION_PSV_SH_ALPHA_RHO = fdum[61];
    
    EPSILON_WE=fdum[62];
497
498
499
500
    EPSILON_WE_SH=fdum[63];
    
    WOLFE_C1_SL=fdum[64];
    WOLFE_C2_SL=fdum[65];
501
    
502
503
504
505
506
    TRKILL_STF_OFFSET_LOWER=fdum[66];
    TRKILL_STF_OFFSET_UPPER=fdum[67];
    TRKILL_OFFSET_LOWER=fdum[68];
    TRKILL_OFFSET_UPPER=fdum[69];
    
507
508
    LBFGS_SCALE_GRADIENTS=fdum[70];
    
509
510
511
    /***********/
    /* Integer */
    /***********/
512
    
513
514
515
516
517
518
    NPROCX = idum[1];
    NPROCY = idum[2];
    NPROC  = idum[4];
    NX = idum[5];
    NY = idum[6];
    
519
520
    SOURCE_SHAPE = idum[8];
    SOURCE_TYPE = idum[9];
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
    READMOD = idum[10];
    L = idum[11];
    FREE_SURF = idum[12];
    SNAP = idum[13];
    DRX = idum[14];
    
    BOUNDARY = idum[16];
    REC_ARRAY = idum[17];
    SRCREC = idum[18];
    IDX = idum[19];
    IDY = idum[20];
    TRKILL_STF=idum[21];
    
    SNAP_FORMAT = idum[23];
    SEISMO = idum[24];
    READREC = idum[25];
    NGEOPH = idum[26];
    NDT = idum[27];
    SEIS_FORMAT = idum[28];
540

541
542
543
544
545
546
547
548
549
550
551
    
    FDORDER = idum[31];
    MAXRELERROR = idum[32];
    RUN_MULTIPLE_SHOTS = idum[33];
    TAPERLENGTH = idum[34];
    INVTYPE = idum[35];
    GRADT1 = idum[36];
    GRADT2 = idum[37];
    GRADT3 = idum[38];
    GRADT4 = idum[39];
    ITERMAX = idum[40];
552
    PARAMETERIZATION = idum[41];
553
    FW = idum[42];
554
    FORWARD_ONLY  = idum[43];  
555
    ADJOINT_TYPE = idum[44];
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
    
    TESTSHOT_START = idum[45];
    TESTSHOT_END = idum[46];
    TESTSHOT_INCR = idum[47];
    
    SWS_TAPER_GRAD_VERT = idum[48];
    SWS_TAPER_GRAD_HOR = idum[49];
    SWS_TAPER_GRAD_SOURCES = idum[50];
    SWS_TAPER_CIRCULAR_PER_SHOT = idum[51];
    SRTSHAPE = idum[52];
    FILTSIZE = idum[53];
    
    SPATFILTER = idum[54];
    SPAT_FILT_SIZE = idum[55];
    SPAT_FILT_1 = idum[56];
    SPAT_FILT_ITER = idum[57];
    
    INV_RHO_ITER = idum[58];
    nfstart = idum[59];
    nf = idum[60];
    
    nfstart_jac = idum[61];
    nf_jac = idum[62];
    SWS_TAPER_FILE = idum[63];
    GRAD_METHOD = idum[65];
    
    
    MODEL_FILTER = idum[66];
    FILT_SIZE = idum[67];
    
    
    INV_STF = idum[69];
    N_STF = idum[70];
    N_STF_START = idum[71];
    
    TIME_FILT = idum[72];
    ORDER = idum[73];
    
    LNORM = idum[74];
    DTINV = idum[75];
    
    STEPMAX = idum[76];
    
    TRKILL = idum[77];
    
    TIMEWIN = idum[78];
    
    NORMALIZE = idum[79];
    
    INV_VP_ITER = idum[80];
    INV_VS_ITER = idum[81];
    
    MIN_ITER = idum[82];
    
    GRAD_FILTER = idum[83];
    FILT_SIZE_GRAD = idum[84];
    
    NO_OF_TESTSHOTS = idum[85];
    
615
    // EMPTY = idum[86];
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
    
    VELOCITY = idum[87];
    
    SWS_TAPER_FILE_PER_SHOT = idum[88];
    
    S = idum[89];
    
    GRAD_FILT_WAVELENGTH = idum[90];
    
    ACOUSTIC = idum[91];
    
    VERBOSE = idum[92];
    
    WAVETYPE = idum[93];
    
631
    SOURCE_SHAPE_SH = idum[94];
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
    
    JOINT_INVERSION_PSV_SH_TYPE = idum[95];
    
    SNAPSHOT_START=idum[96];
    SNAPSHOT_END=idum[97];
    SNAPSHOT_INCR=idum[98];
    
    USE_WORKFLOW=idum[100];
    
    EPRECOND=idum[101];
    EPRECOND_ITER=idum[102];
    
    LBFGS_STEP_LENGTH=idum[104];
    
    EPRECOND_PER_SHOT= idum[105];
647
    EPRECOND_PER_SHOT_SH= idum[106];
648
    
649
    N_LBFGS=idum[107];
650
    
651
    WOLFE_CONDITION=idum[108];
652
    
653
    WOLFE_NUM_TEST=idum[109];
654
    
655
    WOLFE_TRY_OLD_STEPLENGTH=idum[110];
656
    
657
    WRITE_FILTERED_DATA=idum[111];
658
    
659
660
    TAPER_STF=idum[112];
    TW_IND=idum[113];
661
    
662
663
    TRKILL_OFFSET=idum[114];
    TRKILL_STF_OFFSET=idum[115];
664
    TRKILL_STF_OFFSET_INVERT=idum[116];
665
    
666
    JOINT_EQUAL_WEIGHTING=idum[117];
667
    STF_FULL=idum[118];
668
669
670
    if ( MYID!=0 && L>0 ) {
        FL=vector(1,L);
    }
671
    
672
673
674
675
    if ( L>0 ) {
        MPI_Bcast(&FL[1],L,MPI_FLOAT,0,MPI_COMM_WORLD);
    }

Tilman Steinweg's avatar
Tilman Steinweg committed
676
}