Re: DEM plot: memory allocation error

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 11 2013 - 08:53:06 MDT

Hi Noel,

Sorry, I've been away from ncl-talk for a bit.

This is not something you can fix with wsMaximumSize, unfortunately. I think internally, NCL might be making a copy of your array, and simply running out of memory.

What type is the variable?

I'm hoping Dave Brown will have an idea for a work-around, that might prevent a copy from taking place.

--Mary

On Apr 8, 2013, at 1:17 PM, Noel Aloysius wrote:

> Dear NCL-talk,
>
> I have a 90m DEM with the following dimensions (/27260,26610/), ~ 2.9GB in size. The script below creates a spatial plot of the DEM.
>
> The plot is successfully created if I restrict the region as follows,
>
> plot = gsn_csm_contour_map(wks, dem90m(5000:27259,5000:26609), res1)
>
> I get an error otherwise.
>
> fatal:NhlRealloc Failed:[errno=12]
> fatal:ContourPlotDraw: dynamic memory allocation error
> fatal:ContourPlotDraw: draw error
> warning:WorkstationDeactivate: workstation not active or not opened
>
> Is there a way around?
>
> Thanks,
> Noel
>
>
> ;*****************************************************************
> ffig = diro + "dem90m"
> wks = gsn_open_wks(type, ffig)
> plot = new(1, graphic)
> gsn_define_colormap(wks, "ncl_default")
> maps = NewList("fifo")
>
> ;--------------------------------------------------------
> setvalues NhlGetWorkspaceObjectId()
> "wsMaximumSize": 2000000000
> end setvalues
> ;--------------------------------------------------------
>
> res1 = True ; plot mods desired
> res1@gsnDraw = False
> res1@gsnFrame = False
>
> res1@tiMainString = "90m DEM"
> res1@gsnPaperOrientation = "auto"
> res1@gsnMaximize = True
> res1@gsnSpreadColors = True
> res1@gsnAddCyclic = False
>
> res1@lbLabelBarOn = True
>
> res1@cnFillMode = "RasterFill"
> res1@cnFillOn = True
> res1@cnLinesOn = False
>
> res1@mpCenterLonF = (regBnds(2)+regBnds(3))/2 ; center the map arounf this lon.
> res1@mpMinLatF = regBnds(0) ; select a subregion
> res1@mpMaxLatF = regBnds(1)
> res1@mpMinLonF = regBnds(2)
> res1@mpMaxLonF = regBnds(3)
>
> plot = gsn_csm_contour_map(wks, dem90m(5000:27259,5000:26609), res1)
> ;plot = gsn_csm_contour_map(wks, dem90m, res1)
>
> ; draw polygon
> lnres1 = True
> lnres1@gsLineColor = "black"
> lnres1@gsLineThicknessF = 2.0
> ListPush(maps, gsn_add_shapefile_polylines(wks,plot,fshp1,lnres1))
>
> draw(wks)
> frame(wks)
> ;***************************************************************
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 11 08:53:16 2013

This archive was generated by hypermail 2.1.8 : Mon Apr 15 2013 - 20:12:25 MDT