[ncl-talk] replacing data

Guido Cioni guidocioni at gmail.com
Mon Dec 7 04:15:09 MST 2015


Dear Nitin,
if I understood the problem correctly, you should just take advantage of the “w” option in the built-in addfile function. With this additional requirement you can read (and write!) both files and then directly assign the variable with the new values taken from the other file. 

in=addfile(“file1.nc", "w”)
in2=addfile(“file2.nc", “r")

in->temp(:,:,:)=in2->temp(:,:,:)

Be advised that some older versions of NCL don’t really play well with “w” option, so do an update first, just to be safe. 
Although I still don’t understand the problem, since a simple rename would do the same… 

Guido Cioni
http://guidocioni.altervista.org <http://guidocioni.altervista.org/> 




> Il giorno 07 dic 2015, alle ore 11:01, Nitin Patil <nitinpatil85 at gmail.com> ha scritto:
> 
> Dear ncl usr,
> 
> I have to netcdf file with 3 dims [time, lat, lon] and the 5 variables in it.
> 
> What I need is need to replace only data contain in that 5 variables from other file which also includes same dims and variable names, any idea or easy way?
> 
> Kindly let me know.
> 
> --
> Regards,
> Nitin Patil
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151207/3bec6254/attachment.html 


More information about the ncl-talk mailing list