[ncl-talk] Assignment type mismatch, right hand side can't be coerced to type of left hand side
Rick Brownrigg
brownrig at ucar.edu
Mon Nov 4 07:20:48 MST 2019
Hi,
Docs for clmMonTLL says that the input variable can be of type float or
"numeric", but it really must be either float or double. Notice that your
variable "u" is of type short, and that further there are "add_offset" and
"scale_factor" attributes that must be applied to the data to get the
actual values. "short2flt()" is exactly the function you want; I think this
will do it:
uClm = clmMonTLL (short2flt(u))
vClm = clmMonTLL (short2flt(v))
http://ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml
There are numerous examples of how to write NetCDF file at the following
link. I recommend the "inefficient" way. Its much easier and not that
inefficient unless you are dealing with lots of really big variables or are
writing files on a production basis.
http://ncl.ucar.edu/Applications/write_netcdf.shtml
Hope that helps...
Rick
On Mon, Nov 4, 2019 at 5:42 AM zoe jacobs via ncl-talk <ncl-talk at ucar.edu>
wrote:
> Dear All,
> I attempted to plot climatological wind speed during 1979-2015. But I
> faced an error and have no idea from where this problem arose. ( I checked
> the NCL website but was not enough:
> https://www.ncl.ucar.edu/Document/Language/error_messages.shtml#AssignMismatch
> ).Please have a look at the attached script, error message, and data file.
> I also have another question, after having climatological wind, how can I
> have the result as nc file?
> I am waiting for your helpful suggestions.
> Many thanks in advance.
> adaptor.mars.internal-1572848815.075499-2543-15...
> <https://drive.google.com/file/d/1DAUj5O8_HRB80p6f2ieiubdjqGlUokTL/view?usp=drive_web>
> ,
> _______________________________________________
> 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/20191104/6af6d51d/attachment.html>
More information about the ncl-talk
mailing list