[ncl-talk] Problem with
MELISSA KAZEMI RAD
mk1369 at scarletmail.rutgers.edu
Wed Jul 25 13:22:45 MDT 2018
Hi,
I am having a problem with panel plotting wrfout results. Here is my NCL
code:
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/wrf/WRFUserARW.ncl"
;----------------------------------------------------------------------
; Main code
;----------------------------------------------------------------------
begin
a = addfile("wrfout_d03_2017-07-17_06_00_00.nc","r")
type = "png"
wks = gsn_open_wks(type,"Cloud")
times = wrf_user_list_times(a)
time = 166
p = wrf_user_getvar(a, "pressure", time) ; Total Pressure
qc = wrf_user_getvar(a,"QCLOUD", time)
qc = qc*1000.
qc at units = "g/kg"
res = True
res at gsnMaximize = True
res at cnFillOn = True
res at cnFillPalette = "WhBlGrYeRe"
res at cnLinesOn = False
res = wrf_map_resources(a,res)
res at gsnAddCyclic = False
res at tfDoNDCOverlay = "NDCViewport"
;-- For Individual Plots:
res at gsnDraw = False
res at gsnFrame = False
res at lbLabelBarOn = False
mnmxint = nice_mnmxintvl( min(qc), max(qc), 14, False)
res at cnLevelSelectionMode = "ManualLevels"
res at cnMinLevelValF = mnmxint(0)
res at cnMaxLevelValF = mnmxint(1)
res at cnLevelSpacingF = mnmxint(2)/2. ; twice as many levels
height_levels = (/500., 750., 1000., 1500./) ; heigth levels to plot
nlevels = dimsizes(height_levels) ; number of height levels
nplots = 4
plots = new(nplots,"graphic")
plot_idxs = (/0,1,2,3/)
do level = 0,nlevels-1
height = height_levels(level)
qc_plane = wrf_user_intrp3d(qc,p,"h",height,0.,False)
res at gsnLeftString = height
plots(level) = gsn_csm_contour_map(wks, (/qc_plane/), res)
end do
; Panel the WRF Plots:
pnlres = True
pnlres at gsnPanelLabelBar = True
pnlres at gsnMaximize = True
pnlres at gsnPanelMainString = "Cloud Water Mixing Ratio (g/kg): " +
times(time)
gsn_panel(wks, plots, (/2,2/), pnlres)
end
Below is the error that I get:
fatal:Conditional statements (if and do while) require SCALAR logical
values, see all and any functions
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 1809 in
file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 7994 in
file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 11287 in
file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
fatal:["Execute.c":8640]:Execute: Error occurred at or near line 69 in file
Cloud.ncl
Line 69 being: plots(level) = gsn_csm_contour_map(wks, (/qc_plane/), res)
I'd appreciate your help.
Bests,
Melissa
--
*Melissa Kazemi Rad*
*Atmospheric Sciences Department*
*Rutgers University*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180725/964bd332/attachment.html>
More information about the ncl-talk
mailing list