; ; PROGRAM VC_VISUALIZE.PRO ; ; This program plots the output of VC_SER.F, the VC simulator ..... ; ; Some Admonitions: ; ; 1. Make sure the dimensions here match up with those in the ; parameter file EQPARM_4.FOR ; 2. You need to have the IDL package of software visualization ; codes for these scripts to work. ; 3. The data files you will need are: ; ; i. The output from VC simulator ; ii. The fault data file that describes the fault ; system topology ; ; See code VC_SER.f for definitions of arrays and variables, ; discussion, and code physics. ; Defintions are also given in procedures called ; by this code. ; ; ************************************************************* ; ; Primary variable definitions: ; ; ntime - Number of time steps ; tstep - Size of time steps in yr. ; tmin - Starting time of data file ; ntm - Used in continuation from previous simulations ; nfault - number of fault segments ; vplatx - East-component of plate velocity in cm/yr ; vplaty - North-component of plate velocity in cm/yr ; tauast - Viscoelastic relaxation time (yr) ; hplate - Elastic plate thickness (km) ; db(i) - Depth to bottom, segment i (km) ; dt(i) - Depth to top, segment i (km) ; xfe(i) - x-component of easternmost point of fault segment i ; yfe(i) - y-component of easternmost point of fault segment i ; xfw(i) - x-component of westernmost point of fault segment i ; yfw(i) - y-component of westernmost point of fault segment i ; flen(i) - Array of fault segment lengths ; area(i) - Array of fault segment areas ; dfric(i) - Dynamic friction coefficient, fault segment i ; cfric(i) - Static friction coefficient, fault segment i ; tslip(i,j) - Time at which segment i slipped for jth time (yr) ; dslip(i,j) - Slip of segment i at jth time (cm) ; islip(i) - Number of times segment i slipped (# of earthquakes) ; facsd(i) - Aseismic slip factor, segment i ; ; ; ************************************************************* ; ; fname1 ='' fn1 ='' fname2 ='' fname3 ='' fname5 ='' fn5 ='' ; rmenu ='' resp ='' respfb ='' ; ; ****************************************************** ; ; Set up color printer ; set_plot,'ps' device,/color,bits=8 ; ; Query for output file from EQSYN ; Print, ' ' print, ' Enter the name of the output file' print, ' from VC_SER.f?' read,fname2 ; ; Open the output file and read the stuff in it ; openr, 10, fname2 ; readf, 10, fname5, fname1 readf, 10, nfault,hplate,vplatx,vplaty,tauast,taufar,amu, $ tmin,tstep,ntime,TBIAS,bulkm,ntm,$ ncycle, pdcy readf, 10, ptrade readf, 10, respfb NFT=6000 NTSTP=6000 NF = nfault NF1= 450 NF2= 450 NFF = 205000 NMF = 1700000 NPT = 500000 ; dfric = fltarr(NF,/no) rhofac = fltarr(NF,/no) islip = intarr(NF,/no) db = fltarr(NF,/no) dt = fltarr(NF,/no) xfe = fltarr(NF,/no) yfe = fltarr(NF,/no) xfw = fltarr(NF,/no) yfw = fltarr(NF,/no) flen = fltarr(NF,/no) area = fltarr(NF,/no) nseg = fltarr(NF,/no) hite = fltarr(NF,/no) depmid = fltarr(NF,/no) deltot = fltarr(NF,/no) dstart = fltarr(NF,/no) slpvel = fltarr(NF,/no) cfric = fltarr(NF,/no) taub = fltarr(NF,/no) timi = fltarr(NF,/no) slpav = dblarr(NF,/no) facsdp = fltarr(NF,/no) facsd = fltarr(NF,/no) ; isltot = intarr(NTSTP,NF1,/no) ; cumsl = fltarr(NF,NFT,/no) dslip = fltarr(NF,NFT,/no) tslip = fltarr(NF,NFT,/no) readf, 10, timi readf, 10, taub readf, 10, deltot readf, 10, cfric readf, 10, dfric readf, 10, dstart readf, 10, slpvel readf, 10, rhofac readf, 10, islip for i=0L,NF-1 do begin NFI = islip(i) if (NFI gt 0) then begin dslipi = fltarr(NFI,/no) readf, 10, dslipi for j=0L,NFI-1 do begin dslip(i,j) = dslipi(j) endfor endif endfor for i=0L,NF-1 do begin NFI = islip(i) if (NFI gt 0) then begin tslipi = fltarr(NFI,/no) readf, 10, tslipi for j=0L,NFI-1 do begin tslip(i,j) = tslipi(j) endfor endif endfor nthi=ntime + 1001 if (nthi lt NTSTP) then begin ndim = nthi*NF1 isltot_vector = intarr(ndim) readf, 10, isltot_vector k = long(0) for j = 0, NF1-1 do begin for i = 0L,nthi-1 do begin isltot(i,j) = isltot_vector(k) k = k+1 endfor endfor endif else begin ndim = long(ntime*NF1) isltot_vector = intarr(ndim) readf, 10, isltot_vector k = long(0) for j = 0, NF1-1 do begin for i = 0L,ntime-1 do begin isltot(i,j) = isltot_vector(k) k = k+1 endfor endfor endelse readf, 10, slpav readf, 10, facsd ; ; Close the file ; close, 10 ; ; Open the fault geometry file ; nfault_int = fix(nfault) nfault_and_mend = intarr(2) fault_data = fltarr(8,nfault) vplatx_and_vplaty = fltarr(2) ; ; Function strtrim trims off trailing white spaces openr, 20, strtrim(fname5) readf, 20, nfault_and_mend, fault_data, vplatx_and_vplaty nflt = nfault_and_mend(0) mend = nfault_and_mend(1) close, 20 ; Split the big fault_data array into its components db = fault_data(0,*) dt = fault_data(1,*) xfw = fault_data(2,*) yfw = fault_data(3,*) xfe = fault_data(4,*) yfe = fault_data(5,*) slpvel = fault_data(6,*) nseg = long(fault_data(7,*)) flen = sqrt((xfe-xfw)^2 + (yfe-yfw)^2) hite = db - dt depmid =(db+dt)/2. area =(db-dt)*flen ; ; Calculate cumulative slip ; cumsl = fltarr(nfault,NFT) ; zeros just to be safe for i = 0L, nfault-1 do begin for j = 0L, islip(i)-1 do begin cumsl(i,j) = total(dslip(i,0:j)) endfor endfor ; rmenu = 'A' while (rmenu ne 'Z') do begin ; print, ' ' print, ' THIS IS THE PLOT MENU -- SELECT ONE' print, ' (BY LETTER)' print, ' ' print, ' A. DRAW MODEL ON X - Y MAP' print, ' B. DRAW TIME - DISTANCE DIAGRAM' print, ' C. DRAW EVENT SLIP - DISTANCE DIAGRAM' print, ' D. DRAW MAP OF AN EVENT' print, ' E. DRAW THREE-DIMENSIONAL MAP VIEW OF MODEL' print, ' F. DRAW MAP OF SLIP SUPERPOSED ON 3D FAULT MAP' print, ' G. DRAW THREE-D COLOR CODED FAULT-FRICTION MAP' print, ' H. DRAW DEFORMATION ARROWS ON MAP' print, ' I. DRAW WRAPPED InSAR DEFORMATION FRINGES ON MAP' print, ' ' print, ' Z. EXIT PROGRAM' print, ' ' ; read, format ='(a1)', rmenu ; ; Branch to correct subroutine or exit.run PCA_Plot ; if (rmenu eq 'A') then begin model, nfault, vplatx, vplaty, xfe, xfw, yfe, yfw endif if (rmenu eq 'B') then begin timdis, nfault, hplate, tauast, flen, tstep, tmin, ntime, ntm, $ islip, tslip, cfric, dfric endif if (rmenu eq 'C') then begin slipdis, nfault, hplate, tauast, flen, tstep, tmin, ntime, ntm, $ islip, tslip, dslip, cfric, dfric endif if (rmenu eq 'D') then begin event_map, nfault, xfe, xfw, yfe, yfw, islip, tslip, dslip, facsd endif if (rmenu eq 'E') then begin model_3d, nfault, vplatx, vplaty, xfe, xfw, yfe, yfw, db, dt endif if (rmenu eq 'F') then begin slipmap_3d, nfault, xfe, xfw, yfe, yfw, db, dt, islip, $ tslip, dslip, cfric, dfric, hplate, tauast, flen, tstep, tmin, $ ntime, ntm endif if (rmenu eq 'G') then begin frictionmap_3d, nfault, xfe, xfw, yfe, yfw, db, dt, islip, tslip, dslip, $ cfric, dfric endif if (rmenu eq 'H') then begin displ_arrow, tstep, nfault, vplatx, vplaty,$ xfe, xfw, yfe, yfw, islip, tslip endif if (rmenu eq 'I') then begin insarfringe_wrapped, tstep, nfault, vplatx, vplaty,$ xfe, xfw, yfe, yfw, islip, tslip endif ; ; End of the Main "While" Loop ; endwhile ; end