ESCOMP / ESCOMP/atmospheric_physics
Efficiency improvements for CAM physics
- Dominant language
- Fortran
- Stars
- 12
- Forks
- 38
- Avg merge
- 11h 16m
- Merged PRs (30d)
- 5
Description
This issue has been created to be a location where people can list possible efficiency modifications to various physics schemes that currently can't be applied due to the need to maintain bit-for-bit (b4b) reproducibility with the results from [CAM](https://github.com/ESCOMP/CAM).
Once all of the various schemes needed to reproduce CAM have been converted and verified, then these efficiency improvements can be applied.
To start, in `apply_heating_rate_run` in `utilities/physics_tendency_updaters.F90`, instead of doing:
```
do klev = 1, nz
temp(:, klev) = temp(:, klev) + (heating_rate(:, klev) * dt / cpair)
dTdt_total(:, klev) = dTdt_total(:, klev) + (heating_rate(:, klev) / cpair)
end do
```
One could do:
```
cpair_inv = 1._kind_phys/cpair
do klev = 1, nz
temp(:, klev) = temp(:, klev) + (heating_rate(:, klev) * dt * cpair_inv)
dTdt_total(:, klev) = dTdt_total(:, klev) + (heating_rate(:, klev) * cpair_inv)
end do
```
which would reduce the number of (relatively more expensive) division calculations that are performed.
Feel free to add to this issue if any other efficiency improvements that could produce round-off changes are found.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.