      subroutine nclhwrf2sws(ny,mx,nsws,glon,glat,u,v,lon,lat,sws,uv)
      implicit none
      integer, intent(in) ::ny,mx,nsws
      real, intent(in) ::glon(ny,mx),glat(ny,mx),u(ny,mx),v(ny,mx)
      real, intent(in) ::lon(nsws),lat(nsws),sws(nsws)
      real, intent(out) ::uv(nsws)
      integer ::j,i,m,jmin,imin
      real    ::dsmin,dx,dy,ds,rad2deg

      rad2deg = 180./3.14159

      do m = 1, nsws

      dsmin = 10.
      do j = 1, ny
      do i = 1, mx

      dx = lon(m)-glon(j,i)*rad2deg 
      dy = lat(m)-glat(j,i)*rad2deg
      ds=sqrt(dx*dx+dy*dy)

      if(ds.lt.dsmin) then
      dsmin = ds
      imin = i
      jmin = j
      end if

      enddo 
      enddo 

      uv(m) = sqrt(u(jmin,imin)**2+v(jmin,imin)**2)

      enddo 

99    continue

      return
      end subroutine NCLhwrf2sws


