<div dir="ltr">Mary: thank you for clarifying the issue of using := and =.  It's a big help to know this!<div><br></div><div>Barry</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 8, 2017 at 1:03 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Barry,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Since variables are not overwritten unless you do a ":=", you can do this kind of thing:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"> opts_xy = True</div><div class="gmail_default" style="font-size:small"> opts_xy@xxxx = ....</div><div class="gmail_default"><div class="gmail_default" style="font-size:small"> opts_xy@yyyy = ....</div><div class="gmail_default"><div class="gmail_default" style="font-size:small"> opts_xy@zzzz = ....</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">  opts_rad = opts_xy</div><div class="gmail_default" style="font-size:small">  opts_rad = set_res1_list()</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">and opts_rad will have the resources from both opts_xy and set_res1_list.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Try this program to verify it:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><span class=""><div class="gmail_default">function set_res1_list()</div><div class="gmail_default">begin</div><div class="gmail_default">  res = True</div></span><div class="gmail_default">  res@gsnMaximize      = True</div><div class="gmail_default">  res@xyLineColor      = "red"</div><div class="gmail_default">  res@xyLineThicknessF = 2.0</div><div class="gmail_default">  return(res)</div><div class="gmail_default">end</div><div class="gmail_default"><br></div><div class="gmail_default">begin</div><div class="gmail_default">  opts_xy = True</div><div class="gmail_default">  opts_xy@gsnDraw = False</div><div class="gmail_default">  opts_xy@gsnFrame = False</div><div class="gmail_default"><br></div><div class="gmail_default">  opts_rad = opts_xy</div><div class="gmail_default">  print("=======================<wbr>===========================")</div><div class="gmail_default">  print("First time")</div><div class="gmail_default">  print(opts_rad)</div><div class="gmail_default"><br></div><div class="gmail_default">  opts_rad = set_res1_list()</div><div class="gmail_default">  print("=======================<wbr>===========================")</div><div class="gmail_default">  print("Second time")</div><div class="gmail_default">  print(opts_rad)</div><div class="gmail_default">end</div><div class="gmail_default"><br></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div style="font-size:small"><br></div></div><div style="font-size:small"><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 7, 2017 at 10:32 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for your suggestion. I will try to explain more clearly.<div><br></div><div>I have:</div><div><br></div><div>







<p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s1">opts_xy</span><span class="m_-8626700712428149252m_5170005551246263495gmail-s2"> <span class="m_-8626700712428149252m_5170005551246263495gmail-Apple-converted-space">                        </span>= True</span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s2">and various resources.</span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s2">I then have opts_rad = opts_xy</span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s2">and various resources.</span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1">This works fine.</p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><br></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1">However, I want to use a subroutine of resources (to simplify the code structure) instead of placing resources in the main program.</p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1">So, in my original code I have:</p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1">







</p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s1">opts_rad = set_res1_list()</span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s1">However, I really want to set opts_rad = opts_xy and then add the resources in res1_list.</span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s1">I don't know how to include the opts_rad = opts_xy with the resources from set_res_list() at the same time.</span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1">Barry</p><span class="m_-8626700712428149252HOEnZb"><font color="#888888"><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s1"><br></span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1">Barry</p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s1"><br></span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><br></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><br></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s2"><br></span></p><p class="m_-8626700712428149252m_5170005551246263495gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495gmail-s2"><br></span></p></font></span></div></div><div class="m_-8626700712428149252HOEnZb"><div class="m_-8626700712428149252h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 7, 2017 at 7:07 PM, Guido Cioni <span dir="ltr"><<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Barry,<div>I honestly don't understand the problem.</div><div>Why would just copying the resource over not work? :) </div><div><br></div><div>if you set</div><div><br></div><div>res=True </div><div>res@...</div><div>res@....</div><div><br></div><div>and then assign </div><div><br></div><div>res2=res</div><div><br></div><div>res2 will be True and have all the resources that you define for res.</div><div><br></div><div>Am I missing something? </div><div><br></div><div>If you instead want to set "just one resource" why not just assign it without having to copy the ones that you do not want to use? </div><div><br></div><div><br></div><div><div><div class="m_-8626700712428149252m_5170005551246263495h5"><br><div><blockquote type="cite"><div>On 7. Nov 2017, at 18:04, Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>> wrote:</div><br class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326Apple-interchange-newline"><div><div dir="ltr">Hi:<div><br></div><div>Thank you, but not the attributes, but the resources.</div><div><br></div><div>I have "subroutines" that define resources for a variable.</div><div><br></div><div>However, before using one of them (the appropriate one), I want to set the variable equal to other resources first.</div><div><br></div><div>For instance:</div><div><br></div><div>zdr_res = opts_xy</div><div><br></div><div>Then add to opts_xy the resources in res1, for instance.</div><div><br></div><div><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-s1">undef("set_res1_list")</span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-s1">function set_res1_list()</span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-s1">begin</span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-s1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-Apple-converted-space">  </span>res<span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-Apple-converted-space">                </span>= True ; I assume this would need to be commented out.</span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-p1">various resources...</p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail-p1">end</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 7, 2017 at 6:48 PM, Adam Phillips <span dir="ltr"><<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Barry,<div>If all you want to do is to copy attributes from one array to another, I think copy_VarAtts would work:</div><div><a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarAtts.shtml" target="_blank">https://www.ncl.ucar.edu/Docum<wbr>ent/Functions/Contributed/copy<wbr>_VarAtts.shtml</a></div><div>Adam</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326h5">On Tue, Nov 7, 2017 at 4:56 AM, Barry Lynn <span dir="ltr"><<a href="mailto:barry.h.lynn@gmail.com" target="_blank">barry.h.lynn@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326h5"><div dir="ltr">Hello:<div><br></div><div>I can't seem to find how to do this.</div><div><br></div><div>I have this ncl line:</div><div><br></div><div><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-s1">opts_zdr = </span><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-s2">set_res2</span><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-s1">_list()</span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-s1">I also have opts_xy.</span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-s1">When making vertical cross sections I need to set opts_zdr = opts_xy</span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1">and then add in the resources of res2_lis.</p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1">I am not sure how to add them in, rather than "set" them.</p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1">Thanks,</p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1"><br></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1">Barry</p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-s1"><br></span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-s1"><br></span></p><p class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-p1"><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail-s1"><br></span></p><div><br></div>-- <br><div class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470m_-8543467763429719921gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com/" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div></div>
<br></div></div>______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><span class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326m_-3771703249917078470gmail_signature" data-smartmail="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,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphill<wbr>i/</a>   </font></span><span><font color="#888888"><a href="tel:(303)%20497-1726" value="+13034971726" target="_blank">303-497-1726</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>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com/" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div>
______________________________<wbr>_________________<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" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br></div></blockquote></div><br></div></div><span class="m_-8626700712428149252m_5170005551246263495HOEnZb"><font color="#888888"><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;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"><br class="m_-8626700712428149252m_5170005551246263495m_-3678851466703463326Apple-interchange-newline">Guido Cioni</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;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"><a href="http://guidocioni.altervista" target="_blank">http://guidocioni.altervista</a>.o<wbr>rg</div>

</div>
<br></font></span></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-8626700712428149252m_5170005551246263495gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US <a href="tel:(914)%20432-3108" value="+19144323108" target="_blank">914 432 3108</a><br></div></div></div>
</div>
</div></div><br>______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Barry H. Lynn, Ph.D<div><div>Senior Lecturer,</div><div><div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)"></div><span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div></div><div><span style="color:rgb(136,136,136)"><br></span></div><div>C.E.O, Weather It Is, LTD<br>Weather and Climate Focus<br><a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>Jerusalem, Israel<br>Local: 02 930 9525<br>Cell: 054 7 231 170<br>Int-IS: x972 2 930 9525<br>US 914 432 3108<br></div></div></div>
</div>