load "/opt/ncl-6.5/lib/ncarg/nclscripts/csm/heat_stress.ncl" do it=0,23 print("Working on time: " + it ) if it .lt. 10 wrf_file1 = "/dailyaverage/splithour_0" + it + "_timmean2"+ ".nc" else wrf_file1 = "/dailyaverage/splithour_" + it + "_timmean2"+ ".nc" end if a = addfile(wrf_file1, "r") tk= wrf_user_getvar(a,"tk",0) rh=wrf_user_getvar(a,"rh",0) xlat = wrf_user_getvar(a,"XLAT",-1) xlon = wrf_user_getvar(a,"XLONG",-1) io = (/1,0/) hi = heat_index_nws(tk, rh, io, False) hi@description = "Heat Index" hi@units = "C" filo = "Heat_Stress.nc" ncdf = addfile(filo ,"c") ncdf->hi = hi ncdf->XLAT = xlat ncdf->XLONG = xlon end do