[ncl-talk] weird error

Marston Johnston marston.johnston at gu.se
Thu Dec 1 06:34:37 MST 2016


Hi Lara,

I’m glad it works. NCL is really great to code in and the NCL community is very good and fast at helping you.
In the future please reply to the NCL group as well so that we all know you got the help you needed.

Just remember that when you assign A = B, then the metadata of B is transferred to A. If the dimension names
are labelled in A and different from B then you will get a warning.

Cheers,
/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: Lara Gunn <lara.n.gunn at gmail.com>
Date: Thursday, 1 December 2016 at 14:29
To: Marston Johnston <marston.johnston at gu.se>
Subject: Re: [ncl-talk] weird error

Hi

Thanks for your answer. You are 100% right. I looked at the variable before I filled it and the time dimension is there. So I'll figure out how to do it properly.

Helps a lot. I had the feeling it would be something simple I just was really struggling to see. it.

Thanks
Lara

On Thu, 1 Dec 2016 at 10:28, Marston Johnston <marston.johnston at gu.se<mailto:marston.johnston at gu.se>> wrote:
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<tel:+46%2031%20786%2049%2001>
Only the fruitful thing is true!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



From: <ncl-talk-bounces at ucar.edu<mailto:ncl-talk-bounces at ucar.edu>> on behalf of Lara Gunn <lara.n.gunn at gmail.com<mailto:lara.n.gunn at gmail.com>>
Date: Thursday, 1 December 2016 at 11:00
To: <ncl-talk at ucar.edu<mailto: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.

Error! Filename not specified.

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.

Error! Filename not specified.

Thanks in advance
_______________________________________________ ncl-talk mailing list ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu> List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talklooked
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161201/3582f455/attachment.html 


More information about the ncl-talk mailing list