21cmfast / 21cmFAST

Official repository for 21cmFAST: a code for generating fast simulations of the cosmological 21cm signal
MIT License
56 stars 37 forks source link

Reduce Global Variables in the C backend #373

Open daviesje opened 3 months ago

daviesje commented 3 months ago

There are a large amount of global variables throughout the backend which are used across multiple files. This makes the package rely on the structure of including all .c files in GenerateIC.c, and makes it difficult to debug/develop the backend. We should separate these into a few cases:

This should be closely related to a re-think of how we pass in the parameter structures from the wrapper (#TBD), which are currently declared separately in several files e.g astro_params_ps and broadcast manually when needed. This can result in several issues if one is not careful in if/when they broadcast (and we should never expect a user to keep track of this).