<div dir="ltr"><div><div>Dear Guido,<br><br></div>Thanks for the code lines, I modified (attached) and need some little more.<br>I want to copy 5 variable data from <b>in1 to in2</b> and the issue is the <b>latitude</b> is to be swapped while writing to in2 along with data as well because otherwise it will show reverse plot. any solution?  <br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><b>Note: latitude is in ascending order (in1) and decending order (in2).</b><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>--</div>Regards,<div>Nitin Patil</div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Dec 7, 2015 at 4:45 PM, Guido Cioni <span dir="ltr">&lt;<a href="mailto:guidocioni@gmail.com" target="_blank">guidocioni@gmail.com</a>&gt;</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">Dear Nitin,<div>if I understood the problem correctly, you should just take advantage of the <font face="Menlo">“w”</font> option in the built-in <font face="Menlo">addfile</font> function. With this additional requirement you can read (and write!) both files and then directly assign the variable with the new values taken from the other file. </div><div><br></div><div><div><font face="Menlo">in=addfile(“<a href="http://file1.nc" target="_blank">file1.nc</a>&quot;, &quot;w”)</font></div><div><font face="Menlo">in2=addfile(“<a href="http://file2.nc" target="_blank">file2.nc</a>&quot;, “r&quot;)</font></div><div><br></div><div><font face="Menlo">in-&gt;temp(:,:,:)=in2-&gt;temp</font><span style="font-family:Menlo">(:,:,:)</span></div></div><div><br></div><div>Be advised that some older versions of NCL don’t really play well with “w” option, so do an update first, just to be safe. </div><div>Although I still don’t understand the problem, since a simple rename would do the same… <br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div><br>Guido Cioni</div><div><a href="http://guidocioni.altervista.org" target="_blank">http://guidocioni.altervista.org</a> </div><div><br></div></div><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div>
</div>
<br><div><blockquote type="cite"><div><div class="h5"><div>Il giorno 07 dic 2015, alle ore 11:01, Nitin Patil &lt;<a href="mailto:nitinpatil85@gmail.com" target="_blank">nitinpatil85@gmail.com</a>&gt; ha scritto:</div><br></div></div><div><div><div class="h5"><div dir="ltr">Dear ncl usr,<div><br></div><div>I have to netcdf file with 3 dims [time, lat, lon] and the 5 variables in it.</div><div><br></div><div>What I need is need to replace only data contain in that 5 variables from other file which also includes same dims and variable names, any idea or easy way?</div><div><br></div><div>Kindly let me know.</div><div><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>--</div>Regards,<div>Nitin Patil</div></div></div></div></div></div></div></div></div></div>
</div></div></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" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div>