Skip to content

Commit 8ae5478

Browse files
committed
Reorg some content
Reorg some content and clarify ELM, EAM and CIME
1 parent 6c0fb9d commit 8ae5478

File tree

1 file changed

+86
-66
lines changed
  • docs/dev-guide/adding-grid-support/adding-grid-support-step-by-step-guide

1 file changed

+86
-66
lines changed
Lines changed: 86 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Add New Grid Configuration to E3SM
22

3-
In addition to generating input data to support a new grid, several code modifications are required before E3SM can run with the grid. However, the specific changes will depend on how the grid will be used. The intendend model configuration for the new grid will change which files need to be modified. For instance, a grid intended for aquaplanet experiments does not require as many changes as a historical AMIP-style run.
3+
In addition to generating input data to support a new grid, several modifications to XML files are required before E3SM can run with the grid.
4+
However, the specific changes will depend on how the grid will be used. The intended model configuration for the new grid will change which files need to be modified. For instance, a grid intended for aquaplanet experiments does not require as many changes as a historical AMIP-style run.
45

5-
The guidelines here are meant to outline various possible changes the user should consider when adding support for a new grid. This document cannot be exhaustive, and it is important that the user understands the changes they are making. It is often useful to use a pre-existing grid configuration as a template. Note that the guidelines here are only relevant for "horizontal" grids. Additional considerations are needed to support a new vertical grid, which is a topic not currently covered here.
6+
The guidelines here are meant to outline various possible changes the user should consider when adding support for a new grid for the land and/or atmosphere.
7+
This document cannot be exhaustive, and it is important that the user understands the changes they are making. It is often useful to use a pre-existing grid configuration as a template.
8+
Note that the guidelines here are only relevant for "horizontal" grids in the atmosphere and/or land.
9+
Additional considerations are needed to support a new vertical grid in the atmosphere, which is a topic not currently covered here.
610

7-
When setting up a new grid you will need to edit some or all of these files:
11+
When setting up a new grid for the atmosphere and/or land model, you will need to edit some or all of these files:
812

913
- `cime_config/config_grids.xml`
1014
- `components/eam/bld/config_files/horiz_grid.xml`
@@ -21,17 +25,24 @@ In practice, "bi" and "tri" grids are most commonly used and the main difference
2125

2226
## Grid Naming Conventions
2327

28+
### Atmosphere
29+
2430
The atmosphere grid name should always indicate the base "ne" value and whether the physgrid is being used, usually by adding ".pg2" at the end. For a regionally refined mesh (RRM) the grid name should always start with `ne0` followed a descriptive string that includes the region being refined and the degree of refinement.
2531

2632
**Example**: `ne0np4_northamerica_30x4v1.pg2`
2733

2834
Note that this example differs from how the North American grid is currently named as `ne0np4_northamericax4v1.pg2`, which indicates a `4x` refinement, but does not indicate the base resolution, which is useful to know. The more informative grid name `ne0np4_northamerica_30x4v1.pg2` makes it clear that unrefined regions are consistent with `ne30pg2`.
2935

36+
### River (or Land in tri-grid)
37+
3038
For a rectilinear lat-lon grid used by the land and/or river models the grid name should start with "r" and typically use spacing less than one degree, so they indicate the nominal grid spacing, starting with "0" and omitting the decimal.
3139

3240
**Examples**: `r05` is 0.5 degree spacing and `r0125` is 1/8 or 0.125 degree spacing.
3341

34-
For a mono-grid the convention is that the grid is written twice to indicate that both atmosphere/land and ocean/sea-ice models are on the same grid. A mono-grid is typically only used for idealized simulations such as aqua planet and RCE, but can also be used for F-compsets if the CICE sea-ice model is used in place of the MPAS sea-ice model (MPASSI).
42+
### Grid Aliases
43+
44+
Grid aliases are short strings used to represent the complete set of grids used in the model configuration.
45+
For a mono-grid the convention is that the grid alias is the base mesh written twice to indicate that both atmosphere/land and ocean/sea-ice models are on the same grid. A mono-grid is typically only used for idealized simulations such as aqua planet and RCE, but can also be used for F-compsets if the CICE sea-ice model is used in place of the MPAS sea-ice model (MPASSI).
3546

3647
**Example**: `ne30pg2_ne30pg2`
3748

@@ -43,7 +54,9 @@ Tri-grid options should indicate three different grids used for atmosphere, land
4354

4455
**Example**: `ne30pg2_r05_IcoswISC30E3r5`
4556

46-
Note that the conventions discussed above refer to the "grid alias", but for any combination of grids the full grid definition has a long form representation that spells out the grid in more detail.
57+
### Grid longnames
58+
59+
For any combination of grids, the full grid definition has a long form representation that spells out the grid in more detail.
4760

4861
**Example**:
4962

@@ -55,11 +68,72 @@ Note that the conventions discussed above refer to the "grid alias", but for any
5568
mask is: oQU240
5669
```
5770

58-
## Grid Definition
71+
## Defining a New Atmosphere Grid for EAM
72+
73+
When defining a new atmosphere grid, information needs to be provided on how the grid is constructed.
74+
75+
To define a new atmosphere grid a line must be added to `components/eam/bld/config_files/horiz_grid.xml` that indicates the number of elements and physics columns. In the lines below for `ne30np4` (without the physgrid) and `ne30pg2` (with the physgrid) you can see the value of `ne` is the same (number of elements along a cube edge), but the number of physics columns is different.
76+
77+
```xml
78+
<horiz_grid dyn="se" hgrid="ne30np4" ncol="48602" csne="30" csnp="4" npg="0" />
79+
<horiz_grid dyn="se" hgrid="ne30np4.pg2" ncol="21600" csne="30" csnp="4" npg="2" />
80+
```
81+
82+
An explanation of how to calculate the number of physics columns can be found here: [Atmosphere Grid Overview](../../../EAM/tech-guide/atmosphere-grid-overview.md).
83+
84+
For a grid with regional refinement, follow the conventions of other grids in this file. There is no formula to calculate the number of columns for RRM grids, but the value can be obtained from the grid files used for mapping.
85+
86+
```xml
87+
<horiz_grid dyn="se" hgrid="ne0np4_antarcticax4v1.pg2" ncol="48836" csne="0" csnp="4" npg="2" />
88+
```
89+
90+
## Defining a New Land Grid for ELM
91+
92+
If you are creating a new grid that will be used by the land model the grid name needs to be added to the list `valid_values` associated with the `res` entry in the file `components/elm/bld/namelist_files/namelist_definition.xml` that holds the definition of namelist variables used by the land model.
93+
94+
```xml
95+
<entry id="res" type="char*30" category="default_settings"
96+
group="default_settings"
97+
valid_values=
98+
"512x1024,360x720cru,128x256,64x128,...">
99+
Horizontal resolutions
100+
Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for ELM tools
101+
</entry>
102+
```
103+
104+
Simply add the name of your new grid to the list of `valid_values`.
105+
106+
## Using New Grids in Default Namelists
107+
108+
Each new grid will likely need various new default parameter values to be specified. These parameters can be set for individual simulations by editing the `user_nl_*` files in the case directory, but for these to become defaults any time the grid is used then new defaults need to be specified.
109+
110+
The lists below show namelist parameters that may need to be specified for a new grid. The creator of a new grid is responsible for understanding these parameters and deciding when new defaults are appropriate.
111+
112+
### Atmosphere Namelist Parameters
113+
114+
- `drydep_srf_file` - Data file for surface aerosol deposition
115+
- `bnd_topo` - Surface topography (smoothed for target grid)
116+
- `mesh_file` - HOMME np4 mesh file (exodus format)
117+
- `se_tstep` - HOMME time step [seconds]
118+
- `dt_remap_factor` - HOMME vertical remap factor
119+
- `dt_tracer_factor` - HOMME tracer advection factor
120+
- `hypervis_subcycle_q` - HOMME tracer hyperviscosity factor
121+
122+
### Land Namelist Parameters
123+
124+
- `fsurdat` - Surface data file
125+
- `finidat` - Land model initial condition file
126+
- `flanduse_timeseries` - Time-evolving land-use data file
127+
128+
## Defining a new grid for CIME
129+
130+
The CIME Case Control system will configure a case according to the component set and grid alias you specify with the `--res` argument.
131+
As part of that configuration, CIME needs to know
132+
how to translate the grid alias and set the paths for domain and mapping files used by the grid so the model can find them at runtime.
59133

60134
### Adding a New Grid Alias
61135

62-
Grid aliases are defined in `cime_config/config_grids.xml` and are used to specify the grid for a case when calling `create_newcase` via the `--res` argument. Below is an example grid alias for the `ne30pg2_r05_IcoswISC30E3r5` grid used in E3SMv3 production simulations.
136+
Grid aliases are defined in `cime_config/config_grids.xml`. Below is an example grid alias for the `ne30pg2_r05_IcoswISC30E3r5` grid used in E3SMv3 production simulations.
63137

64138
```xml
65139
<model_grid alias="ne30pg2_r05_IcoswISC30E3r5">
@@ -73,6 +147,8 @@ Grid aliases are defined in `cime_config/config_grids.xml` and are used to speci
73147
</model_grid>
74148
```
75149

150+
Add a similar block for your new grid. Aliases must be unique within `config_grids.xml`
151+
76152
### Domain Files
77153

78154
Domain files are needed for each grid and are specified in the `<domains>` section of `cime_config/config_grids.xml`. The default domain files are grouped by the atmosphere grid. The section for the typical `ne30pg2` grid looks as follows:
@@ -89,7 +165,7 @@ Domain files are needed for each grid and are specified in the `<domains>` secti
89165
</domain>
90166
```
91167

92-
Notice the ellipses `...` are used here to omit all entries that are not relevant to the `ne30pg2_r05_IcoswISC30E3r5` grid. Also, note that all of these paths are relative to the input data path set as `DIN_LOC_ROOT` which has a default for each machine. See [Generating Domain Files](/generate_domain_files/) for information about creating domain files.
168+
Notice the ellipses `...` are used here to omit all entries that are not relevant to the `ne30pg2_r05_IcoswISC30E3r5` grid. Also, note that all of these paths are relative to the input data path set as `DIN_LOC_ROOT` which has a default for each machine. See [Generating Domain Files](../../../generate_domain_files/index.md) for information about creating domain files.
93169

94170
### Coupler Mapping Files
95171

@@ -125,63 +201,7 @@ The mapping files used by the component coupler to communicate fluxes between th
125201
</gridmap>
126202
```
127203

128-
Note that all of these paths are relative to the input data path set as `DIN_LOC_ROOT` which has a default for each machine.
129-
130-
### Defining a New Atmosphere Grid
131-
132-
When defining a new atmosphere grid, information needs to be provided on how the grid is constructed.
133-
134-
To define a new atmosphere grid a line must be added to `components/eam/bld/config_files/horiz_grid.xml` that indicates the number of elements and physics columns. In the lines below for `ne30np4` (without the physgrid) and `ne30pg2` (with the physgrid) you can see the value of `ne` is the same (number of elements along a cube edge), but the number of physics columns is different.
135-
136-
```xml
137-
<horiz_grid dyn="se" hgrid="ne30np4" ncol="48602" csne="30" csnp="4" npg="0" />
138-
<horiz_grid dyn="se" hgrid="ne30np4.pg2" ncol="21600" csne="30" csnp="4" npg="2" />
139-
```
140-
141-
An explanation of how to calculate the number of physics columns can be found here: [Atmosphere Grid Overview](../../../EAM/tech-guide/atmosphere-grid-overview.md).
142-
143-
For a grid with regional refinement, follow the conventions of other grids in this file. There is no formula to calculate the number of columns for RRM grids, but the value can be obtained from the grid files used for mapping.
144-
145-
```xml
146-
<horiz_grid dyn="se" hgrid="ne0np4_antarcticax4v1.pg2" ncol="48836" csne="0" csnp="4" npg="2" />
147-
```
148-
149-
### Defining a New Land Grid
150-
151-
If you are creating a new grid that will be used by the land model the grid name needs to be added to the list `valid_values` associated with the `res` entry in the file `components/elm/bld/namelist_files/namelist_definition.xml` that holds the definition of namelist variables used by the land model.
152-
153-
```xml
154-
<entry id="res" type="char*30" category="default_settings"
155-
group="default_settings"
156-
valid_values=
157-
"512x1024,360x720cru,128x256,64x128,...">
158-
Horizontal resolutions
159-
Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for ELM tools
160-
</entry>
161-
```
162-
163-
Simply add the name of your new grid to the list of `valid_values`.
164-
165-
## Namelist Variable Defaults
166-
167-
Each new grid will likely need various new default parameter values to be specified. These parameters can be set for individual simulations by editing the `user_nl_*` files in the case directory, but for these to become defaults any time the grid is used then new defaults need to be specified.
168-
169-
The lists below show namelist parameters that may need to be specified for a new grid. The creator of a new grid is responsible for understanding these parameters and deciding when new defaults are appropriate.
170-
171-
### Atmosphere Namelist Parameters
172-
173-
- `drydep_srf_file` - Data file for surface aerosol deposition
174-
- `bnd_topo` - Surface topography (smoothed for target grid)
175-
- `mesh_file` - HOMME np4 mesh file (exodus format)
176-
- `se_tstep` - HOMME time step [seconds]
177-
- `dt_remap_factor` - HOMME vertical remap factor
178-
- `dt_tracer_factor` - HOMME tracer advection factor
179-
- `hypervis_subcycle_q` - HOMME tracer hyperviscosity factor
180-
181-
### Land Namelist Parameters
182-
183-
- `fsurdat` - Surface data file
184-
- `finidat` - Land model initial condition file
185-
- `flanduse_timeseries` - Time-evolving land-use data file
204+
Note that all of these paths are relative to the input data path set as `DIN_LOC_ROOT` which has a default for each machine. Mapping files can be created with
205+
the [ncremap](https://acme-climate.atlassian.net/wiki/spaces/DOC/pages/754286611/Regridding+E3SM+Data+with+ncremap) utility in NCO
186206

187207
Back to step-by-step guide for [Adding Support for New Grids](../adding-grid-support-step-by-step-guide.md)

0 commit comments

Comments
 (0)