subroutine fout(output_file,ierr) c c hidden check of parameter 'filter_out' : c if c if 'filter_out:no' (default) --> return c if 'filter_out:yes' write into 'output_file'_filt the 3 c filterd time history and EXIT --> ierr = -99 c a.tento 6/03 v.1.0 c implicit none include 'main.h' include 'parameters.h' include 'times.h' c character*200 output_file integer ierr c character argout(20)*200, sep2*1, output_filt*200 parameter (sep2 = ':') integer j1, nunit, jlen, nw, i, j real sfre c c ierr = 0 call split3(filter_out,argout,sep2,nw) if ( argout(1) .eq. 'no' ) return c output_filt = output_file j1 = jlen(output_filt) output_filt(j1 + 1:j1 + 7) = '_SAF_fi' call glun(nunit,ierr) if (ierr .eq. 1) then write (*,*) ' ERROR: FOUT: can not find free unit number' ierr=1 return endif c open(unit=nunit,file=output_filt,status='unknown') c c write a SAF file, at this point we have lost information contained c in the original header (file could be saf, gse, cs) c sfre = 1.0 / sampling_rate write(nunit,400) write(nunit,420) write(nunit,430) write(nunit,440) sfre write(nunit,450) n_samples write(nunit,460) write(nunit,470) write(nunit,480) write(nunit,490) write(nunit,500) write(nunit,510) c do 1 i = 1, n_samples write(nunit,*)(datath(i,j),j=1,3) 1 continue c close(nunit) c c ierr = -99 return c c 400 format('SESAME ASCII data format (saf) v. 1 ') 420 format('STA_CODE = FIL') 430 format('START_TIME = 2003 06 14 14 40 30.000') 440 format('SAMP_FREQ = ',g15.7) 450 format('NDAT = ',i10) 460 format('CH0_ID = ver') 470 format('CH1_ID = ho1') 480 format('CH2_ID = ho2') 490 format('UNITS = filtered') 500 format('# GAIN = 1.0') 510 format('####----------------------------------------') c c end