[ncl-talk] Daily average from wrfout multiple files

Dennis Shea shea at ucar.edu
Tue Jun 20 08:19:28 MDT 2017


Actually, I had a test script for 'calculate_daily_values' that used WRF
data. Specifically: 1-and-3 hrly WRF files. It does what Mary suggested. I
added a lot of print and printVarSummary for pedantic purposes. I suggest
looking at script and the generated output.



On Mon, Jun 19, 2017 at 1:47 PM, Mary Haley <haley at ucar.edu> wrote:

> The calculate_xxxx_values functions expect the time dimension of the
> variable you're trying to average to have a time coordinate array attached
> to it.
>
> WRF-ARW data does not have a time coordinate array, but I think you can
> create one.
>
> Before calling calculate_daily_values, try this:
>
>   x&Time :=  wrf_times_c(a[:]->Times, 0)  ; convert to "hours since"
>
> You may need to load this file at the top of your script, since it defines
> the "wrf_times_c" function:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
>
> --Mary
>
>
>
>
> On Mon, Jun 19, 2017 at 11:43 AM, Vanúcia Schumacher <
> vanucia-schumacher at hotmail.com> wrote:
>
>> Dear NCL users,
>>
>> Is there any NCL function to calculate the
>> daily average from wrf output files by each 6 hourly (4 files per day)
>> I've tried the function below, but it returns the error:
>> No coordinate variable exists for dimension (Time) in variable (x)
>>
>> How can I resolve this issue for this data?
>>
>>
>> files = systemfunc("ls -1 wrfout_d01_20*") + ".nc"
>>       a = addfiles(files,"r")
>>       x = wrf_user_getvar(a,"slp",-1)
>>             printVarSummary(x)
>>  xDayAvg = calculate_daily_values(x, "avg", nDim, False)
>>
>> Variable: x
>> Type: float
>> Total Size: 67200 bytes
>>             16800 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [Time | 12] x [south_north | 50] x [west_east | 28]
>> Coordinates:
>> Number Of Attributes: 6
>>   description : Sea Level Pressure
>>   units : hPa
>>   coordinates : XLONG XLAT
>>   stagger :
>>   MemoryOrder : XYZ
>>   FieldType : 104
>>
>>
>> Regards
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20170620/d193d598/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_daily_mean.ncl
Type: application/octet-stream
Size: 1804 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170620/d193d598/attachment.obj 


More information about the ncl-talk mailing list