[ncl-talk] Issues With EP Flux Calculation
Rick Brownrigg
brownrig at ucar.edu
Wed Dec 7 07:24:50 MST 2016
Hi Josh,
I've not had a chance to look at your script, but that "Assignment type
mismatch..." error message always means one thing: the variable on the
lefthand side (lhs) has been defined elsewhere prior to the assignment, and
it has a certain type, shape, and dimensions. The righthand side variable
or expression must match in all regards -- type, shape, dimension. In your
case, it doesn't.
If you simply want to reuse a variable name on the lhs, you can use the
reassignment operator ":=", which is an explicit indication by you the
programmer that you don't care that the lhs gets stomped on; eg.:
foo = (/ 1, 2, 3, 4 /)
foo = "A string, not an 1D integer array" ; assignment YIELDS AN
ERROR, not same type, shape, or dimension
foo := "A string, not an 1D integer array" ; RE-assignment is OK.
If simple reuse is not what you want, try putting in some print statements
to make sure you know what lhs and rhs are/should-be.
Hope that helps...
Rick
On Tue, Dec 6, 2016 at 1:13 PM, Joshua Walston <joshwalston at gmail.com>
wrote:
> Hi NCL Users,
>
> I am attempting to use the Eliassen-Palm flux function via the
> ncl_contributed functions for the upcoming ncl_6.4 version. There seems to
> be an error in my calculations as the output figures seem odd. My script is
> running fine with no warnings, however the divergence and flux vectors seem
> incorrect. Can anyone see what I am doing wrong?
>
> Additionally, I have a 6 hourly data set that I would like to calculate
> the flux for (i.e. would prefer to not have a time average). Is it possible
> to loop through the data and get a return value of type "list" for each
> time, so I can plot the flux at each 6 hour time step. If so, how? When I
> attempt I receive a warning that states:
>
> "fatal:Assignment type mismatch, right hand side can't be coerced to type
> of left hand side"
>
> I have placed 3 figures (00z, 06z and the average over all times), my
> script, and the data (ERA40 Interim) here:
>
> <http://goog_1241068196>
> ftp://pubfiles.dri.edu/pub/jwalston/
>
> Thank you in advance for your help,
> Josh
>
>
>
>
>
>
>
>
> _______________________________________________
> 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/20161207/8b0f45d9/attachment.html
More information about the ncl-talk
mailing list