[gradsusr] writing some defined variables in ASCII file

hachelaf rabah r.hachelaf at gmail.com
Wed Mar 9 14:43:01 EST 2011


Dear Muhamaad,
Thank you for help , your suggestion works correctely
could you tell me who can i add the name of parameter to write it, with the
value like that :
exemple :
EQMVR850 = 1.58
EQMVR500 = 1.89
EQMVR700 =1.98
.......
.........

2011/3/9 Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk>

> Dear Rabah,
>
> Could you try the following?
>
> ...
> ...
>
> 'set gxout print'
> 'd eqmVr850'
> ret = result
> res = write("output.txt",ret,append)
> res = close("output.txt)
>
>
> --
> Muhammad Rahiz
> Researcher & DPhil Candidate (Climate Systems & Policy)
> School of Geography & the Environment
> University of Oxford
>
>
> On Wed, 9 Mar 2011, hachelaf rabah wrote:
>
>  Hello all GRADS users,
>>
>> My problem is that i can not find a solution to write some defined
>> parameters like result of
>> summing some parameters.
>> or others statistical operations between variables.
>> i have this part of my script :
>> ......................................
>> 'define VV1=mag(UGRDprs.1,VGRDprs.1)'
>> 'define VV2=mag(UGRDprs.2,VGRDprs.2)'
>> 'define VV3=mag(UGRDprs.3,VGRDprs.3)'
>> 'define VVdif=(VV2-VV1)*(VV2-VV1)'
>> 'define sumxVVdif=sum(VVdif,x=1,x=139)'
>> 'define sumtVVdif=sum(sumxVVdif,y=1,y=159)'
>> 'define eqmVr850=sqrt(sumtVVdif/22101)'
>> 'd eqmVr850'
>> 'define VVdif3=(VV3-VV1)*(VV3-VV1)'
>> 'define sumxVVdif3=sum(VVdif3,x=1,x=139)'
>> 'define sumtVVdif3=sum(sumxVVdif3,y=1,y=159)'
>> 'define eqmVs850=sqrt(sumtVVdif3/22101)'
>> 'd eqmVs850'........
>> ..........................................
>> so i need to write the result of eqmVr850 and eqmVs850 ....and other
>> variables like that in a ASCII
>> file.
>> i tried that with the fprintf.gs script but it each time,just the last
>> value is wrote because this
>> script erase preceding values wrote in the ASCII file.
>>
>> Thank you advance for any suggestions.
>>
>>
>>
>> --
>> Cordialement,
>> Best regards,
>> Rabah Hachelaf
>>
>>      ______
>>     (          )
>>    (            )
>>   (________)
>>      /////////
>>
>>
>>
>>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Cordialement,
Best regards,
Rabah Hachelaf

     ______
    (          )
   (            )
  (________)
     /////////
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110309/73cc827f/attachment-0003.html 


More information about the gradsusr mailing list