<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks Rick and Dennis,<div class=""><br class=""></div><div class="">Rick was correct that in one of the pre-loads that helps write out netCDF files more easily a debug integer flag was set using different debug levels. Once deleted, the shading worked just fine. Debug and other general variables that might be used in different sections of the code collection, it might be good to keep them local.</div><div class=""><br class=""></div><div class="">Fortunately, the positive message is that in the extensive script, I turned Cyclic off, so at least that one I caught ! ;-)</div><div class=""><br class=""></div><div class="">Thanks both of you for quick reply!</div><div class=""><br class=""></div><div class="">Caspar</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Helvetica;" class=""><br class="Apple-interchange-newline">Caspar Ammann</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><font face="Helvetica" color="#656fb7" class=""><span style="font-size: 11px;" class=""><b class=""><i class="">National Center for Atmospheric Research</i></b></span></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><font face="Helvetica" color="#656fb7" class=""><span style="font-size: 11px;" class=""><b class=""><i class="">RAL - Climate Science and Applications Program</i></b></span></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><font face="Helvetica" color="#656fb7" class=""><span style="font-size: 11px;" class=""><br class=""></span></font></div><br class="Apple-interchange-newline">
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Feb 18, 2020, at 6:03 PM, Dennis Shea <<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class="">Hi Caspar,</div><div class=""><br class=""></div><div class="">The 'b' variable already had a cyclic point</div><div class=""><br class=""></div><div class="">Variable: b<br class="">Type: float<br class="">Total Size: 261364 bytes<br class=""> 65341 values<br class="">Number of Dimensions: 3<br class="">Dimensions and sizes: [time | 1] x [latitude | 181] x [longitude | 361]<br class="">Coordinates: <br class=""> time: [0..0]<br class=""> latitude: [-90..90]<br class=""> <b class=""> <span style="color:rgb(0,0,255)" class="">longitude: [-180..180] <=== cyclic point already present</span><br class=""></b></div><div class=""><br class=""></div><div class="">Adding the following:</div><div class=""> <b class="">res@gsnAddCyclic = False </b> ; cyclic point already present</div><div class=""><br class=""></div><div class="">See attached<br class=""></div></div></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 18, 2020 at 4:44 PM Caspar Ammann via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">Hi NCL team, <div class=""><br class=""></div><div class="">I’m suddenly running into issues with gsn_contour_shade. </div><div class=""><br class=""></div><div class="">An old script that I have used successfully many times suddenly breaks with<b class=""> Assignment type mismatch</b>, even if I put the command into a new variable (previously undefined), Below is a ‘burnt-down’ test script for illustration.</div><div class=""><br class=""></div><div class="">Error:</div><div class=""><div class=""><br class=""></div><div class="">fatal:["NclVar.c":1390]:Assignment type mismatch, right hand side can't be coerced to type of left hand side</div><div class="">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 12665 in file /glade/u/apps/dav/opt/ncl/6.6.2/intel/18.0.5/lib/ncarg/nclscripts/csm/gsn_code.ncl</div><div class="">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 18 in file test_shade.ncl </div><div class=""><br class=""></div><div class="">(>> it is in the gsn_contour_shade call, see below).</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">What I see in gsn_code.ncl where the error occurs is this assignment :</div><div class=""><br class=""></div><div class=""><div class=""> <span style="white-space:pre-wrap" class=""> </span>debug = get_res_value_keep(opt,"debug",False)</div><div class=""><br class=""></div></div><div class="">But debug is not a local variable, but something that appears already populated and defined as an integer (for some reason). Once I set ‘debug' to be a local variable inside the function (gsn_contour_shade), then it all works as expected. So I do have a temporary fix if I replicate the function from gsn_code inside my script with the local variable “debug”. Maybe somebody can have a look and see what a more durable solution is.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Caspar</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class="">begin</span></font></div><div class=""><span style="white-space:pre-wrap;font-style:normal;font-size:9px" class=""><font face="Courier" class=""> </font></span></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><span style="white-space:pre-wrap" class=""> </span>a = addfile("/glade/scratch/ammann/NEWMONT/pr_meanfield_DJF_2085.nc","r")</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><span style="white-space:pre-wrap" class=""> </span>b = a->meanfield</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><br class=""></span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><span style="white-space:pre-wrap" class=""> </span>wks <span style="white-space:pre-wrap" class=""> </span>= gsn_open_wks ("x11", "coneff" )</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><span style="white-space:pre-wrap" class=""> </span>res <span style="white-space:pre-wrap" class=""> </span>= True</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><span style="white-space:pre-wrap" class=""> </span>res@gsnDraw = False ; We're going to panel later, so don't</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><span style="white-space:pre-wrap" class=""> </span>res@gsnFrame = False ; draw or advance frame.</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""> <span style="white-space:pre-wrap" class=""> </span>plot = gsn_csm_contour_map(wks, b(0,:,:), res ) </span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><br class=""></span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""> <span style="white-space:pre-wrap" class=""> </span>opt = True</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""> <span style="white-space:pre-wrap" class=""> </span>opt@gsnShadeFillType = "Pattern"</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""> <span style="white-space:pre-wrap" class=""> </span>opt@gsnShadeLow = 3 ; Use fill Pattern #3</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""> <span style="white-space:pre-wrap" class=""> </span>plot <span style="white-space:pre-wrap" class=""> </span>= gsn_contour_shade(plot,0.,-999, opt) ; should be target</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class="">; <span style="white-space:pre-wrap" class=""> </span>dummy <span style="white-space:pre-wrap" class=""> </span>= gsn_contour_shade(plot,0.,-999, opt) ; dummy: also assignment problem</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><br class=""></span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><span style="white-space:pre-wrap" class=""> </span>draw(plot)</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><span style="white-space:pre-wrap" class=""> </span>frame(wks)</span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class=""><br class=""></span></font></div><div class=""><font face="Courier" class=""><span style="font-style:normal;font-size:9px" class="">end</span></font></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">
<div style="font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-family: Helvetica;" class=""><br class="">Caspar Ammann</div><div style="font-family: Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><font face="Helvetica" color="#656fb7" class=""><span style="font-size:11px" class=""><b class=""><i class="">National Center for Atmospheric Research</i></b></span></font></div><div style="font-family: Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><font face="Helvetica" color="#656fb7" class=""><span style="font-size:11px" class=""><b class=""><i class="">RAL - Climate Science and Applications Program</i></b></span></font></div><div style="font-family: Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><font face="Helvetica" color="#656fb7" class=""><span style="font-size:11px" class=""><br class=""></span></font></div><br class="">
</div>
<br class=""></div></div>_______________________________________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
<span id="cid:f_k6sm47bl0"><caspar.png></span></div></blockquote></div><br class=""></div></body></html>