Skip to content

Commit 7f814f1

Browse files
WIP May Software meeting
Co-authored-by: Dennis Yatunin <dyatun@gmail.com> Co-authored-by: Simon Byrne <simonbyrne@gmail.com> Co-authored-by: Sriharsha Kandala <sriharsha.kvs@gmail.com> Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com> Co-authored-by: LenkaNovak <lenka@caltech.edu> Co-authored-by: Julia Sloan <jsloan@caltech.edu> Co-authored-by: Nat Efrat-Henrici <nat.henrici@gmail.com>
1 parent 55c60f6 commit 7f814f1

File tree

2 files changed

+87
-15
lines changed

2 files changed

+87
-15
lines changed

docs/papers/joss/paper.bib

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,20 @@ @software{climate_machine_zenodo
158158
doi = {10.5281/zenodo.5542395},
159159
url = {https://doi.org/10.5281/zenodo.5542395}
160160
}
161+
162+
@article{TempestRemap1,
163+
author = {Paul A. Ullrich and Mark A. Taylor},
164+
journal = {Mon. Wea. Rev.},
165+
title = {Arbitrary-Order Conservative and Consistent Remapping and a Theory of Linear Maps: Part 1},
166+
volume = {143},
167+
year = {2015},
168+
doi = {10.1175/MWR-D-14-00343.1}
169+
}
170+
171+
@article{TempestRemap2,
172+
author = {Paul A. Ullrich, Darshi Devendran and Hans Johansen},
173+
journal = {Mon. Weather Rev.},
174+
title = {Arbitrary-Order Conservative and Consistent Remapping and a Theory of Linear Maps, Part 2},
175+
volume = {144},
176+
year = {doi: 10.1175/MWR-D-15-0301.1}
177+
}

docs/papers/joss/paper.md

Lines changed: 70 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ authors:
5050
- name: Toby Bischoff
5151
orcid: XXXX
5252
affiliation: 1
53-
- name: LenkaNovak
53+
- name: Lenka Novak
5454
orcid: XXXX
5555
affiliation: 1
5656
- name: Daniel (Zhengyu) Huang
@@ -99,15 +99,16 @@ Earth system model dynamical cores are traditionally hard-coded to specific equa
9999

100100
`ClimaCore.jl` aims to be a more flexible approach, inspired by other mathematical software libraries for constructing spatial discretizations of partial differential equations (PDEs), such as PETSc [@petsc-web-page; @petsc-user-ref; @petsc-efficient], libCEED [@libceed-joss-paper; @libceed-user-manual], MFEM [@MFEMlibrary; @mfem-paper], deal.II [@dealII92], Firedrake [@firedrake], and FeniCS [@FeniCS].
101101

102-
However, ESMs tend to have some specific properties, some of which can leverage modern heterogenous architectures (including CPUs and GPUs) or modern ML/AI tools, that there are advantages to developing a new library
102+
However, ESMs tend to have some specific properties, some of which can leverage modern heterogenous architectures (including CPUs and GPUs) or modern ML/AI tools, that there are advantages to developing a new library.
103+
104+
Firstly, ESMs often use a very skewed aspect ratio: when performing global simulations, it is common to use a resolution of O(100km) in the horizontal, compared with O(100m) in the vertical. This leads to several other design considerations:
105+
- Implicit-explicit (IMEX) timestepping are typically used, with only the vertical components of the governing equations handled implicitly, known as horizontally-explicit, vertically-implicit (HEVI) schemes.
106+
- Distributed memory parallelism is only used in the horizontal direction, which avoids the need for communication inside the implicit step.
107+
- Meshes are not fuly unstructured, instead the 3D meshes are constructed by extruding the 2D horizontal mesh. Finally
108+
- Different discretizations may be used in each dimension, for example our current atmosphere model uses a specral element discretization in the horizontal, with a staggered finite difference discretization in the verfical.
109+
110+
Secondly, we aim to support both local high-resolution (box) configurations and global lower-resolution (spherical) simulations, using a unified equation set and discretizations. Specifically, we define the equations using a local Cartesian coordinate system: in a box configuration, this corresponds to the usual global coordinate system, but use latitude, longitude and altitude on a sphere: this means that, `z` is used to refer to the Cartesian coordinate in the box, or the altitude from the surface on the sphere. Similarly, for vector quantities, `u`, `v`, `w` refer to the Cartesian components in the box, or the zonal, meridonal and radial components on the sphere. Additionally, for our atmosphere model we make use of the so called "vector invariant form", which specifies the equations directly in covariant and contravariant components (with respect to the mesh elements).
103111

104-
- very skewed aspect ratio for the atmosphere component: O(100km) in the horizontal vs O(10m) in the vertical;
105-
- implicit-explicit (IMEX) timestepping, with only the vertical components of the governing equations handled implicitly: horizontally-explicit, vertically-implicit (HEVI) schemes;
106-
- use of different discertizations in each dimension, for example our current atmosphere model uses a specral element discretization in the horizontal, with a staggered finite difference discretization in the verfical;
107-
- don't need a fully unstructured mesh: 3D meshes are constucted by extruding a 2D mesh;
108-
- distributed parallely only in the horizontal direction;
109-
- support both Cartesian and spherical geometries and vector bases: on a sphere, vector components are typical specified in spherical basis (zonal, meridonal, radial);
110-
- capability to run embedded regional high-resolution and global simulations.
111112

112113

113114

@@ -122,13 +123,17 @@ However, ESMs tend to have some specific properties, some of which can leverage
122123
# Introduction
123124

124125

125-
126126
<!-- from README -->
127127
`ClimaCore.jl` is a the dynamical core (_dycore_) of the atmosphere and land models, providing discretization tools to solve the governing equations of the ESM component models.
128128

129129
`ClimaCore.jl`'s high-level API facilitates modularity and composition of differential operators and the definition of flexible discretizations. This, in turn, is coupled with low-level APIs that support different data layouts, specialized implementations, and flexible models for threading, to better face high-performance optimization, data storage, and scalability challenges on modern HPC architectures. `ClimaCore.jl` is designed to be performance portable and can be used in a distributed setting with CPU and GPU clusters.
130130

131+
## Why Julia?
132+
Julia is a compiled, dynamic programming language with great potential in numerical analysis and applied sciences. One of its defining features is multiple dispatch, in which the method of a function to be called is dynamically chosen based on run-time types. Multiple dispatch both increases run-time speed, and allows users to easily extend existing functions to suit their own needs. Another of Julia's useful qualities is array broadcasting, which facilitates efficient operations involving large data structures without extra memory allocations. Julia balances minimal barrier to entry with superior performance compared to similar easy-to-use languages, such as Python or Matlab.
133+
131134
## Technical aims and current support
135+
136+
132137
* Support both large-eddy simulation (LES) and general circulation model (GCM) configurations for the atmosphere.
133138
* A suite of tools for constructing space discretizations.
134139
* Horizontal spatial discretization:
@@ -151,6 +156,14 @@ However, ESMs tend to have some specific properties, some of which can leverage
151156
- CPU thread over elements
152157
- GPU thread over nodes.
153158

159+
# Example [Nat]
160+
161+
162+
# Results
163+
(scaling/visualization)
164+
165+
166+
154167

155168

156169

@@ -170,25 +183,67 @@ Improve Unit Tests:
170183
Performance:
171184
- [ ] Distributed computing capability (re-run latest scaling studies)
172185

173-
Cleanup:
186+
Cleanup: [Dennis]
174187
- [ ] Remove dead code, comments and TODOs
175188

176189

177190
# TODOs for the paper
178191
- [x] Abstract/Summary
179192
- [x] Statement of need
180193
- [x] Introduction
194+
- [x] Why Julia? [Julia]
195+
- [ ] Why ClimaCore?
181196
- [ ] APIs
182-
- [ ] high-level API
183-
- [ ] low-level API
184-
- Performance Portability (ClimaComms)
197+
- [x] high-level API [Valeria]
198+
- [ ] low-level API [Charlie]
199+
- [ ] Examples
200+
- Performance Portability (ClimaComms) [Sriharsha]
185201
- [ ] Multi-threading capability
186202
- [ ] Include initial GPU support
187-
- [ ] GPU support
188203

189204

190205
- [ ] References
191206

207+
# API
208+
## High-level API [Valeria]
209+
### Spatial discretizations
210+
To construct a spatial discretization, in ClimaCore's API, we need 4 elements:
211+
212+
- Domain: defines the bounding box of a domain. It can be an `IntervalDomain` (1D), a `RectangleDomain` (2D), `SphereDomain` (2D, which can be extruded in 3D).
213+
- `Mesh`: a division of a domain into elements.
214+
- `Topology`: determines the ordering and connections between elements of a mesh.
215+
- `Space`: represents a discretized function space over some domain. Currently two main discretizations are supported: Spectral Element Discretization (both Continuous Galerkin and Discontinuous Galerkin types), a staggered Finite Difference Discretization, and the combination of these two in what we call a hybrid space.
216+
- `Field`: on a given `Space`, we can construct a `Field`, which can represent mathematically either a scalar-valued field, a vector-valued field, or a combination of these two. A field is simply the association of a space and the values at each node in the space.
217+
### Composable Spatial Operators
218+
Operators can compute spatial derivative operations:
219+
220+
- For performance reasons, we need to be able to "fuse" multiple operators and function applications.
221+
- Julia provides a tool for this: broadcasting, with a very flexible API.
222+
223+
We can think of operators are "pseudo-functions": can't be called directly, but act similar to functions in the context of broadcasting. They are matrix-free, in the sense that we define the action of the operator directly on a field, without explicitly assembling the matrix representing the discretized operator. ClimaCore.jl supports Spectral element operators for the horizontal direction and finite difference ones for the vertical direction.
224+
### Other operations
225+
- DSS, limiters, remapping:
226+
Since in a finite element representation a given field is discretely defined across subdomains (elements), it might have discontinuous values across element boundaries. When we use a _continuous Galerkin_ (CG) spectral element discretization, we must ensure that the state variable is continuous across element boundaries. Therefore, we apply a so-called Direct Stiffness Summation (DSS) operator to ensure this continuity by removing redundant degrees of freedom multiplicity across element boundaries/corners.
227+
228+
For atmospheric model applications, it may be necessary to ensure monotonocity or positivity of some quantities (e.g., moisture). For this reason, ClimaCore.jl supports a class of so-called _flux-limiters_ that take care of finding values that do not satisfy constraints and bringing these values to a closest desirable constraint.
229+
230+
In ESMs, for postprocessing and visualization purposes, it is often necessary to map data from a spherical grid (in spherical or Cartesian coordinates) to a latitude and longitude grid. To achieve this, ClimaCore.jl uses the external software package _TempestRemap_, a consistent and monotone remapping package for arbitrary grid geometry [@TempestRemap1;@TempestRemap2].
231+
232+
Remapping is following the conservative, consistent and (if required) monotonous method, detailed in [Ullrich and Taylor 2015](https://journals.ametsoc.org/view/journals/mwre/143/6/mwr-d-14-00343.1.xml). This is a linear remapping operator, which obtains the target field by multiplying the source field with a sparse matrix of source-to-target weights ($\psi_i = R_{ij} \psi_j$). The weight for cartesian domains are generated in ClimaCore, and for the equiangular cubed sphere weight generation we use TempestRemap. The sparse matrix multiply is (will be soon! TODO) parallelized. If monotonicity is not required, this method can capitalize on the high order of our CG discretization.
233+
234+
### ODE API compatibility [Dennis]
235+
236+
237+
238+
## Low-level API [Charlie]
239+
ClimaCore has layered abstractions for data layouts to flexibly and efficiently read and write data of different sizes. The space and field abstraction layers, which contain local geometry and field variable values, sit ontop of this layer so that all fields leverage the flexibility of the data layouts. In addition, operators for slicing data in different ways, for example column-wise and level-wise are supported for fields. These layers help separate concerns of what variables are stored, and in which shape they exist, from the variables that users interact with. One benefit of this is that adjusting memory layout or memory access patterns can be changed internally, which can be very helpful to improve performance.
240+
241+
# Parallelism
242+
243+
## ClimaComms [Sriharsha]
244+
245+
## GPU
246+
192247
<!-- Acknowledgement of any financial support. -->
193248
# Acknowledgements
194249
We acknowledge contributions from several others who played a role in the evolution of this library, especially contributors and users of an eralier iteration of this effort, [ClimateMachine.jl](https://github.com/CliMA/ClimateMachine.jl) [@climate_machine_zenodo]. The development of this package was supported by the generosity of Eric and Wendy Schmidt by recommendation of the Schmidt Futures program, and by the Defense Advanced Research Projects Agency (Agreement No. HR00112290030).

0 commit comments

Comments
 (0)