[ncl-talk] wrf_user_getvar for 3d variables in multiple files
Mary Haley
haley at ucar.edu
Tue Dec 5 16:32:51 MST 2017
Sheng-Hung,
Using a list of files should work with wrf_user_getvar, but you didn't
indicate how the function was failing, or how you are trying to open the
files.
It should work with something like this:
ncl 0> fnames = systemfunc("ls -1 wrfout_d01_2008-09-29*")
ncl 1> print("# of files = " + dimsizes(fnames))
(0) # of files = 48
ncl 2> a = addfiles(fnames,"r")
ncl 3> t = wrf_user_getvar(a,"T2",-1)
ncl 4> printVarSummary(t)
Variable: t
Type: float
Total Size: 7791744 bytes
1947936 values
Number of Dimensions: 3
Dimensions and sizes: [Time | 48] x [south_north | 197] x [west_east | 206]
Coordinates:
Number Of Attributes: 6
FieldType : 104
MemoryOrder : XY
description : TEMP at 2 M
units : K
stagger :
coordinates : XLONG XLAT
ncl 5>
--Mary
On Mon, Dec 4, 2017 at 12:08 PM, Sheng-Hung Wang <wang.446 at osu.edu> wrote:
> Hi
>
> Is there a problem (or bug) for following NCL statement
>
> wrf_P = wrf_user_getvar(a,"pressure",-1)
>
> a is multiple wrfout files.
>
> When I changed time=-1 to single time step, the function worked. It didn't
> work on multiple time steps.
>
> Thanks
>
> Sheng-Hung
>
> --
> ========================================
> Sheng-Hung Wang, PhD
> Polar Meteorology Group
> Byrd Polar and Climate Research Center
> The Ohio State University
> 1090 Carmack Road, Columbus, Ohio 43210
> Phone: (614) 292-1060
> Fax: (614) 292-4697
> email: wang.446 at osu.edu
> ========================================
>
> _______________________________________________
> 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/20171205/d35459e6/attachment.html>
More information about the ncl-talk
mailing list