[ncl-talk] Plotting 2D (surface) WRF Wind Data
Bill Ladwig
ladwig at ucar.edu
Tue Jul 31 12:04:40 MDT 2018
Hi Brock,
The error is occurring in your call to wrf_map_overlays. The reason is
because your data is different from what it would be in actual WRF output.
The XLAT variable is a 3D variable in a WRF file (Time, south_north,
west_east) and only a 2D variable in your data, which is why you're seeing
that subscripting error (and causing everything else to crash). The bottom
line is that your data set has changed so much from what it is in WRF that
the 'wrf_*' routines are going to have problems.
However, it looks like your script made it all the way to the bottom, so
you should just need to change the wrf_map_overlays call to instead do it
the traditional NCL way (wrf_map_overlays is a wrapper around the typical
NCL drawing routines). Here is a link to the overlay examples:
https://www.ncl.ucar.edu/Applications/overlay.shtml
Give it a good try, and if you're still having problems with the plotting,
send another reply to this thread.
Hope this helps,
Bill
On Mon, Jul 30, 2018 at 11:44 PM Brock Tropea <brockt.1337 at gmail.com> wrote:
> Hello,
>
> I'm a grad student, attempting to do some work with the NCAR WRF CONUS
> simulations:
> https://rda.ucar.edu/datasets/ds612.0/#access
>
> Currently, I'm just trying to look at the surface wind field (ie: the 2D U
> and V field), as either a vector or wind barb map. I've already tried to do
> this in python, which I cannot get working, so I've given up on that for
> the moment. Was hoping NCL might be able to handle it easier.
>
> This dataset has given me nothing but headaches from day 1, because the
> WRF output is not organized like normal WRF output. Rather than a single
> file for a day or an hour, with all variables in it, there are individual
> NetCDF files for each variable (organized into 3 month chunks). At least,
> that's my understanding of how "normal" WRF output works.
>
> This is mostly a problem for wind data, because the U and V components are
> their own NetCDF files; all of the plotting routines I've seen in NCL for
> wind plots seem to depend on there being a single input file.
> I was looking through some of the examples, particularly "wrf_nogsn_6.ncl
> <http://www.ncl.ucar.edu/Applications/Scripts/wrf_nogsn_6.ncl>" upon
> Mary's recommendation:
> http://www.ncl.ucar.edu/Applications/wrfgsn.shtml
>
> There, you can see this issue in action. Both "wrf_vector" and
> "wrf_map_overlays" only accept a single input file? (in this case, "a").
>
>
> Anyway, I've tried playing with modified versions of wrf_nogsn_6.ncl for a
> week or so now, with zero luck. *My suspected issues*:
>
> *1.* I'm only referencing a single input file, a, which in my case has
> only the U component.
>
> *2.* The U and V winds are staggered in the west_east and north_south
> dimensions, respectively; they need to be unstaggered, so that they line up
> with the mass points. I used "wrf_user_unstagger", but it didn't seem to
> help. This is likely due to problem #1.
>
> *3.* After I used the unstagger command, I get the following error:
> "[umtropea at tatanka NCL]$ ncl wrf_windtest3.ncl
> Copyright (C) 1995-2017 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.4.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:Number of subscripts do not match number of dimensions of variable,
> (3) subscripts used, (2) subscripts expected
> fatal:["Execute.c":6381]:variable (XLAT) is not in file (in_file)
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 4122 in
> file
> /global/software/ncl-6.4.0-Prebuild/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 4223 in
> file
> /global/software/ncl-6.4.0-Prebuild/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 4306 in
> file
> /global/software/ncl-6.4.0-Prebuild/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 53 in
> file wrf_windtest3.ncl"
>
> Several things jump out here. Firstly, it's talking about subscripting,
> which is confusing because I have no subscripting in the ncl file that
> generates this error. Second, it is looking for the "XLAT" variable, which
> it cannot find. This is strange, because XLAT is in the file. I've checked
> with filedump. See the attached screenshot.
>
>
>
> So I'm kind of at a loss as to what to do here, so I come here as a last
> resort. I've attached the script I'm using at the moment, as well as a
> screenshot of ncl_filedump's proof of U and XLAT existing in the "U" NetCDF
> file.
>
> I can't attach any of the data file's I'm using, as they're huge, but they
> are available at the link at the start of this message. I'm using NCL 6.4.0
> on CentOS 64 bit v6.8.
>
> Any and all help would be incredibly appreciated. Sorry for the lengthy
> email, and I apologize if this is trivial.
>
>
>
> Cheers
>
> _______________________________________________
> 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/20180731/a4087263/attachment.html>
More information about the ncl-talk
mailing list