Hi,
I want to add one variable to a existed WRF output netcdf file without writing each variable definition. The script I tried as below, but it doesn't work. Any suggestions or help are very appreciated!
cl
----------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
diri = "/data11/cluo/wrf/"
nam1 = "wrfout_d01_2012-03-12_00:00:00"
f_in = addfile(diri+nam1,"r")
RAINC2 = f_in->RAINC(:,:,:)
do it = 0, 47
RAINC2(it,:,:) = RAINC(it+1,:,:) - RAINC(it,:,:)
enddo
ff = f_in + RAINC2
names = getfilevarnames(ff); extract all variable names
system("rm out.nc") ; remove any pre-existing file
ncdf_out = addfile(out.nc,"c") ; create output netCDF file
do i = 0, dimsizes(names)-1
ncdf_out->$names(i)$ = f_in->$names(i)$
end do
end
------------------------------------------
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Sep 10 15:20:40 2013
This archive was generated by hypermail 2.1.8 : Mon Sep 16 2013 - 13:43:52 MDT