[ncl-talk] difference between time and time at time

Mary Haley haley at ucar.edu
Wed Nov 11 08:48:44 MST 2015


You're almost there. You need to actually assign the values to "time" as
well, and not just "time&time". I know this seems kind of strange, but a
coordinate variable is one whose own values are the same as its coordinate
values.

I would try this code; note there's no need to have a separate variable
"yyyymmdd" and no need to use "new" to create "time":

time = yyyymmdd_time(2001, 2050, "integer")
time!0="time"
time at units="days since 2001-1-1 0:0"
time at long_name="time"
time&time=time

If "time" has a _FillValue that you don't want, then add:

delete(time at _FillValue)

--Mary

On Wed, Nov 11, 2015 at 12:02 AM, dyjbean at 163.com <dyjbean at 163.com> wrote:

> hi,
>    i have make a time variable, the patial code as follows:
>
> ***********************************************************
> time=new((/18262/),"integer","No_FillValue")
> yyyymmdd = yyyymmdd_time(2001, 2050, "integer")
> time!0="time"
> time&time=yyyymmdd
> time at units="days since 2001-1-1 0:0"
> time at long_name="time"
> **********************************************
>
> after inputing the above coding in ncl shell, then using the two following
> command:
> print(time)  and print(time&time)
>
> but they gave different result.
>
> ncl 16> print(time)
>
> Variable: time
> Type: integer
> Total Size: 73048 bytes
>             18262 values
> Number of Dimensions: 1
> Dimensions and sizes:   [time | 18262]
> Coordinates:
>             time: [20010101..20501231]
> Number Of Attributes: 2
>   long_name :   time
>   units :       days since 2001-1-1 0:0
> (0)     0
> (1)     0
> (2)     0
> (3)     0
> (4)     0
> (5)     0
> (6)     0
> (7)     0
> (8)     0
> (9)     0
> (10)    0
> (11)    0
> (12)    0
>
> --------------------------------------------------------------
>
> ncl 17> print(time&time)
>
> Variable: time (coordinate)
> Type: integer
> Total Size: 73048 bytes
>             18262 values
> Number of Dimensions: 1
> Dimensions and sizes:   [time | 18262]
> Coordinates:
> Number Of Attributes: 2
>   units :       days since 2001-1-1 0:0
>   long_name :   time
> (0)     20010101
> (1)     20010102
> (2)     20010103
> (3)     20010104
> (4)     20010105
> (5)     20010106
> (6)     20010107
> (7)     20010108
> (8)     20010109
> (9)     20010110
> (10)    20010111
> (11)    20010112
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>
> but they showed different result, why they cannot give the same result
> like other NCEP files?
>
>
> thanks for your advice!
>
>
>
>
> ------------------------------
> dyjbean at 163.com
>
> _______________________________________________
> 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/20151111/21980092/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bg.jpg
Type: image/jpeg
Size: 20365 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151111/21980092/attachment.jpg 


More information about the ncl-talk mailing list