[ncl-talk] Precip Variable Not Pulling in Enough Values Across Multiple Files
Dennis Shea
shea at ucar.edu
Mon May 13 22:44:08 MDT 2019
[1] Likely a transmission error. You would have to resend using a slightly
different file name.
-rw-r--r--@ 1 shea 2200 288249386 May 13 17:04
wrf2d_d01_CTRL_PREC_ACC_NC_200010-200012.nc
%> *ncdump -h* wrf2d_d01_CTRL_PREC_ACC_NC_200010-200012.nc
*NetCDF: HDF error*
====
[2] a comment.
[SNIP]
;---use grid point data
; set lat-lon coordinates to match Trial Lake
a = 40.68
b = -110.95
lat2d = f_in[0]->XLAT(0,:,:)
lon2d = f_in[0]->XLONG(0,:,:)
lat = lat2d(:,0) ;* technically not correct; depending on
grid ... could be very wrong*
lon = lon2d(0,:)
; use ndtooned to transform lat and lon into 1d arrays to find closest
gridpoint to Trial Lake
alat = ndtooned(lat2d)
alon = ndtooned(lon2d)
s_lat = closest_val(a,lat)
s_lon = closest_val(b,lon)
; get x-y indices for lat-lon data, convert back to verify accuracy
nm = getind_latlon2d(lat2d,lon2d,lat(s_lat),lon(s_lon))
nm1 = nm(0,0)
nm2 = nm(0,1)
print(nm)
*; Correct way*
* NM = getind_latlon2d(lat2d,lon2d,a,b) ; <== this is the correct
way NM1 = NM(0,0) NM2 = NM(0,1) print(NM)*
[3]* I* think people would hesitate to debug the script. It is very busy.
IMHO: it would require substantial time. EG:
Nov = new(n_years-1, "float")
do i = 0, n_years-2
s_date7 = years(i) + "110100"
s_time7 = ind(grid_t.EQ.s_date7)
print(s_time7)
e_time7 = s_time7 + Nov_hr
Nov(i) = sum(f_in[:]->PREC_ACC_NC(s_time7:e_time7,nm1,nm2))
print(Nov)
end do
[4]
f = *addfiles*("wrf2d_d01_2019-*","r")
sTime = *tostring*(f[:]->Times)
yyyy_wrf = *toint*(str_get_cols(sTime, 0,3))
mm_wrf = toint(str_get_cols(sTime, 5,6))
dd_wrf = toint(str_get_cols(sTime, 8,9))
hh_wrf = toint(str_get_cols(sTime, 10,11))
iJan = *ind*(mm_wrf.eq. 1) ; monthly indices
printVarSummary(iJan)
print("----------------")
pJan =* f[:]*->PREC(iJan,:,:) ; All January days and time
printVarSummary(pJan)
printMinMax(pJan)
print("----------------")
On Mon, May 13, 2019 at 4:51 PM Zach Rieck <zrr817 at gmail.com> wrote:
> To Whom it May Concern-
>
> 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.
>
> 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.
>
> 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.
>
> 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.
>
> Respectfully,
>
> -Zach Rieck
> zrr817 at gmail.com
> (513)-502-5652
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190513/c63d531a/attachment.html>
More information about the ncl-talk
mailing list