[1]
How much memory do you have available on your machine?
[2]
A single (leap) year will be: w(1464, 17, 73, 144)
For type float, that will be 1464*17*73*144*4 = 1046490624 bytes
You could just read a single file:
diru ="/home/Vishali/Documents/dadosVentos/Speed/"
filu = systemfunc("cd "+diru+" ; ls wind*nc")
f = addfiles(diru+filu, "r")
ListSetType (f, "cat") ; 'cat' (default) or 'join'
w = f[0]->WSpeed ; read from the 1st file only
printVarSummary(w)
---
Currently, NCL can handle only 2GB variables. Obviously,
7 years of data will yield a variable of 7GB+.
Note: The *next* release of NCL (v6.0.0) will be able to handle
variables of this size.
================================================================
If you have one file per year, try the following *untested*
code (otherwise, change as necessary). Note: I am sure the CDO
are computing the weighted means. The following computes the
unweighted monthly means.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
yrStrt = 1998
yrLast = 2004
nyrs = yrLast-yrStrt+1
klev = 17
nlat = 73
mlon = 144
ntim = 12*nyrs ; number of months
wMon = new ( (/ntim,klev,nlat,mlon/), "float", 1e20)
tMon = new ( ntim, "double", "No_FillValue")
diru = "/home/Vishali/Documents/dadosVentos/Speed/"
filu = systemfunc("cd "+diru+" ; ls wind*nc")
nfilu = dimsizes(filu)
; calculate monthly means from 6hrly
nmoStrt = 0
nmoLast = 11
do nf=0,nfilu-1
f = addfile(diru+filu(nf), "r")
w = f->WSpeed
wMon(nmoStrt:nmoLast,:,:,:) = calculate_monthly_values(w,
"avg",0, False)
nmoStrt = nmoStrt+12
nmoLast = nmoLast+12
delete(w) ; may change size next iteration (leap yr)
end do
delete(wMon&time)
printVarSummary(wMon) ; wMon(84,17,73,144)
time = yyyymm_time(yrStrt, yrLast, "integer")
wMon&time = time
wMon!1 = "level" ; minor bug in "calculate_monthly_values"
wMon&level = f->level
printVarSummary(wMon)
; unweighted seasonal means
wAllSea = wgt_runave_n_Wrap(wMon, 3, 0, 0)
printVarSummary(wAllSea)
wSea = wAllSea(::3,:,:,:) ; (28,14,73,144)
printVarSummary(wSea)
On 10/19/2010 12:45 PM, Vishali P. wrote:
> Hello, Ive tried with this script, but appears this error
>
> ;*************************************************
> ; wind.ncl (1998-2004)
> ;************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> ;************************************************
> begin
> ;************************************************
> ; read in netCDF file
> ;************************************************
>
> diru ="/home/Vishali/Documents/dadosVentos/Speed/"
> filu = systemfunc("cd "+diru+" ; ls wind*nc")
> f = addfiles(diru+filu, "r")
>
> ListSetType (f, "cat") ; 'cat' (default) or 'join'
>
> w = f[:]->WSpeed
> printVarSummary(w)
>
> end
>
>
> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
>
> *** glibc detected *** ncl: munmap_chunk(): invalid pointer: 0x7e702008 ***
> ======= Backtrace: =========
> /lib/libc.so.6[0x4cffe1]
> ncl(NclFree+0x22)[0x8101262]
> ncl[0x80ddbc5]
> ncl(_NclDestroyObj+0x73)[0x80eb513]
> ncl(CallLIST_READ_FILEVAR_OP+0xea8)[0x817e238]
> ncl(_NclExecute+0x6aa)[0x818096a]
> ncl(yyparse+0x762d)[0x809da2d]
> ncl(main+0x8bb)[0x8091a6b]
> /lib/libc.so.6(__libc_start_main+0xe6)[0x477cc6]
> ncl[0x8091111]
> ======= Memory map: ========
> 00101000-001b4000 r-xp 00000000 08:06 78990 /lib/libkrb5.so.3.3
> 001b4000-001ba000 rw-p 000b3000 08:06 78990 /lib/libkrb5.so.3.3
> 001bc000-001e6000 r-xp 00000000 08:06 78988 /lib/libk5crypto.so.3.1
> .
> .
> .
> 06530000-06537000 rw-p 00000000 00:00 0
> 08043000-088b0000 r-xp 00000000 08:06 823 /usr/bin/nclAborted
> (core dumped)
>
>
>
>
--
======================================================
Dennis J. Shea tel: 303-497-1361 |
P.O. Box 3000 fax: 303-497-1333 |
Climate Analysis Section |
Climate & Global Dynamics Div. |
National Center for Atmospheric Research |
Boulder, CO 80307 |
USA email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 19 15:06:37 2010
This archive was generated by hypermail 2.1.8 : Fri Oct 22 2010 - 12:21:46 MDT