<div dir="ltr">After getting this, if you still want only binary files, please let me know. there are couple of options to make nc file to .dat file, even with grads.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 24, 2015 at 11:37 AM, Kishore Ragi <span dir="ltr"><<a href="mailto:kishoreragi@gmail.com" target="_blank">kishoreragi@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"><div><div><div><div><div><div><div><div><font color="#444444" face="verdana, sans-serif"><b>Hi Valeria Benson-Lira,<br><br></b></font></div><font color="#444444" face="verdana, sans-serif">If you don't have problem working with nc files, I will give you other option to achieve your task.<br><br></font></div><font color="#444444" face="verdana, sans-serif">First, you make your ctl file into netcdf files as below<br><b><br></b></font></div><font color="#444444" face="verdana, sans-serif">cdo -f nc import_binary </font>ENCB1_precip_apr2008.ctl <a href="http://precip.april.nc" target="_blank">precip.april.nc</a><br></div><font color="#444444" face="verdana, sans-serif">cdo -f nc import_binary </font>ENCB1_precip_may2008.ct <a href="http://precip.may.nc" target="_blank">precip.may.nc</a><br><font color="#444444" face="verdana, sans-serif">cdo -f nc import_binary</font> ENCB1_precip_jun2008.ctl <a href="http://precip.june.nc" target="_blank">precip.june.nc</a><br></div><font color="#444444" face="verdana, sans-serif">cdo -f nc import_binary </font>ENCB1_precip_july2008.ctl <a href="http://precip.july.nc" target="_blank">precip.july.nc</a><br><br></div>now merge them all in a single file like below<br><br></div>cdo mergetime <a href="http://precip.april.nc" target="_blank">precip.april.nc</a> <a href="http://precip.may.nc" target="_blank">precip.may.nc</a> <a href="http://precip.june.nc" target="_blank">precip.june.nc</a> <a href="http://precip.july.nc" target="_blank">precip.july.nc</a> <a href="http://precip.AMJJ.nc" target="_blank">precip.AMJJ.nc</a><br><br></div>Though, I did not help with grads, hope this helps.<br><div><div><div><br></div><div>Cheers,<br><br></div><div>Kishore<br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, Jan 24, 2015 at 11:11 AM, Valeria Benson-Lira <span dir="ltr"><<a href="mailto:vbensonl@asu.edu" target="_blank">vbensonl@asu.edu</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="h5"><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)">'reinit'</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">'open ENCB1_precip_apr2008.ctl'</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">'open ENCB1_precip_may2008.ct'</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">'open ENCB1_precip_jun2008.ctl'</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">'open ENCB1_precip_july2008.ctl'</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)">'set gxout fwrite'</p><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,64,255)">'set fwrite ENCB1_AMJJ_precip.dat '</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)"><=</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>'set t '<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>'d precip.1 '</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)"><=</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>'set t '<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>'d precip.2 '</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)"><=</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>'set t '<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>'d precip.3 '</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)"><=</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>'set t '<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>'d precip.4 '</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)">'disable fwrite'</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)">'reinit'</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><div dir="ltr"><font color="#444444" face="verdana, sans-serif"><b>Valeria Benson-Lira</b></font><div><font color="#444444" face="verdana, sans-serif"><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>
<br></div></div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>