[ncl-talk] Fw: script for daily average
Muhammad Omer Mughal
m.mughal1 at graduate.curtin.edu.au
Wed Jan 31 18:31:36 MST 2018
Hi
I tried to use the suggestion provided by Dennis below and it shows the error.I am using NCL version 6.4.0. I am repeating the steps here for convenience.
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
a=addfile("wrfout_d05_2016-04-01_00:00:00","r")
tc2= wrf_user_getvar(a,"T2",-1)
nDim = 0
tc2DayAvg= calculate_daily_values(tc2, "avg", nDim, False)
At this stage I get the following error
fatal:No coordinate variable exists for dimension (Time) in variable (x)
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 18125 in file /usr/local/ncl-6.4.0/lib/ncarg/nclscripts/csm/contributed.ncl
So I try to do the following to correct this error
tc2 at Time=wrf_times_c(a->Times,0)
and repeat the command but I still receive the same error as above.
I would appreciate the help depending upon your convenience.
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)
________________________________
From: Dennis Shea <shea at ucar.edu>
Sent: Thursday, 1 February 2018 5:51:50 AM
To: Muhammad Omer Mughal
Cc: ncl-talk at ucar.edu
Subject: Re: [ncl-talk] Fw: script for daily average
I am not sure what you were doing but *read the following documentation":
https://www.ncl.ucar.edu/Document/Functions/Contributed/calculate_daily_values.shtml
requires 6.4.0
========
nDim = 0
tc2DayAvg= calculate_daily_values(tc2, "avg", nDim, False)
tc2DayAvg at description = "Daily Mean: " + tc2 at description
printVarSummary(tc2DayAvg)
printMinMax(tc2DayAvg,0)
print("-----")
On Wed, Jan 31, 2018 at 2:24 PM, Muhammad Omer Mughal via ncl-talk <ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>> wrote:
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<tel:+61%208%209266%207962>
Fax | +61 8 9266 2377<tel:+61%208%209266%202377>
Mobile | 0470 237 525
Email | m.mughal1 at postgrad.curtin.edu.au<mailto: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<mailto: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)
_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180201/1874213a/attachment.html>
More information about the ncl-talk
mailing list