[ncl-talk] Change type of coordinate variable

James Russell jorussel at ncsu.edu
Tue Aug 15 11:29:00 MDT 2017


Hi all,

I'm trying to change the coordinate of a variable from an integer to a
float. Specifically, I have a variable with the vertical coordinate of
pressure which is currently an integer. I'm changing the vertical
coordinate to pi (non-dimensionalized pressure) which will need be a float.
However whenever I try to assign the new coordinate pi, with the code:


*var&pre = pi*

I obviously get the error:

*fatal:["NclVar.c":1390]:Assignment type mismatch, right hand side can't be
coerced to type of left hand side*
*fatal:["Execute.c":8575]:Execute: Error occurred at or near line 74 in
file ert_inv.ncl*

Since it's a coordinate variable I can't think of a way to use tofloat to
convert the current coordinate array from an integer to a float as I don't
want to re-write the whole variable.

Does anyone know of a way that I can assign the new coordinate without just
re-writing the whole variable?

Thanks,
James

------------------------------------------------------------------------------------
Graduate Research & Teaching Assistant
PhD Student: Atmospheric Science
Department of Marine, Earth, and Atmospheric Sciences
North Carolina State University
http://www4.ncsu.edu/~jorussel
--------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170815/22d0ae84/attachment.html 


More information about the ncl-talk mailing list