[ncl-talk] wrf_user_getvar for 3d variables in multiple files

Sheng-Hung Wang wang.446 at osu.edu
Wed Dec 6 08:34:38 MST 2017


Hi Mary

Maybe I should make it clear in my question.

wrf_user_getvar is working on 2D variables (in your case T2) for 
multiple files.

It seems not working on 3D variable (in my example pressures of model 
levels) for multiple files.

I used the way you used to open multiple wrfout files.

I can get by using do loop for each file, but it is kind of slow.

Thanks

Sheng-Hung


On 12/5/2017 6:32 PM, Mary Haley wrote:
> 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 
> <mailto: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 <tel:%28614%29%20292-1060>
>      Fax: (614) 292-4697 <tel:%28614%29%20292-4697>
>      email: wang.446 at osu.edu <mailto:wang.446 at osu.edu>
>     ========================================
>
>     _______________________________________________
>     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
>     <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>

-- 
========================================
  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
========================================

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


More information about the ncl-talk mailing list