<div dir="ltr">I think NCL arg numbering is zero based, so arg (3) is hres. Now there might be something going on with hres, elsewhere in your code.<br>printVarSummary (hres)<div><br></div><div>Also note that you are setting hres to True, but not attaching any attributes. Perhaps try False.<br><div><br></div><div>If that doesn't get it, then look at printVarSummary for all four args. Compare with the documented function prototype.<br><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 29, 2023 at 2:50 PM Laura Fowler via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:small">Hello:</div><div style="font-family:arial,sans-serif;font-size:small">I am totally baffled about the error message I get when using the function gsn_csm_xy (see error below).<br></div><div style="font-family:arial,sans-serif">
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">fatal:Argument type mismatch on argument (3) of (gsn_csm_xy) can not coerce</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 263 in file var3_profile.ncl</span></p></div><div><br></div><div><div style="font-family:arial,sans-serif;font-size:small">Here are the few lines that are causing me trouble:</div>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">hres = True</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">qco_area_avg!0 = "nFixed"</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">qco_area_avg&nFixed = zFixed</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">printVarSummary(qco_area_avg)</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">wks = gsn_open_wks("png","test_mpas")</span></p>
<div style="font-family:arial,sans-serif"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Courier">plot = gsn_csm_xy(wks,qco_area_avg&nFixed,qco_area_avg,hres)</span></div><br></div><div><div style="font-family:arial,sans-serif;font-size:small">The output from these few lines are:</div>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Variable: qco_area_avg</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Type: float</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 280 bytes</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>70 values</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span style="white-space:pre-wrap"> </span>[nFixed | 70]</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Coordinates:<span> </span></span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>nFixed: [8000..14900]</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 2</span></p>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Courier;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span> </span>_FillValue :<span style="white-space:pre-wrap"> </span>9.96921e+36</span></p>
<div style="font-family:arial,sans-serif"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Courier"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Courier">average_op_ncl :</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Courier;white-space:pre-wrap"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Courier">dim_avg_n over dimension(s): nLoc</span></div><br></div><div><div style="font-family:arial,sans-serif;font-size:small">I do not understand where the mismatch between plot and argument (3), i.e. qco_area_avg comes from?</div><div style="font-family:arial,sans-serif;font-size:small"><br></div><div style="font-family:arial,sans-serif;font-size:small">Thanks for your help,</div><div style="font-family:arial,sans-serif;font-size:small">Laura</div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">!-------------------------------------------------------------------------------------------------------------</font><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">Laura D. Fowler </font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">Mesoscale and Microscale Meteorology Division (MMM) </font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">National Center for Atmospheric Research<br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">P.O. Box 3000, Boulder CO 80307-3000</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">e-mail: <a href="mailto:laura@ucar.edu" target="_blank">laura@ucar.edu</a></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">phone: 303-497-1628</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff" style="background-color:rgb(255,255,255)">!-------------------------------------------------------------------------------------------------------------</font><br></div></div></div></div><br>
</blockquote></div></div></div></div></div>