Re: getfilevardims() while Handling Multiple File

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sat May 29 2010 - 10:47:33 MDT

Adam is correct. You should not reorder on input.
Forther, for your purpose, there is no need to reorder at all.

If you are performing an average

t=infile1[:]->temp((0:99,0,:,:)
clm = dim_avg_n_Wrap(t,0)
printVarSummary(clm)

On 5/29/10 10:37 AM, Adam Phillips wrote:
> Hello again,
> In this case, the error message is telling you what the problem is.
> infile1 is a list, and getfilevardims does not support lists. Also, it is
> inefficient in NCL to dimension reorder upon reading in an array. I think
> the best way to accomplish what you want is to do the following:
>
> fpath = systemfunc ("ls
> /gpfs2/home/kiran/freerun/t62/monthly/time_mean.*01.nc")
> infile1= addfiles(fpath,"r")
> tw=infile1[:]->temp(0:99,0,:,:)
> dims = getvardims(tw)
> t = tw($dims(1)$ |:,$dims(2)$ |:,{$dims(0)$ |:})
> delete(tw)
>
> Good luck,
> Adam
>
>
>
>
>
>> Hello,
>>
>> I wrote a script to analyse my data spread over many files. I got an error
>> while using getfilevardims() function for a variable from multiple file.
>> The
>> details of the variable which I have taken is as follows:
>>
>> ##########################
>> Variable: temp (file variable)
>> Type: float
>> Total Size: 1163520000 bytes
>> 290880000 values
>> Number of Dimensions: 4
>> Dimensions and sizes: [Time | 101] x [zt_k | 40] x [yt_j | 200] x [xt_i
>> |
>> 360]
>> Coordinates:
>> Time: [35079.95833333334..71604.95833333331]
>> zt_k: [ 5..4478.478]
>> yt_j: [-74.5..64.4997]
>> xt_i: [0.5..359.5]
>> Number Of Attributes: 5
>> long_name : potential temperature
>> units : deg C
>> valid_range : ( -5, 50 )
>> missing_value : -1e+34
>> _FillValue : -1e+34
>> ##########################
>>
>> My script is provided here.
>>
>> 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"
>>
>> begin
>> fpath = systemfunc ("ls /gpfs2/home/kiran/freerun/t62/monthly/time_mean.*
>> 01.nc")
>> infile1= addfiles(fpath,"r")
>> c*
>> t=infile1[:]->temp($dims(2)$ |:,$dims(3)$ |:,{$dims(0)$ |0:99},$dims(1)$
>> |0)
>>
>> clm = dim_avg_n(t,2)
>> copy_VarCoords_1(t,clm)
>> ................................................
>> ................................................
>> ................................................
>> contour = gsn_csm_contour_map(wks,clm,res)
>> end
>>
>> #######################
>> The error message is as follows:
>>
>> *fatal:_NclBuildConcatArray: Arrays of files are not yet supported
>> fatal:Execute: Error occurred at or near line 15 in file clim5.ncl*
>>
>> #######################
>>
>> Line number 15 is at the getfilevardims() function call.
>> Can anybody suggest a way to solve this problem?
>>
>> Thanking you in advance.
>>
>> --
>> Gibies George,CSIR-RF,
>> Climate and Global Modelling Division,
>> Indian Institute of Tropical Meteorology,
>> Dr. Homi Bhabha Road,
>> NCL (P. O.), Pashan,
>> Pune 411008, India.
>>
>> http://sites.google.com/site/gibiesge/
>> _______________________________________________
>> 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
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat May 29 10:47:39 2010

This archive was generated by hypermail 2.1.8 : Tue Jun 01 2010 - 09:12:20 MDT