%N findsrc %F $MIR/src/subs/calsubs.for
%D Find index of word in a list of words
%: calibration, baselines
%P pjt
%B
        INTEGER FUNCTION findsrc(n,list,name)

   return index of name in an array of name's in list(n):
       input:   n      lenght of list
                list   array of sources
                name   source to look for in array
       output:
       0       not found
       1..n    found match in this one, name(findsrc)

        INTEGER   n
        CHARACTER list(*)*(*), name*(*)

        INTEGER i

        findsrc = 0
        i = 0
        DO WHILE(i.LT.n .AND. findsrc.EQ.0)
            i = i+1
            IF (name.EQ.list(i)) findsrc = i
        ENDDO

        END
