[ncl-talk] replacing data

Nitin Patil nitinpatil85 at gmail.com
Mon Dec 7 23:50:32 MST 2015


Dear Guido,

Thanks for the code lines, I modified (attached) and need some little more.
I want to copy 5 variable data from *in1 to in2* and the issue is the
*latitude* is to be swapped while writing to in2 along with data as well
because otherwise it will show reverse plot. any solution?

*Note: latitude is in ascending order (in1) and decending order (in2).*

--
Regards,
Nitin Patil

On Mon, Dec 7, 2015 at 4:45 PM, Guido Cioni <guidocioni at gmail.com> wrote:

> 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
>
>
>
>
> 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/20151208/cefa5439/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new.ncl
Type: application/octet-stream
Size: 609 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151208/cefa5439/attachment.obj 


More information about the ncl-talk mailing list