[gradsusr] text file

Lee Byerle lbyerle at yahoo.com
Sat Mar 9 11:15:39 EST 2013


Kaikombo,

I was able to run your script after a few modifications.  After displaying avvort and mvort, you can define the output using sublin(result,2).  Also, I did not use quotes for the write statements.

.
.
.
'set gxout print'
'set prnopts %10.3e 5 1'
'd avvort'
var1=sublin(result,2)
'd mvort'
var2=sublin(result,2)
retcode1=write(avvort.txt, var1, 0)
retcode2=close(avvort.txt)

retcode2=write(mvort.txt, var2 ,0)
retcode2=close(mvort.txt)

good luck,
Lee

On Mar 9, 2013, at 8:00 AM, kombo kai wrote:

> Hi Grads users
> I have calculated the area and time average of my variables, noe I want to write the out put results in output.txt my codes are as follows
> 'reinit'
> 'c'
> 'open d:/vorticity/data2_extraction.ctl'
> 'set lon 0 360'
> 'set lat  -90 90'
> 'set t 1 47'
> 'set z 3'
> 'define vort=hcurl(uwnd1,vwnd2)'
> 'set lon 40'
> 'set lat -22.5'
> 'set z 3'
> 'set t 1 47'
> *defining the area average vorticity
> 'define avvort=aave(vort,lon=40,lon=70,lat=-22.5,lat=-5)'
> *dining time average vorticiy va
> 'define mvort=ave(vort,t=1,t=47)'
> * printing and writing the the text files of the out puts
> 'set gxout print'
> 'set prnopts %10.3e 5 1'
> *'set prnopts %g 1 1'
> 'd avvort'
> 'd mvort'
> 'retcode1=write('d;/avvort.txt', avvort, 0)'
> 'retcode2=write('d;/mvort.txt', mvort,0)'
> 'retcode1=close(avort.txt)'
> 'retcode2=close(mvort.txt)'
> but when I run the script I get error in line whcih defines the recode1.
> I tried several options bur i havent get the output writen to the file I want 
> please any one can help this 
> regards
> kaikombo
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130309/b88c6b7e/attachment-0003.html 


More information about the gradsusr mailing list