how to fwrite data from a while loop

Dan Barrie dbarrie at ATMOS.UMD.EDU
Sat May 6 18:11:14 EDT 2006


Chuck,

Good catch there. Unfortunately, that was just something I forgot to
change before I sent the email out. I'm still having the same problem.
Any other suggestions? Thanks.

-Dan




Charles Seman wrote:
> Dan,
>
> I'm not sure, but is "win'a'" defined before doing the "aave"?
>
> Chuck
>
> Dan Barrie wrote:
>
>> Hi everyone,
>>
>> I am having a relatively simple problem with a grads script I wrote. I
>> am simply looking for the script to output a data file with the result
>> of every incremental passage through a while loop. The loop I have
>> written is hopefully producing only one data point each time through.
>> All I am getting out is a blank data file. I have copied my script
>> below. Thank you in advance for your help.
>>
>> Sincerely,
>>
>> Dan Barrie
>>
>>
>>
>> 'reinit'
>>
>> 'open project/ERA40_test.ctl'
>>
>> 'set lon 140 260'
>> 'set lat 15 75'
>> 'set lev 775'
>> 'set t 1 528'
>> countt = 12
>> a=1959
>> 'set fwrite project/peakvalues.data'
>> 'set gxout fwrite'
>> while(countt<=527)
>>     'set t 'countt
>>     'define d=vv'
>>      countt=countt+1
>>     'set t 'countt
>>     'define j=vv'
>>      countt=countt+1
>>     'set t 'countt
>>     'define f=vv'
>>     'define win=(d+j+f)/3'
>>     'define pval=aave(win'a',lon=189,lon=207,lat=51,lat=64)'
>>     'd pval'
>>     a=a+1
>>     countt = countt + 10
>> endwhile
>> 'disable fwrite'
>
>
> --
>
> ********************************************************************
> Charles Seman                                charles.seman at noaa.gov
> U.S. Department of Commerce / NOAA / OAR
> Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
> 201 Forrestal Road                              fax: (609) 987-5063
> Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
> ********************************************************************
>
> "The contents of this message are mine personally and do not reflect
> any position of the Government or NOAA."



More information about the gradsusr mailing list