<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear ncl-team,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The other day when I was trying to use the colors in the "<b>BlGrYeOrReVi200</b>", I use the <b>res@cnFillPalette = "BlGrYeOrReVi200"</b>. However, it kept reminding me "<b>warning:ContourPlotSetValues: color index (204) exceeds size of palette, defaulting
to foreground color for entry (12)</b>".</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
But when I changed the instruction to <b>gsn_define_colormap(wks,"BlGrYeOrReVi200")</b>, it works fine. I'd like to ask the reason for these two instructions. The following is my full script.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div>
<div><br>
</div>
<div>begin</div>
<div><br>
</div>
<div> DATADir = "/disk/wrfout/"</div>
<div> FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d04_2020-06* ")</div>
<div> numFILES = dimsizes(FILES)</div>
<div> print("numFILES = " + numFILES)</div>
<div> print(FILES)</div>
<div> print (" ")</div>
<div><br>
</div>
<div> type = "pdf"</div>
<div> wks = gsn_open_wks(type,"average_temp")</div>
<div><br>
</div>
<div> res = True</div>
<div> res@MainTitle = "REAL-TIME WRF"</div>
<div> res@Footer = False</div>
<div><br>
</div>
<div> pltres = True</div>
<div> pltres@PanelPlot = True</div>
<div> pltres@FramePlot = False</div>
<div><br>
</div>
<div> mpres = True</div>
<div> mpres@mpDataBaseVersion = "HighRes"</div>
<div> mpres@mpGeophysicalLineColor = "Black"</div>
<div> mpres@mpGridLineColor = "Black"</div>
<div> mpres@mpDataResolution = "Finest"</div>
<div><br>
</div>
<div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div>
<div> a = addfiles(FILES+".nc","r")</div>
<div><br>
</div>
<div> times = wrf_user_getvar(a,"times",-1) ; get all times in the file</div>
<div> ntimes = dimsizes(times) ; number of times in the file</div>
<div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div>
<div><br>
</div>
<div><br>
</div>
<div>do k = 0,23,1</div>
<div> meantemp = new((/162,213/),float)</div>
<div> meantemp = 0</div>
<div> temp = new((/ntimes,162,213/),float)</div>
<div><br>
</div>
<div> do it = k,ntimes-1,24 ; TIME LOOP</div>
<div> print("Working on time: " + times(it) )</div>
<div> fi = addfile(FILES(it),"r")</div>
<div> T_2 = fi ->T2 ; T2 in Kelvin</div>
<div> tc2 = T_2-273.16 ; T2 in C</div>
<div> temp(it,:,:) = tc2</div>
<div> meantemp(:,:) = meantemp(:,:)+temp(it,:,:)</div>
<div> end do</div>
<div><br>
</div>
<div> meantemp(:,:) = meantemp(:,:)/30</div>
<div><br>
</div>
<div> opts = res</div>
<div> opts@cnFillOn = True</div>
<div> opts@ContourParameters = (/23,37,1/)</div>
<div> opts@cnFillPalette = "BlGrYeOrReVi200"</div>
<div> contour_FLX = wrf_contour(a[k],wks,meantemp,opts)</div>
<div> delete(opts)</div>
<div><br>
</div>
<div> plot = wrf_map_overlays(a[k],wks,contour_FLX,pltres,mpres)</div>
<div><br>
</div>
<div>end do ; END OF TIME LOOP</div>
<div><br>
</div>
<span>end</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Thank you for your time!</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Best regards</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Zoe</span></div>
</body>
</html>