<div>Dear Dr Gamal, </div>
<div> </div>
<div>i'm trying something through IDL. can you give me the dimensions of your grid you should expect. <br>ie in Netcdf header :</div>
<div> </div>
<div><em>dimensions:<br> <font color="#ff0000"> </font></em><em><strong><font color="#ff0000"> x = ;<br> y = ;<br></font></strong> time = UNLIMITED ; // (1 currently)<br>variables:<br> double lon(y, x) ;<br>
lon:long_name = "longitude" ;<br> lon:units = "degrees_east" ;<br> lon:standard_name = "grid_longitude" ;<br> double lat(y, x) ;<br> lat:long_name = "latitude" ;<br>
lat:units = "degrees_north" ;<br> lat:standard_name = "grid_latitude" ;<br> double time(time) ;<br> time:units = "day as %Y%m%d.%f" ;<br> float preacc(time, y, x) ;<br>
preacc:long_name = "Precipitation" ;<br> preacc:standard_name = "precipitation_flux" ;<br><br></em></div>
<div>Cheers </div>
<div> </div>
<div>Guillaume D.</div>
<div><em> </em></div>
<div class="gmail_quote">On Mon, Jan 30, 2012 at 10:55 PM, Dr.Gamal El Afandi <span dir="ltr"><<a href="mailto:gamalafandy@yahoo.com">gamalafandy@yahoo.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div>
<div style="FONT-FAMILY:times new roman,new york,times,serif;FONT-SIZE:12pt">
<div><span></span></div>
<div></div>
<div><span>Dear all,</span></div>
<div><span></span><span>Could <span>you</span> please let me know if anyone have idea about converting the <span>TXT</span> or ASCII data into <span>NetCDF</span>?</span></div>
<div><span></span><span>Please attached is the file required to be transformed into <span>NetCDF</span>.</span></div>
<div><span></span><span><var></var>Please below is the program I used to convert from binary to <span>TXT</span></span></div>
<div>
<blockquote style="BORDER-LEFT:rgb(16,16,255) 2px solid;MARGIN-TOP:5px;PADDING-LEFT:5px;MARGIN-LEFT:5px">
<div style="FONT-FAMILY:times new roman,new york,times,serif;FONT-SIZE:12pt">
<div style="FONT-FAMILY:times new roman,new york,times,serif;FONT-SIZE:12pt">
<div>
<div>
<div style="FONT-FAMILY:times new roman,new york,times,serif;FONT-SIZE:12pt">
<div><span></span> </div>
<div><span>PROGRAM convert_<span>rfe</span>_bin2<span>asc</span><br><br>c <span>cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc</span><br>c Program: convert_<span>rfe</span>2.f<br>c<br>c Description: This program reads in a daily <span>RFE</span> (rainfall estimate) file<br>
c (version 2) in .bin format and creates an <span>ascii</span> integer<br>c file. Each file contains <span>rfe</span> coordinate data ordered by rows.<br>c Rainfall resolution is 0.1 degree with a domain of<br>
c 20W-55E, 40S-40N.<br>c<br>c Inputs: 'input_file' = the 10-day binary <span>precip</span> file to be converted<br>c<br>c Output: 'output.<span>txt</span>' = the output <span>ascii</span> converted text file<br>
c<br>c Modified: July, 2010 by Nick Novella (<a href="mailto:nicholas.novella@noaa.gov" target="_blank">nicholas.novella@noaa.gov</a>)<br>c<br>c <span>cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc</span><br>
<br>REAL*4 <span>rfe</span>(751,801),arr(3,601551)<br>real*4 lat,<span>lon</span><br>INTEGER:: i,j,ind<br>character*25:: input_file<br><br>c ##### CHANGE FILE NAME BELOW TO INPUT FILE #####<br><br>input_file="all_products.bin.20100621"<br>
<br>c ##################################################<br><br>c ##### Initialize the arrays #####<br>do i = 1,751 <br>do j = 1,801 <br> <span>rfe</span> (i,j) = -999<br>end do<br>end do<br><br>c ##### Read in the input rainfall data #####<br>
open (unit=22,file=input_file,access="direct",<br>1 convert='big_<span>endian</span>',status="old",<span>recl</span>=751*801*4)<br>read (22, rec=1) <span>rfe</span> <br><br>c ##### Open the output file #####<br>
open (88,file="output.<span>txt</span>",access='sequential',<br>1 status='unknown',form='formatted')<br><br>c ##### The next code converts the input rainfall data. Each row is then written<br>
c to the output file.<br><br>ind=1 <br> lat= -40.0<br><span>lon</span>= -20.0 <br>do j=1,801<br>do i=1,751<br> arr(1,ind)=lat<br> arr(2,ind)=<span>lon</span><br> arr(3,ind)=<span>rfe</span>(i,j)<br>
<br>write (88,499) arr(1,ind), arr(2,ind), arr(3,ind)<br>499 format(1X,f6.2,1X,f6.2,1X,f8.2)<br><br> ind=ind+1<br> <span>lon</span>=<span>lon</span>+0.1<br>end do<br> lat=lat+0.1<br> <span>lon</span>=-20.0<br>
end do<br><br><br><br><br><br> END PROGRAM<br></span></div>
<div></div>
<div> </div>
<div><font size="3" face="times new roman, new york,
times, serif">With my kind regards<br>Gamal<br>___________________________________________________________<br><b>Gamal <span>Salah</span> El Afandi, <span>Ph</span>.D. <br>College of Agricultural, Environment and Nutrition Sciences </b></font></div>
<div><font size="3" face="times new roman, new york, times, serif"><b>College of Engineering <br>Tuskegee University, Tuskegee Alabama USA<br></b><br></font><a href="http://www.tuskegee.edu/" rel="nofollow" target="_blank"><font size="3" face="times new roman, new york, times, serif">http://www.tuskegee.edu/</font></a><br>
<a href="http://www.tuskegee.edu/academics/colleges/caens.aspx" rel="nofollow" target="_blank"><font size="3" face="times new roman, new york, times, serif">http://www.tuskegee.edu/academics/colleges/caens.aspx</font></a><br>
<a href="http://www.tuskegee.edu/academics/colleges/ceps.aspx" rel="nofollow" target="_blank"><font size="3" face="times new roman, new york, times, serif">http://www.tuskegee.edu/academics/colleges/ceps.aspx</font></a><br>
<a href="http://maindb.unfccc.int/public/roe/expert_list.pl?id_country=66&" rel="nofollow" target="_blank"><font size="3" face="times new roman, new york, times,
serif">http://maindb.unfccc.int/public/roe/expert_list.pl?id_country=66&</font></a><font size="3" face="times new roman, new york, times, serif">;<br></font><a href="http://www.itap.purdue.edu/pto/NATO_KEEO/partCoDir_en.html" rel="nofollow" target="_blank"><font size="3" face="times new roman, new york, times, serif">http://www.itap.purdue.edu/pto/NATO_KEEO/partCoDir_en.html</font></a><br>
<a href="http://www.ucar.edu/governance/iap/iapreps.shtml" rel="nofollow" target="_blank"><font size="3" face="times new roman, new york, times, serif">http://www.ucar.edu/governance/iap/iapreps.shtml</font></a></div>
<div> </div></div></div></div><br><br></div></div></blockquote></div></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" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>
<div><font style="FONT-FAMILY:garamond,serif" size="2"><span style="COLOR:rgb(0,0,153)"><font size="4"><span></span><span></span>Guillaume Dueymes </font>M.Sc.</span><br style="COLOR:rgb(0,0,153)"><span style="COLOR:rgb(0,0,153)">Agent de Recherche </span></font></div>
<div><font style="FONT-FAMILY:garamond,serif" size="2"><font color="#000099">Centre ESCER - Université du Québec à Montréal</font></font></div>
<div><font style="FONT-FAMILY:garamond,serif" size="2"><font color="#000099">Environnement Canada - </font><font color="#000099">Service Météorologique du Canada</font><br style="COLOR:rgb(0,0,153)"><span style="COLOR:rgb(0,0,153)"></span><font color="#000099">Université du Québec à Montréal</font></font></div>
<div><font color="#000099" face="Garamond">201 avenue Président-Kennedy, local PK-2315</font></div>
<div><font color="#000099" face="Garamond">Montréal (Québec) Canada</font><font style="FONT-FAMILY:garamond,serif" size="2"><br style="COLOR:rgb(0,0,153)"><span style="COLOR:rgb(0,0,153)">Tel: (514) 987-3000 poste 1407</span></font><b style="FONT-FAMILY:garamond,serif"><br>
</b><img src="https://lh4.googleusercontent.com/-p1e80oaMpeY/TrCQdJYH1NI/AAAAAAAAG1E/SkHd0QPX4BI/s912/LogoFace_En-tete.jpg" width="420" height="90"><br></div><br>