[ncl-talk] Fw: script for daily average

Muhammad Omer Mughal m.mughal1 at graduate.curtin.edu.au
Wed Jan 31 14:24:38 MST 2018




​
Muhammad Omer Mughal
MSc BSc Mechanical Engineering
PhD  Research Scholar
Remote Sensing and Satellite Research Group
Department of Imaging and Applied Physics
Curtin University

Curtin University
Tel | +61 8 9266 7962
Fax | +61 8 9266 2377
Mobile | 0470 237 525

Email | m.mughal1 at postgrad.curtin.edu.au
Web | http://curtin.edu.au

​ Curtin University is a trademark of Curtin University of Technology.
CRICOS Provider Code 00301J (WA), 02637B (NSW)

​
________________________________
From: Muhammad Omer Mughal
Sent: Wednesday, 31 January 2018 12:17:57 PM
To: ncl-talk at ucar.edu
Subject: script for daily average


Hi


I wrote the following script to calculate the daily averages


a=addfile("./wrfout_d05_2016-04-01_00:00:00","r")
tc2= wrf_user_getvar(a,"T2",-1)
tc2_dims=dimsizes(tc2)
ntim=tc2_dims(0)
nlat=tc2_dims(1)
nlon=tc2_dims(2)

ndays=ntim/24

tc2D=reshape(tc2,(/ndays,nlat,nlon/))
copy_VarAtts(tc2,tc2D)
tc2_hr_avg=dim_avg_n_Wrap(tc2D,0)

printVarSummary(tc2_hr)

but I am seeing the following error


input dimension sizes cannot conform to dimensions of input array

The Var summaries are as follows
Variable: tc2
Type: float
Total Size: 75526920 bytes
            18881730 values
Number of Dimensions: 3
Dimensions and sizes:    [Time | 697] x [south_north | 129] x [west_east | 210]
Coordinates:
Number Of Attributes: 6
  coordinates :    XLONG XLAT XTIME
  stagger :
  units :    K
  description :    TEMP at 2 M
  MemoryOrder :    XY
  FieldType :    104

Variable: nlat
Type: integer
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:    [1]
Coordinates:
(0)    129







Muhammad Omer Mughal
MSc BSc Mechanical Engineering
PhD  Research Scholar
Remote Sensing and Satellite Research Group
Department of Imaging and Applied Physics
Curtin University

Curtin University
Tel | +61 8 9266 7962
Fax | +61 8 9266 2377
Mobile | 0470 237 525

Email | m.mughal1 at postgrad.curtin.edu.au<mailto:m.lynch at curtin.edu.au>
Web | http://curtin.edu.au<http://curtin.edu.au/>

Curtin University is a trademark of Curtin University of Technology.
CRICOS Provider Code 00301J (WA), 02637B (NSW)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180131/dee13522/attachment.html>


More information about the ncl-talk mailing list