[ncl-talk] problem with plotting from wrf output
Anahita Amiri Farahani
aamir003 at ucr.edu
Wed Jan 8 09:28:12 MST 2020
Hi all,
I have some problems with plotting wrf output, the values are not in the
correct place here is my code:
;; -*- mode: emacs-lisp; coding: emacs-mule; -*-; -*- mode: ncl;-*-
;***************************************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
ana=addfile("wrfout_d01_2015-08-13","r")
lat1=ana->XLAT(0,:,0)
lon1=ana->XLONG(0,0,:)
P=ana->P
pm10=ana->PM10
pp = wrf_user_getvar(ana, "pressure",-1)
delete(ana)
printVarSummary(pm10)
printMinMax(pm10,0)
print("====")
printVarSummary(P)
printMinMax(P,0)
print("====")
po=(/1000,925,850,700,600,500,400,300,250,200,150,100/)
po!0 = "po"
po at long_name = "Pressure Level"
po at units = "hPa"
To = int2p_n_Wrap (pp,pm10,po,1,1)
printVarSummary(To)
printMinMax(To,0)
print("====")
lat= lat1 ;fspan(39.43722,49.86291,95)
lon= lon1 ;fpan(-92.1441,-75.8559,114)+360
lat at longname = "latitude"
lat at units = "degrees_north"
lon at longname ="longitude"
lon at units = "degrees_east"
To!2 = "lat"
To!3 = "lon"
To&lon = lon
To&lat = lat
wks = gsn_open_wks("eps","pm10_")
;gsn_define_colormap(wks,"BlWhRe")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
res = True ; plot mods desired
res at cnFillOn = True ; turn on color
res at gsnSpreadColors = True ; use full color map
res at cnLinesOn = False ; no contour lines
res at cnLineLabelsOn = False ; no line labels
res at mpMaxLatF = 50. ; specify the plot domain
res at mpMinLatF = 39. ;
res at mpMinLonF = 267 ;
res at mpMaxLonF = 285
res at mpCenterLonF= 276
res at gsnAddCyclic = False
res at cnLevelSelectionMode = "AutomaticLevels" ; AutomaticLevels
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
res at tiMainString = " Test PM10"
res at gsnDraw = False ; Do not draw plot
res at gsnFrame = False ; Do not advance frome
plot= gsn_csm_contour_map(wks,To(1,0,:,:),res)
draw (plot)
frame(wks)
delete(wks)
Thanks,
Ana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200108/e0200d44/attachment.html>
More information about the ncl-talk
mailing list