; Procedure TIMDIS.pro ; ; This procedure plots the time at which events occur vs. the ; location along a model fault, a "Time-Distance" plot. We also ; may have an option of having the "Friction-Distance" plot along ; the bottom. ; ; Primary Variables: ; ; 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 ; tauast - Viscoelastic relaxation time (yr) ; hplate - Elastic plate thickness (km) ; flen(i) - Array of fault segment lengths ; 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) ; islip(i) - Number of times segment i slipped (# of earthquakes) ; ; ; ************************************************************* ; pro TIMDIS, nfault, hplate, tauast, flen, tstep, tmin, $ ntime, ntm, islip, tslip, cfric, dfric ; ; ************************************************************* ; NF = long(nfault) first_fault = 0L last_fault = NF -1 num_faults_to_plot = last_fault - first_fault + 1 fault_indices = lindgen(num_faults_to_plot) + first_fault num_faults_to_plot = n_elements(fault_indices) ; Compute total fault length total_fault_length = total(flen(fault_indices)) ; Find minimum and maximum times ; maximum_time = fix(max(tslip) + 1) ; minimum_time = maximum_time - ntime*tstep + ntm maximum_time = tmin minimum_time = maximum_time - (ntime-ntm)*tstep ; print, 'ntime, ntm', ntime, ntm ; Query for time interval print, '' print, ' Current Minimum, Maximum times are: ', minimum_time, $ maximum_time read, 'Enter Minimum, Maximum times ', minimum_time, maximum_time time_plot_endpoints = [minimum_time, maximum_time] ; print,'' ; print_fault_numbers = '' ; read, 'Print the fault numbers? (y/n) ', print_fault_numbers ; Set up the window loadct, 13 ; rainbow !P.MULTI = [0, 1, 2] ; ; FIRST PLOT: TIME-DISTANCE !P.POSITION = [.09, .3, .99, .95] plot,[0],[0], $ ; put something here... xstyle=1,ystyle=1, $ ; suppress axis extension xrange=[0,total_fault_length], $ yrange=[minimum_time,maximum_time], $ title='Occurrence Time Vs. Distance', $ ytitle='Time, years', $ xticklen = 0., $ xticks = 0, $ yticks = 0 ; Plot the stuff fault_left_end = 0. for fault_index = 0L,num_faults_to_plot-1 do begin fault_right_end = fault_left_end + flen(fault_index) ; plot all the slip times for this fault for time_index = 0L,islip(fault_index)-1 do begin tplot = tslip(fault_index,time_index) X1 = [fault_left_end, fault_right_end] Y1 = [tplot, tplot] if (tplot ge minimum_time and tplot le maximum_time) then begin oplot, X1, Y1, linestyle=0, thick = 2.0, color = 254 endif endfor fault_left_end = fault_right_end endfor ; ; SECOND PLOT: FRICTION-DISTANCE ; fricdiffmax = max(cfric) fricmin = min(dfric) fricmin = 0. fricmax = 1. print, 'fricmax, fricmin, fricdiffmax', fricmax, fricmin, fricdiffmax !P.POSITION = [.09, .1, .99, .2] plot,[0],[0], $ ; put something here... xstyle=1, ystyle=1, $ ; suppress axis extension xrange=[0.,total_fault_length], $ ; yrange=[.099,fricmax], $ yrange=[fricmin,fricmax], $ title='Fault Friction Coefficients (Scaled)', $ xtitle='Distance, km', $ ytitle='Friction', $ xticklen = .06, $ yticks = 1 ; Plot the stuff xr = fltarr(5) yr = fltarr(5) faultnumber = '' for i = 0L,num_faults_to_plot-1 do begin fault_number = fault_indices(i) if (i eq 0) then begin xleft = 0. endif else begin xleft = xleft + flen(fault_indices(i-1)) endelse xright = xleft + flen(fault_indices(i)) ; yup = cfric(i) + dfric(i) ; ydown = dfric(i) yup = cfric(i)/fricdiffmax ydown = 0. xr(0) = xleft yr(0) = yup xr(1) = xleft yr(1) = ydown xr(2) = xright yr(2) = ydown xr(3) = xright yr(3) = yup xr(4) = xleft yr(4) = yup X11 = xleft X12 = xright Y11 = yup Y12 = ydown X1 = [X11, X11, X12, X12] Y1 = [Y11, Y12, Y12, Y11] polyfill,X1,Y1, color = 100 oplot, xr, yr, linestyle = 0, color = 150 xs = (xleft + xright)/2. ys = (yup + ydown)/2. endfor ; ; ; opportunity to stop while in this environment dummy = '' & read,'Press Return to continue... ',dummy end ; procedure TIMDIS, hplate, tauast, flen, tstep, ntime, isltot