<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>[1] Likely a transmission error. You would have to resend using a slightly different file name.<br></div><div><br></div><div>-rw-r--r--@ 1 shea 2200 288249386 May 13 17:04 wrf2d_d01_CTRL_PREC_ACC_NC_200010-200012.nc<br></div><div dir="ltr"><br></div><div dir="ltr">%> <b>ncdump -h</b> wrf2d_d01_CTRL_PREC_ACC_NC_200010-200012.nc<br><b><br></b></div><div dir="ltr"><b>NetCDF: HDF error</b></div><div dir="ltr">====</div><div dir="ltr"><br></div><div>[2] a comment. <br></div><div><br></div><div>[SNIP]<br></div><div dir="ltr">;---use grid point data<br>; set lat-lon coordinates to match Trial Lake<br> a = 40.68<br> b = -110.95<br><br> lat2d = f_in[0]->XLAT(0,:,:)<br> lon2d = f_in[0]->XLONG(0,:,:)<br> lat = lat2d(:,0) ;<span style="color:rgb(255,0,0)"><b> technically not correct; depending on grid ... could be very wrong</b></span><br> lon = lon2d(0,:)<br><br>; use ndtooned to transform lat and lon into 1d arrays to find closest gridpoint to Trial Lake<br> alat = ndtooned(lat2d)<br> alon = ndtooned(lon2d)<br><br> s_lat = closest_val(a,lat)<br> s_lon = closest_val(b,lon)<br><br>; get x-y indices for lat-lon data, convert back to verify accuracy<br> nm = getind_latlon2d(lat2d,lon2d,lat(s_lat),lon(s_lon))<br> nm1 = nm(0,0)<br> nm2 = nm(0,1)<br> print(nm)</div><div dir="ltr"><br></div><div><b>; Correct way</b></div><div><b><br></b></div><div dir="ltr"><b> NM = getind_latlon2d(lat2d,lon2d,a,b) <span style="color:rgb(0,0,255)">; <== this is the correct way</span><br> NM1 = NM(0,0)<br> NM2 = NM(0,1)<br> print(NM)</b></div><div dir="ltr"><b><br></b></div><div>[3]<b> I</b> think people would hesitate to debug the script. It is very busy. IMHO: it would require substantial time. EG:<br></div><div><br></div><div><br> Nov = new(n_years-1, "float")<br> do i = 0, n_years-2<br> s_date7 = years(i) + "110100"<br> s_time7 = ind(grid_t.EQ.s_date7)<br> print(s_time7)<br> e_time7 = s_time7 + Nov_hr<br> Nov(i) = sum(f_in[:]->PREC_ACC_NC(s_time7:e_time7,nm1,nm2))<br> print(Nov)<br> end do</div><div><br></div><div>[4]</div><div><br></div> f = <b>addfiles</b>("wrf2d_d01_2019-*","r") <br><div> sTime = <b>tostring</b>(f[:]->Times)</div><div><br></div><div> yyyy_wrf = <b>toint</b>(str_get_cols(sTime, 0,3))</div><div> mm_wrf = toint(str_get_cols(sTime, 5,6))</div><div> dd_wrf = toint(str_get_cols(sTime, 8,9))</div><div> hh_wrf = toint(str_get_cols(sTime, 10,11))</div><div><br></div><div> iJan = <b>ind</b>(mm_wrf.eq. 1) ; monthly indices</div><div>printVarSummary(iJan)</div><div>print("----------------")<br></div><div><br></div><div> pJan =<b> f[:]</b>->PREC(iJan,:,:) ; All January days and time <br></div><div> printVarSummary(pJan)</div><div> printMinMax(pJan)</div><div> print("----------------")</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div dir="ltr"><b></b><br></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 13, 2019 at 4:51 PM Zach Rieck <<a href="mailto:zrr817@gmail.com" target="_blank">zrr817@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">To Whom it May Concern-<div><br></div><div>I've been having issues getting enough precip values out of my WRF file so I can calculate accurate totals. I'm importing 26 different files, and have my code set up to pull in data from all 26 of these files to use so that I can calculate precip from November 1- Mar 31 for all years from 2000 to 2013. The data appears to be importing fine, and my code runs without errors.</div><div><br></div><div>The issue is that I'm expecting more than 46,000 time precip values (about 150 days for each year and 24 hours in each day), but I'm only getting a little over 4000. It's impossible to calculate accurate totals or even compare hourly data side by side with mu surface data if the time doesn't match, and I'm unable to accurately match the data unless I can pull the data hour by hour and sum it into daily, monthly, and seasonal totals.</div><div><br></div><div>I will attach my code and surface data and here, and I am currently FTP ing over the WRF data as well since I know it's nearly impossible to troubleshoot this without the code. The filename is wrf2d_d01_CTRL_PREC_ACC_NC_200010-200012.nc and will be in the incoming directory. Let me know if it doesn't show there.</div><div><br></div><div>Thank you so much for the help and if you have any clarification questions or need me to send something else please let me know.</div><div><br></div><div>Respectfully,</div><div><br clear="all"><div><div dir="ltr" class="gmail-m_-4528597905083209149gmail-m_1136145299461066899gmail-m_-1775665140490430427gmail_signature"><div dir="ltr">-Zach Rieck<div><a href="mailto:zrr817@gmail.com" target="_blank">zrr817@gmail.com</a></div><div>(513)-502-5652</div></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>