fwrite problem of 4D data

John Guhin johnguhin at GMAIL.COM
Tue Nov 27 10:49:09 EST 2007


Hi,
      I am trying to write a 4D  (time, height, lat,
 lon). This is the script I wrote, but only the first time step is written.
Any help?

'reinit'
'c'

'sdfopen uwnd.2002.nc'
'sdfopen vwnd.2002.nc'

'set gxout fwrite'
'set fwrite u_v_anom_ncep.grd'

t1=100
z1=1
while(t1<161)
'set t 't1
while(z1<18)
'set z 'z1

'set x 1 144' ; 'set y 1 73'

'define ubar=ave(uwnd,time=10apr02,time=10jun02)'
'define vbar=ave(vwnd.2,time=10apr02,time=10jun02)'

'd uwnd-ubar'
'd vwnd.2-vbar'

z1=z1+1
endwhile
t1=t1+1
endwhile
'disable fwrite'


 How can I write the data for all time steps?

 thanks.


 John Guhin
-



More information about the gradsusr mailing list