<div dir="ltr">Hi Zhuxiao,<div>If you delete kp@units the script works. The error is occurring in gsn_csm.ncl at line 816:</div><div>return((/valid_units(n),data@$valid_units(n)$/))</div><div>I *think* it is because the units were set to an integer (=1) and not a string, but I am not certain.</div><div>Best,</div><div>Adam</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Dec 19, 2024 at 11:47 AM Zhuxiao Li - NOAA Affiliate <<a href="mailto:zhuxiao.li@noaa.gov">zhuxiao.li@noaa.gov</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 dir="ltr">Hi Adam, <div>The attached is the netcdf file I used in the code.</div><div>Thanks for the great help!</div><div>Zhuxiao</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 18, 2024 at 2:21 PM Adam Phillips <<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@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 dir="ltr">Hi Zhuxiao,<div>Can you send me the .nc file you used (offline) so I can try running it? </div><div>Best,</div><div>Adam</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 18, 2024 at 1:00 PM Zhuxiao Li - NOAA Affiliate <<a href="mailto:zhuxiao.li@noaa.gov" target="_blank">zhuxiao.li@noaa.gov</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 dir="ltr">Hi Adam, <div>Would like you know that the problem is still there.</div><div>Thanks,</div><div>Zhuxiao</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 16, 2024 at 12:20 PM Zhuxiao Li - NOAA Affiliate <<a href="mailto:zhuxiao.li@noaa.gov" target="_blank">zhuxiao.li@noaa.gov</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 dir="ltr"><div dir="ltr">Hi Adam,<div>Thanks for the response and nice info.</div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div>Does the error message happen when the plot is created at this line:</div><div>plot = gsn_csm_xy(wks, day(0:100), kp(0:100) ,res) ; create plot</div><div><br></div></div></blockquote><div>yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>I have seen this type of error message before where NCL is trying to automatically set one of the gsn*String, or ti*AxisString resources. To test this, you can set:</div><div>res@gsnLeftString = ""</div><div>res@gsnCenterString = ""</div><div>res@gsnRightString = ""</div><div>res@tiXAxisString = ""</div><div>res@tiYAxisString = ""</div><div>and see if the error message continues.</div></div></blockquote><div>Will give it a try.</div><div><br></div><div>Thanks again.</div><div>Zhuxiao</div><div><br></div><div><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 dir="ltr"><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 14, 2024 at 7:19 PM Zhuxiao Li - NOAA Affiliate <<a href="mailto:zhuxiao.li@noaa.gov" target="_blank">zhuxiao.li@noaa.gov</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 dir="ltr"><div>Hi there, </div><div>When I run a simple NCL code, I get the error message 'can not combine character or string types with numeric types, can't continue'</div><div>Actually, day are integers and kp includes float values, and I printed out each value. </div><div>there are no strings in the two arrays, I don't know where the error message comes from. Could you please help me with this?</div><div>Thanks!</div><div>Zhuxiao</div><div><br></div><div>NCL code are as follows,</div><div><br></div><div>>begin</div> >  Dir= "/scratch1/NCEPDEV/swpc/WAM-IPE_DATA/INPUT_PARAMETERS/KP_AP/"<br>>   fil1 = "<a href="http://kp_ap_19320101-2024.nc" target="_blank">kp_ap_19320101-2024.nc</a>"<br> >  f1 = addfile(Dir+fil1,"r")<br>   kp = f1->Kp(222072:222072+5844*8-1)<br>   printVarSummary(kp)<br>  printMinMax(kp,False)<br>    nt0 = 5844*8<br>    day = ispan(0, nt0-1 , 1)<br>   printVarSummary(day)<br>  printMinMax(day,False)<br>         kp!0 = "day"<br>         kp@day = day<br>   printVarSummary(kp)<br>  printMinMax(kp,False)<br><div>   print(day(0:100))</div>  print(kp(0:100))<br>      wks = gsn_open_wks ("png","kp_for_2008-2023")<br>      res     = True                      ; plot mods desired<br>      plot = gsn_csm_xy(wks, day(0:100), kp(0:100) ,res) ; create plot<br>      exit<br>end<br><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="margin:0px;padding:0px 0px 20px;width:1560px;color:rgb(34,34,34);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif"><div><div style="margin:8px 0px 0px;padding:0px"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dr. Zhuxiao Li</div><div dir="ltr">NOAA/NWS/NCEP/SWPC</div><div dir="ltr">325 Broadway, </div><div dir="ltr">Boulder, Colorado 80305</div><div dir="ltr">303-497-4649<br><div style="margin:2px 0px 0px"><div><img src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif" style="background-image: url("https://ci3.googleusercontent.com/meips/ADKq_NapKeXWRbMZdFh8JaDvGXyynYknLCwr6NatZUUm25MtP4JWtqaT0csR5HBIi6A5YzOX9GWteWk7lgv7sZg_YZBkWnQa0-GDZMJNnKHZo8Cl8GZMZQgSDztsXJhWpebQFwELRFT_t0s=s0-d-e1-ft#https://www.gstatic.com/images/icons/material/system/1x/more_horiz_black_20dp.png");"></div><div><br></div></div></div></div></div></div></div></div></div><div style="font-size:medium"></div></div></div></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist IV, Climate Analysis Section</font></span></div><div><span><font color="#888888">Climate and Global Dynamics Laboratory<br></font></span></div></div><div><span style="color:rgb(136,136,136)">National Center for Atmospheric Research</span><span><font color="#888888"><br></font></span></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="margin:0px;padding:0px 0px 20px;width:1560px;color:rgb(34,34,34);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif"><div><div style="margin:8px 0px 0px;padding:0px"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dr. Zhuxiao Li</div><div dir="ltr">NOAA/NWS/NCEP/SWPC</div><div dir="ltr">325 Broadway, </div><div dir="ltr">Boulder, Colorado 80305</div><div dir="ltr">303-497-4649<br><div style="margin:2px 0px 0px"><div><img src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif" style="background-image: url("https://ci3.googleusercontent.com/meips/ADKq_NapKeXWRbMZdFh8JaDvGXyynYknLCwr6NatZUUm25MtP4JWtqaT0csR5HBIi6A5YzOX9GWteWk7lgv7sZg_YZBkWnQa0-GDZMJNnKHZo8Cl8GZMZQgSDztsXJhWpebQFwELRFT_t0s=s0-d-e1-ft#https://www.gstatic.com/images/icons/material/system/1x/more_horiz_black_20dp.png");"></div><div><br></div></div></div></div></div></div></div></div></div><div style="font-size:medium"></div></div></div></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="margin:0px;padding:0px 0px 20px;width:1560px;color:rgb(34,34,34);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif"><div><div style="margin:8px 0px 0px;padding:0px"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dr. Zhuxiao Li</div><div dir="ltr">NOAA/NWS/NCEP/SWPC</div><div dir="ltr">325 Broadway, </div><div dir="ltr">Boulder, Colorado 80305</div><div dir="ltr">303-497-4649<br><div style="margin:2px 0px 0px"><div><img src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif" style="background-image: url("https://ci3.googleusercontent.com/meips/ADKq_NapKeXWRbMZdFh8JaDvGXyynYknLCwr6NatZUUm25MtP4JWtqaT0csR5HBIi6A5YzOX9GWteWk7lgv7sZg_YZBkWnQa0-GDZMJNnKHZo8Cl8GZMZQgSDztsXJhWpebQFwELRFT_t0s=s0-d-e1-ft#https://www.gstatic.com/images/icons/material/system/1x/more_horiz_black_20dp.png");"></div><div><br></div></div></div></div></div></div></div></div></div><div style="font-size:medium"></div></div></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist IV, Climate Analysis Section</font></span></div><div><span><font color="#888888">Climate and Global Dynamics Laboratory<br></font></span></div></div><div><span style="color:rgb(136,136,136)">National Center for Atmospheric Research</span><span><font color="#888888"><br></font></span></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="margin:0px;padding:0px 0px 20px;width:1560px;color:rgb(34,34,34);font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif"><div><div style="margin:8px 0px 0px;padding:0px"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dr. Zhuxiao Li</div><div dir="ltr">NOAA/NWS/NCEP/SWPC</div><div dir="ltr">325 Broadway, </div><div dir="ltr">Boulder, Colorado 80305</div><div dir="ltr">303-497-4649<br><div style="margin:2px 0px 0px"><div><img src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif" style="background-image: url("https://ci3.googleusercontent.com/meips/ADKq_NapKeXWRbMZdFh8JaDvGXyynYknLCwr6NatZUUm25MtP4JWtqaT0csR5HBIi6A5YzOX9GWteWk7lgv7sZg_YZBkWnQa0-GDZMJNnKHZo8Cl8GZMZQgSDztsXJhWpebQFwELRFT_t0s=s0-d-e1-ft#https://www.gstatic.com/images/icons/material/system/1x/more_horiz_black_20dp.png");"></div><div><br></div></div></div></div></div></div></div></div></div><div style="font-size:medium"></div></div></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist IV, Climate Analysis Section</font></span></div><div><span><font color="#888888">Climate and Global Dynamics Laboratory<br></font></span></div></div><div><span style="color:rgb(136,136,136)">National Center for Atmospheric Research</span><span><font color="#888888"><br></font></span></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>