[gradsusr] merge data
ugo okoro
uknac23 at yahoo.com
Mon Jun 18 13:26:08 EDT 2012
hello all,
please i am working with ncep data in .nc format and had merged it with the help of this forum. however i am faced with some challenges as when i subtract the merged data with the original data for some variables, i dont get zero.
for instance for u-wind, i merged it using the following .gs script;
*script to merge data from multiple netcdf files, e.g. uwnd.1979.nc, uwnd.1980.nc, etc
*edit start and end dates as needed
*view output with Mergedncep_uwnd1000.ctl (edit tdef for longer times)
'reinit'
iyear=1979
'set gxout fwrite'
'set fwrite F:\merged_uwnd1000.dat'
while (iyear <= 2011)
'sdfopen F:\ncep_uwind\uwnd.'iyear'.nc'
'q file'
res=sublin(result,5)
tsize=subwrd(res,12)
say tsize
tim = 1
'set x 1 144'
'set y 1 73'
while (tim <= tsize)
'set t 'tim
'd uwnd(lev=1000)'
tim=tim+1
endwhile
'close 1'
iyear=iyear+1
endwhile
'disable fwrite'
'reinit'
and ran it with the following .ctl script;
dset F:\merged_uwnd1000.dat
title daily NCEP/DOE Reanalysis 2
undef -9.99e+33
xdef 144 linear 0 2.5
ydef 73 linear -90 2.5
zdef 17 levels 1000 925 850 700 600 500 400 300
250 200 150 100 70 50 30 20 10
tdef 12053 linear 00Z01JAN1979 1dy
vars 1
uwnd 0 t,z,y,x Daily U-wind on Pressure Levels
endvars
please were did i get it wrong?
ugo okoro
cmsr, iap-cas,
beijing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120618/30b875a2/attachment-0003.html
More information about the gradsusr
mailing list