[Thread Prev][Thread Next][Index]
Re: [ferret_users] How to read WRF output and plot ?
- To: ferret_users@xxxxxxxx
- Subject: Re: [ferret_users] How to read WRF output and plot ?
- From: Ansley Manke <a.c.manke@xxxxxxxxx>
- Date: Thu, 20 Apr 2023 16:58:18 -0700
- Arc-authentication-results: i=4; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=dzBpKclO; arc=pass (i=2 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of a.c.manke@xxxxxxxxx designates 209.85.160.200 as permitted sender) smtp.mailfrom=a.c.manke@xxxxxxxxx
- Arc-authentication-results: i=3; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=dzBpKclO; arc=pass (i=2 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of a.c.manke@xxxxxxxxx designates 209.85.160.200 as permitted sender) smtp.mailfrom=a.c.manke@xxxxxxxxx
- Arc-authentication-results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=dzBpKclO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of a.c.manke@xxxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=a.c.manke@xxxxxxxxx
- Arc-authentication-results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=dzBpKclO; spf=pass (google.com: domain of a.c.manke@xxxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=a.c.manke@xxxxxxxxx; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
- Arc-message-signature: i=4; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-archive:list-help:list-post:list-id:mailing-list:precedence :in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:sender:dkim-signature; bh=03WCkXUFFLVsCLA/SrkQvwQOxs1/j7SBItbJUNFYSpo=; b=LWYoB8obr0WXU9XPRBq4cUI7a1bJW8zfgNxcLhAq7Ow69nsfcwmae2R9O+tDRkmCm8 u8k9q7TxVOLvR9p/0qDUjxZyR6EGiHQRsF59nX4YuVSNRht3WpfDNzOMI2ufm0rD0B+T QHWCBWv1eM29AtcHSpxzucy+/s4lvkt4alGgPgvYvMmxRQ5kySqrB6k6VVrtF2cos/9S fxyCTVx+aMcGJ8qKfFKoKLXo7PocrqngG2fAcgAPP7RLWv7vOAARkW0dMLQi6m+rA7f0 jyvU+zPL/kYLnRnWNSwrThre7jMdKbah2o8lsehmS0aOHizUAfDuX8G6Yer1MPNldt8P d4HQ==
- Arc-message-signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=03WCkXUFFLVsCLA/SrkQvwQOxs1/j7SBItbJUNFYSpo=; b=GxKCzolpJUzJ9Ef/nl4V8D3MJZsmB9nM+qReyS+24Y2idFqZrwGP0LshgC2Bf/IaMe rQYLovTHAc2JRZOOvj70kXeMuCnxdX5L9wAeDrgXFzXK6DjdGrVCnOmeQxluH7EJnxXJ 7Gf3IYzGRcfgcnjuUd1nyEfxc/YjDM/ttbTfVWM1C3Exq3ivQuHEXi2286CSVYfak+bi nE2ffcZi0nUj2qVvgyUwFvYJc8VL3Odi55mUPgXrFfO8rmkx0HvcWop/5Y8FQV5KzWZS n84bf0B1jydrBaQByDvnMHpY6ZCYPjxK4tLlSxlLPTvcKs8uMc4ePASEAaQbhpfzZ5Ed m7rQ==
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=03WCkXUFFLVsCLA/SrkQvwQOxs1/j7SBItbJUNFYSpo=; b=CjqZdq802YdYnFDy+kYPwMtkIC3QKE0fwELbIaaAEBqmy7aqtLBwU9WBNL4DIUsrhY /qH6bIaHoHCSUoemcKbuS1CQKB8rexlWKFohRFHrvhlHEuzlJ4PvyXOhL9IOhgFC9jpW Aok9hZ5T/EgRuZAuZGHR3POUobqJPfa9CE10d9mdHFFmVdyf0AU4+4lK+veS03sl/PCb ZFkyFltFunv3qHLTKIA4pqiaCMhsh3ClvcWWpeDUviTFF0omdUnW8/LqQJSVWXCvgfmA IkXu3m1I0Y4iNhlfdcks8pCtVkUsAzs4yfIDnCxc/cz0QfntCvu7ebhqzvan57FaQISF EibQ==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=03WCkXUFFLVsCLA/SrkQvwQOxs1/j7SBItbJUNFYSpo=; b=JiYEWOJmfxw+8Xyxf3r1h+x9lO1zVtlMw8Z9vvVK9xHZCYtbkyHq3D6yAYqfCPqAPI 0XKt2EAMXNHj/9AAXMKKEcDgAOoTY2vjDAcwkM4LyUInkgPU7JWBiT+wQER5BdgHvU59 nRKbS4dBI2GKUQH5k792zbU8RYMnRdmHwcWkgMjGgyUajfMp2aNZb4GgT3Pn0hRaCUt/ 9MmLunT9WloVtSKheiy+Z9WnDnE8U6rIPJDQcQ3gGJQIvyQQ+E7vNM6jn8i48ebz2NAS H8WYMnqTVDAsL9ZzYwJnQSQTh8pDzlXVutLkFXZJBTJ/Ei/h/CWv2d0UkOc9aOpVKqi7 zLTw==
- Arc-seal: i=4; a=rsa-sha256; t=1682035115; cv=pass; d=google.com; s=arc-20160816; b=rs7in20OSyfgeYmAwEjJeQaPZgOM1NQlvpgwq411B8xBReFULF7rN3q1D8zVsQaPfU E9yr22ZKTCvoG7AHZ8E0mbzc3tmtt9BYXnTlf4EFVpiWoDr7ksGZ+2zk8oo4ENpvhRNq tWqxFCSypJ50GcBSWT3D280FIZ9m+Iii5uy8VU9SEGmajsH2dQfge7vALBF165jWXH4E ERasAOamX576mNLp1DEaiGTRikW6b6UQTUNpOHFucWXdDKU0uORddA9V0kVKV2TMOyTM pW3khVQz56thcPTeiujQArKFNXraNmeuwo4Gmn0neDGR05hVlwbBaXgcV32RCa0DcCAY J07w==
- Arc-seal: i=3; a=rsa-sha256; t=1682035113; cv=pass; d=google.com; s=arc-20160816; b=fiocrp2G7Yf/lzmKr0GzYhwu2kbQQIh4tqiiTQaBsXlCQllY9IUBbmiB0ZIbZX2Ktp DlSE/4un/drRSQONrOX1DgIBckkxcFpfvxuxsXnwldyHJDI6H+A1ZwJsWS1coBVyTiYe 4H34yOWaioc+kXVhorxh9sQ5apX1JdFgEf3ZMf0KXxtSUtM2k5mMnGqWS1b7H7n5rH5I gcNISPrUj7omSYKLJ+aHZL8iHJsx9j7nmBP+Gp/g79t1RhVWHoyvzDjPWB8pwmyau+Ci BsZzLxynQPiA33jZNsJyDS2Rksi/Z5rCVerTUJueIZSbk1+QAF0rHaageiCRY5rNc81x zUZQ==
- Arc-seal: i=2; a=rsa-sha256; t=1682035104; cv=pass; d=google.com; s=arc-20160816; b=oZjCFOEnrgRK4Tx1AAFfD1GxaGrVikEt/ClLs9hgcHnGpZJs2ysxN/iajTITTD7cTn /DyG6mAKHUj6koOJmRmNQpqYxw6PSjZxjlSYwVshPd6auleyCC+GDVn4xBJUwcLNhowQ R1Dh5/noNv6eFygi+xS805KPCWfUAFaxsaI4To0kIxSiTa9hEQu04FG8NVQSUsGKRpn/ xTqDA80Nj3i6VwPTIHf2Spohs/4470kexMb26OzD6gw2X7RbBEZvvKLHjmLIgdFm3wEn fOagiDZ8aWnUfkukMYKgVOxYaWUBriMCKXCo8i33vtX4+1UH4VuWQpUsr36r6i7CitPK bXaw==
- Arc-seal: i=1; a=rsa-sha256; t=1682035102; cv=none; d=google.com; s=arc-20160816; b=wo6lXZkS7wxSsUBI7MBqbvMb2y8tHKSDLgkrIKL/WFssiE4LtLlOJ8H76r0/KDG/AM qgcpdUfM829l1z9ajz2DQpLmi+42hURWZrZnoujZwJOKMNBJAf26vzklCuMyZ6OLyYkw jEQC5lVdz7eGECcLgS6vD2tvJZ+Av1YG85u/cGybmoMZFRNKj5wNsOELDZMDxvOmsyWF VzYjEPodeU9E5BRaQE+NoNrZ29Ni0v/a8LFBDd1MWwrWmQi3KvEAPwm7Lj4CjPx9SMd1 I/nWN1YsnBwPcjztxfb/epgSn4r9Oe4i9FPyxpqC5rmMF+Ls3a0BNZoFAmkBcQDpfMU0 skFw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa.gov; s=google; t=1682035115; x=1684627115; h=list-archive:list-help:list-post:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:in-reply-to :from:content-language:references:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=03WCkXUFFLVsCLA/SrkQvwQOxs1/j7SBItbJUNFYSpo=; b=eSdRcaDHJxpl7nCo4ErCUT6JPOjxtPFMN35H9MgIQZx0BP2aHTY+WrODS3Ls4w3C1v IGlf30spZ7aJ4JkWYEOTDKJmAAvm8SFXpTvtvCw/giGb4gx83IevgyLxsHUYDXh+Tr0o B5pSzbp/0SwpmK4F+3XkZyIRUTP7/JYc15fJLaaoi/CCF91ZE5pwVaaT7nd/oe4qH6N4 ty5vwcgYY6TvTwYb2OLr7FdqvptPFQ2RW31BL+HrCObx4pCCJc5Sqy5ZYk5BnFomLF2n MbHIQ2wm9ZrUPhqaKSR58uSN06otexMX6Ad//iNfWc7WgDD1kAWMwAkHU3pTYVLowVfX r0Wg==
- In-reply-to: <532A2680-226D-402E-8F91-DDACDCE4FFBC@gmail.com>
- List-archive: <https://groups.google.com/a/noaa.gov/group/ferret_users/>
- List-help: <https://support.google.com/a/noaa.gov/bin/topic.py?topic=25838>, <mailto:ferret_users+help@noaa.gov>
- List-id: <ferret_users.noaa.gov>
- List-post: <https://groups.google.com/a/noaa.gov/group/ferret_users/post>, <mailto:ferret_users@noaa.gov>
- Mailing-list: list ferret_users@xxxxxxxx; contact ferret_users+owners@xxxxxxxx
- References: <532A2680-226D-402E-8F91-DDACDCE4FFBC@gmail.com>
- Sender: owner-ferret_users@xxxxxxxx
- User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0
This has also been asked in the GitHub
issue.
I have some ideas which I posted there and
will add here.
I have looked into this some more. It
seems that the format for wrf files is not consistent with the
COARDS and CF netCDF standards used by PyFerret https://www.ncl.ucar.edu/Applications/wrfnetcdf.shtml
I expect that this problem will be
resolved with updates that are in the code base but not yet in a
PyFerret release. I do not know what the plans are for the next
release.
However, I have a suggestion, which I'd like
to add here. I will show it using a small example file, attached
to this message. This is a file from a previous question, which I
think shows the behavior that is seen in the wrf files. Its netCDF
header looks like this:
netcdf sample_wrf {
dimensions:
Time = UNLIMITED ; // (13 currently)
bottom_top = 2 ;
south_north = 6 ;
west_east = 7 ;
variables:
float FNM(Time, bottom_top) ;
FNM:FieldType = 104 ;
FNM:MemoryOrder = "Z " ;
FNM:description = "upper weight for vertical stretching" ;
FNM:units = "" ;
FNM:stagger = "" ;
float P(Time, bottom_top, south_north, west_east) ;
P:FieldType = 104 ;
P:MemoryOrder = "XYZ" ;
P:description = "perturbation pressure" ;
P:units = "Pa" ;
P:stagger = "" ;
// global attributes:
:TITLE = "Grids as in WRF model" ;
:history = "Downloaded orig file from link at https://www.riinu.me/2014/05/saving-subset/" ;
}
The note you are seeing about axis
coordinates suggests that PyFerret would use attributes on
coordinate variables to determine the directions of the dimensions
when it is defining grids. The file with coordinate variables
would look like this, when listed using ncdump -c
netcdf sample_wrf {
dimensions:
Time = UNLIMITED ; // (13 currently)
bottom_top = 2 ;
south_north = 6 ;
west_east = 7 ;
variables:
double Time(Time) ;
Time:axis = "T" ;
double bottom_top(bottom_top) ;
bottom_top:axis = "Z" ;
double south_north(south_north) ;
south_north:axis = "Y" ;
double west_east(west_east) ;
west_east:axis = "X" ;
float FNM(Time, bottom_top) ;
FNM:FieldType = 104 ;
FNM:MemoryOrder = "Z " ;
FNM:description = "upper weight for vertical stretching" ;
FNM:units = "" ;
FNM:stagger = "" ;
float P(Time, bottom_top, south_north, west_east) ;
P:FieldType = 104 ;
P:MemoryOrder = "XYZ" ;
P:description = "perturbation pressure" ;
P:units = "Pa" ;
P:stagger = "" ;
// global attributes:
:TITLE = "Grids as in WRF model" ;
:history = "Downloaded orig file from link at https://www.riinu.me/2014/05/saving-subset/" ;
data:
Time = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ;
bottom_top = 1, 2 ;
south_north = 1, 2, 3, 4, 5, 6 ;
west_east = 1, 2, 3, 4, 5, 6, 7 ;
}
We can create a new, separate netCDF file
that contains the desired coordinate variables. Then use the
netcdf utility ncks to add the coordinate variables to the wrf
file.
Here is a Ferret script to write a dummy
file with the desired "axis" attributes. The appropriate axis
attributes are automatically written by modern Ferret and
PyFerret.
! Define the coordinate axes, the dimension names and lengths from the wrf file. Keep
! the same upper-case and lower-case spellings as in the file.
define axis/t=1:13:1 Time
define axis/z=1:2:1 bottom_top
define axis/y=1:6:1 south_north
define axis/x=1:7:1 west_east
! Define variables on these axes to write to a new netCDF file.
let/title=Time tcoord = t[gt=Time]
let/title=bottom_top zcoord = z[gz=bottom_top]
let/title=south_north ycoord = y[gy=south_north]
let/title=west_east xcoord = x[gx=west_east]
! Write the dummy variables. We will get the coordinate axes from this file.
cancel mode upcase
save/clobber/file=wrf_axes.nc tcoord, zcoord, ycoord, xcoord
Now, use the Unix ncks utility to copy the
coordinate variables into the wrf file. (make a copy of the file
if you want to keep the original)
> ncks -A -h -v Time wrf_axes.nc sample_wrf.nc
> ncks -A -h -v bottom_top wrf_axes.nc sample_wrf.nc
> ncks -A -h -v south_north wrf_axes.nc sample_wrf.nc
> ncks -A -h -v west_east wrf_axes.nc sample_wrf.nc
Now, sample_wrf.nc will open.
On 9/5/2021 3:37 AM, Jeevan Kumar
wrote:
I have wrfout file at one time
step and trying to open in ferret. but I am having error like
this (below)
(```
base) jeevan@MacBook-Pro idojaros % pf
NOAA/PMEL TMAP
PyFerret v7.63 (optimized)
Darwin 19.6.0 - 10/13/20
5-Sep-21 12:14
yes? use wrfout_d01_2020-01-16_00:00_jk_E_G.nc
*** NOTE:
*** NOTE: Could not adjust grid for variable ZNU
**ERROR: inconsistent data grids: File needs axis attributes on coordinate variables indicating correct directions
yes? sh d
currently SET data sets:
yes? q
Best Regards
Jeevan Kumar
Attachment:
sample_wrf.nc
Description: Binary data
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement