GeoscienceAustralia / tcrm

A statistical-parametric model for assessing wind hazard from tropical cyclones
http://geoscienceaustralia.github.io/tcrm
Other
80 stars 52 forks source link

Fortran wind models #131

Closed kieranricardo closed 2 years ago

kieranricardo commented 2 years ago

This PR adds a fortran implementation of the holland wind profile and Kepert boundary layer models. In single core mode it speeds things up by a factor of 5x and scales nicely with the number of cores. The python implementations are still there as fallback if fortran isn't available.

Unfortunately this still needs to be manually compiled with f2py3 -c --f90flags='-fopenmp' -lgomp -m fwind fwind.f90 but I'm planning on adding a setup.py and refactoring tcrm into a pip installable package in a later PR.

fyi I think the speed up here is just from fusing all the array operations together - so the array is only traversed once instead of every time a numpy operation is called.