<div dir="ltr"><div>I speculate you are overwriting the generated png file with each iteration.<br><br>---<br>[1] Move the following before the 'do' loop<br><br>wks = gsn_open_wks("png","diff")<br><br></div><div>or<br></div><div><br>[2] Keep it where it is but make the line<br></div><br>wks = gsn_open_wks("png","diff_"+sprinti("%0.2i", it) )</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 18, 2017 at 2:51 AM, Muhammad Omer Mughal <span dir="ltr"><<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.au</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 id="m_7047997972392175801divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi</p>
<p><br>
</p>
<p>I am trying to use the following script to generate a temperature difference between two files. This script should generate 24 plots instead of just one. When I add "it" in <span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">tc2=
 wrf_user_getvar(a,"T2",it) then I get this error "<span>Subscript out of range, error in subscript #0". This could be because I used NCO to generate these files which stripped out the time dimension since I have averaged them over time. I would appreciate
 if some one can help me out here. Kindly note that I donot intend to waste someone personal time.</span></span></p>
<p><br>
</p>
<p></p>
<div>do it=0,23</div>
<div><span style="font-size:12pt"> wrf_file1 = "UTC_" + it + ".nc"</span></div>
<div> a = addfile(wrf_file1, "r")</div>
<div><span style="font-size:12pt"> wrf_file2 = "../OmerForest/UTC_" + it + ".nc"</span><br>
</div>
<div> b=addfile(wrf_file2,"r")</div>
<div><br>
</div>
<div><span style="font-size:12pt">tc2= wrf_user_getvar(a,"T2",0)</span><br>
</div>
<div><span style="font-size:12pt">tcf= wrf_user_getvar(b,"T2",0)</span><br>
</div>
<div>diff=tc2-tcf</div>
<div>wks = gsn_open_wks("png","diff")</div>
<div>res=True</div>
<div><span>plot = gsn_csm_contour(wks,diff,res)</span><br>
</div>
 end do
<div>
<p><br>
</p>
<div id="m_7047997972392175801Signature">
<div id="m_7047997972392175801divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div style="font-family:Tahoma;font-size:13px">
<div style="font-family:Tahoma;font-size:13px"><b><br>
</b></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif;font-size:15.4545450210571px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:11pt">Muhammad Omer Mughal</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif;font-size:15.4545450210571px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:11pt">MSc BSc Mechanical Engineering</span></font><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:8pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">PhD  Research Scholar</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif;font-size:15.4545450210571px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Remote Sensing and Satellite Research Group</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif;font-size:15.4545450210571px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
Curtin University</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:11pt"><br>
</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt">Curtin University</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Tel |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
 8 9266 7962</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:7pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Fax |</span></font><font size="2" face="Arial Bold" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">+61
 8 9266 2377</span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Mobile |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt">0470 237 525</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt">  </span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Email |</span></font><font size="2" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><a href="mailto:m.lynch@curtin.edu.au" id="m_7047997972392175801LPNoLP" target="_blank"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">m.mughal1@postgrad.curtin.<wbr>edu.au</span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"> </span></font><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="2" face="Arial Bold" color="#AB8303"><span style="font-size:9pt">Web |</span></font><font size="2" face="Calibri,sans-serif" color="#AB8303"><span style="font-size:9pt"> </span></font><a href="http://curtin.edu.au/" id="m_7047997972392175801LPNoLP" target="_blank"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font size="2" face="Arial,sans-serif" color="#1F497D"><span style="font-size:9pt"><br>
</span></font><font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:7pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif;font-size:15.4545450210571px;margin:0px;background-color:rgb(255,255,255)">
<font size="1" face="Calibri,sans-serif" color="#1F497D"><span style="font-size:6pt"></span></font><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt">Curtin University is a trademark of Curtin University of Technology. </span></font><br>
</div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif;font-size:15.4545450210571px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt">CRICOS Provider Code 00301J (WA), 02637B (NSW)</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif;font-size:15.4545450210571px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif;font-size:15.4545450210571px;margin:0px;background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font size="1" face="Arial,sans-serif" color="#1F497D"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br></div>