Skip to content

Commit 33398ab

Browse files
blimlimccarougeanton-seaice
authored
Add description of restart files and instructions for changing calendar to documentation
Co-authored-by: Claire Carouge <ccarouge@users.noreply.github.com> Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com>
1 parent 9bc5d5c commit 33398ab

2 files changed

Lines changed: 131 additions & 0 deletions

File tree

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
ESM1.6 restart files contain copies of complete model states, allowing for experiments to be stopped and restarted at a later time. This page outlines their structure and details basic procedures for manipulating them.
2+
3+
4+
## Structure of the ESM1.6 restart directory
5+
6+
An ESM1.6 restart directory contains separate restart files for each component. These are organised into the following directories:
7+
8+
```
9+
atmosphere coupler ice ocean README
10+
```
11+
12+
An example restart directory is available in `/g/data/vk83/prerelease/configurations/inputs/access-esm1p6/modern/pre-industrial/restart/2025.11.2`.
13+
14+
### Atmosphere
15+
The atmosphere restart directory contains the following files
16+
```
17+
restart_dump.astart um.res.yaml
18+
```
19+
`restart_dump.astart` is the main UM restart file, containing the atmospheric and land state in addition to static boundary information such as the land-sea mask, vegetation maps and orography.
20+
21+
`um.res.yaml` is a separate calendar file which holds the date and time associated with the restart. Information in this file is copied by [Payu](https://payu.readthedocs.io) into the model namelist files at runtime.
22+
23+
24+
### Ocean
25+
The ocean restart files are organised into separate groups of variables:
26+
```
27+
ocean_age.res.nc ocean_density.res.nc ... ocean_solo.res
28+
```
29+
30+
These netCDF files contain snapshots of the model state while `ocean_solo.res` is a text file specifying the model date and time.
31+
32+
### Ice
33+
34+
The ice restart directory contains the following files:
35+
36+
```
37+
iced.2145-01-01-00000.nc ice.restart_file mice.nc
38+
```
39+
40+
The `iced.YYYY-MM-DD-00000.nc` holds the model state and also carries the date and time in the global attributes. `ice.restart_file` is
41+
a pointer file used by CICE when finding the correct restart file to read. `mice.nc` contains ice coupling data to be sent to the ocean model
42+
at the beginning of the next run.
43+
44+
### Coupler
45+
The coupler restart directory contains data sent from each component at the termination of the previous run, allowing for the submodels to restart with the same boundary conditions at the beginning of the next run.
46+
47+
```
48+
a2i.nc i2a.nc o2i.nc
49+
```
50+
51+
52+
53+
## Common restart manipulations
54+
55+
### Changing the date of restart files
56+
57+
It's commonly required to change the date for a restart file. For example when setting up a historical experiment, a restart might be taken from a pre-industrial simulation and the date changed to 1850. Another example is when combining ocean and atmosphere restarts from two different experiments into a single restart, where it is necessary to make sure the dates for the different components match.
58+
59+
The following instructions outline how to modify the date for each component. It's important to apply the updates to all components consistently, as inconsistencies in the model dates can cause crashes.
60+
61+
!!! info
62+
Before starting any manipulation, copy the restart folders you want to modify to a new location of your choice.
63+
64+
65+
#### Atmosphere:
66+
Navigate to the `restart/atmosphere` directory:
67+
68+
<terminal-window static>
69+
<terminal-line>module use /g/data/xp65/public/modules</terminal-line>
70+
<terminal-line>module load conda/analysis3</terminal-line>
71+
<terminal-line><span style='color:#009933'>&#35 Update the date in the UM dump file</span></terminal-line>
72+
<terminal-line>python ~access/apps/pythonlib/umfile_utils/access_cm2/change_dump_date.py restart_dump.astart <<< <span style='color:red'>"YYYY MM DD",</span></terminal-line>
73+
<terminal-line><span style='color:#009933'># Update the date in the calendar file</span></terminal-line>
74+
<terminal-line>sed -i "s/end_date:.*/end_date: <span style='color:red'>YYYY-MM-DD</span> 00:00:00/" <new-restart-path>/atmosphere/um.res.yaml</terminal-line>
75+
</terminal-window>
76+
77+
#### Ocean:
78+
In the `restart/ocean` directory, edit `ocean_solo.res`:
79+
80+
```
81+
3 (Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4)
82+
1 1 1 0 0 0 Model start time: year, month, day, hour, minute, second
83+
2145 1 1 0 0 0 Current model time: year, month, day, hour, minute, second
84+
```
85+
86+
Replace the date in the 3rd line, taking care to preserve the column alignment. The entries should not be zero-padded.
87+
88+
#### Sea-ice:
89+
In the `restart/ice` directory:
90+
91+
Rename the `iced.YYYY-MM-DD-00000.nc` with new date. The year, month, and day should be zero padded.
92+
93+
Edit the `ice.restart` pointer file to use the new file name:
94+
<terminal-window static>
95+
<terminal-line>echo ./RESTART/iced.YYYY-MM-DD-00000.nc > ice.restart_file</terminal-line>
96+
</terminal-window>
97+
98+
Replace the `year`, `nyr`, `month`, and `mday` global attributes using `nco` (in most cases, only the `year` and `nyr` attributes will need to be changed. These should be given the same value.):
99+
<terminal-window static>
100+
<terminal-line>module load nco</terminal-line>
101+
<terminal-line>ncatted -O -a year,global,o,l,<span style="color:red">YYYY</span> iced.YYYY-MM-DD-00000.nc</terminal-line>
102+
<terminal-line>ncatted -O -a nyr,global,o,l,<span style="color:red">YYYY</span> iced.YYYY-MM-DD-00000.nc</terminal-line>
103+
<terminal-line>ncatted -O -a month,global,o,l,<span style="color:red">MM</span> iced.YYYY-MM-DD-00000.nc</terminal-line>
104+
<terminal-line>ncatted -O -a mday,global,o,l,<span style="color:red">DD</span> iced.YYYY-MM-DD-00000.nc</terminal-line>
105+
</terminal-window>
106+
107+
108+
Replace the `time` global attribute to equal the total number of seconds between 1/1/1 and the new date using the proleptic Gregorian calendar. This can be calculated using the `cftime` python library. E.g. using 2105-03-01 as the new date:
109+
<terminal-window static>
110+
<terminal-line>python</terminal-line>
111+
<terminal-line>>>> import cftime</terminal-line>
112+
<terminal-line>>>> start = cftime.datetime(1,1,1, calendar="proleptic_gregorian")</terminal-line>
113+
<terminal-line>>>> end = cftime.datetime(2105,3,1, calendar="proleptic_gregorian")</terminal-line>
114+
<terminal-line>>>> (end-start).total_seconds()</terminal-line>
115+
<terminal-line>66400905600.0</terminal-line>
116+
</terminal-window>
117+
118+
Then add this to the restart file using `nco`:
119+
<terminal-window static>
120+
<terminal-line>ncatted -O -a time,global,o,d,66400905600 iced.YYYY-MM-DD-00000.nc</terminal-line>
121+
</terminal-window>
122+
123+
#### Update the configuration
124+
125+
Update the payu configuration file, `config.yaml`, with the path to the new restart files:
126+
127+
```yaml
128+
restart: <path_to_new_restarts>
129+
```

documentation/mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ nav:
111111
- Sea ice: pages/inputs/seaice.md
112112
- Atmosphere: pages/inputs/atmosphere.md
113113
- Land: pages/inputs/land.md
114+
- Restarts: pages/inputs/restarts.md
114115

115116
- Configurations and Experiments:
116117
- Configuration: pages/configs_experiments/overviewconfiguration.md
@@ -135,6 +136,7 @@ extra:
135136

136137
extra_css:
137138
- "https://fonts.googleapis.com/icon?family=Material+Icons" # Material Icons Reference - https://material.io/resources/icons/?style=baseline
139+
- "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"
138140
- fontello/css/fontello-codes.css
139141
- fontello/css/fontello-ie7-codes.css
140142
- fontello/css/fontello-ie7.css

0 commit comments

Comments
 (0)