[ncl-talk] segmentation fault caused by large variable

Dennis Shea shea at ucar.edu
Thu Jan 26 16:08:54 MST 2017


Did you run out of memory?



*print(12419l*22*145*512*4)  ; *4 for
bytes                                               ; the appended  'l' [
small L ] make a long integer(0)    81134817280 *

81+GB  for the variable 'x'

Another 81GB for the variable 'xAnom'

Do you need the original 'x' ? If not, maybe the following will work:

Replace

  xAnom = new((/ntim,nlev,nlat,mlon/),float) ; This line causes the
segmentation fault.
 do n = 0,nlev-1
    xAnom(:,n,:,:)  = calcDayAnomTLL (x(:,n,:,:), yyyyddd, xClmDay(:,n,:,:))
  end d0


With

 do n = 0,nlev-1
    x(:,n,:,:)  = calcDayAnomTLL (x(:,n,:,:), yyyyddd, xClmDay(:,n,:,:))
  end do



On Wed, Jan 25, 2017 at 1:43 PM, Cristiana Stan <cstan at gmu.edu> wrote:

>
> Hi,
>
> I would like to compute daily anomalies of a large 4D variable that
> exceeds the NCL size limit and causes segmentation fault. I’m looking for a
> suggestion to work around this issue.
>
> My code looks like:
>
>  x       =  f->$var$(iStrt:iLast,:,:,:)
>
> ntim = 12419
> nlev = 22
> nlat = 145
> mlon = 512
>
>
> xClmDay = clmDayTLLL((/x/), yyyyddd)
>
>
> xAnom = new((/ntim,nlev,nlat,mlon/),float) ; This line causes the
> segmentation fault.
>  do n = 0,nlev-1
>     xAnom(:,n,:,:)  = calcDayAnomTLL (x(:,n,:,:), yyyyddd,
> xClmDay(:,n,:,:))
>   end do
>
> ;***********************************************************
> ; Create netCDF using 'simple' method
> ;***********************************************************
>
>
> Thanks,
>
> Cristiana
>
>
>
>
> _______________________________________________
> 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/20170126/a5b57b28/attachment.html 


More information about the ncl-talk mailing list