eagles-project / mam4xx

A C++ implementation of MAM4
https://eagles-project.github.io/mam4xx/
Other
7 stars 6 forks source link

Aerosol diagnostics: compute once and store, or recompute when needed? #77

Closed jeff-cohere closed 1 year ago

jeff-cohere commented 1 year ago

@pbosler raised this issue in the review for PR #72 , which I think is another thing we should discuss:

Redundant data storage. Within the Atmosphere class, we've made the decision to record only one measure of water vapor content (its dry mixing ratio); when other measures (specific humidity, relative humidity) are needed, we compute them from the dry mixing ratio. We don't store multiple sources of the same information; we use conversions. Should we do the same within mam4xx, for example, with particle size (store either diameter or volume, but not both)? I vote yes. GPUs are supposed to make the computations required by conversions "free" and, more importantly, then we don't have to worry about keeping the two values consistent with each other.

jeff-cohere commented 1 year ago

For now, we're just moving "extra" variables and intended diagnostics into the Diagnostics type. For our "direct port" strategy, we aren't really changing how we store/compute these quantities, but this question will arise when we can improve the structure of the code.