       subroutine cnvnts(ain,lambda,freq,units,aout)
	  
c***********************************************************************
c      CoNVertuNiTS 
c      Written by Orlando Camargo Rodriguez
c      orodrig@ualg.pt
c      Universidade do Algarve
c      Physics Department
c      Signal Processing Laboratory
c      Faro, 02/08/2010 at 13:30
c****&******************************************************************

       include 'params.for'

       character*1 units 
       
       real*8 ain,aout,freq,lambda
       real*8 c1,c2
       
c***********************************************************************

       c1 = 8.68588963806504
       c2 = 8685.88963806504

c***********************************************************************
       
       if (units.eq.'W') then
           aout = ain
       else
           if (units.eq.'F') then
           aout = ain*lambda*freq*1.0e-3
           elseif (units.eq.'M') then
           aout = ain*lambda
           elseif (units.eq.'N') then
           aout = ain*lambda*c1
           elseif (units.eq.'Q') then
             if (ain.ne.0.0) then
	     aout = c1*pi/ain
             else
	     aout = 0.0 
	     end if
	   else
           write(6,*) 'Boundary attenuation: unknown units,'
           write(6,*) 'aborting calculations...'
           stop
           end if
       end if
       return 
       
       end
       
c***********************************************************************
