<div>Thank so much for your reply.</div>
<div>With the script you have sent me:</div>
<div> </div>
<div>'reinit'<br>'sdfopen ereda'<br>'set lat 41'<br>'set lon 359'<br>'set lev 1'<br>to = 1<br>* Write the variable to a file<br>*'set gxout vector'<br>*'set fwrite z:\dummy.dat'<br>
while (to<5)<br>'set t 'to<br>tmp=''<br>tmp=subwrd(rerult,4)<br>'d u';tmp=tmp%''subwrd(result,4)<br>rrc = write('c:\prueba_c\pruebas_archivo_ecmwf\prueba3.txt',tmp)<br>tmp=subwrd(rerult,4)<br>
'd v';tmp=tmp%''subwrd(result,4)<br>rrc = write('c:\prueba_c\pruebas_archivo_ecmwf\prueba3.txt',tmp)<br>to = to + 1<br>endwhile<br>set lev 1<br></div>
<div>I've gotten the following result:</div>
<div> </div>
<div>0.261717<br>-2.01558<br>2.12168<br>-4.01917<br>1.91571<br>-4.87874<br>0.710381<br>-3.54395</div>
<div> </div>
<div>In the first row, the fist data of the u velocity appears; in the second row, the second data of the v velocity appears, in the third row, the second data of the u velocity appears; in the fourth row, the second data of the v velocity appears. </div>
<div>This is fine but I'd would like the following: The first data of u velocity appears in the first row and first column, the second data of u velocity appears in the second row and first column,... The first data of v velocity appears in the first row and second column; the second data of velicity appears in the second row and the second column,...</div>
<div>I mean, somethink similar like this:</div>
<div>
<div>0.261717 -2.01558<br>2.12168 -4.01917 <br>1.91571 -4.87874<br>0.710381 -3.54395<br>It say like a array o matrix.</div>
<div>Is it possible to do that?</div>
<div> </div>
<div>Best Regards:</div>
<div> </div>
<div>Javier Peña </div></div>
<div><br> </div>
<div class="gmail_quote">2009/9/17 Kim WonMoo <span dir="ltr"><<a href="mailto:kwmski7@snu.ac.kr">kwmski7@snu.ac.kr</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" name="Compose message area">
<div><font face="Calibri">Try this :</font></div>
<div><font face="Calibri"></font> </div>
<div><font face="Calibri">in the 'while' loop,</font></div>
<div><font face="Calibri">------------------------------------------</font></div>
<div class="im">
<div><font face="Calibri">while ( to<5 )</font></div>
<div><font face="Calibri"> 'set t 'to</font></div></div>
<div><font face="Calibri"> tmp=''</font></div>
<div><font face="Calibri"> 'd var1' ; tmp=subwrd(result,4)</font></div>
<div><font face="Calibri"> 'd var2' ; tmp=tmp%' 'subwrd(result,4)</font></div>
<div><font face="Calibri"> 'd var3' ; tmp=tmp%' 'subwrd(result,4)</font></div>
<div><font face="Calibri"> 'd var4' ; tmp=tmp%' 'subwrd(result,4)</font></div>
<div><font face="Calibri"> rrc = write('c:\prueba_c\pruebas_archivo_ecmwf\ereda_ecmwf_t.txt',tmp)<br> to = to + 1<br>endwhile</font></div>
<div style="FONT: 10pt Tahoma"><font face="Calibri" size="3">------------------------------------------</font></div>
<div style="FONT: 10pt Tahoma"><font face="Calibri" size="3"></font> </div>
<div style="FONT: 10pt Tahoma"><font face="Calibri" size="3">so that before you write to ~.txt file, make a augmented outputs as in the script.</font></div>
<div style="FONT: 10pt Tahoma"><font face="Calibri" size="3"></font> </div>
<div style="FONT: 10pt Tahoma"><font face="Calibri" size="3">here, subwrd(result,4) is used, for the 4th word of the 'result' contains the value.</font></div>
<div style="FONT: 10pt Tahoma"> </div>
<div style="FONT: 10pt Tahoma"><font face="Calibri" size="3">Good luck,</font></div>
<div style="FONT: 10pt Tahoma"><font face="Calibri" size="3">Kim, WonMoo</font></div>
<div style="FONT: 10pt Tahoma"><font face="Calibri" size="3"></font> </div>
<div style="FONT: 10pt Tahoma">
<div><br></div>
<div style="BACKGROUND: #f5f5f5">
<div><b>From:</b> <a title="mailto:javier.p@EREDA.COM
링크를 따라가려면 CTRL 키를 누른 상태에서 클릭합니다." href="mailto:javier.p@EREDA.COM" target="_blank">Javier Peña</a> </div>
<div><b>Sent:</b> Thursday, September 17, 2009 6:23 PM</div>
<div><b>To:</b> <a title="mailto:GRADSUSR@LIST.CINECA.IT
링크를 따라가려면 CTRL 키를 누른 상태에서 클릭합니다." href="mailto:GRADSUSR@LIST.CINECA.IT" target="_blank">GRADSUSR@LIST.CINECA.IT</a> </div>
<div><b>Subject:</b> Help</div></div></div>
<div>
<div></div>
<div class="h5">
<div><br></div>
<p>We have some data in a netcdf file (u velocity, v velocity, geopetential,ect) to some dates and some points of a grid.<br>Now, we extract each variable in a file with following script:<br>For example to extract the temperature:<br>
<br>'reinit'<br>'sdfopen ereda'<br>'set lat 41'<br>'set lon 359'<br>'set lev 1'<br>to = 1<br>* Write the variable to a file<br>*'set gxout vector'<br>*'set fwrite z:\dummy.dat'<br>
while (to<5)<br>'set t 'to<br>'d t'<br>rrc = write('c:\prueba_c\pruebas_archivo_ecmwf\ereda_ecmwf_t.txt',result)<br>to = to + 1<br>endwhile</p>
<div>We'd like to extract all variables in a same file and the variables are in differents columns. </div>
<div>Are there any script to do this?<br clear="all"></div>
<div></div><br>-- <br>Javier Peña Álvarez<br>Energías Renovables<br><a href="mailto:javier.p@ereda.com" target="_blank">javier.p@ereda.com</a><br>EREDA<br><br> Tel: +34 91 5014755<br> Fax: +34 91 5014756<br>
c/ Téllez 26, 28007 MADRID<br> <a href="http://www.ereda.com/" target="_blank">www.ereda.com</a><br></div></div></div></blockquote></div><br><br clear="all">
<div></div><br>-- <br>Javier Peña Álvarez<br>Energías Renovables<br><a href="mailto:javier.p@ereda.com">javier.p@ereda.com</a><br>EREDA<br><br> Tel: +34 91 5014755<br> Fax: +34 91 5014756<br>
c/ Téllez 26, 28007 MADRID<br> <a href="http://www.ereda.com">www.ereda.com</a><br>