[gradsusr] Problem Extracting data in netcdf format

Zablone Owiti zablonowiti at yahoo.com
Sat Jan 15 09:53:36 EST 2011


Hi Rashed,
How can I adjust it to stop overwriting the output? See below the .gs file.

Thanks

'reinit'
'sdfopen gcpcr.nc'
'set x 0.5 360.5'
'set y 1 180'
t = 151
'set sdfwrite rain.nc'
*'set gxout fwrite'
while (t<670)
'set t 't
'define jul=r'
'set t 't+1
'define aug=r' 
'set t 't+2
'define sep=r'
'define jas=(jul+aug+sep)/3'
'sdfwrite jas'
t = t+12 
endwhile
'clear sdfwrite'
;




===================================================
ZABLONE OWITI
GRADUATE STUDENT
Nanjing University of Information, Science and Technology
College of International Education
Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China
Tel: +86-25-58731402
Fax: +86-25-58731456
Mob. 15077895632
Website: www.nuist.edu.cn
====================================================
"The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid the wrong thing at the tempting moment."
 



From: Rashed Mahmood <rashidcomsis at gmail.com>
To: Zablone Owiti <zablonowiti at yahoo.com>; GrADS Users Forum <gradsusr at gradsusr.org>
Cc: 
Sent: Saturday, 15 January 2011 8:34 PM
Subject: Re: [gradsusr] Problem Extracting data in netcdf format



I guess your loop is overwriting the output file and the output variable as after every loop as the name is same after each iteration...



Rashed 

Institute of Atmospheric Physics
(CAS) Beijing.


On Thu, Jan 13, 2011 at 6:13 PM, Zablone Owiti <zablonowiti at yahoo.com> wrote:

 Dear users,
>I am attempting to extract seasonal(JAS) data from a monthly netcdf data file using the attached script.
>When I run the script, it only write the first timestep data(i.e it fails to loop). 
>What could be error in the script?
>
>Thanks
>
>===================================================
>ZABLONE OWITI
>GRADUATE STUDENT
>Nanjing University of Information, Science and Technology
>College of International Education
>Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China
>Tel: +86-25-58731402
>Fax: +86-25-58731456
>Mob. 15077895632
>Website: www.nuist.edu.cn
>====================================================
>"The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid the wrong thing at the tempting moment."
> 
>
>
>_______________________________________________
>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/20110115/89166a31/attachment-0003.html 


More information about the gradsusr mailing list