[ncl-talk] Cross sections w/ smoothed terrain.... New issue???
Kacie Shourd
Kacie.Shourd at dri.edu
Sat Apr 14 10:12:55 MDT 2018
Hi Bill (and Rick),
Thank you so much for looking into this! It is much appreciated.
Best regards,
Kacie
---
Kacie N. Shourd, M.S.
드림
Staff Research Scientist
Division of Atmospheric Science
Desert Research Institute, Reno, NV
Kacie.Shourd at dri.edu
Work: (775) 674-7049
________________________________
From: Bill Ladwig [ladwig at ucar.edu]
Sent: Thursday, April 12, 2018 10:05 AM
To: Kacie Shourd
Cc: ncl-talk (ncl-talk at ucar.edu)
Subject: Re: [ncl-talk] Cross sections w/ smoothed terrain.... New issue???
Hi Kacie,
Rick and I both looked over this problem and came up with a solution, but you won't be able to use the wrf_contour routines with it. You have to use the gsn_csm_contour routines instead. The root cause of the problem is that the example you are using does a bit of a hack to get the RH contours on to a scatter plot for terrain. It tries to cap the height of the terrain plot to a value that you specify (i.e. zmax), then tries to crop the data for RH to fit in that terrain scatter plot area. To make a long story short, as you go higher up in WRF, the grid boxes get taller. When cropped, there's a bunch of extra slop depending on how the WRF grid aligns with the zmax you chose, since the chosen value for zmax might be in the middle of a grid box. At the end of the day, there's going to be misalignment between the contour plot for terrain and the contour plot of RH, since those contours aren't being drawn with an identical y-axis. The example page warns of this with "Users are STRONGLY CAUTIONED that these scripts are EXPERIMENTAIL and the terrain may not plot in exactly the right location.".
To fix the problem, we're going to supply the RH cross section with coordinate data for the "Vertical" dimension. Once the RH cross section has the height information, it's easy for NCL to plot the terrain and RH on the same y-axis. (Not having the cross section height coordinate information is the real cause of this problem and why the hack was required for the example you used. In the future, I will be adding a new cross section routine to NCL that mirrors what wrf-python is doing, so these kind of plots will be easier in the future.)
Attached is a script (new_cross_section.ncl) that shows how we did it. Note that if you decide you still want to modify WRFUserARW.ncl to improve the vertical resolution of the cross section (as we did), you'll also need to modify new_cross_section.ncl to match. I've attached the modified WRFUserARW.ncl that we used for version 6.4.0 (make sure you copy the WRFUserARW.ncl that came with your NCL distribution if you aren't using 6.4.0). You can just keep the modified version of WRFUserARW.ncl in the same directory as new_cross_section.ncl and the script will load it at the top.
The plots I attached below show the cross sections for the original data (contour_rh) and the data with the missing values filled (contour_rh2) so you can see the differences. The script itself is still a bit messy, but I removed most of the stuff that wasn't needed to make these plots. Let me know if you have any questions.
Hope this helps,
Bill
On Mon, Apr 9, 2018 at 12:05 PM, Kacie Shourd <Kacie.Shourd at dri.edu<mailto:Kacie.Shourd at dri.edu>> wrote:
Hi everyone,
It's been a while since anyone posted to this thread, but I tried the suggested fix (modifying my WRFUserARW.ncl line 382) to no avail! There is still a good chunk of data missing above the terrain. See the attached output images. The wider image is the default with "dz=0.01*z_max" and the skinnier image is with "dz=0.00001*z_max".
Attempted fix:
"Have you modified line ~382 in WRFUserARW.ncl yet? dz can be decreased from the default value of 0.01:
...else
z_max = max(z)
z_min = 0.
; Changed to:
dz = 0.00001 * z_max
; From:
;dz = 0.01 * z_max
nlevels = tointeger( z_max/dz )
z_var2d = new( (/nlevels/), typeof(z))
z_var2d(0) = z_min
end if"
There are quite noticeable differences between the two plots, but no improvement to the terrain. I am close to giving up on this, but thought I would reach out one more time. I have changed other things in the "wrf_intrpd_3d" function also without luck. As mentioned before, the missing data near the terrain was not an issue in a colleague's RIP plot, so I know it is not the data.
Best,
Kacie
---
Kacie N. Shourd, M.S.
드림
Staff Research Scientist
Division of Atmospheric Science
Desert Research Institute, Reno, NV
Kacie.Shourd at dri.edu<mailto:Kacie.Shourd at dri.edu>
Work: (775) 674-7049
________________________________
From: Scott Capps [scapps at atmosdatasolutions.com<mailto:scapps at atmosdatasolutions.com>]
Sent: Tuesday, March 27, 2018 4:47 PM
To: Kacie Shourd
Cc: ncl-talk (ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>)
Subject: Re: [ncl-talk] Cross sections w/ smoothed terrain.... New issue???
Have you modified line ~382 in WRFUserARW.ncl yet? dz can be decreased from the default value of 0.01:
...else
z_max = max(z)
z_min = 0.
; Changed to:
dz = 0.002 * z_max
; From:
;dz = 0.01 * z_max
nlevels = tointeger( z_max/dz )
z_var2d = new( (/nlevels/), typeof(z))
z_var2d(0) = z_min
end if
On Tue, Mar 27, 2018 at 4:36 PM, Kacie Shourd <Kacie.Shourd at dri.edu<mailto:Kacie.Shourd at dri.edu>> wrote:
Hi NCL friends,
Attached is an image of the current output I am getting trying to plot a vertical cross section with WRF data in NCL. Also attached is my code, and I can upload the WRF data file for anyone who needs it.
I have used this script tons of times in the past with no issue (i.e. no "missing" data near the ground, or at least the terrain was smoothed to cover that up) and am hoping to figure out what's wrong.
Could it be the data file I have? If yes, is there a simple way I can extrapolate the RH values to below the ground?
Is it the version of NCL I am running?? I used to run this script in v6.4 but am using v6.3 at the moment.
A colleague of mine made a plot with the same WRF file in RIP and did not have this issue. I would prefer to plot this up in NCL if possible as I think the plots come out nicer and this is going into a document for some pretty important folks...
Thanks,
Kacie
---
Kacie N. Shourd, M.S.
드림
Staff Research Scientist
Division of Atmospheric Science
Desert Research Institute, Reno, NV
Kacie.Shourd at dri.edu<mailto:Kacie.Shourd at dri.edu>
Work: (775) 674-7049<tel:(775)%20674-7049>
PUBLIC RECORDS NOTICE: In accordance with NRS Chapter 239, this email and responses, unless otherwise made confidential by law, may be subject to the Nevada Public Records laws and may be disclosed to the public upon request.
_______________________________________________
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<https://linkprotect.cudasvc.com/url?a=http://mailman.ucar.edu/mailman/listinfo/ncl-talk&c=E,1,FvUIVgD7EH9G1hQSxvgiu9p8mf_4k0kEcTABmKT6pVBB-FhMwRwnE4yuShuTwXhNqoezMpeYqatYxdSV83pHVm7uAsGw71owTjHKYqPf7g,,&typo=1>
--
Scott Capps
Principal
Atmospheric Data Solutions<https://linkprotect.cudasvc.com/url?a=http://www.atmosphericdatasolutions.com&c=E,1,ii7FITA5DOfDJKepvgGfOku-AGID3DnAJtS5iWd_oBwb_PIKnfs-1V1XTcN2ZiESPh4EGugxUHZb3Vv0bmuUu2W6sV9LogTv0Nw4PDekVE-r4rFAJI2KDnz5K5wQ&typo=1>
scapps at atmosdatasolutions.com<mailto:scapps at atmosdatasolutions.com>
cell: (949) 910-4385
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180414/6c6bd31f/attachment.html>
More information about the ncl-talk
mailing list