-
Notifications
You must be signed in to change notification settings - Fork 1
Add restart description and instructions for changing date #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
50a8e58
Add restart description and instructions for changing date
blimlim e0f4208
Correction to ice restart instructions
blimlim f94d9ef
Apply suggestions from code review
blimlim 3066a3b
Suggestions from review
blimlim 1ee1bef
Remove reference to cice_in.nml
blimlim ca44cea
Add note about cice_in.nml file
blimlim 1fc36af
Add Font Awesome CSS for proper icons in admonition boxes
ccarouge 4c3eaad
Remove info on cice_in.nml
blimlim e6228b4
Merge remote-tracking branch 'origin/296-restart-date-documentation' …
blimlim 2f1e182
Suggestions from review
blimlim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| 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. | ||
|
|
||
|
|
||
| ## Structure of the ESM1.6 restart directory | ||
|
|
||
| An ESM1.6 restart directory contains separate restart files for each component. These are organised into the following directories: | ||
|
|
||
| ``` | ||
| atmosphere coupler ice ocean README | ||
| ``` | ||
|
|
||
| An example restart directory is available in `/g/data/vk83/prerelease/configurations/inputs/access-esm1p6/modern/pre-industrial/restart/2025.11.2`. | ||
|
|
||
| ### Atmosphere | ||
| The atmosphere restart directory contains the following files | ||
| ``` | ||
| restart_dump.astart um.res.yaml | ||
| ``` | ||
| `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. | ||
|
|
||
| `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. | ||
|
|
||
|
|
||
| ### Ocean | ||
| The ocean restart files are organised into separate groups of variables: | ||
| ``` | ||
| ocean_age.res.nc ocean_density.res.nc ... ocean_solo.res | ||
| ``` | ||
|
|
||
| These netCDF files contain snapshots of the model state while `ocean_solo.res` is a text file specifying the model date and time. | ||
|
|
||
| ### Ice | ||
|
|
||
| The ice restart directory contains the following files: | ||
|
|
||
| ``` | ||
| iced.2145-01-01-00000.nc ice.restart_file mice.nc | ||
| ``` | ||
|
|
||
| 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 | ||
| 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 | ||
| at the beginning of the next run. | ||
|
|
||
| ### Coupler | ||
| 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. | ||
|
|
||
| ``` | ||
| a2i.nc i2a.nc o2i.nc | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## Common restart manipulations | ||
|
|
||
| ### Changing the date of restart files | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| !!! info | ||
| Before starting any manipulation, copy the restart folders you want to modify to a new location of your choice. | ||
|
|
||
|
|
||
| #### Atmosphere: | ||
|
blimlim marked this conversation as resolved.
|
||
| Navigate to the `restart/atmosphere` directory: | ||
|
|
||
| <terminal-window static> | ||
| <terminal-line>module use /g/data/xp65/public/modules</terminal-line> | ||
| <terminal-line>module load conda/analysis3</terminal-line> | ||
| <terminal-line><span style='color:#009933'># Update the date in the UM dump file</span></terminal-line> | ||
| <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> | ||
| <terminal-line><span style='color:#009933'># Update the date in the calendar file</span></terminal-line> | ||
| <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> | ||
| </terminal-window> | ||
|
|
||
| #### Ocean: | ||
| In the `restart/ocean` directory, edit `ocean_solo.res`: | ||
|
|
||
| ``` | ||
| 3 (Calendar: no_calendar=0, thirty_day_months=1, julian=2, gregorian=3, noleap=4) | ||
| 1 1 1 0 0 0 Model start time: year, month, day, hour, minute, second | ||
| 2145 1 1 0 0 0 Current model time: year, month, day, hour, minute, second | ||
| ``` | ||
|
|
||
| Replace the date in the 3rd line, taking care to preserve the column alignment. The entries should not be zero-padded. | ||
|
|
||
| #### Sea-ice: | ||
| In the `restart/ice` directory: | ||
|
|
||
| Rename the `iced.YYYY-MM-DD-00000.nc` with new date. The year, month, and day should be zero padded. | ||
|
|
||
| Edit the `ice.restart` pointer file to use the new file name: | ||
|
anton-seaice marked this conversation as resolved.
|
||
| <terminal-window static> | ||
| <terminal-line>echo ./RESTART/iced.YYYY-MM-DD-00000.nc > ice.restart_file</terminal-line> | ||
| </terminal-window> | ||
|
|
||
| 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.): | ||
| <terminal-window static> | ||
| <terminal-line>module load nco</terminal-line> | ||
| <terminal-line>ncatted -O -a year,global,o,l,<span style="color:red">YYYY</span> iced.YYYY-MM-DD-00000.nc</terminal-line> | ||
| <terminal-line>ncatted -O -a nyr,global,o,l,<span style="color:red">YYYY</span> iced.YYYY-MM-DD-00000.nc</terminal-line> | ||
|
blimlim marked this conversation as resolved.
|
||
| <terminal-line>ncatted -O -a month,global,o,l,<span style="color:red">MM</span> iced.YYYY-MM-DD-00000.nc</terminal-line> | ||
| <terminal-line>ncatted -O -a mday,global,o,l,<span style="color:red">DD</span> iced.YYYY-MM-DD-00000.nc</terminal-line> | ||
| </terminal-window> | ||
|
|
||
|
|
||
| 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: | ||
| <terminal-window static> | ||
| <terminal-line>python</terminal-line> | ||
| <terminal-line>>>> import cftime</terminal-line> | ||
| <terminal-line>>>> start = cftime.datetime(1,1,1, calendar="proleptic_gregorian")</terminal-line> | ||
| <terminal-line>>>> end = cftime.datetime(2105,3,1, calendar="proleptic_gregorian")</terminal-line> | ||
| <terminal-line>>>> (end-start).total_seconds()</terminal-line> | ||
| <terminal-line>66400905600.0</terminal-line> | ||
| </terminal-window> | ||
|
|
||
| Then add this to the restart file using `nco`: | ||
| <terminal-window static> | ||
| <terminal-line>ncatted -O -a time,global,o,d,66400905600 iced.YYYY-MM-DD-00000.nc</terminal-line> | ||
| </terminal-window> | ||
|
|
||
| #### Update the configuration | ||
|
|
||
| Update the payu configuration file, `config.yaml`, with the path to the new restart files: | ||
|
|
||
| ```yaml | ||
| restart: <path_to_new_restarts> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.