[ncl-talk] weird error

Marston Johnston marston.johnston at gu.se
Thu Dec 1 03:28:15 MST 2016


Hi,

It would help to see the entire script. But I think the problem is well stated in the warning message.
I suspect that the warning doesn’t come from the line Temp!0 = “time”. In fact I’m pretty sure of it.
The warning comes later when you try and assign another variable to Temp, like this: Temp = A.
If A doesn’t have a dimension A!0 called “time”, just the same as Temp, then you will get the warning. But the script will work and your data is not corrupted.
Also Temp’s dimensions will be renamed to match A, since you are copying A to Temp and without (//), then A’s metadata will be also copied to Temp.
This is why printVarSummary(Temp) AFTER the assignment of A will not show the name dimension “time”. It was simply replaced per your request: Temp = A.
What NCL then does is as it says: Temp = (/A/), which strips away A’s meta data and then assign just the data to Temp.
So to get rid of the warning, simply give Temp!0 the same name as the variable you are copying to Temp or simply do as the message says: Temp = (/A/).

Hope this helps,
/M
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marston S. Johnston, PhD
Department of Earth Sciences
University of Gothenburg, Sweden
Email: marston.johnston at gu.se<mailto:marston.johnston at gu.se>
SkypeID: marston.johnston
Phone: +46-31-7864901
Only the fruitful thing is true!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



From: <ncl-talk-bounces at ucar.edu> on behalf of Lara Gunn <lara.n.gunn at gmail.com>
Date: Thursday, 1 December 2016 at 11:00
To: <ncl-talk at ucar.edu>
Subject: [ncl-talk] weird error

Hi

I am having an odd error in ncl so thought I'd see if anyone knows what I've done wrong. I am simply writing an array and trying to name the dimensions but for some reason ncl doesn't want me to name the time dimension.

Here is a snapshot of the code.

[nline image 1]

when I run this I get this error

warning:VarVarWrite: lhs has dimension name and rhs doesn't, deleting name of lhs dimension number(0), use "(/../)" if this is not desired outcome. I did this and still get the same issue so just a bbit confused as to why it will name the other two dimensions but not the first one.

[nline image 3]

Thanks in advance
_______________________________________________ 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/20161201/b15c60eb/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 12655 bytes
Desc: image001.png
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161201/b15c60eb/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 71924 bytes
Desc: image002.png
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161201/b15c60eb/attachment-0001.png 


More information about the ncl-talk mailing list