NclMalloc Failed:[errno=12]...switch to float?

From: DJ Rasmussen <dj.rasmussen_at_nyahnyahspammersnyahnyah>
Date: Tue, 22 Sep 2009 12:40:20 -0500

I have a NCL file that calls in some files (up to 14) then
computes some averages of them. However, with NCL version
5.1.1 I get the following error:

fatal:NclMalloc Failed:[errno=12]
fatal:dim_avg_n: Could not coerce input data to double,
can't continue
fatal:Execute: Error occurred at or near line 40 in file

Which I know has something to do with memory allocation. I
am guessing I need to have my variables somehow be set to
float when I use the function dim_avg_n_Wrap. Here is a
print out of my variable, WSPD:

Variable: WSPD
Type: float
Total Size: 488317440 bytes
             122079360 values
Number of Dimensions: 3
Dimensions and sizes: [time | 8760] x [yc | 104] x [xc |
             time: [0.125..1096]
             yc: [600000..5750000]
             xc: [600000..7250000]
Number Of Attributes: 9
   _FillValue : 1e+20
   original_units : m s-1
   original_name : UA
   missing_value : 1e+20
   coordinates : lon lat level
   units : m s-1
   long_name : wind speed
   standard_name : eastward_wind
   grid_mapping : Transverse_Mercator

Looking at the NCL archive, I didn't see anything related
to this particular problem with this function,
dim_avg_n_Wrap. Maybe because it is rather new?

Any advice would be helpful.

My code:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"


; read in multiple netCDF files
diri = "/home/rasmussen/NARCCAP/netCDF/RCM3/" ; directory
where files reside
fils = systemfunc("ls "+diri+"*as_RCM3_*.nc")
nfil = dimsizes(fils)

;*************************Get Variables**********
  f = addfiles (fils, "r")

    UAS = f[:]->uas ; (time,yc,xc)
    VAS = f[:]->vas ; (time,yc,xc)


    WSPD = sqrt(UAS^2 + VAS^2) ; calculate wind speed

    WSPD=(WSPD*2.2) ; convert to miles per hour

    copy_VarMeta(UAS, WSPD) ; copy dimensions to new
averaged wind speed array
    WSPD_at_long_name = "wind speed"

;*************************Calculate Average******

    WSPD_AVG = dim_avg_n_Wrap(WSPD,0) ; (lat,lon)
    WSPD_AVG_at_long_name = "mean wind speed"


; output ascii

  fName = "RCM3AVG.txt"
  system("/bin/rm -f "+fName) ; remove if file is present
  asciiwrite (fName , WSPD)

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Tue Sep 22 2009 - 11:40:20 MDT

This archive was generated by hypermail 2.2.0 : Thu Sep 24 2009 - 13:55:09 MDT