earth-system-radiation / rte-rrtmgp

RTE+RRTMGP is a set of codes for computing radiative fluxes in planetary atmospheres.
BSD 3-Clause "New" or "Revised" License
74 stars 65 forks source link

Re-vectorize SW two-stream #275

Closed RobertPincus closed 4 months ago

RobertPincus commented 4 months ago

Adopt suggestions by @peterukk in #215

This approach makes expensive direct beam computations even when solar zenith angle is < 0, but masks those results out in layers where the direct beam does not reach. This will have practical impacts only in columns where the top of the column is in sunlight but the bottom not (or if users aren't removing columns entirely below the horizon).

RobertPincus commented 4 months ago

I've used compiler output to ensure that the loop changed in the PR did not vectorize using gfortran and ifort but does vectorize after this change.