<div dir="ltr"><br>Please find my script in attached .<br><div class="gmail_quote">2011/3/10 Muhammad Rahiz <span dir="ltr"><<a href="mailto:muhammad.rahiz@ouce.ox.ac.uk">muhammad.rahiz@ouce.ox.ac.uk</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Could you attach your script?<div><div></div><div class="h5"><br>
<br>
-- <br>
Muhammad Rahiz<br>
Researcher & DPhil Candidate (Climate Systems & Policy)<br>
School of Geography & the Environment<br>
University of Oxford<br>
<br>
On Thu, 10 Mar 2011, hachelaf rabah wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello ,<br>
there my q define.<br>
<br>
ga-> q define<br>
tdif 0.00353409<br>
sumxtdif 1.84828<br>
sumttdif 663.954<br>
eqmtr850 0.173326<br>
tdif3 0.00315651<br>
sumxtdif3 1.89671<br>
sumttdif3 660.984<br>
eqmts850 0.172938<br>
vv1 1.04454<br>
vv2 1.00704<br>
vv3 0.999065<br>
vvdif 0.00140657<br>
sumxvvdif 6.4696<br>
sumtvvdif 2598.48<br>
eqmvr850 0.342889<br>
vvdif3 0.00206843<br>
sumxvvdif3 6.51913<br>
sumtvvdif3 2583.97<br>
eqmvs850 0.341931<br>
tdif5 0.00484139<br>
sumxtdif5 0.391542<br>
sumttdif5 341.125<br>
eqmtr500 0.124237<br>
tdif35 0.00490103<br>
sumxtdif35 0.403863<br>
sumttdif35 339.058<br>
eqmts500 0.12386<br>
vv15 24.0027<br>
vv25 24.047<br>
vv35 24.0475<br>
vvdif5 0.00195946<br>
sumxvvdif5 12.7343<br>
sumtvvdif5 7833.4<br>
eqmvr500 0.595346<br>
vvdif35 0.00200719<br>
sumxvvdif35 12.7124<br>
sumtvvdif35 7695.36<br>
eqmvs500 0.590077<br>
vsfc1 3.9419<br>
vsfc2 3.9419<br>
vsfc3 3.9419<br>
vsfcdif 0<br>
sumxvsfcdif 0<br>
sumtvsfcdif 0<br>
eqmvsfcr 0<br>
vsfcdif3 0<br>
sumxvsfcdif3 0<br>
sumtvsfcdif3 0<br>
eqmvsfcs 0<br>
tsfcdif 2.05729e-06<br>
sumxtsfcdif 0.031608<br>
sumttsfcdif 3.56429<br>
eqmtsfcr 0.0126993<br>
tdifsfc3 4.6948e-06<br>
sumxtdifsfc3 0.0311705<br>
sumttdifsfc3 3.60771<br>
eqmtsfcs 0.0127764<br>
pmsldif 0.00057525<br>
sumxpmsldif 4.33772<br>
sumtpmsldif 938.117<br>
eqmpmslr 0.206026<br>
pdif3 0.000571509<br>
sumxpdif3 4.3276<br>
sumtpdif3 946.112<br>
eqmpmsls 0.206902<br>
qv501 0.290728<br>
sumxqv501 12.1445<br>
sumtqv501 17710.8<br>
eqmqv501 0.895185<br>
qv502 0.290786<br>
sumxqv502 12.3113<br>
sumtqv502 16894.3<br>
eqmqv502 0.874308<br>
qv851 0.0132816<br>
sumxqv851 4.49544<br>
sumtqv851 14155.8<br>
eqmqv851 0.800315<br>
qv852 0.0132447<br>
sumxqv852 4.586<br>
sumtqv852 14006.1<br>
eqmqv852 0.796073<br>
<br>
<br>
2011/3/10 Muhammad Rahiz <<a href="mailto:muhammad.rahiz@ouce.ox.ac.uk" target="_blank">muhammad.rahiz@ouce.ox.ac.uk</a>><br>
Could you provide the result of 'q define'?<br>
<br>
--<br>
Muhammad Rahiz<br>
Researcher & DPhil Candidate (Climate Systems & Policy)<br>
School of Geography & the Environment<br>
University of Oxford<br>
<br>
On Thu, 10 Mar 2011, hachelaf rabah wrote:<br>
<br>
Hello Muhamed,<br>
your script help me , but it doesn't work fine<br>
i have this warning when i run it :<br>
ga-> <a href="http://test.gs" target="_blank">test.gs</a><br>
Data Request Error: File number out of range<br>
Variable = tdif0.00353409<br>
Error ocurred at column 1<br>
DISPLAY error: Invalid expression<br>
Expression = tdif0.00353409<br>
Data Request Error: File number out of range<br>
Variable = sumxtdif1.84828<br>
Error ocurred at column 1<br>
DISPLAY error: Invalid expression<br>
Expression = sumxtdif1.84828<br>
Data Request Error: File number out of range<br>
Variable = sumttdif663.954<br>
Error ocurred at column 1<br>
DISPLAY error: Invalid expression<br>
Expression = sumttdif663.954<br>
Data Request Error: File number out of range<br>
Variable = eqmtr8500.173326<br>
..............................<br>
However i need to write just some variables from all screened by taping " q<br>
define "<br>
so i don't know who to filtered just desired variables.<br>
<br>
<br>
2011/3/10 Muhammad Rahiz <<a href="mailto:muhammad.rahiz@ouce.ox.ac.uk" target="_blank">muhammad.rahiz@ouce.ox.ac.uk</a>><br>
Dear Rabah,<br>
<br>
EQMVR850,EQMVR500 (& others) are objects which you've defined earlier in<br>
your<br>
original calculation. If you want to add the defined variables<br>
automatically, you<br>
can use the 'q define' and 'sublin' command.<br>
<br>
**********<br>
'set gxout print'<br>
<br>
n1 = 5 # assuming you have 5 defined variables/objects<br>
n2 = 1<br>
while (n2 <=n1)<br>
<br>
'q define'<br>
var = sublin(result,n2)<br>
'd 'var''<br>
ret = result<br>
res = write("output.txt",ret,append)<br>
res = close("output.txt)<br>
<br>
n2 = n2 + 1<br>
endwhile<br>
**********<br>
<br>
What the code does is to create a while loop and select each of the defined<br>
variables in<br>
'sublin(result,n2)' where n2 = 1,2,3,4,5 and print it to output.txt. The<br>
following<br>
illustrates what 'q define' and 'sublin' does;<br>
<br>
'q define'<br>
EQMVR850 = 1.58<br>
EQMVR500 = 1.89<br>
EQMVR700 = 1.98<br>
<br>
sublin(result,1) # EQMVR850 = 1.58<br>
sublin(result,2) # EQMVR500 = 1.89<br>
sublin(result,3) # EQMVR700 = 1.98<br>
<br>
<br>
<br>
--<br>
Muhammad Rahiz<br>
Researcher & DPhil Candidate (Climate Systems & Policy)<br>
School of Geography & the Environment<br>
University of Oxford<br>
<br>
On Wed, 9 Mar 2011, hachelaf rabah wrote:<br>
<br>
Dear Muhamaad,<br>
Thank you for help , your suggestion works correctely<br>
could you tell me who can i add the name of parameter to write it, with<br>
the<br>
value like that :<br>
exemple :<br>
EQMVR850 = 1.58<br>
EQMVR500 = 1.89<br>
EQMVR700 =1.98<br>
.......<br>
.........<br>
<br>
2011/3/9 Muhammad Rahiz <<a href="mailto:muhammad.rahiz@ouce.ox.ac.uk" target="_blank">muhammad.rahiz@ouce.ox.ac.uk</a>><br>
Dear Rabah,<br>
<br>
Could you try the following?<br>
<br>
...<br>
...<br>
<br>
'set gxout print'<br>
'd eqmVr850'<br>
ret = result<br>
res = write("output.txt",ret,append)<br>
res = close("output.txt)<br>
<br>
<br>
--<br>
Muhammad Rahiz<br>
Researcher & DPhil Candidate (Climate Systems & Policy)<br>
School of Geography & the Environment<br>
University of Oxford<br>
<br>
<br>
On Wed, 9 Mar 2011, hachelaf rabah wrote:<br>
<br>
Hello all GRADS users,<br>
<br>
My problem is that i can not find a solution to write some<br>
defined parameters like result of<br>
summing some parameters.<br>
or others statistical operations between variables.<br>
i have this part of my script :<br>
......................................<br>
'define VV1=mag(UGRDprs.1,VGRDprs.1)'<br>
'define VV2=mag(UGRDprs.2,VGRDprs.2)'<br>
'define VV3=mag(UGRDprs.3,VGRDprs.3)'<br>
'define VVdif=(VV2-VV1)*(VV2-VV1)'<br>
'define sumxVVdif=sum(VVdif,x=1,x=139)'<br>
'define sumtVVdif=sum(sumxVVdif,y=1,y=159)'<br>
'define eqmVr850=sqrt(sumtVVdif/22101)'<br>
'd eqmVr850'<br>
'define VVdif3=(VV3-VV1)*(VV3-VV1)'<br>
'define sumxVVdif3=sum(VVdif3,x=1,x=139)'<br>
'define sumtVVdif3=sum(sumxVVdif3,y=1,y=159)'<br>
'define eqmVs850=sqrt(sumtVVdif3/22101)'<br>
'd eqmVs850'........<br>
..........................................<br>
so i need to write the result of eqmVr850 and eqmVs850<br>
....and other variables like that in a ASCII<br>
file.<br>
i tried that with the <a href="http://fprintf.gs" target="_blank">fprintf.gs</a> script but it each<br>
time,just the last value is wrote because this<br>
script erase preceding values wrote in the ASCII file.<br>
<br>
Thank you advance for any suggestions.<br>
<br>
<br>
<br>
--<br>
Cordialement,<br>
Best regards,<br>
Rabah Hachelaf<br>
<br>
______ <br>
( )<br>
( ) <br>
(________) <br>
///////// <br>
<br>
<br>
<br>
<br>
_______________________________________________<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>
<br>
<br>
<br>
--<br>
Cordialement,<br>
Best regards,<br>
Rabah Hachelaf<br>
<br>
______ <br>
( )<br>
( ) <br>
(________) <br>
///////// <br>
<br>
<br>
<br>
<br>
_______________________________________________<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>
<br>
<br>
<br>
--<br>
Cordialement,<br>
Best regards,<br>
Rabah Hachelaf<br>
<br>
______ <br>
( )<br>
( ) <br>
(________) <br>
///////// <br>
<br>
<br>
<br>
<br>
_______________________________________________<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>
<br>
<br>
<br>
--<br>
Cordialement,<br>
Best regards,<br>
Rabah Hachelaf<br>
<br>
______ <br>
( )<br>
( ) <br>
(________) <br>
///////// <br>
<br>
<br>
<br>
</blockquote>
</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>Cordialement,<br>Best regards,<br>Rabah Hachelaf <br><br> ______ <br> ( )<br> ( ) <br> (________) <br>
///////// <br><br><br>
</div>