Re: malloc error in area_hi2lores

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri, 12 Jun 2009 09:54:31 -0600 (MDT)

Erik,

I think you are simply running out of memory on your machine. How
much memory do you have on your machine?

What happens if you only execute these lines:

  a = addfile("CMORPH_September_.25x.25.nc","r")
  p = a->CMOPRH_RAIN_RATE
  p =p(:,::-1,:)
  Lat = fspan(-59.875,59.875,240)
  Lon = fspan(-180,180,720)
  po = area_hi2lores (p&lon,p&lat, p , True, 1, Lon, Lat, False)

If the above fails, what about this:

  a = addfile("CMORPH_September_.25x.25.nc","r")
  p = a->CMOPRH_RAIN_RATE
  p =p(:,::-1,:)
  nl = dimsizes(p(:,0,0))

  Lat = fspan(-59.875,59.875,240)
  Lon = fspan(-180,180,720)
  po = new((/nl,720,240/),typeof(p))

--Mary

On Fri, 12 Jun 2009, Erik Noble wrote:

> Hi. I fixed those errors. Lat variable is monotonically increasing (ncl 7>
> rain_new=p(:,::-1,:) ) and the lat and lon variables are not transposed in
> the are_hi2low function.Thank you for catching those two.
>
> But I am still getting this error.
>
>
> noble:CMORPH enoble$ ncl
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> ncl 0> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> ncl 1> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> ncl 2> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> ncl 3> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> ncl 4> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
> ncl 5> a = addfile("CMORPH_September_.25x.25.nc","r")
> ncl 6> p = a->CMOPRH_RAIN_RATE
> ncl 7> p =p(:,::-1,:)
> ncl 8> Lat = fspan(-59.875,59.875,240)
> ncl 9> Lon = fspan(-180,180,720)
> ncl 10> po = area_hi2lores_Wrap (p&lon,p&lat, p , True, 1, Lon, Lat,
> False)
> ncl(96407) malloc: *** mmap(size=1327104000) failed (error code=12)
> *** error: can't allocate region
> *** set a breakpoint in malloc_error_break to debug
> Bus error
> *****************************************
>
> BELOW,I used the example from the NCL website and it worked (below). But
> when I try to interpolate the to the grid I need, it gives me an error
> (above.)
>
> noble:CMORPH enoble$ ncl
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> ncl 0> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> ncl 1> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> ncl 2> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> ncl 3> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> ncl 4> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
> ncl 5> a = addfile("CMORPH_September_.25x.25.nc","r")
> ncl 6> p = a->CMOPRH_RAIN_RATE
> ncl 7> p =p(:,::-1,:) ; make lat monotonically increasing
> ncl 8> LON = fspan(-178.5,178.5, 120)
> ncl 9> LAT = fspan(-48,48, 49)
> ncl 10> po = area_hi2lores_Wrap (p&lon,p&lat, p , True, 1, LON, LAT,
> False) ; (ntim,49,120)
> ncl 11> printMinMax(po, True)
> (0)
> (0) CMORPH: min=0 max=11.5147
> ncl 12> printMinMax(p, True)
> (0)
> (0) CMORPH: min=0 max=40.3708
>
>
>>
>> _______________________________________________
>> 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 Fri Jun 12 2009 - 09:54:31 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 15 2009 - 08:53:05 MDT