Re: mergetime with different time units

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

NCO utilities have this capability built in, if you do not mind
creating a new concatenated file. They call this "time rebasing".

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 if you are careful about roundoff error.

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:19:33 2013

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