<div dir="ltr"><div>Try this one. Why 'define january=rainfall' and 'd rainfall' ??.....instead of d january ?.. Also the set time 'set time Jan1950 Dec2015'</div><div>statement is inactive inside he loop. I removed that also. If still error, then try with set x and set y.</div><div><br></div><div>'reinit'</div><div>'c'</div><div>'sdfopen IMD_Precip_1948-2015.nc'</div><div>'set lat 6.5 38.5'</div><div>'set lon 66.5 100'</div><div>'set fwrite jan.bin'<br></div><div>tt=25<br></div><div>while(tt<=816)</div><div>'set t 'tt</div><div>'set gxout fwrite'<br></div><div>'d rainfall'<br></div><div>tt=tt+12</div><div>endwhile<br></div><div>'disable fwrite'</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 18, 2016 at 2:03 PM, Lekshmi Mudra <span dir="ltr"><<a href="mailto:lekshmimdr@gmail.com" target="_blank">lekshmimdr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Before using sdfwrite, i tried 'fwrite'. The resultant binary file is<br>
not working. Here i'm attaching gs file for extracting monthly data<br>
from nc file and respective .ctl file for the monthly data.<br>
<br>
Below given are the details of .nc file for IMD rainfall from 1948-2015<br>
Grid coordinates :<br>
1 : lonlat > size : dim = 17415 nx = 135 ny = 129<br>
lon : first = 66.5 last = 100 inc =<br>
0.25 degrees_east<br>
lat : first = 6.5 last = 38.5 inc =<br>
0.25 degrees_north<br>
Vertical coordinates :<br>
1 : surface : 0<br>
Time coordinate : 816 steps<br>
><br>
ga-> q file<br>
File 1 : Monthly cumulative rainfall<br>
Descriptor: IMD_Precip_1948-2015.nc<br>
Binary: IMD_Precip_1948-2015.nc<br>
Type = Gridded<br>
Xsize = 135 Ysize = 129 Zsize = 1 Tsize = 816 Esize = 1<br>
Number of Variables = 1<br>
rainfall 0 t,y,x Rainfall<br>
<br>
<br>
Thank you all for the suggestions.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
On 5/18/16, Jayakrishnan P.R <<a href="mailto:prjayakrishnan@gmail.com">prjayakrishnan@gmail.com</a>> wrote:<br>
> Share your gs file along with the ctl file which you used for opening the<br>
> converted binary file so that someone can have a look into it for error. As<br>
> already pointed out by users, sdfwrite is for writing a file into netcdf<br>
> format. Here is a sample gs file which can be used for converting OLR into<br>
> .bin file. Have a look and modify it for your purpose. Best of Luck.<br>
><br>
> 'reinit'<br>
> 'sdfopen D:/computation2008/IITM_OLR_2008.nc'<br>
> 'set lon 62 72'<br>
> 'set lat 5 15'<br>
> prompt 'key-in file name for olr : '<br>
> pull fname<br>
> 'set fwrite 'fname<br>
> tt=153<br>
> 'set t 'tt<br>
> 'set gxout fwrite'<br>
> 'd olr'<br>
> 'disable fwrite'<br>
><br>
><br>
><br>
> On Tue, May 17, 2016 at 8:59 PM, Mikovitz, Colleen (LARC-E302)[SCIENCE<br>
> SYSTEMS AND APPLICATIONS, INC] <<a href="mailto:j.c.mikovitz@nasa.gov">j.c.mikovitz@nasa.gov</a>> wrote:<br>
><br>
>> The sdfwrite is for writing into another .nc file (sdf=self-describing<br>
>> format).<br>
>><br>
>> Use ‘set gxout fwrite’ along with ‘set fwrite’ Check out the<br>
>> documentation on <a href="http://cola.gmu.edu/grads/gadoc/gadocindex.html" rel="noreferrer" target="_blank">http://cola.gmu.edu/grads/gadoc/gadocindex.html</a> for each<br>
>> of those.<br>
>><br>
>> As a tip, make sure your x and y are set exactly to what you want output.<br>
>> For example, ‘set x 1 360’ for a one-degree grid.<br>
>><br>
>> Colleen<br>
>><br>
>> On May 17, 2016, at 6:18 AM, Lekshmi Mudra <<a href="mailto:lekshmimdr@gmail.com">lekshmimdr@gmail.com</a>> wrote:<br>
>><br>
>> > Dear All,<br>
>> ><br>
>> > I have all India gridded (0.25 x 0.25) imd rainfall data from<br>
>> > 1948 to 2015, which is in .nc format. I wanted to convert the same<br>
>> > into .bin format. I have tried using sdfwrite command. The resulted<br>
>> > binary file is not working properly.<br>
>> > Is there any solution?<br>
>> ><br>
>> ><br>
>> ><br>
>> > Lekshmi Mudra<br>
>> > _______________________________________________<br>
>> > gradsusr mailing list<br>
>> > <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
>> > <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> gradsusr mailing list<br>
>> <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
>> <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Sincerely<br>
><br>
> **************************************************<br>
> Dr. Jayakrishnan P.R<br>
> Post Doctoral Research Fellow<br>
> C308, Institute of Ocean and Earth Sciences (IOES)<br>
> University of Malaya<br>
> 50603, Kuala Lumpur<br>
> Tel: <a href="tel:%28%2B603%29%207967%204640" value="+60379674640">(+603) 7967 4640</a> / 6995<br>
> Mobile: 012-3526094<br>
><br>
> ****************************************************<br>
><br>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div style="font-size:12.8px">Sincerely</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">**************************************************</div><div style="font-size:12.8px">Dr. Jayakrishnan P.R</div><div style="font-size:12.8px">Post Doctoral Research Fellow</div><div style="font-size:12.8px">C308, Institute of Ocean and Earth Sciences (IOES)</div><div style="font-size:12.8px">University of Malaya</div><div style="font-size:12.8px">50603, Kuala Lumpur</div><div style="font-size:12.8px">Tel: (+603) 7967 4640 / 6995</div><div style="font-size:12.8px">Mobile: 012-3526094</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">****************************************************</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><span style="color:rgb(7,55,99)"><font size="1"><br></font></span></div><div style="font-size:12.8px"><span style="color:rgb(7,55,99)"><font size="1"><br></font></span></div><div style="font-size:12.8px"><br></div></div></div>
</div>