<div dir="ltr">Dear Grads users,<div><br></div><div>Can someone please help me with my script? I am trying to write a binary file that contains all the values recorded in four different control files. My new binary file will have the hourly precipitation records from April through July. So far, the script works for the first month but not for the following months.</div><div><br></div><div><div style="font-size:13px">This is the script:</div><div style="font-size:13px"><p style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;reinit&#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;open ENCB1_precip_apr2008.ctl&#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;open ENCB1_precip_may2008.ct&#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;open ENCB1_precip_jun2008.ctl&#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;open ENCB1_precip_july2008.ctl&#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;set gxout fwrite&#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;set fwrite ENCB1_AMJJ_precip.dat &#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Write April data First. </p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Recall that April has 720 hours (30 days)</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> = </span><span style="color:rgb(255,64,255)">1</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(236,236,21)">while<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(40,239,239)"><b>index</b></span><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)">&lt;=</span><span style="color:rgb(255,64,255)">720</span><span style="color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)"><span style="color:rgb(0,0,0)">  </span>&#39;set t &#39;<span style="color:rgb(40,239,239)"><b>index</b></span><span style="color:rgb(255,221,221)">_t</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(0,0,0)">  </span><span style="color:rgb(236,236,21)">say</span><span style="color:rgb(0,0,0)"> </span><b>index</b><span style="color:rgb(255,221,221)">_t</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)"><span style="color:rgb(0,0,0)">  </span>&#39;d precip.1 &#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(0,0,0)">  </span><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> = </span><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> + </span><span style="color:rgb(255,64,255)">1</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(236,236,21)">endwhile</p><p style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Write May data Next. </p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Recall that May has 744 hours (31 days)</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> = </span><span style="color:rgb(255,64,255)">1</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(236,236,21)">while<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(40,239,239)"><b>index</b></span><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)">&lt;=</span><span style="color:rgb(255,64,255)">744</span><span style="color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)"><span style="color:rgb(0,0,0)">  </span>&#39;set t &#39;<span style="color:rgb(40,239,239)"><b>index</b></span><span style="color:rgb(255,221,221)">_t</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(0,0,0)">  </span><span style="color:rgb(236,236,21)">say</span><span style="color:rgb(0,0,0)"> </span><b>index</b><span style="color:rgb(255,221,221)">_t</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)"><span style="color:rgb(0,0,0)">  </span>&#39;d precip.2 &#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(0,0,0)">  </span><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> = </span><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> + </span><span style="color:rgb(255,64,255)">1</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(236,236,21)">endwhile</p><p style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Write June data Next. </p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Recall that June has 720 hours (30 days)</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> = </span><span style="color:rgb(255,64,255)">1</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(236,236,21)">while<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(40,239,239)"><b>index</b></span><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)">&lt;=</span><span style="color:rgb(255,64,255)">720</span><span style="color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)"><span style="color:rgb(0,0,0)">  </span>&#39;set t &#39;<span style="color:rgb(40,239,239)"><b>index</b></span><span style="color:rgb(255,221,221)">_t</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(0,0,0)">  </span><span style="color:rgb(236,236,21)">say</span><span style="color:rgb(0,0,0)"> </span><b>index</b><span style="color:rgb(255,221,221)">_t</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)"><span style="color:rgb(0,0,0)">  </span>&#39;d precip.3 &#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(0,0,0)">  </span><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> = </span><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> + </span><span style="color:rgb(255,64,255)">1</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(236,236,21)">endwhile</p><p style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Write July data Next. </p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Recall that July has 744 hours (31 days)</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> = </span><span style="color:rgb(255,64,255)">1</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(236,236,21)">while<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(40,239,239)"><b>index</b></span><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)">&lt;=</span><span style="color:rgb(255,64,255)">744</span><span style="color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)"><span style="color:rgb(0,0,0)">  </span>&#39;set t &#39;<span style="color:rgb(40,239,239)"><b>index</b></span><span style="color:rgb(255,221,221)">_t</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(0,0,0)">  </span><span style="color:rgb(236,236,21)">say</span><span style="color:rgb(0,0,0)"> </span><b>index</b><span style="color:rgb(255,221,221)">_t</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)"><span style="color:rgb(0,0,0)">  </span>&#39;d precip.4 &#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(0,0,0)">  </span><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> = </span><b>index</b><span style="color:rgb(255,221,221)">_t</span><span style="color:rgb(0,0,0)"> + </span><span style="color:rgb(255,64,255)">1</span></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(236,236,21)">endwhile</p><p style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*************************</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;disable fwrite&#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*************************</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****Always reinitialize when finished, </p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)">*****to avoid mistakingly writing extraneous data</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"></p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">&#39;reinit&#39;</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(40,239,239)"><span style="color:rgb(255,64,255)"><br></span></p><p style="margin:0px;font-size:11px;font-family:Menlo"><font color="#000000">Do you have a suggestion of how I can fix it?</font></p><p style="margin:0px;font-size:11px;font-family:Menlo"><font color="#000000">Thanks,</font></p></div></div><div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><font face="verdana, sans-serif" color="#444444"><b>Valeria Benson-Lira</b></font><div><font face="verdana, sans-serif" color="#444444"><b>Graduate Teaching Assistant, Geography M.A.</b></font></div><div><font color="#444444" face="verdana, sans-serif"><b>e-mail: <a href="mailto:vbensonl@asu.edu" target="_blank">vbensonl@asu.edu</a></b></font></div><div><div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:medium;text-align:-webkit-auto"><img src="http://www.asu.edu/asuthemes/4.0/images/logos/sgsup_logo2.png"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:medium;text-align:-webkit-auto"><br></div></div></div></div></div></div>
</div></div>