# piControl time coordinates

**URL:** https://forum.access-hive.org.au/t/picontrol-time-coordinates/3739
**Category:** Earth System
**Tags:** python, cmip6
**Created:** [29 September 2024 23:38 UTC](https://forum.access-hive.org.au/t/picontrol-time-coordinates/3739 "2024-09-29T23:38:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Hasna\_K](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/hasna_k/32/2257_2.png) [@Hasna\_K](https://forum.access-hive.org.au/u/Hasna_K)
#### Post date: [29 September 2024 23:38 UTC](https://forum.access-hive.org.au/t/picontrol-time-coordinates/3739/1 "2024-09-29T23:38:41Z")

</div>

Hi,

I have outputs from several CMIP6 models for the piControl experiment, but I noticed that the time coordinates vary between models. For example, one model starts in 1850, another in 0950, and others start in 0001 (I have attached a screenshot below showing the different time coordinates). How should I interpret these varying time coordinates? Also, how can I concatenate the time axis for the piControl, historical, and SSP experiments for further analysis?  
Could someone help me with this?  
Thanks in advance!  
 ![Screenshot 2024-09-30 093312](https://us1.discourse-cdn.com/flex020/uploads/access1/original/2X/9/9948cfa969d6c4b4e31f182d83435ac55a436f9c.png)

---

<div class="post-metadata">

### Author: ![Scott](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/scott/32/37_2.png) [@Scott](https://forum.access-hive.org.au/u/Scott)
#### Post date: [30 September 2024 23:51 UTC](https://forum.access-hive.org.au/t/picontrol-time-coordinates/3739/2 "2024-09-30T23:51:18Z")

</div>

piControl years should be arbitrary - they represent some ‘pre-industrial’ steady state.

The historical runs are initiated from piControl - each run will come from a different starting point in the piControl data, e.g. ACCESS-ESM r1i1p1 has

```auto
                :branch_method = "standard" ;
                :branch_time_in_child = 0. ;
                :branch_time_in_parent = 21915. ;

```

while r10i1p1 has

```auto
                :branch_method = "standard" ;
                :branch_time_in_child = 0. ;
                :branch_time_in_parent = 87658. ;

```

(I do not know what units this time is in).

SSP runs should continue directly from the end of historical I believe, though check the dates in the file to be sure.

---

<div class="post-metadata">

### Author: ![Hasna\_K](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/hasna_k/32/2257_2.png) [@Hasna\_K](https://forum.access-hive.org.au/u/Hasna_K)
#### Post date: [1 October 2024 23:24 UTC](https://forum.access-hive.org.au/t/picontrol-time-coordinates/3739/3 "2024-10-01T23:24:42Z")

</div>

Yes, the piControl times are arbitrary (spanning 500 years).

Since the piControl time coords differ across the cmip6 models, i am unable to concatenate them with historical (1850-2014) and SSP(2015-2100) experiments.

---

<div class="post-metadata">

### Author: ![Scott](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/scott/32/37_2.png) [@Scott](https://forum.access-hive.org.au/u/Scott)
#### Post date: [3 October 2024 04:02 UTC](https://forum.access-hive.org.au/t/picontrol-time-coordinates/3739/4 "2024-10-03T04:02:12Z")

</div>

Try something like this - meaningfullness of the time axis - if leap years etc line up properly is left as an exercise

```python
import xarray
import cftime

pic = xarray.open_mfdataset("/g/data/fs38/publications/CMIP6/CMIP/CSIRO/ACCESS-ESM1-5/piControl/r1i1p1f1/Amon/tas/gn/latest/tas_Amon_ACCESS-ESM1-5_piControl_r1i1p1f1_gn_*", use_cftime=True)
his = xarray.open_mfdataset("/g/data/fs38/publications/CMIP6/CMIP/CSIRO/ACCESS-ESM1-5/historical/r1i1p1f1/Amon/tas/gn/latest/tas_Amon_ACCESS-ESM1-5_historical_r1i1p1f1_gn_185001-201412.nc", use_cftime=True)

# Date in 'pic' that 'his' branched from
branch_date = cftime.num2date(his.branch_time_in_parent, his.parent_time_units)

# Correction for 'pic' years to match up with 'his'
year_offset = his.time.dt.year.data[0] - branch_date.year

# Slice out 'pic' before the branch point and override its time axis
pic_before_branch = pic.sel(time=slice(None, branch_date))
pic_before_branch['time'] = pic_before_branch.indexes['time'].map(lambda x: x.replace(year=x.year + year_offset))

# Concatenate the datasets together
extended = xarray.concat([pic_before_branch, his], dim="time")

```

---

<div class="post-metadata">

### Author: ![Hasna\_K](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.access-hive.org.au/hasna_k/32/2257_2.png) [@Hasna\_K](https://forum.access-hive.org.au/u/Hasna_K)
#### Post date: [9 October 2024 02:58 UTC](https://forum.access-hive.org.au/t/picontrol-time-coordinates/3739/5 "2024-10-09T02:58:05Z")

</div>

Yeah thank you. it almost worked !
