[ncl-talk] Calculating monthly number of precipitation days using daily data from netCDF file

amit timilsina timilsinaamit87 at huskers.unl.edu
Sat Nov 7 11:05:41 MST 2015


Hello all,
I have precipitation data in netCDF file. I intended to calculate the number of precipitation days per month over 30 years period considering days with precipitation more than 0.001 mm. I used following syntax:

a1 =addfile("pr_day_MIROC5_rcp85_r2i1p1_20100101-20191231.nc","r") ; reading file
b1 = a1->pr
x1 = b1*86400    ; converting kg/m-2/s to mm/day
m = where(x1.ge. 0.001, 1, 0)       ; replacing pr value with 1 if prcipitation values is > 0.001 mm per day otherwise with 0
copy_VarCoords(b1,m)                 ; copying metadata
xMon = calculate_monthly_values(t1, "sum", 0, False)            ; caculating sum of days
warning:tofloat: A bad value was passed to (string) tofloat, input strings must contain numeric digits, replacing with missing value

Are there any other ways I could follow to calculate numbers of precipitation day? If not, what could be the best way to solve the above problem.

Thank you in advance.


Regards,
Amit Prasad Timilsina
University of Nebraska-Lincoln



More information about the ncl-talk mailing list