Optimizing a coated-sphere module

 

Authors

David Wong — U.S. Environmental Protection Agency
Francis S Binkowski — University of North Carolina, Chapel Hill

Category

Modeling

Description

A widely used coated-sphere module, BHCOAT (Bohren and Huffman 1983), has been adopted for applications in coupled Weather Research and Forecasting Community Multi-scale Air Quality Model (WRF-CMAQ applications). This module calculates the efficiencies for extinction, total scattering, and backscattering and asymmetry factor for a particle consisting of an absorbing spherical surrounded by a shell of material with a different refractive index from the core. When the refractive indices are equal, then the particle is treated as homogeneous. Our starting base version had been implemented from Bohren and Huffman's listing by Professor Bruce T. Draine of Princeton University from whom we obtained the code. This version of the code was implemented in standard double precision complex number format.

We have optimized to improve computational performance for our application in the coupled WRF-CMAQ model. During the model testing phase, we have encountered numerous cases that caused the failure in the BHCOAT algorithm. We have tested the algorithm with 32 specific cases, and 4 of them failed. The reason of failure is that the denominator becomes zero due to subtraction of two similar numbers. One of the failed cases did not exceed the limits that Bohren and Huffman had suggested. We applied a classical approach that increases the real precision to 16 bytes and the complex precision to 32 bytes. The problem went away. However, the run increased time by 77.47% to 96.33%.

We have devised a simple approach to deal with this numerical precision issue but add no extra burden on computation. We will present example calculations to illustrate the optimization technique we used, the numerical precision issue, and our approach to handle it.

Bohren, CF, and DR Huffman. 1983. Absorption and Scattering of Light by Small Particles. Wiley-Interscience, New York, 530pp.