<html><head></head><body><div class="ydp746804aayahoo-style-wrap" style="font-family: times new roman, new york, times, serif; font-size: 16px;">Hi <br></div><div class="ydp746804aayahoo-style-wrap" style="font-family: times new roman, new york, times, serif; font-size: 16px;"><span><span class="ydp25d67df0tlid-translation ydp25d67df0translation"><span title="">I try to read multiple wrfchem output files and extract surface temperature for multiple stations, and output all the files write in one csv file for comparing , but the values are wrong and it seems like a if condition.</span></span></span></div><div class="ydp746804aayahoo-style-wrap" style="font-family: times new roman, new york, times, serif; font-size: 16px;"><span><span class="ydp25d67df0tlid-translation ydp25d67df0translation"><span title="">please help me where is wrong</span></span></span></div><div class="ydp746804aayahoo-style-wrap" style="font-family: times new roman, new york, times, serif; font-size: 16px;"><span><span class="ydp25d67df0tlid-translation ydp25d67df0translation"><span title="">this is my script</span></span></span></div><div class="ydp746804aayahoo-style-wrap" style="font-family: times new roman, new york, times, serif; font-size: 16px;"><span><span class="ydp25d67df0tlid-translation ydp25d67df0translation"><span title="">Best Regards</span></span></span></div><div class="ydp746804aayahoo-style-wrap" style="font-family: times new roman, new york, times, serif; font-size: 16px;"><span><span class="ydp25d67df0tlid-translation ydp25d67df0translation"><span title="">Elham <br></span></span></span></div><div class="ydp746804aayahoo-style-wrap" style="font-family: times new roman, new york, times, serif; font-size: 16px;"><span><span class="ydp25d67df0tlid-translation ydp25d67df0translation"><span title=""><span> year = "2012"<br> month = "03"<br> day = "16"<br> hour = "00"<br> Dirin = "./"+ year + month + "/20190114/"<br><br> wrffiles = systemfunc("ls " + Dirin + "*wrf*" )<br> print (wrffiles)<br> numFiles = dimsizes(wrffiles)<br> do i = 0, numFiles -1<br> wrffiles(i) = wrffiles(i)+".nc"<br> nd = dimsizes(wrffiles)<br> end do<br> inpFiles = addfiles(wrffiles,"r")<br><br> do ifile = 0, numFiles-1<br> a = inpFiles[ifile]<br><br>; a = addfile(Dirin+"YSU_wrfout_d01_2012-03-16_00:00:00.nc","r")<br><br><br> opt = True<br> ip_lon = (/ 48.73,47.27,46.17/)<br> ip_lat = (/ 31.33,32.67,33.10/)<br><span> nlocs = dimsizes(ip_locs)<br> do ip = 0 , nlocs-1<br> opt = True<br> loc = wrf_user_ll_to_ij(a,ip_lon(ip),ip_lat(ip),opt)<br> loc = loc-1<br><br> t = wrf_user_getvar(a,"T2",-1) ; get t2 for all times<br> ttf = t(:,loc(1),loc(0)) ; extract a time series at a point<br> tf = ttf-273.16<br><br></span><span>if (ifile.eq.0) then<br>t_acm = tf<br><br>else if (ifile.eq.1) then<br>t_bo = tf<br><br>else if (ifile.eq.2) then<br>t_mjj = tf<br><br>else if (ifile.eq.3) then<br>t_sh = tf<br><br>else if (ifile.eq.4) then<br>t_uw = tf<br><br>else if (ifile.eq.5) then<br>t_ysu = tf<br><br></span><span>slist = [/"date,"+"year, " + "month," + "day," + "hour,"+"t_AC,"+ "t_BO,"+"t_MJJ,"+"t_SH,"+"t_UW,"+"t_YSU," /]<br> write_table( Diro+ip_locs(ip)+"tem.csv","a" ,slist," %s,")<br> alist=[/ yymmddhh,year1, mm, dd, hh, t_acm,t_bo,t_mjj,t_sh,t_uw,t_ysu/]<br> write_table( Diro+ip_locs(ip)+"tem.csv","a" ,alist," %s, %s, %s, %s, %s, %8.2f, %8.2f, %8.2f, %8.2f, %8.2f, %8.2f, %8.2f, %8.2f,")<br><br>end if<br>end if<br>end if<br>end if<br>end if<br>end if<br><br>end do<br>end do<br>end<br><br></span><br></span><br></span></span></span></div><div class="ydp746804aayahoo-style-wrap" style="font-family: times new roman, new york, times, serif; font-size: 16px;"><span><span class="ydp25d67df0tlid-translation ydp25d67df0translation"><span title=""><br></span></span></span></div></body></html>