<div dir="ltr"><div>Hi Caspar,</div><div><br></div><div>I concur with your analysis. The "debug" variable is usually defined as boolean. If you are seeing it as already defined to be an "int" value, then that would certainly cause the assignment mismatch error on line 12665 of gsn_code.ncl.  The trick then obviously is to track down where "debug" is getting set to this integer value. I unfortunately no longer have access to the glade filesystem, but I would start by looking at the scripts under:</div><div><br></div><div>    /glade/u/apps/dav/opt/ncl/6.6.2/intel/18.0.5/lib/ncarg/nclscripts/csm/</div><div><br></div><div>as well as any personal scripts that you may be "load"ing.</div><div><br></div><div>Rick</div><div><br></div></div><br><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">ncl-talk@ucar.edu</a>> wrote:<br></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;">Hi NCL team, <div><br></div><div>I’m suddenly running into issues with gsn_contour_shade. </div><div><br></div><div>An old script that I have used successfully many times suddenly breaks with<b> 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><br></div><div>Error:</div><div><div><br></div><div>fatal:["NclVar.c":1390]:Assignment type mismatch, right hand side can't be coerced to type of left hand side</div><div>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>fatal:["Execute.c":8637]:Execute: Error occurred at or near line 18 in file test_shade.ncl  </div><div><br></div><div>(>> it is in the gsn_contour_shade call, see below).</div><div><br></div><div><br></div><div>What I see in gsn_code.ncl where the error occurs is this assignment :</div><div><br></div><div><div>   <span style="white-space:pre-wrap">      </span>debug = get_res_value_keep(opt,"debug",False)</div><div><br></div></div><div>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><br></div><div>Thanks,</div><div>Caspar</div><div><br></div><div><br></div><div><br></div><div><div><font face="Courier"><span style="font-style:normal;font-size:9px">begin</span></font></div><div><span style="white-space:pre-wrap;font-style:normal;font-size:9px"><font face="Courier">   </font></span></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><span style="white-space:pre-wrap"> </span>a = addfile("/glade/scratch/ammann/NEWMONT/pr_meanfield_DJF_2085.nc","r")</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><span style="white-space:pre-wrap">       </span>b = a->meanfield</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><br></span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><span style="white-space:pre-wrap">   </span>wks   <span style="white-space:pre-wrap">                         </span>= gsn_open_wks ("x11", "coneff" )</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><span style="white-space:pre-wrap">       </span>res   <span style="white-space:pre-wrap">                         </span>= True</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><span style="white-space:pre-wrap">      </span>res@gsnDraw         = False    ; We're going to panel later, so don't</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><span style="white-space:pre-wrap"> </span>res@gsnFrame        = False    ; draw or advance frame.</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px">   <span style="white-space:pre-wrap">  </span>plot  = gsn_csm_contour_map(wks, b(0,:,:), res )     </span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><br></span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"> <span style="white-space:pre-wrap">   </span>opt                  = True</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"> <span style="white-space:pre-wrap">      </span>opt@gsnShadeFillType = "Pattern"</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"> <span style="white-space:pre-wrap">        </span>opt@gsnShadeLow      = 3                            ; Use fill Pattern #3</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"> <span style="white-space:pre-wrap">        </span>plot <span style="white-space:pre-wrap">   </span>= gsn_contour_shade(plot,0.,-999, opt)   ; should be target</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px">; <span style="white-space:pre-wrap">      </span>dummy <span style="white-space:pre-wrap">  </span>= gsn_contour_shade(plot,0.,-999, opt)   ; dummy: also assignment problem</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><br></span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><span style="white-space:pre-wrap">    </span>draw(plot)</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><span style="white-space:pre-wrap">  </span>frame(wks)</span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px"><br></span></font></div><div><font face="Courier"><span style="font-style:normal;font-size:9px">end</span></font></div></div><div><br></div><div><br></div><div>
<div style="color:rgb(0,0,0);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"><br>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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font face="Helvetica" color="#656fb7"><span style="font-size:11px"><b><i>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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font face="Helvetica" color="#656fb7"><span style="font-size:11px"><b><i>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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font face="Helvetica" color="#656fb7"><span style="font-size:11px"><br></span></font></div><br>
</div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>