Re: Trying to adjust Cross section data

From: Erik N <nobleeu_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 03 2012 - 11:24:10 MDT

Dear Paul,
If you tell the wrf_user_intrp3d function what pressure levels you want,
you will know what pressure levels the cross-section will plot.
Just assign meta data and you are good to go.

 For example, here is a step I use to process some wrf data for regular NCL
plot commands (since I find the wrf_NCL plot commands to be too whacky to
use).

a = addfile(WRF_FILE+".nc","r") ;read individual wrfout file
  ;******** PRESSURE-LEVEL VARIABLES *****************
  p = wrf_user_getvar(a,"pressure",-1);
  u = wrf_user_getvar(a,"ua",-1)
  v = wrf_user_getvar(a,"va",-1)
  ;******** Good ol' lats and lons *******************
  lat2d = wrf_user_getvar(a,"lat",-1)
  lon2d = wrf_user_getvar(a,"lon",-1)
  lat = lat2d(0,:,0)
  lat!0 = "lat"
  lon = lon2d(0,0,:)
  lon!0 = "lon"
pressure_levels = (/1000.,925.,850.,700.,500.,300.,200./)
; ********* or if you really want some OVERKILL.....
;pressure_levels = (/1000.,987.5,975.,962.5,950.,937.5,925.,\
; 900.,875.,850.,825.,800.,750.,700.,650.,\
; 600.,550.,500.,450.,400.,350.,300.,250.,\
; 225.,200.,175.,150.,137.5,125.,112.5,100.,\
; 87.5,75.,62.5,50.,37.5,25.,12.5, 10., 5./)

; Assign Meta Data for "level"
lev = pressure_levels
lev!0 = "lev"
lev&lev = pressure_levels
lev@units = "hPa"
lev@long_name = "isobaric level"
lev@_CoordinateAxisType = "Pressure"

; Interpolate your variable
; here I interpolate U Wind horizontally then use the regular NCL commands
to create an NCL cross_section
u_plane = wrf_user_intrp3d(u,p,"h",pressure_levels,0,False)
u_plane!0 = "time"
u_plane!1 = "lev"
u_plane!2 = "lat"
u_plane!3 = "lon"
printVarSummary(u_plane)

; ***********************
; From here, do whatever you want
; ***********************
; make a cross-section using
; X = u_plane
; < plot commands>
; plot = gsn_csm_pres_hgt(wks,X,res) ; contour the variable

Erik Noble | Research Assistant | NASA Goddard Institute for Space Studies
Direct: 1 (212) 678-5512 | www.giss.nasa.gov | 2880 Broadway, New York,
NY-10025

On Fri, Aug 3, 2012 at 8:56 AM, Suffern Paul <paul.suffern@ntsb.gov> wrote:

> Happy Friday everyone,****
>
> ** **
>
> I have two quick questions about some cross section diagrams I am trying
> to do. Attached are two .pdf image files and as can be seen I know how to
> adjust the y-axis labels (using the YLValues and YLLabels commands, line
> 127 of .ncl code). However, I was curious if anyone knew first of all how
> to make sure that my z-axis labels actually line up with the correct values
> from the model data? Otherwise I can arbitrarily assign hPa z-axis values
> on any model run/case that I do… and I want to make sure everything is
> correctly lined up. This case is over Peruvian mountains and all the
> mountainous terrain within the domain is above 3000 meters…so clearly image
> 1 can’t be correct even though it is the default from the script I have.
> Any help there would be greatly greatly appreciated!****
>
> ** **
>
> My 2nd question relates on how to adjust my script so that I can plot any
> range in the z dimension that I want. For instance, plotting just 800 hPa
> to 600 hPa, or 300 to 200 hPa…rather than plotting the whole z dimension of
> 1000 hPa to 50 hPa. Does anyone know how to narrow this down? Is that
> something I can adjust in line 61 through 76 of the .ncl code attached
> here? I’ve tried changing the zz=z/100 value (line 63) and that doesn’t
> change the z-scale.****
>
> ** **
>
> Any thoughts or suggestions would be very helpful!****
>
> ** **
>
> Thanks!****
>
> Paul****
>
> CONFIDENTIALITY NOTICE - THIS E-MAIL TRANSMISSION MAY CONTAIN INFORMATION
> THAT IS PRIVILEGED, CONFIDENTIAL, PROPRIETARY, SUBJECT TO COPYRIGHT, AND/OR
> EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. IT IS FOR THE USE OF INTENDED
> RECIPIENTS ONLY. If you are not an intended recipient of this message,
> please notify the original sender immediately by forwarding what you
> received and then delete all copies of the correspondence and attachments
> from your computer system. Any use, distribution, or disclosure of this
> message by unintended recipients is not authorized and may be unlawful.
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
- Erik -

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 3 11:24:22 2012

This archive was generated by hypermail 2.1.8 : Fri Aug 03 2012 - 14:39:58 MDT