Skip to content

darothen/Coad.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coad.jl

This library is a Julia-based re-implementation of the flux-based numerical solution to the stochastic collection equation developed by Andreas Bott in his well-known 1998 JAS paper (B98). Bott provides legacy FORTRAN implementations on his academic website, and while these are a useful reference, they have a few idiosyncrasies that make them challenging for new researchers in cloud microphysicists:

  • They are implemented in legacy FORTRAN 77 conventions with common and data blocks rather than use proper subroutines with clearly declared argument intent.
  • The variable names and conventions leverage legacy implicit conventions for typing with which contemporary coders may not be familiar.
  • The chosen variable names and overall structure of the code can be difficult to relate to the actual equations in B98.

Stochastic Collection Equation

The SCE describes the evolution of a droplets size distribution over time due to random collision events sampled from elements of droplet population:

sce_eq

Julia Implementation

The implementation presented here is a 50/50 re-write of the original FORTRAN. The core algorithm (inner loop) is more-or-less unchanged from the original version. However, we liberally leverage the core features of the Julia language to enable future development and extensibility while retaining very fast computational performance. The end result is an implementation which is about as fast as the original FORTRAN code but far more practically useful.

We expect that the code here could easily be implemented in cloud microphysical or other process models boot-strapped in Julia.

Example Application

We've included a very basic demo program reproducing Figure (3) of B98 in the script examples/simple.jl. In this example we initialize a basic exponential droplet size distribution and configure the model to use the Long (1974) collision kernel. This results in a droplet autoconversion simulation where a secondary raindrop mode "appears" out of nowhere after about 15 minutes in the simulation.

The result of this simulation can be visualized (e.g. in the demo Python Jupyter Notebook at examples/plot_brm_ridgeline.ipynb to produce a "ridgeline" style plot showing the evolution of the multi-modal droplet population over time:

BR74 reproduction

Acknowledgments

The core algorithm and basis implementation that inspired this project are originally by Andreas Bott.

About

Julia-based port of the Bott 1998 flux-based solution to the SCE

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages