Re: mergetime with different time units

From: Dave Allured - NOAA Affiliate <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Wed Sep 25 2013 - 13:21:38 MDT

[Please ignore my previous message, somehow my mailer sent out a draft
that was incomplete.]
NCO utilities have this capability built in to recent versions. It is
an extremely simple and robust solution for this problem, if you do
not mind creating a new concatenated file. They call this "time

Here is an overview of a straightforward method for NCL. There is
more than one way to do this:

1. Use the cd_calendar function to decode the time coordinates of
each file into time series of separate date numbers year, month, day,
hour, etc. You will get arrays (N1, 6) and (N2, 6). See the function

2. Concatenate these two decoded arrays. You should now have a
single array (N, 6) where N is the total number of time steps (N1 +
N2), and 6 is the dimension for the separated year, month, day, etc.

3. As needed, concatenate the associated data arrays along the time dimension.

4. If needed, you can re-encode the time coordinates back to CF-style
time coordinates, by using cd_inv_calendar on the concatenated
date/time array from step (2). For the unit string, recycle the time
unit string from the EARLIEST data being concatenated. You could also
use a different unit string of your choice, if you are careful about
roundoff error. HTH.

Please reply only to the user list.


On Wed, Sep 25, 2013 at 12:38 PM, Xi Chang <> wrote:
> Hallo NCL,,
> Is there any solution in NCL to merge two netcdf data with different time
> units?
> for instance I have two daily datasets, say:
> 1990-2010 time units hours since 1955-01-01 00:00:00
> 2011-2013 time units hours since 1980-01-01 18:00:00
> how could I combine or merge the time in these two datasets?
> Thank you for any hints..
> Xi
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Wed Sep 25 13:21:48 2013

This archive was generated by hypermail 2.1.8 : Tue Oct 01 2013 - 14:41:43 MDT