[ncl-talk] Adding time coordinate

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Mon Jan 11 16:27:01 MST 2021


Your script looks pretty good so far.  This does not look right:
    new_data = new((/nlat,mlon,toint(time(1))/),"float")

Try this:
    ntimes = dimsizes (time)
    new_data = new((/nlat,mlon,ntimes/),"float")

Always use printVarSummary when you are having problems with arrays; and
look at dimensions, coordinates, attributes, and such.

Also, in the future, please show the *first* error received, and be sure to
show exactly which line it occurs on.  Usually the first error causes more
problems later, and it is harder to sort out.  I am not sure what happened
this time, but that does not matter now.  Good luck.


On Mon, Jan 11, 2021 at 2:51 PM Vanúcia Schumacher via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hi users,
>
> I need to add the time information (preference in hh and mn) extracted
> from an ascii file to a new variable (new_data from script), but I am not
> having success.
> Attached is the script I am trying using the function cd_inv_calendar and
> the error obtained:
> fatal:No coordinate variable exists for dimension (time) in variable
> (new_data)
>
> I appreciate some help to attach this information to my new variable
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210111/622f34b5/attachment.html>


More information about the ncl-talk mailing list