program hvproc1 c c SESAME project - WP03 c HVPROC: H/V main processing module v.1.1. june 2003 c current version (1.1) developed by A. Tento IDPA-CNR Milano - Italy c c previous version (0.1) developed by A. Tento IDPA-CNR Milano - Italy c F. Kind ETHZ Zurich - Swiss c implicit none c include 'main.h' include 'parameters.h' include 'times.h' include 'window.h' c real work dimension work(mbig) common /room/ work character*200 window_file, parameter_file, output_file integer nsamps_inwin, n_freq, n_win, ierr integer nfft, maxsave, mwl, i1, i2, i3, i4, i5, i6, i7, i8, # i9, i10, i11, i12, i13, itot c c c read command line arguments call gcmln(window_file, parameter_file,output_file,ierr) call ckerr(ierr) c c set default parameters call defpar(ierr) call ckerr(ierr) c c read parameter file call parfile_read(parameter_file,ierr) call ckerr(ierr) c c read in all time window definitions call gtws(window_file,n_win,ierr) call ckerr(ierr) c c read HERE the first time history to get the sampling rate call readerth(1,ierr) call ckerr(ierr) c c check of hidden parameter 'filter_out' call fout(output_file,ierr) call ckerr(ierr) c c compute window length in number of samples c nsamps_inwin=int(rmaxwl/sampling_rate+0.5) nsamps_inwin=int(rmaxwl/sampling_rate+0.5) + 1 c if ( nsamps_inwin .gt. maxwinlen ) then c write(*,*)' Requested window exceeds current dimension ' c write(*,*)' requested # point : ',nsamps_inwin , c # ' current dimension', maxwinlen c call ckerr(1) c endif c c c define frequency vector call deffre(nsamps_inwin,work,n_freq,ierr) call ckerr(ierr) c c define 'dynamical' vector dimensions nfft = nsamps_inwin/2 + 1 nfft = max0(nfft,n_freq) maxsave = 4*nsamps_inwin + 20 mwl = n_freq*n_win i1 = 1 i2 = i1 + n_freq i3 = i2 + nsamps_inwin i4 = i3 + maxsave i5 = i4 + nfft i6 = i5 + nfft i7 = i6 + nfft i8 = i7 + mwl i9 = i8 + mwl i10 = i9 + mwl i11 = i10 + n_freq i12 = i11 + n_freq i13 = i12 + n_freq itot = i13 + nsamps_inwin + nsamps_inwin if ( itot .gt. mbig ) then write(*,*)' ERROR: Required amount of memory exceed current', # ' allowed dimension' write(*,*)' Try to use fewer windows or shorter window', # ' duration' call ckerr(1) endif c c main processing routine call hv(output_file,n_win,nsamps_inwin,nfft,maxsave,n_freq, # work(i1),work(i2),work(i3),work(i4),work(i5), # work(i6),work(i7),work(i8),work(i9),work(i10), # work(i11),work(i12),work(i13), # ierr) call ckerr(ierr) c c end of hv process call ckerr(-99) stop end c*** end of main program ********************************************* c include 'routines.lst'