Skip to main content

Posts

Showing posts from September, 2019

Lessons I have learnt during E3SM development

I have been involved with the E3SM development since I joined PNNL as a postdoc. Over the course of time, I have learnt a lot from the E3SM model. I also found many issues within the model, which reflects lots of similar struggles in the lifespan of software engineering.

Here I list a few major ones that we all dislike but they are around in almost every project we have worked on.

Excessive usage of existing framework even it is not meant to Working in a large project means that you should NOT re-invent the wheels if they are already there. But more often, developers tend to use existing data types and functions even when they were not designed to do so. The reason is simple: it is easier to use existing ones than to create new ones. For example, in E3SM, there was not a data type to transfer data between river and land. Instead, developers use the data type designed for atmosphere and land to do the job. While it is ok to do so, it added unnecessary confusion for future development a…

Publication graphic generation workflow

Preparing graphics for journal publication is an important step before we submit the manuscript. And sometimes this process is not as smooth as we expected. There are several problems we often encounter: We generally generate more than enough figures and in the end, we only need a few;We also use different format for different purposes. For example, we use jpg/png for debugging. And we use svg/postscript for high quality production. A conversion is usually required.Journals usually prefer 600dpi high resolution figures. So postscript format might be the best option.Indexing is important for final upload.Subplot makes it even complicated.We use more than one tools as well. I use IDL/Python for plotting, but I also use GIMP/Snagit/Inkscape for some processes. Keep the process consistent is not easy. So maybe we need a clear road map so we won’t get lost easily. Here are my plans: Produce postscript/svg when possible using DrawIO/Python/IDL;If we need subplot, produce them simultaneously;…

A revisit of spatial discretization

Discretization by definition from Wikipedia: In applied mathematics, discretization is the process of transferring continuous functions, models, variables, and equations into discrete counterparts. This process is usually carried out as a first step toward making them suitable for numerical evaluation and implementation on digital computers. Now we add “spatial” to the term. The first intuitive definition is the discretization of functions in the spatial domain. There are two elements in this description: functions and spatial domain. For functions, we often refer to integral or ODEs/PDEs in numerical simulations. If these functions involve with gradient information, then they depend on spatial domain, which is how gradient is calculated. For spatial domain, we often refer to mesh or grid. And mesh can generally be classified into structured and unstructured grid. In practice, we have spent great effects on both aspects of the spatial discretization: mesh and corresponding function s…