#! /bin/csh -f
# Above line used to select the C-shell rather than the Bourne shell (/bin/sh).
# This shell script processes and stacks all 50 synthetic gathers, by running
# the stack.sh script 50 times.
echo `date`  ftp://www.seismo.unr.edu/pub/louie/rg/allstack.sh

# As this script will accumulate the individual stacks of 50 records into the
# file named modelstack, we want to make sure we don't have previous results
# lying around in that file. The following commands will check for the existence
# of a file in the current directory named modelstack, and remove it if exists.
# 	It is wisest to create a new directory
# with new copies of all scripts and parameter files each time you make a
# processing run, so results will not be over-written by new trials.  You do not
# need to copy the large data volume file; instead just specify in the stack.sh
# the full path it is obtained from.
if ( -e modelstack ) then
	rm modelstack
endif

# The following 50 lines run the stack.sh script on each of the 50 synthetic
# shot records in the MODEL data volume file.  The stacks are accumulated into
# the modelstack file by the script.  Note that the stack.sh script is given
# three parameters for each record: the plane number of the record in the MODEL
# data volume file; the field record number (or field file ID number); and the
# source location VP number.  A script like this is usually created by editing
# the observer's report file.

csh stack.sh 0 333 333
csh stack.sh 1 334 334
csh stack.sh 2 335 335
csh stack.sh 3 336 336
csh stack.sh 4 337 337
csh stack.sh 5 338 338
csh stack.sh 6 339 339
csh stack.sh 7 340 340
csh stack.sh 8 341 341
csh stack.sh 9 342 342
csh stack.sh 10 343 343
csh stack.sh 11 344 344
csh stack.sh 12 345 345
csh stack.sh 13 346 346
csh stack.sh 14 347 347
csh stack.sh 15 348 348
csh stack.sh 16 349 349
csh stack.sh 17 350 350
csh stack.sh 18 351 351
csh stack.sh 19 352 352
csh stack.sh 20 353 353
csh stack.sh 21 354 354
csh stack.sh 22 355 355
csh stack.sh 23 356 356
csh stack.sh 24 357 357
csh stack.sh 25 358 358
csh stack.sh 26 359 359
csh stack.sh 27 360 360
csh stack.sh 28 361 361
csh stack.sh 29 362 362
csh stack.sh 30 363 363
csh stack.sh 31 364 364
csh stack.sh 32 365 365
csh stack.sh 33 366 366
csh stack.sh 34 367 367
csh stack.sh 35 368 368
csh stack.sh 36 369 369
csh stack.sh 37 370 370
csh stack.sh 38 371 371
csh stack.sh 39 372 372
csh stack.sh 40 373 373
csh stack.sh 41 374 374
csh stack.sh 42 375 375
csh stack.sh 43 376 376
csh stack.sh 44 377 377
csh stack.sh 45 378 378
csh stack.sh 46 379 379
csh stack.sh 47 380 380
csh stack.sh 48 381 381
csh stack.sh 49 382 382

# DONE
