<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 13px;">
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF926041"><font size="2" color="#000000" face="Tahoma"><b>From:</b> eric.holt@huskers.unl.edu<br>
<b>Sent:</b> Saturday, September 18, 2010 1:24 PM<br>
<b>To:</b> ncl-users@ucar.edu<br>
<b>Subject:</b> NARCCAP Resolution Problem<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 13px;">
<div style="">Hello, <br>
<br>
I am trying to simply plot winds from RCM3-cgcm3 and RCM3-gdfl solutions under NARCCAP. I can run my code at 2 degree resolution, and my image is fine (2reswind.pdf). However, when I run my code at 0.5 degrees, the plot displays choppy data, or none at all
(pt5reswind.pdf). This has been bugging me for a while now, can anyone provide a tip on why this is, and what I can do? It would be much appreciated. Thank You!
<br>
<br>
Here is the error when the 0.5 degree doesn't plot:<br>
<br>
warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible :[errno=1101]<br>
<br>
<br>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"<br>
<br>
<br>
begin<br>
<br>
file1 = "vas_RCM3_cgcm3_2038010103.nc"<br>
file2 = "uas_RCM3_cgcm3_2038010103.nc"<br>
file3 = "vas_RCM3_cgcm3_2066010103.nc"<br>
file4 = "uas_RCM3_cgcm3_2066010103.nc"<br>
<br>
<br>
print("Starting file 1")<br>
f1 = addfile(file1,"r")<br>
print("Starting file 2")<br>
f2 = addfile(file2,"r")<br>
print("Starting file 3")<br>
f3 = addfile(file1,"r")<br>
print("Starting file 4")<br>
f4 = addfile(file2,"r")<br>
<br>
;===============================<br>
;2038-2041<br>
print("Starting U")<br>
U10_o = f2->uas(0:5,:,:)<br>
<br>
<br>
print("Starting V")<br>
V10_o = f1->vas(0:5,:,:)<br>
<br>
<br>
;Total Wind Calculation<br>
tot10 = V10_o ; Transfering meta data <br>
tot10 = sqrt(U10_o^2+V10_o^2)<br>
<br>
delete(V10_o)<br>
delete(U10_o)<br>
<br>
;;2D Arrays of Lat and Lon<br>
lat2d = f1->lat<br>
lon2d = f1->lon<br>
<br>
<br>
<br>
y1 = dim_avg_Wrap( tot10(yc|:,xc|:,time|:))<br>
printVarSummary(y1) <br>
<br>
delete(tot10)<br>
<br>
;;2D Arrays of Lat and Lon<br>
lat2d = f1->lat<br>
lon2d = f1->lon<br>
print(" min="+min(lat2d)+" max="+max(lat2d))<br>
print(" min="+min(lon2d)+" max="+max(lon2d))<br>
<br>
dimlc = dimsizes(lat2d)<br>
nlat = dimlc(0)<br>
mlon = dimlc(1)<br>
<br>
; NLAT = 180<br>
; MLON = 360<br>
NLAT = 046<br>
MLON = 090<br>
<br>
dlat = 0.5 ; output lat, in this case dlat=2<br>
lat = ispan ( 0,NLAT-1,1 )*dlat ; 0-90N, by dlat=0.5, so 0, 0.5N 1N, 1.5N. 90N<br>
lat!0 = "lat"<br>
lat@units = "degrees_north"<br>
lat&lat = lat<br>
<br>
dlon = 0.5 ; output lon, in this case dlon=2<br>
lon = ispan ( 0,MLON-1,1 )*dlon + 180. ; -180W-180E by dlon=2, so -180, -178W... 180E<br>
lon!0 = "lon"<br>
lon@units = "degrees_east"<br>
lon&lon = lon<br>
<br>
<br>
; ydiff = y2 <br>
; ydiff = y2 - y1 <br>
<br>
X2D = triple2grid(ndtooned(lon2d),ndtooned(lat2d),ndtooned(y1(:,:)), lon,lat, False)<br>
; X2D = triple2grid2d(ndtooned(lon2d),ndtooned(lat2d),ndtooned(y1(:,:)), lon,lat, False)<br>
X2D!0 = "lat" ; triple2grid regrids based on a nearest neighbor routine.<br>
X2D&lat = lat<br>
X2D!1 = "lon"<br>
X2D&lon = lon<br>
X2D@units = y1@units<br>
printVarSummary(X2D)<br>
print(" min="+min(X2D)+" max="+max(X2D))<br>
<br>
print(" min="+min(lat2d)+" max="+max(lat2d))<br>
print(" min="+min(lon2d)+" max="+max(lon2d))<br>
<br>
; print (lat)<br>
; print (lon) <br>
<br>
;********************************************<br>
; create plots<br>
;********************************************<br>
wks = gsn_open_wks ("pdf", "pt5reswind") ; open workstation<br>
gsn_define_colormap (wks,"gui_default") ; choose color map<br>
<br>
sres = True ; plot mods desired for 2x2 array<br>
sres@gsnAddCyclic = False <br>
sres@cnFillOn = True ; color fill<br>
sres@cnLinesOn = False ; no contour lines<br>
sres@cnLineLabelsOn = False ; no contour labels<br>
sres@gsnSpreadColors = True ; use total colormap<br>
sres@gsnSpreadColorStart = 4<br>
sres@gsnSpreadColorEnd = -1<br>
sres@cnInfoLabelOn = False ; no contour info label<br>
<br>
sres@mpMinLatF = min(lat2d)+1<br>
sres@mpMaxLatF = max(lat2d)-1<br>
sres@mpMinLonF = min(lon2d)+1<br>
sres@mpMaxLonF = max(lon2d)-1<br>
; sres@mpMinLonF = 220. ; min(lon2d) - 1<br>
; sres@mpMaxLonF = 300. ; max(lon2d) - 1<br>
sres@mpCenterLonF = 270 ; Centers the plot at 180<br>
<br>
sres@gsnFrame = False<br>
sres@gsnDraw = False<br>
sres@lbLabelBarOn = False<br>
<br>
panres = True ; set up panel resources<br>
panres@gsnPaperOrientation = "portrait"<br>
panres@gsnMaximize = True<br>
panres@gsnPanelLabelBar = True<br>
; panres@gsnPanelYWhiteSpacePercent= 3.0<br>
panres@gsnPanelYWhiteSpacePercent= 0.5<br>
<br>
plot = new(1,graphic)<br>
<br>
sres@gsnLeftString = "Regridded to 0.5x0.5"<br>
; sres@gsnCenterString = "Gridded Precipitation "<br>
; plot(1) = gsn_csm_contour_map_ce(wks,X2D,sres) ; Draw new 2x2 grid<br>
plot = gsn_csm_contour_map_ce(wks,X2D,sres) ; Draw new 2x2 grid<br>
<br>
gsn_panel(wks,plot,(/1,1/),panres)<br>
<br>
end <br>
<br>
<br>
</div>
<div><br>
<div class="BodyFragment"><font size="2"><span style="font-size: 10pt;">
<div class="PlainText">Eric Holt<br>
Department Of Geosciences<br>
Graduate Student<br>
University of Nebraska<br>
119 Bessey Hall<br>
eric.holt@huskers.unl.edu</div>
</span></font></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>