[ncl-talk] Daily average from wrfout multiple files

Mary Haley haley at ucar.edu
Mon Jun 19 13:47:58 MDT 2017


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170619/178748d2/attachment.html 


More information about the ncl-talk mailing list