<div>Dear Jayakrishnan</div> <div> </div> <div>Thanks. I have tried the fortran and C program and both they go well. </div> <div> </div> <div>did you see the sheet 2 in excel files.</div> <div> </div> <div> </div> <div>Again thank</div> <div> </div> <div> </div> <div>Ahmed</div> <div> </div> <div> </div> <div><BR><BR><B><I>Jayakrishnan PR <prjayakrishnan@GMAIL.COM></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Dear Kareem, <BR> I herewith attaches the programs with which I used to convert station files into grads figures. Try yourself. You first run the FORTRAN followed by C.<BR>Hope this helps and best wishes....<BR><BR><BR><BR> <DIV class=gmail_quote>On Sun, Mar 23, 2008 at 11:53 AM, ahmed kareem <<A href="mailto:am_kareem2001@yahoo.com">am_kareem2001@yahoo.com</A>> wrote:<BR> <BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"> <DIV>Dear grads user<BR> <BR>I have a problem to covert, the standard rainfall data Sheet 1; to be read grads.<BR>I have tried the program in the manual but with no success. <BR> <BR>I have mange to put the data in the SURFE program (sheet 2).<BR> <BR>I will be thankful for any assistant. <BR> <BR>Thank you in advance <BR> <BR>Ahmed A.Kareem</DIV> <DIV>Phd. Student Uni. of Khartoum<BR></DIV> <DIV class=WgoR0d> <div></div> <HR SIZE=1> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. <A href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ" target=_blank>Try it now.</A></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>***********************************************<BR>Jayakrishnan.P.R<BR>Junior Research Fellow<BR>Department of Atmospheric Sciences<BR>Cochin University of Science
And Technology (CUSAT), Cochin-16<BR>Kerala, India.<BR>Mob: 09895417565<BR><BR>*********************************************** #include <STDIO.H><BR>/* Structure that describes a report header in a stn file */ <BR>struct rpthdr {<BR>char id[8]; /* Station ID */<BR>float lat; /* Latitude of Station */<BR>float lon; /* Longitude of Station */ <BR>float t; /* Time in grid-relative units */ <BR>int nlev; /* Number of levels following */ <BR>int flag; /* Level independent var set flag */ <BR>} hdr;<BR><BR>main () <BR>{<BR>FILE *ifile, *ofile; <BR>char rec[80]; <BR>int flag,year,month,yrsav,mnsav,i; <BR>float val;<BR><BR>/* Open files */ <BR>ifile = fopen ("resultrain.txt","r"); <BR>ofile = fopen ("resultrain.bin","wb"); <BR>if (ifile==NULL || ofile==NULL) { <BR>printf("Error opening files\n"); <BR>return; <BR>}<BR><BR>/* Read, write loop */<BR>flag = 1; <BR>while (fgets(rec,79,ifile)!=NULL) { <BR>/* Format conversion */ <BR>sscanf (rec,"%i %i",&year,&month); <BR>sscanf
(rec+20," %g %g %g",&hdr.lat,&hdr.lon,&val); <BR>for (i=0; i<8; i++) hdr.id[i] = rec[i+11]; <BR>/* Time group terminator if needed */ <BR>if (flag) { <BR>yrsav = year; <BR>mnsav = month;<BR>flag = 0; <BR>} <BR>if (yrsav!=year || mnsav!=month) { <BR>hdr.nlev = 0; <BR>fwrite(&hdr,sizeof(struct rpthdr), 1, ofile); <BR>} <BR>yrsav = year; <BR>mnsav = month;<BR>/* Write this report */ <BR>hdr.nlev = 1;<BR>hdr.flag = 1; <BR>hdr.t = 0.0;<BR>fwrite (&hdr,sizeof(struct rpthdr), 1, ofile);<BR>fwrite (&val,sizeof(float), 1, ofile); <BR>} <BR>hdr.nlev = 0; <BR>fwrite (&hdr,sizeof(struct rpthdr), 1, ofile);<BR>} <BR>1010066 48.87 -123.28 21.1<BR>1010235 48.40 -123.48 16.5<BR>1010595 48.58 -123.52 19.6<BR>1010774 48.50 -123.35 16.8<BR>1010780 48.33 -123.63 18.0<BR>1010960 48.60 -123.47 18.8<BR>1010961 48.57 -123.45 18.2<BR>1010965 48.57 -123.43 17.5<BR>1011467 48.58 -123.42 15.9<BR>10114F6 48.57 -123.37 17.8<BR>10114FF 48.55 -123.40 17.2<BR>1011500 48.93
-123.75 23.1<BR>1011743 48.68 -123.60 21.6<BR>1011745 48.65 -123.57 21.0<BR>1011775 48.65 -123.40 18.6<BR>1011810 48.42 -123.48 16.0<BR>1011860 48.83 -123.83 22.1<BR>1011920 48.53 -123.37 17.1<BR>1011922 48.52 -123.37 17.0<BR>1012008 48.42 -123.70 19.8<BR>1012010 48.72 -123.55 23.9<BR>1012018 48.73 -123.60 21.6<BR>1012190 48.82 -123.67 21.2<BR>1012550 48.78 -123.72 21.2<BR>1012562 48.83 -123.72 21.9<BR>1012566 48.78 -123.68 21.0<BR>1012570 48.77 -123.68 21.0<BR>1012573 48.73 -123.73 21.1<BR>1012628 48.35 -123.63 18.0<BR>1012655 48.52 -123.38 17.1<BR>1012656 48.53 -123.38 17.2<BR>1012700 48.43 -123.42 15.5<BR>1012707 48.42 -123.47 15.9<BR>1012710 48.42 -123.40 14.3<BR>1012883 48.50 -123.53 19.0<BR>1013045 48.90 -123.35 23.1<BR>1013051 48.87 -123.50 21.5<BR>10130DE 48.87 -123.32 21.0<BR>10130MN 48.98 -123.57 26.9<BR>1013240 48.45 -123.55 18.1<BR>1013241 48.62 -123.53 20.0<BR>1013720 48.60 -123.35 17.8<BR>1014430 48.97 -123.63 23.6<BR>1014530 48.43 -123.53 17.3<BR>1014820
48.58 -123.53 19.9<BR>1014930 48.85 -123.33 20.9<BR>1014931 48.85 -123.32 20.9<BR>1015105 48.37 -123.57 14.7<BR>1015107 48.42 -123.53 16.9<BR>1015109 48.40 -123.53 16.7<BR>1015134 48.65 -123.55 20.8<BR>1015136 48.65 -123.55 20.8<BR>1015150 48.48 -123.55 18.3<BR>1015160 48.35 -123.73 20.5<BR>1015242 48.38 -123.88 20.0<BR>1015628 48.82 -123.72 21.2<BR>1015638 48.82 -123.32 20.7<BR>1016120 48.77 -123.30 20.3<BR>1016169 48.70 -123.42 19.4<BR>1016203 48.40 -123.98 19.8<BR>1016641 48.30 -123.53 16.8<BR>1016940 48.62 -123.42 18.2<BR>1016941 48.50 -123.42 17.1<BR>1016942 48.50 -123.40 17.0<BR>1016980 48.97 -123.77 23.4<BR>1016990 48.85 -123.50 20.5<BR>1016992 48.82 -123.48 20.5<BR>1016995 48.88 -123.55 21.4<BR>10169DK 48.52 -123.42 17.2<BR>10169MK 48.55 -123.42 17.2<BR>1016RM0 48.60 -123.43 18.2<BR>1017 43.73 -116.20 46.5<BR>1017000 48.88 -123.57 21.4<BR>1017098 48.80 -123.15 21.8<BR>1017101 48.78 -123.05 25.6<BR>1017230 48.65 -123.63 23.5<BR>1017233 48.65 -123.63 23.5<BR>1017329
48.68 -123.40 19.2<BR>1017556 48.37 -123.73 22.2<BR>1017559 48.42 -123.63 18.3<BR>1017560 48.52 -123.70 20.6<BR>1017563 48.57 -123.65 22.4<BR>1017570 48.37 -123.82 20.2<BR>1017575 48.38 -123.67 18.9<BR>1017610 48.75 -123.22 19.9<BR>1018590 48.45 -123.28 16.3<BR>1018592 48.63 -123.47 18.9<BR>1018595 48.43 -123.37 15.5<BR>1018600 48.47 -123.47 16.6<BR>1018605 48.48 -123.45 16.9<BR>1018610 48.42 -123.32 14.0<BR>1018611 48.42 -123.32 14.0<BR>1018614 48.47 -123.30 17.0<BR>1018616 48.52 -123.52 20.8<BR>1018617 48.48 -123.40 16.6<BR>1018620 48.65 -123.43 17.6<BR>1018629 48.43 -123.33 15.4<BR>1018640 48.43 -123.32 15.4<BR>1018642 48.37 -123.75 21.1<BR>1018644 48.43 -123.30 15.5c program<BR>parameter (nl=26)<BR>real alat1(nl),alon1(nl),clim(nl)<BR>character sid(nl) <BR>open(unit=1,file='rain.txt')<BR>open(unit=2,file='resultrain.txt')<BR>do 20 i=1,nl<BR>read(1,*)sid(i),alat1(i),alon1(i),clim(i)<BR>20 continue<BR>12 format(f10.2,2x,f10.2,56(2x,f10.2))<BR>c 12
format(f6.3,2x,f7.3,14(2x,f10.2),14(2x,f10.2),14(2x,f10.2)<BR>c 1 ,14(2x,f10.2))<BR>iyr=1961<BR>imon=06<BR>do 30 i=1,nl<BR>c t1(i)=300.<BR>write(2,14)iyr,imon,i,alat1(i),alon1(i),clim(i)<BR>30 continue<BR>14 format(i4,2x,i2,2x,i5,'ab',9x,f10.3,2x,f10.3,2x,f10.3)<BR>stop<BR>end <BR></BLOCKQUOTE><BR><p> 
<hr size=1>Never miss a thing. <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>