[ncl-talk] fatal:["Execute.c":8640]:Execute: Error occurred at or near line 897 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/crop.ncl
Beáta Szabó-Takács
szabo.b at czechglobe.cz
Wed Aug 23 05:08:57 MDT 2017
Dear NCL Users,
I would like to calculate Aridity index base on Hargreaves ETo equation. I use daily maximum and minimum temperature data from 1971 to 2000 and yearly sum precipitation (30 years). The dimension of latitude is (201x464) and the day of year is (10957) vector for radext_fao56 function. When I run the scipt I get the following error message:
fatal:NclMalloc Failed:[errno=12]
fatal:New: could not create new array:[errno=12]
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 897 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/crop.ncl
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 162 in file lambert_PET.ncl
; Main code.
;----------------------------------------------------------------------
begin
;************************************************
; read in netCDF file
;************************************************
a = addfile("E-OBS_tasmax.nc","r")
b = addfile("E-OBS_tasmin.nc","r")
c = addfile("E-OBS_1971-2000_ys.nc","r")
tasmax = a->tasmax
tasmin = b->tasmin
Pr_annual_total = c->pr
lon = a->longitude
lat = a->latitude
time = a->time
minlat = 30 ; min lat to mask
maxlat = 75 ; max lat to mask
minlon = -20 ; min lon to mask
maxlon = 40 ; max lon to mask
nlat = dimsizes(lat)
mlon = dimsizes(lon)
lat_new=conform_dims( (/nlat,mlon/), lat, 0)
time2 = calendar_decode2(time,-5)
doy = day_of_year(time2(:,0),time2(:,1),time2(:,2))
print(doy)
radext = radext_fao56(doy, lat_new, 0)
radext = where(ismissing(radext), 0, radext)
evtH_0 = refevt_hargreaves_fao56( tmin, tmax, radext, (/0,0,0/) )
print(evtH_0)
opt = True
opt at nval_crit = 12
PET_m = calculate_monthly_values (evtH_0, "sum", 0,opt)
print(PET_m)
PET_annual_total = month_to_annual(PET_m, 0)
; Pr_annual_total = month_to_annual(Pr_m, 0)
AI = Pr_annual_total/PET_annual_total
AI2 = dim_avg_n(AI,0)
IM = new(dimsizes(AI2),typeof(AI2))
IM = where(AI2 .lt. 0.03,1.0,IM)
IM = where(AI2 .ge. 0.03 .and. AI2 .lt. 0.2,2.0,IM)
IM = where(AI2 .ge. 0.2 .and. AI2 .lt. 0.5,3.0,IM)
IM = where(AI2 .ge. 0.5 .and. AI2 .lt. 0.65,4.0,IM)
IM = where(AI2 .ge. 0.65,5.0,IM)
The error refer to the radext_fao56 in my script which is attached as well. Could someone suggest a solution?
Thank you for your help in advance!
Best regards,
Beata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170823/6aac372a/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lambert_PET.ncl
Type: application/octet-stream
Size: 10290 bytes
Desc: lambert_PET.ncl
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170823/6aac372a/attachment.obj
More information about the ncl-talk
mailing list