Friday, October 30, 2009

Evalresp follies

The IRIS-supplied instrument response software was not straightforward to incorporate into our codes. The key C-subroutine EVRESP is built for incorporating into Fortran codes, but seems to have developed a bug over its past revisions, and no one may have complained of it. The subroutine generates the filename of a RESP file, nominally output by rdseed. In previous versions of the subroutine I have used (circa 2005) the routine opens the file, reads the contents and generates a frequency domain instrument response for convolving synthetics or deconvolving data. The 2008-9 versions of EVRESP cant seem to find the file whose name they create (seemingly correctly) and the program fails. Diddling with the SEEDRESP environmental variable does not seem to help. The fix that I found was to feed EVRESP the RESP.* filename explicitly, by generating the filename myself from the same group of character-string variables that EVRESP uses. To wit:

file='RESP.'//net//'.'//sta//'.'//locid//'.'//cha
print *,file
c remove blank spaces
do i=30,7,-1
if(file(i:i).eq.' ') file=file(1:i-1)//file(i+1:80)//' '
end do
print *,file
print *,'entering evresp'
print *,sta,cha,net,locid,datime,unts,nscan,npad,nha
iflag=evresp(sta,cha,net,locid,datime,unts,file,freq,nha,resp,
x rtyp,vbs,start_stage,stop_stage,stdio_flag)
print *,'done evresp'

The character string "file" is passed to the routine and the code looks for it successfully, if the file is there!

No comments:

 
Link